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