cartodata  5.1.2
carto::VolumeRef< T > Class Template Reference

Convenient handle for a Volume - this is normally the entry point for all volumes handling. More...

#include <cartodata/volume/volumeref.h>

Inheritance diagram for carto::VolumeRef< T >:
Collaboration diagram for carto::VolumeRef< T >:

Public Types

typedef T datatype
 
typedef Volume< T >::Position4Di Position4Di
 
typedef Volume< T >::Position Position
 
typedef Volume< T >::iterator iterator
 
typedef Volume< T >::const_iterator const_iterator
 
- Public Types inherited from carto::ref< class >
typedef T referenced_type
 
- Public Types inherited from carto::const_ref< class >
typedef T referenced_type
 

Public Member Functions

 VolumeRef ()
 
 VolumeRef (Volume< T > *x)
 
 VolumeRef (const rc_ptr< Volume< T > > &x)
 
virtual ~VolumeRef ()
 
Volume< T > & operator* ()
 
const Volume< T > & operator* () const
 
 VolumeRef (int sizeX, int sizeY=1, int sizeZ=1, int sizeT=1, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (const Position4Di &size, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (int sizeX, int sizeY, int sizeZ, int sizeT, int bordersize, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (const Position4Di &size, int bordersize, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (int sizeX, int sizeY, int sizeZ, int sizeT, const Position4Di &border, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (const Position4Di &size, const Position4Di &border, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 
 VolumeRef (rc_ptr< Volume< T > > other, const Position4Di &pos, const Position4Di &size=Position4Di(-1, -1, -1, -1), const AllocatorContext &allocContext=AllocatorContext())
 
 VolumeRef (rc_ptr< Volume< T > > other, const Position &pos, const Position &size=Position(), const AllocatorContext &allocContext=AllocatorContext())
 
std::vector< int > getSize () const
 
int getSizeX () const
 
int getSizeY () const
 
int getSizeZ () const
 
int getSizeT () const
 
const PropertySet & header () const
 
PropertySet & header ()
 
const PropertySet & getPropertySet () const __attribute__((__deprecated__("use header() instead")))
 
PropertySet & getPropertySet () __attribute__((__deprecated__("use header() instead")))
 
std::vector< float > getVoxelSize () const
 
void setVoxelSize (float vx, float vy=1., float vz=1., float vt=1.)
 
void setVoxelSize (const std::vector< float > &vs)
 
virtual void copyHeaderFrom (const PropertySet &other)
 
virtual void copyHeaderFrom (const Object &other)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const T & operator() (long x, long y=0, long z=0, long t=0) const
 
T & operator() (long x, long y=0, long z=0, long t=0)
 
const T & at (long x, long y=0, long z=0, long t=0) const
 
T & at (long x, long y=0, long z=0, long t=0)
 
const T & operator() (const Position4Di &position) const
 
T & operator() (const Position4Di &position)
 
const T & at (const Position4Di &position) const
 
T & at (const Position4Di &position)
 
const T & operator() (const Position &position) const
 
T & operator() (const Position &position)
 
const T & at (const Position &position) const
 
T & at (const Position &position)
 
virtual void initialize ()
 
const AllocatorContext & allocatorContext () const
 
void allocate ()
 
virtual void reallocate (int sizeX=1, int sizeY=1, int sizeZ=1, int sizeT=1, bool keepcontents=false, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocate=true)
 
VolumeRef< T > copy () const
 
template<typename OUTP >
VolumeRef< OUTP > copy () const
 
VolumeRef< T > deepcopy () const
 
template<typename OUTP >
VolumeRef< OUTP > deepcopy () const
 
VolumeRef< T > copyStructure () const
 
template<typename OUTP >
VolumeRef< OUTP > copyStructure () const
 
template<typename OUTP >
 operator VolumeRef< OUTP > () const
 
int getLevelsCount () const
 
int refLevel (const int level) const
 
rc_ptr< Volume< T > > refVolume () const
 
rc_ptr< Volume< T > > refVolumeAtLevel (const int level) const
 
void setRefVolume (const rc_ptr< Volume< T > > &refvol)
 
const Position4Di posInRefVolume () const
 
Volume< T >::Position posInRefVolumeAtLevel (const int level) const
 
void setPosInRefVolume (const Position4Di &pos)
 
void setPosInRefVolume (const typename Volume< T >::Position &pos)
 
std::vector< int > getBorders () const
 
std::vector< size_t > getStrides () const
 
bool all () const
 True if all values compare to true. More...
 
bool any () const
 True if at least one value compares to true. More...
 
T min () const
 
T max () const
 
DataTypeTraits< T >::LongType sum () const
 To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation and returned. More...
 
void fill (const T &value)
 Fills the volume with a given value. More...
 
void fillBorder (const T &value)
 Fill border with a constant value. More...
 
VolumeRef< T > & operator= (const T &value)
 
VolumeRef< T > view (const Position4Di &pos, const Position4Di &size)
 
const VolumeRef< T > view (const Position4Di &pos, const Position4Di &size) const
 
- Public Member Functions inherited from carto::rc_ptr< Volume< T > >
 rc_ptr ()
 
 rc_ptr (T *p)
 
 rc_ptr (T *p, bool externalowner)
 
 rc_ptr (std::auto_ptr< U > r)
 
void reset (T *p=NULL)
 
T * get () const
 
bool operator< (const rc_ptr< T > &other) const
 
 operator insipid * () const
 
- Public Member Functions inherited from carto::ref< class >
 ref ()
 
 ref (T *pObject)
 
 ref (T *pObject, bool externalowner)
 
 ref (std::auto_ptr< U > r)
 
 ref (const ref< T > &other)
 
 ref (const ref< R > &other)
 
 ~ref ()
 
T * release ()
 
ref< T > & operator= (const ref< T > &other)
 
T * operator-> () const
 
T & operator* () const
 
T * pointer () const
 
- Public Member Functions inherited from carto::const_ref< class >
 const_ref ()
 
 const_ref (const T *pObject)
 
 const_ref (const T *pObject, bool externalowner)
 
 const_ref (std::auto_ptr< U > r)
 
 const_ref (const ref< T > &other)
 
 const_ref (const const_ref< T > &other)
 
 const_ref (const ref< R > &o)
 
 const_ref (const const_ref< R > &other)
 
 ~const_ref ()
 
const_ref< T > & operator= (const ref< T > &other)
 
const_ref< T > & operator= (const const_ref< T > &other)
 
bool isNull () const
 
bool operator== (const ref< T > &other) const
 
bool operator== (const T *pointer) const
 
bool operator== (const const_ref< T > &other) const
 
bool operator!= (const ref< T > &other) const
 
bool operator!= (const const_ref< T > &other) const
 
bool operator!= (const T *pointer) const
 
const T * operator-> () const
 
const T & operator* () const
 
const T * pointer () const
 
int refCount () const
 
- Public Member Functions inherited from carto::RefData< class >
int count () const
 

Detailed Description

template<typename T>
class carto::VolumeRef< T >

Convenient handle for a Volume - this is normally the entry point for all volumes handling.

See Volume for more documentation

Definition at line 59 of file volumeref.h.

Member Typedef Documentation

◆ const_iterator

template<typename T >
typedef Volume<T>::const_iterator carto::VolumeRef< T >::const_iterator

Definition at line 94 of file volumeref.h.

◆ datatype

template<typename T >
typedef T carto::VolumeRef< T >::datatype

Definition at line 83 of file volumeref.h.

◆ iterator

template<typename T >
typedef Volume<T>::iterator carto::VolumeRef< T >::iterator

Definition at line 93 of file volumeref.h.

◆ Position

template<typename T >
typedef Volume<T>::Position carto::VolumeRef< T >::Position

Definition at line 92 of file volumeref.h.

◆ Position4Di

template<typename T >
typedef Volume<T>::Position4Di carto::VolumeRef< T >::Position4Di

Definition at line 91 of file volumeref.h.

Constructor & Destructor Documentation

◆ VolumeRef() [1/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef

Definition at line 47 of file volumeref_d_inline.h.

◆ VolumeRef() [2/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( Volume< T > *  x)

Definition at line 52 of file volumeref_d_inline.h.

◆ VolumeRef() [3/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( const rc_ptr< Volume< T > > &  x)

Definition at line 57 of file volumeref_d_inline.h.

◆ ~VolumeRef()

template<typename T >
carto::VolumeRef< T >::~VolumeRef
virtual

Definition at line 62 of file volumeref_d_inline.h.

◆ VolumeRef() [4/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( int  sizeX,
int  sizeY = 1,
int  sizeZ = 1,
int  sizeT = 1,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 71 of file volumeref_d_inline.h.

◆ VolumeRef() [5/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( const Position4Di &  size,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 79 of file volumeref_d_inline.h.

◆ VolumeRef() [6/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( int  sizeX,
int  sizeY,
int  sizeZ,
int  sizeT,
int  bordersize,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 86 of file volumeref_d_inline.h.

◆ VolumeRef() [7/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( const Position4Di &  size,
int  bordersize,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 95 of file volumeref_d_inline.h.

◆ VolumeRef() [8/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( int  sizeX,
int  sizeY,
int  sizeZ,
int  sizeT,
const Position4Di &  border,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 102 of file volumeref_d_inline.h.

◆ VolumeRef() [9/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( const Position4Di &  size,
const Position4Di &  border,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocated = true 
)
explicit

Definition at line 111 of file volumeref_d_inline.h.

◆ VolumeRef() [10/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( rc_ptr< Volume< T > >  other,
const Position4Di &  pos,
const Position4Di &  size = Position4Di( -1, -1, -1, -1 ),
const AllocatorContext &  allocContext = AllocatorContext() 
)
explicit

Definition at line 119 of file volumeref_d_inline.h.

◆ VolumeRef() [11/11]

template<typename T >
carto::VolumeRef< T >::VolumeRef ( rc_ptr< Volume< T > >  other,
const Position &  pos,
const Position &  size = Position(),
const AllocatorContext &  allocContext = AllocatorContext() 
)
explicit

Definition at line 127 of file volumeref_d_inline.h.

Member Function Documentation

◆ all()

template<typename T >
bool carto::VolumeRef< T >::all
inline

True if all values compare to true.

Definition at line 57 of file volumeref_d_operators.h.

◆ allocate()

template<typename T >
void carto::VolumeRef< T >::allocate
inline

Definition at line 358 of file volumeref_d_inline.h.

◆ allocatorContext()

template<typename T >
const AllocatorContext & carto::VolumeRef< T >::allocatorContext
inline

Definition at line 351 of file volumeref_d_inline.h.

◆ any()

template<typename T >
bool carto::VolumeRef< T >::any
inline

True if at least one value compares to true.

Definition at line 64 of file volumeref_d_operators.h.

◆ at() [1/6]

template<typename T >
T & carto::VolumeRef< T >::at ( const Position &  position)
inline

Definition at line 334 of file volumeref_d_inline.h.

◆ at() [2/6]

template<typename T >
const T & carto::VolumeRef< T >::at ( const Position &  position) const
inline

Definition at line 327 of file volumeref_d_inline.h.

◆ at() [3/6]

template<typename T >
T & carto::VolumeRef< T >::at ( const Position4Di &  position)
inline

Definition at line 306 of file volumeref_d_inline.h.

◆ at() [4/6]

template<typename T >
const T & carto::VolumeRef< T >::at ( const Position4Di &  position) const
inline

Definition at line 299 of file volumeref_d_inline.h.

◆ at() [5/6]

template<typename T >
T & carto::VolumeRef< T >::at ( long  x,
long  y = 0,
long  z = 0,
long  t = 0 
)
inline

Definition at line 278 of file volumeref_d_inline.h.

◆ at() [6/6]

template<typename T >
const T & carto::VolumeRef< T >::at ( long  x,
long  y = 0,
long  z = 0,
long  t = 0 
) const
inline

◆ begin() [1/2]

template<typename T >
VolumeRef< T >::iterator carto::VolumeRef< T >::begin
inline

Definition at line 226 of file volumeref_d_inline.h.

◆ begin() [2/2]

template<typename T >
VolumeRef< T >::const_iterator carto::VolumeRef< T >::begin
inline

Definition at line 240 of file volumeref_d_inline.h.

◆ copy() [1/2]

template<typename T >
VolumeRef< OUTP > carto::VolumeRef< T >::copy
inline

Definition at line 133 of file volumeref_d_operators.h.

◆ copy() [2/2]

template<typename T >
template<typename OUTP >
VolumeRef<OUTP> carto::VolumeRef< T >::copy ( ) const

◆ copyHeaderFrom() [1/2]

template<typename T >
void carto::VolumeRef< T >::copyHeaderFrom ( const Object &  other)
virtual

Definition at line 65 of file volumeref_d.h.

◆ copyHeaderFrom() [2/2]

template<typename T >
void carto::VolumeRef< T >::copyHeaderFrom ( const PropertySet &  other)
inlinevirtual

Definition at line 460 of file volumeref_d_inline.h.

◆ copyStructure() [1/2]

template<typename T >
VolumeRef< OUTP > carto::VolumeRef< T >::copyStructure
inline

Definition at line 163 of file volumeref_d_operators.h.

◆ copyStructure() [2/2]

template<typename T >
template<typename OUTP >
VolumeRef<OUTP> carto::VolumeRef< T >::copyStructure ( ) const

◆ deepcopy() [1/2]

template<typename T >
VolumeRef< OUTP > carto::VolumeRef< T >::deepcopy
inline

Definition at line 148 of file volumeref_d_operators.h.

◆ deepcopy() [2/2]

template<typename T >
template<typename OUTP >
VolumeRef<OUTP> carto::VolumeRef< T >::deepcopy ( ) const

◆ end() [1/2]

template<typename T >
VolumeRef< T >::iterator carto::VolumeRef< T >::end
inline

Definition at line 233 of file volumeref_d_inline.h.

◆ end() [2/2]

template<typename T >
VolumeRef< T >::const_iterator carto::VolumeRef< T >::end
inline

Definition at line 247 of file volumeref_d_inline.h.

◆ fill()

template<typename T >
void carto::VolumeRef< T >::fill ( const T &  value)
inline

Fills the volume with a given value.

Definition at line 106 of file volumeref_d_operators.h.

◆ fillBorder()

template<typename T >
void carto::VolumeRef< T >::fillBorder ( const T &  value)
inline

Fill border with a constant value.

More precisely, fill the surrounding of the volume view in the reference volume (if any) using the given value.

Definition at line 113 of file volumeref_d_operators.h.

◆ getBorders()

template<typename T >
std::vector< int > carto::VolumeRef< T >::getBorders
inline

Definition at line 446 of file volumeref_d_inline.h.

◆ getLevelsCount()

template<typename T >
int carto::VolumeRef< T >::getLevelsCount
inline

Definition at line 421 of file volumeref_d_inline.h.

◆ getPropertySet() [1/2]

template<typename T >
PropertySet & carto::VolumeRef< T >::getPropertySet
inline

Definition at line 195 of file volumeref_d_inline.h.

◆ getPropertySet() [2/2]

template<typename T >
const PropertySet & carto::VolumeRef< T >::getPropertySet
inline

Definition at line 188 of file volumeref_d_inline.h.

◆ getSize()

template<typename T >
std::vector< int > carto::VolumeRef< T >::getSize
inline

◆ getSizeT()

template<typename T >
int carto::VolumeRef< T >::getSizeT
inline

Definition at line 167 of file volumeref_d_inline.h.

Referenced by carto::VolumeUtil< T >::selfApply().

◆ getSizeX()

template<typename T >
int carto::VolumeRef< T >::getSizeX
inline

Definition at line 146 of file volumeref_d_inline.h.

Referenced by carto::VolumeUtil< T >::selfApply().

◆ getSizeY()

template<typename T >
int carto::VolumeRef< T >::getSizeY
inline

Definition at line 153 of file volumeref_d_inline.h.

Referenced by carto::VolumeUtil< T >::selfApply().

◆ getSizeZ()

template<typename T >
int carto::VolumeRef< T >::getSizeZ
inline

Definition at line 160 of file volumeref_d_inline.h.

Referenced by carto::VolumeUtil< T >::selfApply().

◆ getStrides()

template<typename T >
std::vector< size_t > carto::VolumeRef< T >::getStrides
inline

◆ getVoxelSize()

template<typename T >
std::vector< float > carto::VolumeRef< T >::getVoxelSize
inline

Definition at line 202 of file volumeref_d_inline.h.

◆ header() [1/2]

template<typename T >
PropertySet & carto::VolumeRef< T >::header
inline

Definition at line 181 of file volumeref_d_inline.h.

◆ header() [2/2]

◆ initialize()

template<typename T >
void carto::VolumeRef< T >::initialize
inlinevirtual

Definition at line 344 of file volumeref_d_inline.h.

◆ max()

template<typename T >
T carto::VolumeRef< T >::max
inline

Definition at line 87 of file volumeref_d_operators.h.

◆ min()

template<typename T >
T carto::VolumeRef< T >::min
inline

Definition at line 80 of file volumeref_d_operators.h.

◆ operator VolumeRef< OUTP >()

template<typename T >
template<typename OUTP >
carto::VolumeRef< T >::operator VolumeRef< OUTP >
inline

Definition at line 179 of file volumeref_d_operators.h.

◆ operator()() [1/6]

template<typename T >
T & carto::VolumeRef< T >::operator() ( const Position &  position)
inline

Definition at line 320 of file volumeref_d_inline.h.

◆ operator()() [2/6]

template<typename T >
const T & carto::VolumeRef< T >::operator() ( const Position &  position) const
inline

Definition at line 313 of file volumeref_d_inline.h.

◆ operator()() [3/6]

template<typename T >
T & carto::VolumeRef< T >::operator() ( const Position4Di &  position)
inline

Definition at line 292 of file volumeref_d_inline.h.

◆ operator()() [4/6]

template<typename T >
const T & carto::VolumeRef< T >::operator() ( const Position4Di &  position) const
inline

Definition at line 285 of file volumeref_d_inline.h.

◆ operator()() [5/6]

template<typename T >
T & carto::VolumeRef< T >::operator() ( long  x,
long  y = 0,
long  z = 0,
long  t = 0 
)
inline

Definition at line 264 of file volumeref_d_inline.h.

◆ operator()() [6/6]

template<typename T >
const T & carto::VolumeRef< T >::operator() ( long  x,
long  y = 0,
long  z = 0,
long  t = 0 
) const
inline

Definition at line 257 of file volumeref_d_inline.h.

◆ operator*() [1/2]

template<typename T >
Volume<T>& carto::VolumeRef< T >::operator* ( )
inline

Definition at line 70 of file volumeref.h.

References carto::rc_ptr< Volume< T > >::get().

◆ operator*() [2/2]

template<typename T >
const Volume<T>& carto::VolumeRef< T >::operator* ( ) const
inline

Definition at line 75 of file volumeref.h.

References carto::rc_ptr< Volume< T > >::get().

◆ operator=()

template<typename T >
VolumeRef< T > & carto::VolumeRef< T >::operator= ( const T &  value)
inline

Definition at line 120 of file volumeref_d_operators.h.

◆ posInRefVolume()

template<typename T >
const VolumeRef< T >::Position4Di carto::VolumeRef< T >::posInRefVolume
inline

Definition at line 406 of file volumeref_d_inline.h.

◆ posInRefVolumeAtLevel()

template<typename T >
Volume< T >::Position carto::VolumeRef< T >::posInRefVolumeAtLevel ( const int  level) const
inline

Definition at line 439 of file volumeref_d_inline.h.

◆ reallocate()

template<typename T >
void carto::VolumeRef< T >::reallocate ( int  sizeX = 1,
int  sizeY = 1,
int  sizeZ = 1,
int  sizeT = 1,
bool  keepcontents = false,
const AllocatorContext &  allocatorContext = AllocatorContext(),
bool  allocate = true 
)
inlinevirtual

Definition at line 365 of file volumeref_d_inline.h.

◆ refLevel()

template<typename T >
int carto::VolumeRef< T >::refLevel ( const int  level) const
inline

Definition at line 427 of file volumeref_d_inline.h.

◆ refVolume()

template<typename T >
rc_ptr< Volume< T > > carto::VolumeRef< T >::refVolume
inline

Definition at line 392 of file volumeref_d_inline.h.

◆ refVolumeAtLevel()

template<typename T >
rc_ptr< Volume< T > > carto::VolumeRef< T >::refVolumeAtLevel ( const int  level) const
inline

Definition at line 433 of file volumeref_d_inline.h.

◆ setPosInRefVolume() [1/2]

template<typename T >
void carto::VolumeRef< T >::setPosInRefVolume ( const Position4Di &  pos)
inline

Definition at line 413 of file volumeref_d_inline.h.

◆ setPosInRefVolume() [2/2]

template<typename T >
void carto::VolumeRef< T >::setPosInRefVolume ( const typename Volume< T >::Position &  pos)

◆ setRefVolume()

template<typename T >
void carto::VolumeRef< T >::setRefVolume ( const rc_ptr< Volume< T > > &  refvol)
inline

Definition at line 399 of file volumeref_d_inline.h.

◆ setVoxelSize() [1/2]

template<typename T >
void carto::VolumeRef< T >::setVoxelSize ( const std::vector< float > &  vs)
inline

Definition at line 209 of file volumeref_d_inline.h.

◆ setVoxelSize() [2/2]

template<typename T >
void carto::VolumeRef< T >::setVoxelSize ( float  vx,
float  vy = 1.,
float  vz = 1.,
float  vt = 1. 
)
inline

Definition at line 216 of file volumeref_d_inline.h.

◆ sum()

template<typename T >
DataTypeTraits< T >::LongType carto::VolumeRef< T >::sum
inline

To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation and returned.

Definition at line 94 of file volumeref_d_operators.h.

◆ view() [1/2]

template<typename T >
VolumeRef< T > carto::VolumeRef< T >::view ( const Position4Di &  pos,
const Position4Di &  size 
)
inline

Definition at line 473 of file volumeref_d_inline.h.

◆ view() [2/2]

template<typename T >
const VolumeRef< T > carto::VolumeRef< T >::view ( const Position4Di &  pos,
const Position4Di &  size 
) const
inline

Definition at line 480 of file volumeref_d_inline.h.


The documentation for this class was generated from the following files: