34 #ifndef CARTODATA_VOLUME_VOLUMEREF_H 
   35 #define CARTODATA_VOLUME_VOLUMEREF_H 
   47 #define CARTO_VOLUME_AUTO_DEREFERENCE 
   72       return *(this->
get());
 
   77       return *(this->
get());
 
   85 #ifdef CARTO_VOLUME_AUTO_DEREFERENCE 
   99     explicit VolumeRef( 
int sizeX, 
int sizeY = 1, 
int sizeZ = 1,
 
  102                          = AllocatorContext(),
 
  103                         bool allocated = 
true );
 
  106                          = AllocatorContext(),
 
  107                         bool allocated = 
true );
 
  108     explicit VolumeRef( 
int sizeX, 
int sizeY, 
int sizeZ,
 
  109                         int sizeT, 
int bordersize,
 
  111                          = AllocatorContext(),
 
  112                         bool allocated = 
true );
 
  115                          = AllocatorContext(),
 
  116                         bool allocated = 
true );
 
  117     explicit VolumeRef( 
int sizeX, 
int sizeY, 
int sizeZ, 
int sizeT,
 
  120                          = AllocatorContext(),
 
  121                         bool allocated = 
true );
 
  125                          = AllocatorContext(),
 
  126                         bool allocated = 
true );
 
  130                         const AllocatorContext & allocContext = AllocatorContext() );
 
  134                         const AllocatorContext & allocContext
 
  135                           = AllocatorContext() );
 
  140     std::vector<int> 
getSize() 
const;
 
  148       __attribute__((__deprecated__("use 
header() instead")));
 
  150       __attribute__((__deprecated__("use 
header() instead")));
 
  152     void setVoxelSize( 
float vx, 
float vy = 1., 
float vz = 1., 
float vt = 1. );
 
  169     const T& operator()( 
long x, 
long y = 0, 
long z = 0, 
long t = 0 ) const;
 
  170     T& operator() ( 
long x, 
long y = 0, 
long z = 0, 
long t = 0 );
 
  171     const T& 
at( 
long x, 
long y = 0, 
long z = 0, 
long t = 0 ) const;
 
  172     T& 
at( 
long x, 
long y = 0, 
long z = 0, 
long t = 0 );
 
  173     const T& operator() ( const 
Position4Di & position ) const;
 
  177     const T& operator() ( const 
Position & position ) const;
 
  178     T& operator() ( const 
Position & position );
 
  179     const T& 
at( const 
Position & position ) const;
 
  188     virtual 
void reallocate( 
int sizeX = 1, 
int sizeY = 1, 
int sizeZ = 1,
 
  189                              int sizeT = 1, 
bool keepcontents = false,
 
  191                              = AllocatorContext(), 
bool allocate = true );
 
  194                              bool keepcontents = 
false,
 
  196                              = AllocatorContext(), 
bool allocate = 
true );
 
  203     template <
typename OUTP>
 
  207     template <
typename OUTP>
 
  211     template <
typename OUTP>
 
  214     template <
typename OUTP>
 
  218     int refLevel(
const int level) 
const;
 
  251     void fill( 
const T & value );
 
  272 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES 
  274   template <
typename T>
 
  279     { 
return "VolumeRef"; }
 
  288   template <
typename T>
 
  302 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES 
  304   template <
typename T>
 
  323   template <
typename T>
 
  324   std::ostream & 
operator<< ( std::ostream & out,
 
  328   template <
typename T>
 
static std::string objectType()
static std::string name()
static std::string dataType()
Convenient handle for a Volume - this is normally the entry point for all volumes handling.
bool any() const
True if at least one value compares to true.
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)
const PropertySet & getPropertySet() const __attribute__((__deprecated__("use header() instead")))
int refLevel(const int level) const
std::vector< int > getBorders() const
Volume< T >::Position Position
VolumeRef< OUTP > copy() const
void setVoxelSize(float vx, float vy=1., float vz=1., float vt=1.)
std::vector< float > getVoxelSize() const
void setRefVolume(const rc_ptr< Volume< T > > &refvol)
void fillBorder(const T &value)
Fill border with a constant value.
VolumeRef< T > deepcopy() const
VolumeRef< T > copyStructure() const
virtual void copyHeaderFrom(const PropertySet &other)
Volume< T >::Position posInRefVolumeAtLevel(const int level) const
int getLevelsCount() const
rc_ptr< Volume< T > > refVolume() const
Volume< T > & operator*()
VolumeRef< T > & operator=(const T &value)
void setPosInRefVolume(const typename Volume< T >::Position &pos)
rc_ptr< Volume< T > > refVolumeAtLevel(const int level) const
std::vector< int > getSize() const
const T & at(long x, long y=0, long z=0, long t=0) const
DataTypeTraits< T >::LongType sum() const
To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation...
Volume< T >::iterator iterator
VolumeRef< OUTP > copyStructure() const
const PropertySet & header() const
void fill(const T &value)
Fills the volume with a given value.
bool all() const
True if all values compare to true.
std::vector< size_t > getStrides() const
const AllocatorContext & allocatorContext() const
Volume< T >::const_iterator const_iterator
virtual void initialize()
VolumeRef< OUTP > deepcopy() const
VolumeRef< T > copy() const
Volume< T >::Position4Di Position4Di
void setPosInRefVolume(const Position4Di &pos)
const Position4Di posInRefVolume() const
VolumeRef< T > view(const Position4Di &pos, const Position4Di &size)
std::vector< int > Position
blitz::Array< T, Volume< T >::DIM_MAX >::const_iterator const_iterator
blitz::Array< T, Volume< T >::DIM_MAX >::iterator iterator
std::ostream & operator<<(std::ostream &out, const VoxelValue< T, C > &aa)
void displayRefVolumes(const Volume< T > &vol)
Display information about volumes hierarchy.