34 #ifndef CARTODATA_VOLUME_VOLUMEREF_H 35 #define CARTODATA_VOLUME_VOLUMEREF_H 50 #define CARTO_VOLUME_AUTO_DEREFERENCE 62 class VolumeRef:
public rc_ptr<Volume<T> >
75 return *(this->
get());
80 return *(this->
get());
88 #ifdef CARTO_VOLUME_AUTO_DEREFERENCE 102 explicit VolumeRef(
int sizeX,
int sizeY = 1,
int sizeZ = 1,
105 = AllocatorContext(),
106 bool allocated =
true );
107 explicit VolumeRef(
const Position4Di & size,
109 = AllocatorContext(),
110 bool allocated =
true );
111 explicit VolumeRef(
int sizeX,
int sizeY,
int sizeZ,
112 int sizeT,
int bordersize,
114 = AllocatorContext(),
115 bool allocated =
true );
116 explicit VolumeRef(
const Position4Di & size,
int bordersize,
118 = AllocatorContext(),
119 bool allocated =
true );
120 explicit VolumeRef(
int sizeX,
int sizeY,
int sizeZ,
int sizeT,
121 const Position4Di & border,
123 = AllocatorContext(),
124 bool allocated =
true );
125 explicit VolumeRef(
const Position4Di & size,
126 const Position4Di & border,
128 = AllocatorContext(),
129 bool allocated =
true );
131 const Position4Di & pos,
132 const Position4Di & size =
Position4Di( -1, -1, -1, -1 ),
133 const AllocatorContext & allocContext = AllocatorContext() );
135 const Position & pos,
137 const AllocatorContext & allocContext
138 = AllocatorContext() );
143 std::vector<int>
getSize()
const;
164 const_iterator begin() const;
165 const_iterator end() const;
170 const T& operator()(
long x,
long y = 0,
long z = 0,
long t = 0 ) const;
171 T& operator() (
long x,
long y = 0,
long z = 0,
long t = 0 );
172 const T&
at(
long x,
long y = 0,
long z = 0,
long t = 0 ) const;
173 T&
at(
long x,
long y = 0,
long z = 0,
long t = 0 );
174 const T& operator() ( const Position4Di & position ) const;
175 T& operator() ( const Position4Di & position );
176 const T&
at( const Position4Di & position ) const;
177 T&
at( const Position4Di & position );
178 const T& operator() ( const Position & position ) const;
179 T& operator() ( const Position & position );
180 const T&
at( const Position & position ) const;
181 T&
at( const Position & position );
189 virtual
void reallocate(
int sizeX = 1,
int sizeY = 1,
int sizeZ = 1,
190 int sizeT = 1,
bool keepcontents = false,
192 = AllocatorContext(),
bool allocate = true );
194 virtual void reallocate(
const Position4Di & size,
195 bool keepcontents =
false,
197 = AllocatorContext(),
bool allocate =
true );
204 template <
typename OUTP>
208 template <
typename OUTP>
212 template <
typename OUTP>
215 template <
typename OUTP>
219 int refLevel(
const int level)
const;
252 void fill(
const T & value );
255 #endif // CARTO_VOLUME_AUTO_DEREFERENCE 261 const VolumeRef<T> view(
const Position4Di & pos,
const Position4Di & size )
const;
267 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES 269 template <
typename T>
274 {
return "VolumeRef"; }
283 template <
typename T>
291 #endif // DOXYGEN_HIDE_INTERNAL_CLASSES 297 #ifndef DOXYGEN_HIDE_INTERNAL_CLASSES 299 template <
typename T>
303 #endif // DOXYGEN_HIDE_INTERNAL_CLASSES 318 template <
typename T>
319 std::ostream &
operator<< ( std::ostream & out,
323 template <
typename T>
328 #endif // CARTODATA_VOLUME_VOLUMEREF_H Volume< T > & operator*()
VolumeRef< T > deepcopy() const
rc_ptr< Volume< T > > refVolumeAtLevel(const int level) const
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 > copyStructure() const
virtual void initialize()
blitz::Array< T, Volume< T >::DIM_MAX >::const_iterator const_iterator
void setRefVolume(const rc_ptr< Volume< T > > &refvol)
int refLevel(const int level) const
Convenient handle for a Volume - this is normally the entry point for all volumes handling...
std::ostream & operator<<(std::ostream &out, const VoxelValue< T, C > &aa)
int getLevelsCount() const
bool any() const
True if at least one value compares to true.
VolumeRef< T > view(const Position4Di &pos, const Position4Di &size)
class __attribute__((__deprecated__("Use Volume, which now manages views, instead."))) VolumeView
View into a Volume.
const T & at(long x, long y=0, long z=0, long t=0) const
const PropertySet & header() const
Volume< T >::iterator iterator
std::vector< float > getVoxelSize() const
void fill(const T &value)
Fills the volume with a given value.
Volume< T >::const_iterator const_iterator
static std::string dataType()
static std::string objectType()
VolumeRef< T > & operator=(const T &value)
VolumeRef< T > copy() const
void setPosInRefVolume(const Position4Di &pos)
Volume< T >::Position4Di Position4Di
Volume< T >::Position Position
const Position4Di posInRefVolume() const
void displayRefVolumes(const Volume< T > &vol)
Display information about volumes hierarchy.
std::vector< int > getSize() const
rc_ptr< Volume< T > > refVolume() const
Volume< T >::Position posInRefVolumeAtLevel(const int level) const
std::vector< size_t > getStrides() const
blitz::Array< T, Volume< T >::DIM_MAX >::iterator iterator
virtual void copyHeaderFrom(const PropertySet &other)
DataTypeTraits< T >::LongType sum() const
To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation...
bool all() const
True if all values compare to true.
static std::string name()
const PropertySet & getPropertySet() const __attribute__((__deprecated__("use header() instead")))
const AllocatorContext & allocatorContext() const
std::vector< int > getBorders() const
std::vector< int > Position