45 #ifndef _INCLUDED_Field3D_MIPBase_H_
46 #define _INCLUDED_Field3D_MIPBase_H_
69 template <
class Field_T>
76 typedef boost::shared_ptr<LazyLoadAction<Field_T> >
Ptr;
77 typedef std::vector<Ptr>
Vec;
86 virtual typename Field_T::Ptr
load()
const = 0;
114 template <
class Data_T>
122 typedef boost::intrusive_ptr<MIPBase>
Ptr;
147 virtual Data_T
mipValue(
size_t level,
int i,
int j,
int k)
const = 0;
153 virtual bool levelLoaded(
const size_t level)
const = 0;
158 V3f &outVsP)
const = 0;
200 template <
typename Data_T>
202 : m_numLevels(1), m_lowestLevel(0)
209 template <
typename Data_T>
212 m_lowestLevel = level;
227 #endif // Include guard
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Contains typedefs for the commonly used types in Field3D.
Contains base class for reference counting with Mutex.
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...
size_t numLevels() const
Number of MIP levels.
size_t lowestLevel() const
Lowest MIP level to use.
boost::intrusive_ptr< MIPBase > Ptr
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.
size_t m_lowestLevel
The lowest MIP level to use. Defaults to 0, but can be set higher to prevent high resolution levels f...
static TemplatedFieldType< MIPBase< Data_T > > ms_classType
virtual V3i mipResolution(size_t level) const =0
Returns the resolution of a given MIP level.
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.
FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(MIPBase)
Used to return a string for the name of a templated field.
static const char * staticClassName()
boost::shared_ptr< LazyLoadAction< Field_T > > Ptr
size_t m_numLevels
Number of MIP levels. The default is 1.
Contains Field, WritableField and ResizableField classes.
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
MIPBase< Data_T > class_type
virtual ~LazyLoadAction()
static const char * staticClassType()
void setLowestLevel(size_t level)
Sets the lowest MIP level to use. Defaults to zero, but can be set higher to prevent high resolution ...
virtual Field_T::Ptr load() const =0
Performs the loading of the pre-determined field and returns a pointer to it.
boost::intrusive_ptr< Field > Ptr
std::string name
Optional name of the field.