Field3D
|
#include <FieldGroup.h>
Classes | |
struct | CountFields |
struct | DoWsBoundsOptimization |
struct | GetIntersections |
struct | GetMinMax |
struct | GetMinMaxMIP |
struct | GetMinMaxPrefilt |
struct | GetWsBounds |
struct | GrabFields |
struct | MakeMinMax |
struct | MakeMinMaxMIP |
struct | MemSize |
struct | PointIsect |
struct | Sample |
struct | SampleMIP |
struct | SampleMIPMultiple |
struct | SampleMultiple |
Public Types | |
enum | CompositeOp { Add = 0, Avg } |
typedef fusion_ro::as_vector< MPLDenseTypes >::type | DenseTypes |
typedef fusion_ro::as_vector< MPLMIPDenseTypes >::type | MIPDenseTypes |
typedef fusion_ro::as_vector< MPLMIPSparseTypes >::type | MIPSparseTypes |
typedef BaseTypeList_T | MPLBaseTypes |
typedef mpl::transform< MPLBaseTypes, detail::MakeDense< ph::_1 > >::type | MPLDenseTypes |
typedef mpl::transform< MPLBaseTypes, detail::MakeMIPDense< ph::_1 > >::type | MPLMIPDenseTypes |
typedef mpl::transform< MPLBaseTypes, detail::MakeMIPSparse< ph::_1 > >::type | MPLMIPSparseTypes |
typedef mpl::transform< MPLBaseTypes, detail::MakeSparse< ph::_1 > >::type | MPLSparseTypes |
typedef fusion_ro::as_vector< MPLSparseTypes >::type | SparseTypes |
Public Member Functions | |
FieldGroup () | |
Default constructor, does nothing. More... | |
FieldGroup (const Field3D::FieldRes::Vec &fields) | |
Construct from a set of fields. More... | |
const FieldRes::Vec & | fields () const |
Returns a vector of FieldRes::Ptrs to the fields in the group. More... | |
bool | getIntersections (const Ray3d &ray, IntervalVec &intervals) const |
Gets the intersection intervals between the ray and the fields. More... | |
void | getMinMax (const Box3d &wsBounds, float *min, float *max) const |
Returns the min/max range within a given bounding box. More... | |
bool | hasPrefiltMinMax () const |
Whether the FieldGroup has a pre-filtered min/max representation. More... | |
bool | intersects (const V3d &wsP) const |
Whether the given point intersects any of the fields in the FieldGroup. More... | |
int | load (const std::string &filename, const std::string &attribute) |
Loads all fields from a given file and optional attribute pattern. More... | |
void | makeMinMax (const float resMult) |
Make min/max representations of the fields in the group. More... | |
long long int | memSize () const |
Returns the memory use in bytes for the fields in the group. More... | |
void | sample (const V3d &vsP, float *result, bool isVs) const |
Samples the group of fields at the given point. This call will not include MIP fields, which require a spot size. More... | |
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 compositing functor. More... | |
void | sampleMIP (const V3d &vsP, const float wsSpotSize, float *result, bool isVs) const |
Samples all the MIP fields in the group. More... | |
void | sampleMIPMultiple (const size_t n, const float *wsP, const float *wsSpotSize, float *result) const |
Samples all the MIP fields in the group. More... | |
void | sampleMultiple (const size_t n, const float *wsP, float *result) const |
Samples the fields in the group. More... | |
void | setOsToWs (const Imath::M44d &osToWs) |
Sets the current object to world transform. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields. More... | |
virtual void | setup (const Field3D::FieldRes::Ptr field) |
Adds a single field to the group. More... | |
virtual void | setup (const Field3D::FieldRes::Vec &fields) |
Initializes the FieldGroup from a set of fields. More... | |
virtual void | setup (const Field3D::FieldRes::Vec &fields, const Field3D::FieldRes::Vec &minFields, const Field3D::FieldRes::Vec &maxFields) |
Initializes the FieldGroup from a set of fields with pre-computed min/max representations. More... | |
void | setValueRemapOp (ValueRemapOp::Ptr op) |
Sets the current ValueRemap operator. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields. By default, no value remapping takes place. More... | |
virtual void | setWsBoundsOptimization (const bool doWsBoundsOptimization) |
Enable world axis aligned bounding box in lookups. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields. More... | |
virtual size_t | size () const |
The number of fields in the group. More... | |
size_t | sizeMIP () const |
The number of MIP fields in the group. More... | |
Box3d | wsBounds () const |
Returns the bounds of the group. More... | |
Static Public Attributes | |
static const int | k_missingFile = -1 |
Used by load() to indicate missing file. More... | |
Protected Member Functions | |
void | setupMinMax (const FieldRes::Vec &minFields, const FieldRes::Vec &maxFields) |
Set up the min/max MIP representations. More... | |
Protected Attributes | |
FieldRes::Vec | m_allFields |
Stores all the fields owned by the FieldGroup. More... | |
FieldRes::Vec | m_auxFields |
Stores all the auxiliary fields owned by the FieldGroup. More... | |
DenseTypes | m_dense |
bool | m_doWsBoundsOptimization |
Enable world space bounds optimization. More... | |
bool | m_hasPrefiltMinMax |
Whether pre-filtered min/max are present. More... | |
MIPDenseTypes | m_mipDense |
MIPDenseTypes | m_mipDenseMax |
MIPDenseTypes | m_mipDenseMin |
MIPSparseTypes | m_mipSparse |
MIPSparseTypes | m_mipSparseMax |
MIPSparseTypes | m_mipSparseMin |
M44d | m_osToWs |
Current object to world transform. More... | |
SparseTypes | m_sparse |
ValueRemapOp::Ptr | m_valueRemapOp |
Current value remap op. Defaults to null pointer. More... | |
The FieldGroup is a convenient way to access a collection of heterogeneous fields as one. It will accept any combination of known data structures and template types and efficiently evaluates each one with the optimal interpolator, etc.
FieldGroup also provides efficient min/max queries: If FieldGroup::load() is called, min/max representations of the attributes are read from disk, if available. Otherwise, min/max representations can be constructed by calling FieldGroup::makeMinMax().
The class can also be used to provide basic instancing. By calling setTransform() prior to setup() and load(), an object transform may be applied to each set of fields.
Definition at line 303 of file FieldGroup.h.
typedef BaseTypeList_T FieldGroup< BaseTypeList_T, Dims_T >::MPLBaseTypes |
Definition at line 308 of file FieldGroup.h.
typedef mpl::transform< MPLBaseTypes, detail::MakeDense<ph::_1> >::type FieldGroup< BaseTypeList_T, Dims_T >::MPLDenseTypes |
Definition at line 313 of file FieldGroup.h.
typedef mpl::transform< MPLBaseTypes, detail::MakeSparse<ph::_1> >::type FieldGroup< BaseTypeList_T, Dims_T >::MPLSparseTypes |
Definition at line 316 of file FieldGroup.h.
typedef mpl::transform< MPLBaseTypes, detail::MakeMIPDense<ph::_1> >::type FieldGroup< BaseTypeList_T, Dims_T >::MPLMIPDenseTypes |
Definition at line 319 of file FieldGroup.h.
typedef mpl::transform< MPLBaseTypes, detail::MakeMIPSparse<ph::_1> >::type FieldGroup< BaseTypeList_T, Dims_T >::MPLMIPSparseTypes |
Definition at line 322 of file FieldGroup.h.
typedef fusion_ro::as_vector<MPLDenseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::DenseTypes |
Definition at line 325 of file FieldGroup.h.
typedef fusion_ro::as_vector<MPLSparseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::SparseTypes |
Definition at line 326 of file FieldGroup.h.
typedef fusion_ro::as_vector<MPLMIPDenseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::MIPDenseTypes |
Definition at line 327 of file FieldGroup.h.
typedef fusion_ro::as_vector<MPLMIPSparseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::MIPSparseTypes |
Definition at line 328 of file FieldGroup.h.
enum FieldGroup::CompositeOp |
FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup |
FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup | ( | const Field3D::FieldRes::Vec & | fields | ) |
Construct from a set of fields.
Definition at line 490 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::fields(), and FieldGroup< BaseTypeList_T, Dims_T >::setup().
void FieldGroup< BaseTypeList_T, Dims_T >::setOsToWs | ( | const Imath::M44d & | osToWs | ) |
Sets the current object to world transform. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields.
Definition at line 502 of file FieldGroup.h.
|
virtual |
Enable world axis aligned bounding box in lookups. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields.
Definition at line 511 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::setValueRemapOp | ( | ValueRemapOp::Ptr | op | ) |
Sets the current ValueRemap operator. This will be used for subsequent setup() and load() calls. Primarily used when the FieldGroup is employed for instancing of multiple fields. By default, no value remapping takes place.
Definition at line 529 of file FieldGroup.h.
|
virtual |
Adds a single field to the group.
Definition at line 538 of file FieldGroup.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup().
|
virtual |
|
virtual |
Initializes the FieldGroup from a set of fields with pre-computed min/max representations.
Definition at line 561 of file FieldGroup.h.
int FieldGroup< BaseTypeList_T, Dims_T >::load | ( | const std::string & | filename, |
const std::string & | attribute | ||
) |
Loads all fields from a given file and optional attribute pattern.
Definition at line 619 of file FieldGroup.h.
References Field3DFileBase::getPartitionNames(), and Field3DInputFile::open().
void FieldGroup< BaseTypeList_T, Dims_T >::makeMinMax | ( | const float | resMult | ) |
Make min/max representations of the fields in the group.
Definition at line 668 of file FieldGroup.h.
|
virtual |
The number of fields in the group.
Definition at line 689 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::CountFields::count.
size_t FieldGroup< BaseTypeList_T, Dims_T >::sizeMIP |
The number of MIP fields in the group.
Definition at line 703 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::CountFields::count.
void FieldGroup< BaseTypeList_T, Dims_T >::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 compositing functor.
Definition at line 715 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::sample | ( | const V3d & | vsP, |
float * | result, | ||
bool | isVs | ||
) | const |
Samples the group of fields at the given point. This call will not include MIP fields, which require a spot size.
Definition at line 749 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::sampleMIP | ( | const V3d & | vsP, |
const float | wsSpotSize, | ||
float * | result, | ||
bool | isVs | ||
) | const |
Samples all the MIP fields in the group.
Definition at line 779 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::sampleMultiple | ( | const size_t | n, |
const float * | wsP, | ||
float * | result | ||
) | const |
Samples the fields in the group.
Definition at line 764 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::sampleMIPMultiple | ( | const size_t | n, |
const float * | wsP, | ||
const float * | wsSpotSize, | ||
float * | result | ||
) | const |
Box3d FieldGroup< BaseTypeList_T, Dims_T >::wsBounds |
bool FieldGroup< BaseTypeList_T, Dims_T >::intersects | ( | const V3d & | wsP | ) | const |
Whether the given point intersects any of the fields in the FieldGroup.
Definition at line 826 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::PointIsect::result().
bool FieldGroup< BaseTypeList_T, Dims_T >::getIntersections | ( | const Ray3d & | ray, |
IntervalVec & | intervals | ||
) | const |
Gets the intersection intervals between the ray and the fields.
Definition at line 840 of file FieldGroup.h.
void FieldGroup< BaseTypeList_T, Dims_T >::getMinMax | ( | const Box3d & | wsBounds, |
float * | min, | ||
float * | max | ||
) | const |
Returns the min/max range within a given bounding box.
Definition at line 855 of file FieldGroup.h.
References detail::max(), and detail::min().
|
inline |
Whether the FieldGroup has a pre-filtered min/max representation.
Definition at line 412 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::m_hasPrefiltMinMax.
long long int FieldGroup< BaseTypeList_T, Dims_T >::memSize |
Returns the memory use in bytes for the fields in the group.
Definition at line 883 of file FieldGroup.h.
|
inline |
Returns a vector of FieldRes::Ptrs to the fields in the group.
Definition at line 417 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::m_allFields.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup().
|
protected |
Set up the min/max MIP representations.
Definition at line 584 of file FieldGroup.h.
References FieldGroup< BaseTypeList_T, Dims_T >::CountFields::count.
|
static |
Used by load() to indicate missing file.
Definition at line 341 of file FieldGroup.h.
|
protected |
Definition at line 430 of file FieldGroup.h.
|
protected |
Definition at line 431 of file FieldGroup.h.
|
protected |
Definition at line 432 of file FieldGroup.h.
|
protected |
Definition at line 432 of file FieldGroup.h.
|
protected |
Definition at line 432 of file FieldGroup.h.
|
protected |
Definition at line 433 of file FieldGroup.h.
|
protected |
Definition at line 433 of file FieldGroup.h.
|
protected |
Definition at line 433 of file FieldGroup.h.
|
protected |
Whether pre-filtered min/max are present.
Definition at line 436 of file FieldGroup.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::hasPrefiltMinMax().
|
protected |
Current object to world transform.
Definition at line 439 of file FieldGroup.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GrabFields::operator()().
|
protected |
Enable world space bounds optimization.
Definition at line 442 of file FieldGroup.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GrabFields::operator()(), and FieldGroup< BaseTypeList_T, Dims_T >::DoWsBoundsOptimization::operator()().
|
protected |
Current value remap op. Defaults to null pointer.
Definition at line 445 of file FieldGroup.h.
|
protected |
Stores all the fields owned by the FieldGroup.
Definition at line 448 of file FieldGroup.h.
Referenced by FieldGroup< BaseTypeList_T, Dims_T >::fields().
|
protected |
Stores all the auxiliary fields owned by the FieldGroup.
Definition at line 450 of file FieldGroup.h.