Go to the documentation of this file.
45 #ifndef _INCLUDED_Field3D_MIPBase_H_
46 #define _INCLUDED_Field3D_MIPBase_H_
70 template <
class Field_T>
77 typedef boost::shared_ptr<LazyLoadAction<Field_T> >
Ptr;
78 typedef std::vector<Ptr>
Vec;
87 virtual typename Field_T::Ptr
load()
const = 0;
115 template <
class Data_T>
123 typedef boost::intrusive_ptr<MIPBase>
Ptr;
148 virtual Data_T
mipValue(
size_t level,
int i,
int j,
int k)
const = 0;
154 virtual bool levelLoaded(
const size_t level)
const = 0;
159 V3f &outVsP)
const = 0;
212 template <
typename Data_T>
214 : m_numLevels(1), m_lowestLevel(0), m_mipOffset(0)
221 template <
typename Data_T>
224 m_lowestLevel = level;
229 template <
typename Data_T>
233 m_mipOffset = offset;
248 #endif // Include guard
#define FIELD3D_NAMESPACE_HEADER_CLOSE
virtual ~LazyLoadAction()
size_t numLevels() const
Number of MIP levels.
Contains typedefs for the commonly used types in Field3D.
MIPBase< Data_T > class_type
boost::intrusive_ptr< Field > Ptr
void setMIPOffset(const V3i &offset)
Sets the base MIP offset. This is used to indicate where voxel space coordinate (0,...
size_t lowestLevel() const
Lowest MIP level to use.
size_t m_lowestLevel
The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels f...
std::string name
Optional name of the field.
Contains base class for reference counting with Mutex.
virtual Data_T mipValue(size_t level, int i, int j, int k) const =0
Read access to a voxel in a given MIP level.
virtual Field_T::Ptr load() const =0
Performs the loading of the pre-determined field and returns a pointer to it.
const V3i & mipOffset() const
Returns the base MIP offset.
const std::string k_mipOffsetStr
boost::intrusive_ptr< MIPBase > Ptr
static TemplatedFieldType< MIPBase< Data_T > > ms_classType
V3i m_mipOffset
Base coordinate offset. This is used to indicate where voxel space coordinate (0, 0,...
virtual void getVsMIPCoord(const V3f &vsP, const size_t level, V3f &outVsP) const =0
Given a voxel space coordinate in the 0-level field, computes the coordinate in another level.
static const char * staticClassName()
Contains Field, WritableField and ResizableField classes.
size_t m_numLevels
Number of MIP levels. The default is 1.
FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(MIPBase)
virtual Field< Data_T >::Ptr mipLevel(const size_t level) const =0
Returns a MIP level field.
virtual bool levelLoaded(const size_t level) const =0
Whether a given MIP level is loaded.
void setLowestLevel(size_t level)
Sets the lowest MIP level to use. Defaults to zero, but can be set higher to prevent high resolution ...
boost::shared_ptr< LazyLoadAction< Field_T > > Ptr
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
Used to return a string for the name of a templated field.
Contains MIP-related utility functions.
virtual V3i mipResolution(size_t level) const =0
Returns the resolution of a given MIP level.
static const char * staticClassType()