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;
158 virtual void getVsMIPCoord(
const V3f &vsP,
const size_t level,
159 V3f &outVsP)
const = 0;
169 void setLowestLevel(
size_t level);
172 {
return m_lowestLevel; }
175 {
return m_numLevels; }
178 void setMIPOffset(
const V3i &offset);
181 {
return m_mipOffset; }
212 template <
typename Data_T>
214 : m_numLevels(1), m_lowestLevel(0), m_mipOffset(0)
221 template <
typename Data_T>
229 template <
typename Data_T>
248 #endif // Include guard virtual Field_T::Ptr load() const =0
Performs the loading of the pre-determined field and returns a pointer to it.
#define FIELD3D_NAMESPACE_HEADER_CLOSE
FIELD3D_API V3i mipResolution(const V3i &baseRes, const size_t level, const V3i &add)
Contains typedefs for the commonly used types in Field3D.
Contains base class for reference counting with Mutex.
size_t numLevels() const
Number of MIP levels.
size_t lowestLevel() const
Lowest MIP level to use.
const V3i & mipOffset() const
Returns the base MIP offset.
boost::intrusive_ptr< MIPBase > Ptr
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
V3i m_mipOffset
Base coordinate offset. This is used to indicate where voxel space coordinate (0, 0...
FIELD3D_CLASSTYPE_TEMPL_INSTANTIATION(MIPBase)
Used to return a string for the name of a templated field.
FieldMetadata & metadata()
accessor to the m_metadata class
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.
Contains MIP-related utility functions.
DEFINE_FIELD_RTTI_ABSTRACT_CLASS
MIPBase< Data_T > class_type
const std::string k_mipOffsetStr
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 ...
void setMIPOffset(const V3i &offset)
Sets the base MIP offset. This is used to indicate where voxel space coordinate (0, 0, 0) really maps to.
boost::intrusive_ptr< Field > Ptr
std::string name
Optional name of the field.