3#ifndef __F3DUTIL_FIELDGROUP_H__
4#define __F3DUTIL_FIELDGROUP_H__
9#include <boost/foreach.hpp>
10#include <boost/tokenizer.hpp>
11#include <boost/thread/mutex.hpp>
12#include <boost/mpl/vector.hpp>
13#include <boost/mpl/for_each.hpp>
14#include <boost/mpl/placeholders.hpp>
15#include <boost/mpl/push_back.hpp>
16#include <boost/mpl/transform.hpp>
17#include <boost/fusion/mpl.hpp>
18#include <boost/fusion/algorithm/iteration/for_each.hpp>
19#include <boost/fusion/include/for_each.hpp>
20#include <boost/fusion/include/as_vector.hpp>
45namespace mpl = boost::mpl;
46namespace ph = mpl::placeholders;
47namespace fusion = boost::fusion;
48namespace fusion_ro = boost::fusion::result_of;
51typedef mpl::vector<Field3D::V3h, Field3D::V3f, Field3D::V3d>
VectorTypes;
112 const std::string &
a_name,
124 Field3D::Field3DInputFile &
in;
140 template <
typename T>
144 typename Field3D::Field<T>::Vec fields =
145 m_p.in.readScalarLayers<T>(m_p.name, m_p.attribute);
147 BOOST_FOREACH (
const typename Field3D::Field<T>::Ptr &ptr, fields) {
148 m_p.results.push_back(ptr);
151 typename Field3D::Field<T>::Vec
minFields =
152 m_p.in.readScalarLayers<T>(m_p.name, m_p.attribute +
k_minSuffix);
155 m_p.minResults.push_back(ptr);
158 typename Field3D::Field<T>::Vec
maxFields =
159 m_p.in.readScalarLayers<T>(m_p.name, m_p.attribute +
k_maxSuffix);
162 m_p.maxResults.push_back(ptr);
177 template <
typename Vec_T>
180 typedef typename Vec_T::BaseType T;
183 typename Field3D::Field<Vec_T>::Vec fields =
184 m_p.in.readVectorLayers<T>(m_p.name, m_p.attribute);
186 BOOST_FOREACH (
const typename Field3D::Field<Vec_T>::Ptr &ptr, fields) {
187 m_p.results.push_back(ptr);
190 typename Field3D::Field<Vec_T>::Vec
minFields =
191 m_p.in.readVectorLayers<T>(m_p.name, m_p.attribute +
k_minSuffix);
194 m_p.minResults.push_back(ptr);
197 typename Field3D::Field<Vec_T>::Vec
maxFields =
198 m_p.in.readVectorLayers<T>(m_p.name, m_p.attribute +
k_maxSuffix);
201 m_p.maxResults.push_back(ptr);
210inline std::vector<V3d>
213 std::vector<V3d> result;
227inline std::vector<V3d>
230 std::vector<V3d> result;
231 result.push_back(
V3d(0.0, 0.0, 0.0));
232 result.push_back(
V3d(1.0, 0.0, 0.0));
233 result.push_back(
V3d(0.0, 1.0, 0.0));
234 result.push_back(
V3d(1.0, 1.0, 0.0));
235 result.push_back(
V3d(0.0, 0.0, 1.0));
236 result.push_back(
V3d(1.0, 0.0, 1.0));
237 result.push_back(
V3d(0.0, 1.0, 1.0));
238 result.push_back(
V3d(1.0, 1.0, 1.0));
247 double tNear = -std::numeric_limits<double>::max();
248 double tFar = std::numeric_limits<double>::max();
249 const double epsilon = std::numeric_limits<double>::epsilon() * 10.0;
302template <
typename BaseTypeList_T,
int Dims_T>
311 typedef typename mpl::transform<
314 typedef typename mpl::transform<
317 typedef typename mpl::transform<
320 typedef typename mpl::transform<
325 typedef typename fusion_ro::as_vector<MPLDenseTypes>::type
DenseTypes;
326 typedef typename fusion_ro::as_vector<MPLSparseTypes>::type
SparseTypes;
327 typedef typename fusion_ro::as_vector<MPLMIPDenseTypes>::type
MIPDenseTypes;
355 void setOsToWs(
const Imath::M44d &osToWs);
368 virtual void setup(
const Field3D::FieldRes::Ptr field);
370 virtual void setup(
const Field3D::FieldRes::Vec &
fields);
373 virtual void setup(
const Field3D::FieldRes::Vec &
fields,
375 const Field3D::FieldRes::Vec &
maxFields);
379 int load(
const std::string &filename,
const std::string &attribute);
383 virtual size_t size()
const;
397 float *result,
bool isVs)
const;
402 float *result)
const;
482template <
typename BaseTypeList_T,
int Dims_T>
484 : m_hasPrefiltMinMax(
false), m_doWsBoundsOptimization(
false)
489template <
typename BaseTypeList_T,
int Dims_T>
491(
const Field3D::FieldRes::Vec &fields)
492 : m_hasPrefiltMinMax(
false), m_doWsBoundsOptimization(
false)
500template <
typename BaseTypeList_T,
int Dims_T>
509template <
typename BaseTypeList_T,
int Dims_T>
513 m_doWsBoundsOptimization = doWsBoundsOptimization;
515 if (doWsBoundsOptimization) {
518 fusion::for_each(m_dense, op);
519 fusion::for_each(m_sparse, op);
520 fusion::for_each(m_mipDense, op);
521 fusion::for_each(m_mipSparse, op);
527template <
typename BaseTypeList_T,
int Dims_T>
536template <
typename BaseTypeList_T,
int Dims_T>
541 fields.push_back(field);
548template <
typename BaseTypeList_T,
int Dims_T>
559template <
typename BaseTypeList_T,
int Dims_T>
562(
const Field3D::FieldRes::Vec &fields,
567 m_allFields = fields;
570 for (
size_t i = 0, end = fields.size();
i < end; ++
i) {
571 GrabFields op(fields[
i], m_osToWs, m_valueRemapOp, m_doWsBoundsOptimization);
572 fusion::for_each(m_dense, op);
573 fusion::for_each(m_sparse, op);
574 fusion::for_each(m_mipDense, op);
575 fusion::for_each(m_mipSparse, op);
582template <
typename BaseTypeList_T,
int Dims_T>
593 for (
size_t i = 0, end =
minFields.size();
i < end; ++
i) {
595 fusion::for_each(m_mipDenseMin, op);
596 fusion::for_each(m_mipSparseMin, op);
599 for (
size_t i = 0, end =
maxFields.size();
i < end; ++
i) {
601 fusion::for_each(m_mipDenseMax, op);
602 fusion::for_each(m_mipSparseMax, op);
611 m_hasPrefiltMinMax =
true;
617template <
typename BaseTypeList_T,
int Dims_T>
620(
const std::string &filename,
const std::string &attribute)
634 std::vector<std::string> filenames;
635 filenames.push_back(filename);
641 return k_missingFile;
645 std::vector<std::string>
names;
650 minResults, maxResults);
652 mpl::for_each<BaseTypeList_T>(op);
658 setup(results, minResults, maxResults);
666template <
typename BaseTypeList_T,
int Dims_T>
675 fusion::for_each(m_dense, op);
676 fusion::for_each(m_sparse, op);
679 fusion::for_each(m_mipDense,
opMIP);
680 fusion::for_each(m_mipSparse,
opMIP);
687template <
typename BaseTypeList_T,
int Dims_T>
692 fusion::for_each(m_dense, op);
693 fusion::for_each(m_sparse, op);
694 fusion::for_each(m_mipDense, op);
695 fusion::for_each(m_mipSparse, op);
701template <
typename BaseTypeList_T,
int Dims_T>
706 fusion::for_each(m_mipDense, op);
707 fusion::for_each(m_mipSparse, op);
713template <
typename BaseTypeList_T,
int Dims_T>
725 fusion::for_each(m_dense, op);
726 fusion::for_each(m_sparse, op);
730 fusion::for_each(m_mipDense,
mipOp);
731 fusion::for_each(m_mipSparse,
mipOp);
739 result[
i] /=
static_cast<float>(
numHits);
747template <
typename BaseTypeList_T,
int Dims_T>
756 fusion::for_each(m_dense, op);
757 fusion::for_each(m_sparse, op);
762template <
typename BaseTypeList_T,
int Dims_T>
771 fusion::for_each(m_dense, op);
772 fusion::for_each(m_sparse, op);
777template <
typename BaseTypeList_T,
int Dims_T>
787 fusion::for_each(m_mipDense, op);
788 fusion::for_each(m_mipSparse, op);
793template <
typename BaseTypeList_T,
int Dims_T>
803 fusion::for_each(m_mipDense, op);
804 fusion::for_each(m_mipSparse, op);
809template <
typename BaseTypeList_T,
int Dims_T>
815 fusion::for_each(m_dense, op);
816 fusion::for_each(m_sparse, op);
817 fusion::for_each(m_mipDense, op);
818 fusion::for_each(m_mipSparse, op);
824template <
typename BaseTypeList_T,
int Dims_T>
829 fusion::for_each(m_dense, op);
830 fusion::for_each(m_sparse, op);
831 fusion::for_each(m_mipDense, op);
832 fusion::for_each(m_mipSparse, op);
838template <
typename BaseTypeList_T,
int Dims_T>
844 fusion::for_each(m_dense, op);
845 fusion::for_each(m_sparse, op);
846 fusion::for_each(m_mipDense, op);
847 fusion::for_each(m_mipSparse, op);
853template <
typename BaseTypeList_T,
int Dims_T>
859 if (m_hasPrefiltMinMax) {
863 fusion::for_each(m_mipDenseMin,
opMin);
864 fusion::for_each(m_mipSparseMin,
opMin);
865 fusion::for_each(m_mipDenseMax,
opMax);
866 fusion::for_each(m_mipSparseMax,
opMax);
870 fusion::for_each(m_dense, op);
871 fusion::for_each(m_sparse, op);
874 fusion::for_each(m_mipDense,
opMIP);
875 fusion::for_each(m_mipSparse,
opMIP);
881template <
typename BaseTypeList_T,
int Dims_T>
885 long long int result = 0;
887 fusion::for_each(m_dense, op);
888 fusion::for_each(m_sparse, op);
889 fusion::for_each(m_mipDense, op);
890 fusion::for_each(m_mipSparse, op);
898template <
typename BaseTypeList_T,
int Dims_T>
905 const bool doWsBoundsOptimization)
906 : m_field(
f),
m_osToWs(osToWs), m_op(op),
910 template <
typename WrapperVec_T>
914 typedef typename WrapperVec_T::value_type
Wrapper_T;
915 typedef typename Wrapper_T::field_type Field_T;
916 typedef typename Field_T::Ptr FieldPtr;
919 Field3D::field_dynamic_cast<Field_T>(m_field)) {
938 entry.setValueRemapOp(m_op);
955template <
typename BaseTypeList_T,
int Dims_T>
963 template <
typename WrapperVec_T>
966 for (
size_t i = 0, end =
vec.size();
i < end; ++
i) {
976template <
typename BaseTypeList_T,
int Dims_T>
984 template <
typename T>
986 { count +=
vec.size(); }
993template <
typename BaseTypeList_T,
int Dims_T>
1006 template <
typename WrapperVec_T>
1010 typedef typename WrapperVec_T::value_type
Wrapper_T;
1011 typedef typename Wrapper_T::field_type Field_T;
1012 typedef typename Field3D::MIPField<Field_T>
MIPField_T;
1013 typedef typename Field_T::value_type
Value_T;
1014 typedef typename Field3D::Field<Value_T>::Ptr FieldPtr;
1016 std::pair<FieldPtr, FieldPtr> result;
1017 for (
size_t i = 0, end =
vec.size();
i < end; ++
i) {
1018 const Field_T &
f = *(
vec[
i].field);
1019 result = Field3D::makeMinMax<MIPField_T>(
f, m_resMult, m_numThreads);
1020 m_minFields.push_back(result.first);
1021 m_maxFields.push_back(result.second);
1033template <
typename BaseTypeList_T,
int Dims_T>
1046 template <
typename WrapperVec_T>
1050 typedef typename WrapperVec_T::value_type
Wrapper_T;
1051 typedef typename Wrapper_T::field_type
MIPField_T;
1052 typedef typename MIPField_T::NestedType Field_T;
1053 typedef typename Field_T::value_type
Value_T;
1054 typedef typename Field3D::Field<Value_T>::Ptr FieldPtr;
1056 std::pair<FieldPtr, FieldPtr> result;
1057 for (
size_t i = 0, end =
vec.size();
i < end; ++
i) {
1058 const Field_T &
f = *(
vec[
i].field->concreteMipLevel(0));
1059 result = Field3D::makeMinMax<MIPField_T>(
f, m_resMult, m_numThreads);
1060 m_minFields.push_back(result.first);
1061 m_maxFields.push_back(result.second);
1073template <
typename BaseTypeList_T,
int Dims_T>
1078 : m_p(
p), m_result(result), m_numHits(
numHits)
1081 template <
typename T>
1094template <
typename BaseTypeList_T,
int Dims_T>
1103 template <
typename T>
1118template <
typename BaseTypeList_T,
int Dims_T>
1124 : m_n(
n), m_p(
p), m_result(result), m_numHits(
numHits)
1127 template <
typename T>
1141template <
typename BaseTypeList_T,
int Dims_T>
1146 float *result,
size_t *
numHits)
1147 : m_n(
n), m_p(
p), m_wsSpotSize(
wsSpotSize), m_result(result),
1151 template <
typename T>
1155 m_result, m_numHits);
1167template <
typename BaseTypeList_T,
int Dims_T>
1175 template <
typename T>
1178 for (
size_t field = 0, end =
vec.size(); field < end; ++field) {
1185 for (
size_t i = 0;
i < 8; ++
i) {
1187 if (
vec[field].doOsToWs) {
1190 vec[field].osToWs.multVecMatrix(
osP,
wsP);
1194 m_wsBounds.extendBy(
wsP);
1205template <
typename BaseTypeList_T,
int Dims_T>
1217 const float worldScale)
const
1221 const float time = 0.0f;
1233 const V3d wsVoxelSize =
mtx->wsVoxelSize(0, 0, 0);
1234 const double minLen = min(min(wsVoxelSize.x, wsVoxelSize.y),
1242 const float worldScale)
const
1248 const float time = 0.0f;
1270 double t0 = -std::numeric_limits<double>::max();
1271 double t1 = std::numeric_limits<double>::max();
1272 for (
int i = 0;
i < 6; ++
i) {
1276 if (
wsRay.dir.dot(
p.normal) > 0.0) {
1278 t1 = std::min(t1,
t);
1281 t0 = std::max(t0,
t);
1286 t0 = std::max(t0, 0.0);
1287 const V3d wsVoxelSize =
mtx->wsVoxelSize(0, 0, 0);
1288 const double minLen = min(min(wsVoxelSize.x, wsVoxelSize.y),
1294 template <
typename T>
1298 for (
size_t field = 0, end =
vec.size(); field < end; ++field) {
1301 if (
vec[field].doOsToWs) {
1302 vec[field].wsToOs.multVecMatrix(m_wsRay.pos,
wsRay.pos);
1303 vec[field].wsToOs.multDirMatrix(m_wsRay.dir,
wsRay.dir);
1310 intersectMatrixMapping(
wsRay,
mtx,
vec[field].worldScale);
1315 intersectFrustumMapping(
wsRay,
f,
vec[field].worldScale);
1326template <
typename BaseTypeList_T,
int Dims_T>
1331 : m_wsBounds(
wsBounds), m_min(min), m_max(max)
1334 template <
typename T>
1347template <
typename BaseTypeList_T,
int Dims_T>
1352 : m_wsBounds(
wsBounds), m_min(min), m_max(max)
1355 template <
typename T>
1368template <
typename BaseTypeList_T,
int Dims_T>
1380 template <
typename T>
1383 if (m_mode == Min) {
1399template <
typename BaseTypeList_T,
int Dims_T>
1407 template <
typename T>
1410 for (
size_t field = 0, end =
vec.size(); field < end; ++field) {
1411 *m_memSize +=
vec[field].field->memSize();
1416 {
return m_memSize; }
1423template <
typename BaseTypeList_T,
int Dims_T>
1428 : m_wsP(
wsP), m_doesIntersect(
false)
1431 template <
typename T>
1434 for (
size_t field = 0, end =
vec.size(); field < end; ++field) {
1436 for (
size_t i = 0, end =
vec.size();
i < end; ++
i) {
1439 if (
vec[
i].doOsToWs) {
1441 vec[
i].wsToOs.multVecMatrix(m_wsP,
osP);
1444 vec[
i].mapping->worldToVoxel(m_wsP,
vsP);
1447 if (
vec[
i].vsBounds.intersects(
vsP)) {
1448 m_doesIntersect =
true;
1455 {
return m_doesIntersect; }
Contains the DenseField class.
Contains the Field3DFile classes.
FIELD3D_NAMESPACE_OPEN typedef mpl::vector< Field3D::half, float, double > ScalarTypes
FieldGroup< ScalarTypes, 1 > ScalarFieldGroup
FieldGroup< VectorTypes, 3 > VectorFieldGroup
mpl::vector< Field3D::V3h, Field3D::V3f, Field3D::V3d > VectorTypes
Contains the FieldInterp base class and some standard interpolation classes.
Contains the initIO function.
FIELD3D_API size_t numIOThreads()
Returns the number of I/O threads to use.
Contains the MIPField class.
Contains MIP-related utility functions.
Contains MIP-related utility functions.
Contains the SparseField class.
std::vector< Interval > IntervalVec
void getPartitionNames(std::vector< std::string > &names) const
Gets the names of all the partitions in the file.
Base class for mapping between world-, local- and voxel coordinates.
virtual void localToWorld(const V3d &lsP, V3d &wsP) const =0
Transform from local space position into world space.
Represents the mapping of a field by a perspective transform.
Represents the mapping of a field by a matrix transform.
boost::shared_ptr< ValueRemapOp > Ptr
static const char * k_minSuffix
std::vector< V3d > cornerPoints(const Box3d &box)
std::vector< V3d > unitCornerPoints()
bool intersect(const Ray3d &ray, const Box3d &box, double &outT0, double &outT1)
static const char * k_maxSuffix
#define FIELD3D_NAMESPACE_HEADER_CLOSE
void operator()(const T &vec) const
Functor.
void operator()(WrapperVec_T &vec) const
Functor.
bool m_doWsBoundsOptimization
Enable world space bounds optimization.
DoWsBoundsOptimization(const bool doWsBoundsOptimization)
Ctor.
void intersectFrustumMapping(const Ray3d &wsRay, const FrustumFieldMapping *mtx, const float worldScale) const
Intersect frustum mapping.
void intersectMatrixMapping(const Ray3d &wsRay, const MatrixFieldMapping *mtx, const float worldScale) const
Intersect matrix mapping.
GetIntersections(const Ray3d &wsRay, IntervalVec &intervals)
Ctor.
IntervalVec & m_intervals
void operator()(const T &vec) const
Functor.
void operator()(const T &vec) const
Functor.
GetMinMaxMIP(const Box3d &wsBounds, float *min, float *max)
Ctor.
void operator()(const T &vec) const
Functor.
GetMinMaxPrefilt(const Box3d &wsBounds, float *result, MinMaxMode mode)
Ctor.
GetMinMax(const Box3d &wsBounds, float *min, float *max)
Ctor.
void operator()(const T &vec) const
Functor.
void operator()(const T &vec) const
Functor.
GetWsBounds(Box3d &wsBounds)
Ctor.
GrabFields(Field3D::FieldRes::Ptr f, const M44d &osToWs, ValueRemapOp::Ptr op, const bool doWsBoundsOptimization)
Ctor.
M44d m_osToWs
Object to world transform.
void operator()(WrapperVec_T &vec) const
Functor.
bool m_doWsBoundsOptimization
Enable world space bounds optimization.
ValueRemapOp::Ptr m_op
Value remap operator.
Field3D::FieldRes::Ptr m_field
The field to work on. Will be matched against the type of operator().
MakeMinMaxMIP(Field3D::FieldRes::Vec &minFields, Field3D::FieldRes::Vec &maxFields, const float resMult)
Ctor.
const size_t m_numThreads
void operator()(const WrapperVec_T &vec)
Functor.
Field3D::FieldRes::Vec & m_maxFields
Field3D::FieldRes::Vec & m_minFields
Field3D::FieldRes::Vec & m_minFields
void operator()(const WrapperVec_T &vec)
Functor.
const size_t m_numThreads
MakeMinMax(Field3D::FieldRes::Vec &minFields, Field3D::FieldRes::Vec &maxFields, const float resMult)
Ctor.
Field3D::FieldRes::Vec & m_maxFields
long long int * m_memSize
MemSize(long long int &memSize)
Ctor.
void operator()(const T &vec) const
Functor.
long long int result() const
Result.
PointIsect(const V3d &wsP)
Ctor.
bool result() const
Result.
void operator()(const T &vec) const
Functor.
SampleMIPMultiple(const size_t n, const float *p, const float *wsSpotSize, float *result, size_t *numHits)
Ctor.
const float * m_wsSpotSize
void operator()(const T &vec) const
Functor.
SampleMIP(const V3d &p, const float wsSpotSize, float *result, size_t &numHits)
Ctor.
void operator()(const T &vec) const
Functor.
void operator()(const T &vec) const
Functor.
SampleMultiple(const size_t n, const float *p, float *result, size_t *numHits)
Ctor.
Sample(const V3d &p, float *result, size_t &numHits)
Ctor.
void operator()(const T &vec) const
Functor.
bool hasPrefiltMinMax() const
Whether the FieldGroup has a pre-filtered min/max representation.
void sampleMIPMultiple(const size_t n, const float *wsP, const float *wsSpotSize, float *result) const
Samples all the MIP fields in the group.
mpl::transform< MPLBaseTypes, detail::MakeMIPSparse< ph::_1 > >::type MPLMIPSparseTypes
ValueRemapOp::Ptr m_valueRemapOp
Current value remap op. Defaults to null pointer.
int load(const std::string &filename, const std::string &attribute)
Loads all fields from a given file and optional attribute pattern.
BaseTypeList_T MPLBaseTypes
void sampleMIP(const V3d &vsP, const float wsSpotSize, float *result, bool isVs) const
Samples all the MIP fields in the group.
void makeMinMax(const float resMult)
Make min/max representations of the fields in the group.
bool m_doWsBoundsOptimization
Enable world space bounds optimization.
virtual size_t size() const
The number of fields in the group.
virtual void setWsBoundsOptimization(const bool doWsBoundsOptimization)
Enable world axis aligned bounding box in lookups. This will be used for subsequent setup() and load(...
MIPSparseTypes m_mipSparse
void setOsToWs(const Imath::M44d &osToWs)
Sets the current object to world transform. This will be used for subsequent setup() and load() calls...
void setupMinMax(const FieldRes::Vec &minFields, const FieldRes::Vec &maxFields)
Set up the min/max MIP representations.
MIPDenseTypes m_mipDenseMin
const FieldRes::Vec & fields() const
Returns a vector of FieldRes::Ptrs to the fields in the group.
bool getIntersections(const Ray3d &ray, IntervalVec &intervals) const
Gets the intersection intervals between the ray and the fields.
fusion_ro::as_vector< MPLMIPDenseTypes >::type MIPDenseTypes
void sampleMultiple(const size_t n, const float *wsP, float *result) const
Samples the fields in the group.
virtual void setup(const Field3D::FieldRes::Ptr field)
Adds a single field to the group.
MIPSparseTypes m_mipSparseMax
FieldRes::Vec m_allFields
Stores all the fields owned by the FieldGroup.
FieldRes::Vec m_auxFields
Stores all the auxiliary fields owned by the FieldGroup.
fusion_ro::as_vector< MPLMIPSparseTypes >::type MIPSparseTypes
FieldGroup()
Default constructor, does nothing.
M44d m_osToWs
Current object to world transform.
size_t sizeMIP() const
The number of MIP fields in the group.
bool m_hasPrefiltMinMax
Whether pre-filtered min/max are present.
bool intersects(const V3d &wsP) const
Whether the given point intersects any of the fields in the FieldGroup.
mpl::transform< MPLBaseTypes, detail::MakeMIPDense< ph::_1 > >::type MPLMIPDenseTypes
fusion_ro::as_vector< MPLDenseTypes >::type DenseTypes
mpl::transform< MPLBaseTypes, detail::MakeDense< ph::_1 > >::type MPLDenseTypes
void getMinMax(const Box3d &wsBounds, float *min, float *max) const
Returns the min/max range within a given bounding box.
fusion_ro::as_vector< MPLSparseTypes >::type SparseTypes
MIPSparseTypes m_mipSparseMin
mpl::transform< MPLBaseTypes, detail::MakeSparse< ph::_1 > >::type MPLSparseTypes
Box3d wsBounds() const
Returns the bounds of the group.
static const int k_missingFile
Used by load() to indicate missing file.
long long int memSize() const
Returns the memory use in bytes for the fields in the group.
MIPDenseTypes m_mipDenseMax
void setValueRemapOp(ValueRemapOp::Ptr op)
Sets the current ValueRemap operator. This will be used for subsequent setup() and load() calls....
void sample(const V3d &wsP, const float wsSpotSize, const float time, float *result, const CompositeOp compOp=Add)
Unified sampling of the group's fields. Will handle both MIP and non-MIP data with optional compositi...
Interface for sampling a vector of fields of the same type.
static void sampleMIP(const WrapperVec_T &f, const V3d &wsP, const float wsSpotSize, float *value, size_t &numHits)
static void sample(const WrapperVec_T &f, const V3d &wsP, float *value, size_t &numHits)
static void sampleMultiple(const WrapperVec_T &f, const size_t neval, const float *wsPs, float *value, size_t *numHits)
static void getMinMaxMIP(const WrapperVec_T &f, const Box3d &wsBounds, float *min, float *max)
static void getMinMax(const WrapperVec_T &f, const Box3d &wsBounds, float *min, float *max)
static void sampleMIPMultiple(const WrapperVec_T &f, const size_t neval, const float *wsPs, const float *wsSpotSizes, float *value, size_t *numHits)
static void getMinMaxPrefilt(const WrapperVec_T &f, const Box3d &wsBounds, float *result, const Mode mode)
This class wraps up a single field to make its interpolator and its mapping easily accessible....
Represents a single integration interval. The interval is assumed to be inclusive,...
This class wraps up a single MIP field to make its interpolator and its mapping easily accessible....
Field3D::Field3DInputFile & in
LoadFieldsParams(Field3D::Field3DInputFile &a_in, const std::string &a_name, const std::string &a_attribute, Field3D::FieldRes::Vec &a_results, Field3D::FieldRes::Vec &a_minResults, Field3D::FieldRes::Vec &a_maxResults)
Field3D::FieldRes::Vec & minResults
Field3D::FieldRes::Vec & maxResults
Field3D::FieldRes::Vec & results
const std::string & attribute
LoadFields(LoadFieldsParams ¶ms)
LoadFields(LoadFieldsParams ¶ms)
FieldWrapper< Field3D::DenseField< T > >::Vec type
MIPFieldWrapper< Field3D::MIPField< Field3D::DenseField< T > > >::Vec type
MIPFieldWrapper< Field3D::MIPField< Field3D::SparseField< T > > >::Vec type
FieldWrapper< Field3D::SparseField< T > >::Vec type