Field3D
FieldGroup< BaseTypeList_T, Dims_T > Class Template Reference

#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.
 
 FieldGroup (const Field3D::FieldRes::Vec &fields)
 Construct from a set of fields.
 
const FieldRes::Vecfields () 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.
 
void getMinMax (const Box3d &wsBounds, float *min, float *max) const
 Returns the min/max range within a given bounding box.
 
bool hasPrefiltMinMax () const
 Whether the FieldGroup has a pre-filtered min/max representation.
 
bool intersects (const V3d &wsP) const
 Whether the given point intersects any of the fields in the FieldGroup.
 
int load (const std::string &filename, const std::string &attribute)
 Loads all fields from a given file and optional attribute pattern.
 
void makeMinMax (const float resMult)
 Make min/max representations of the fields in the group.
 
long long int memSize () const
 Returns the memory use in bytes for the fields in the group.
 
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.
 
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.
 
void sampleMIP (const V3d &vsP, const float wsSpotSize, float *result, bool isVs) const
 Samples all the MIP fields in the group.
 
void sampleMIPMultiple (const size_t n, const float *wsP, const float *wsSpotSize, float *result) const
 Samples all the MIP fields in the group.
 
void sampleMultiple (const size_t n, const float *wsP, float *result) const
 Samples the fields in the group.
 
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.
 
virtual void setup (const Field3D::FieldRes::Ptr field)
 Adds a single field to the group.
 
virtual void setup (const Field3D::FieldRes::Vec &fields)
 Initializes the FieldGroup from a set of fields.
 
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.
 
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.
 
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.
 
virtual size_t size () const
 The number of fields in the group.
 
size_t sizeMIP () const
 The number of MIP fields in the group.
 
Box3d wsBounds () const
 Returns the bounds of the group.
 

Static Public Attributes

static const int k_missingFile = -1
 Used by load() to indicate missing file.
 

Protected Member Functions

void setupMinMax (const FieldRes::Vec &minFields, const FieldRes::Vec &maxFields)
 Set up the min/max MIP representations.
 

Protected Attributes

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.
 
DenseTypes m_dense
 
bool m_doWsBoundsOptimization
 Enable world space bounds optimization.
 
bool m_hasPrefiltMinMax
 Whether pre-filtered min/max are present.
 
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.
 
SparseTypes m_sparse
 
ValueRemapOp::Ptr m_valueRemapOp
 Current value remap op. Defaults to null pointer.
 

Detailed Description

template<typename BaseTypeList_T, int Dims_T>
class FieldGroup< BaseTypeList_T, Dims_T >

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.

Member Typedef Documentation

◆ MPLBaseTypes

Definition at line 308 of file FieldGroup.h.

◆ MPLDenseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef mpl::transform<MPLBaseTypes,detail::MakeDense<ph::_1>>::type FieldGroup< BaseTypeList_T, Dims_T >::MPLDenseTypes

Definition at line 313 of file FieldGroup.h.

◆ MPLSparseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef mpl::transform<MPLBaseTypes,detail::MakeSparse<ph::_1>>::type FieldGroup< BaseTypeList_T, Dims_T >::MPLSparseTypes

Definition at line 316 of file FieldGroup.h.

◆ MPLMIPDenseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef mpl::transform<MPLBaseTypes,detail::MakeMIPDense<ph::_1>>::type FieldGroup< BaseTypeList_T, Dims_T >::MPLMIPDenseTypes

Definition at line 319 of file FieldGroup.h.

◆ MPLMIPSparseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef mpl::transform<MPLBaseTypes,detail::MakeMIPSparse<ph::_1>>::type FieldGroup< BaseTypeList_T, Dims_T >::MPLMIPSparseTypes

Definition at line 322 of file FieldGroup.h.

◆ DenseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef fusion_ro::as_vector<MPLDenseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::DenseTypes

Definition at line 325 of file FieldGroup.h.

◆ SparseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef fusion_ro::as_vector<MPLSparseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::SparseTypes

Definition at line 326 of file FieldGroup.h.

◆ MIPDenseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef fusion_ro::as_vector<MPLMIPDenseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::MIPDenseTypes

Definition at line 327 of file FieldGroup.h.

◆ MIPSparseTypes

template<typename BaseTypeList_T , int Dims_T>
typedef fusion_ro::as_vector<MPLMIPSparseTypes>::type FieldGroup< BaseTypeList_T, Dims_T >::MIPSparseTypes

Definition at line 328 of file FieldGroup.h.

Member Enumeration Documentation

◆ CompositeOp

Enumerator
Add 
Avg 

Definition at line 332 of file FieldGroup.h.

333 {
334 Add = 0,
335 Avg
336 };

Constructor & Destructor Documentation

◆ FieldGroup() [1/2]

Default constructor, does nothing.

Definition at line 483 of file FieldGroup.h.

485{ }
bool m_doWsBoundsOptimization
Enable world space bounds optimization.
Definition FieldGroup.h:442
bool m_hasPrefiltMinMax
Whether pre-filtered min/max are present.
Definition FieldGroup.h:436

◆ FieldGroup() [2/2]

template<typename BaseTypeList_T , int Dims_T>
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.

493{
494 // Perform setup
495 setup(fields);
496}
const FieldRes::Vec & fields() const
Returns a vector of FieldRes::Ptrs to the fields in the group.
Definition FieldGroup.h:417
virtual void setup(const Field3D::FieldRes::Ptr field)
Adds a single field to the group.
Definition FieldGroup.h:538

References FieldGroup< BaseTypeList_T, Dims_T >::fields(), and FieldGroup< BaseTypeList_T, Dims_T >::setup().

Member Function Documentation

◆ setOsToWs()

template<typename BaseTypeList_T , int Dims_T>
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.

503{
504 m_osToWs = osToWs;
505}
M44d m_osToWs
Current object to world transform.
Definition FieldGroup.h:439

◆ setWsBoundsOptimization()

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::setWsBoundsOptimization ( const bool doWsBoundsOptimization)
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.

512{
513 m_doWsBoundsOptimization = doWsBoundsOptimization;
514
515 if (doWsBoundsOptimization) {
516 DoWsBoundsOptimization op(m_doWsBoundsOptimization);
517
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);
522 }
523}
MIPSparseTypes m_mipSparse
Definition FieldGroup.h:433
DenseTypes m_dense
Definition FieldGroup.h:430
SparseTypes m_sparse
Definition FieldGroup.h:431
MIPDenseTypes m_mipDense
Definition FieldGroup.h:432

◆ setValueRemapOp()

template<typename BaseTypeList_T , int Dims_T>
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.

Note
It is ok to pass in a null pointer to disable value remapping.

Definition at line 529 of file FieldGroup.h.

530{
531 m_valueRemapOp = op;
532}
ValueRemapOp::Ptr m_valueRemapOp
Current value remap op. Defaults to null pointer.
Definition FieldGroup.h:445

◆ setup() [1/3]

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::setup ( const Field3D::FieldRes::Ptr field)
virtual

Adds a single field to the group.

Definition at line 538 of file FieldGroup.h.

539{
541 fields.push_back(field);
542 // Perform setup
544}
#define FIELD3D_MTX_T
Definition StdMathLib.h:99
std::vector< Ptr > Vec
Definition Field.h:214

References FIELD3D_MTX_T.

Referenced by FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup().

◆ setup() [2/3]

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::setup ( const Field3D::FieldRes::Vec & fields)
virtual

Initializes the FieldGroup from a set of fields.

Definition at line 550 of file FieldGroup.h.

551{
553 // Perform setup
555}

References FIELD3D_MTX_T.

◆ setup() [3/3]

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::setup ( const Field3D::FieldRes::Vec & fields,
const Field3D::FieldRes::Vec & minFields,
const Field3D::FieldRes::Vec & maxFields )
virtual

Initializes the FieldGroup from a set of fields with pre-computed min/max representations.

Definition at line 561 of file FieldGroup.h.

565{
566 // Record fields in m_allFields
568
569 // Pick out primary fields
570 for (size_t i = 0, end = fields.size(); i < end; ++i) {
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);
576 }
577
578 // Pick out min/max fields
580}
void setupMinMax(const FieldRes::Vec &minFields, const FieldRes::Vec &maxFields)
Set up the min/max MIP representations.
Definition FieldGroup.h:585
FieldRes::Vec m_allFields
Stores all the fields owned by the FieldGroup.
Definition FieldGroup.h:448

References FIELD3D_MTX_T.

◆ load()

template<typename BaseTypeList_T , int Dims_T>
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.

Returns
Number of fields loaded, or a negative number if the file failed to open.

Definition at line 619 of file FieldGroup.h.

621{
622 using namespace Field3D;
623
624 // Storage for the primary fields
625 FieldRes::Vec results;
626 // Storage for the auxiliary fields
627 FieldRes::Vec minResults, maxResults;
628
629 // Track number of fields in group before loading.
630 const size_t sizeBeforeLoading = size();
631
632 // Open each file ---
633
634 std::vector<std::string> filenames;
635 filenames.push_back(filename);
636
637 BOOST_FOREACH (const std::string fn, filenames) {
638
640 if (!in.open(fn)) {
641 return k_missingFile;
642 }
643
644 // Use partition names to determine if fields should be loaded
645 std::vector<std::string> names;
647
648 BOOST_FOREACH (const std::string &name, names) {
649 detail::LoadFieldsParams params(in, name, attribute, results,
650 minResults, maxResults);
652 mpl::for_each<BaseTypeList_T>(op);
653 }
654
655 }
656
657 // Set up from fields
658 setup(results, minResults, maxResults);
659
660 // Done. Return the number of fields that were loaded.
661 return size() - sizeBeforeLoading;
662}
void getPartitionNames(std::vector< std::string > &names) const
Gets the names of all the partitions in the file.
Provides reading of .f3d (internally, hdf5 or Ogawa) files.
bool open(const std::string &filename)
Opens the given file.
virtual size_t size() const
The number of fields in the group.
Definition FieldGroup.h:689
static const int k_missingFile
Used by load() to indicate missing file.
Definition FieldGroup.h:341

References FIELD3D_MTX_T, Field3DFileBase::getPartitionNames(), and Field3DInputFile::open().

◆ makeMinMax()

template<typename BaseTypeList_T , int Dims_T>
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.

670{
671 // Storage for the auxiliary fields
673
674 MakeMinMax op(minFields, maxFields, resMult);
675 fusion::for_each(m_dense, op);
676 fusion::for_each(m_sparse, op);
677
678 MakeMinMaxMIP opMIP(minFields, maxFields, resMult);
679 fusion::for_each(m_mipDense, opMIP);
680 fusion::for_each(m_mipSparse, opMIP);
681
683}

References FIELD3D_MTX_T.

◆ size()

template<typename BaseTypeList_T , int Dims_T>
size_t FieldGroup< BaseTypeList_T, Dims_T >::size ( ) const
virtual

The number of fields in the group.

Definition at line 689 of file FieldGroup.h.

690{
691 CountFields op;
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);
696 return op.count;
697}

References FieldGroup< BaseTypeList_T, Dims_T >::CountFields::count.

◆ sizeMIP()

template<typename BaseTypeList_T , int Dims_T>
size_t FieldGroup< BaseTypeList_T, Dims_T >::sizeMIP ( ) const

The number of MIP fields in the group.

Definition at line 703 of file FieldGroup.h.

704{
705 CountFields op;
706 fusion::for_each(m_mipDense, op);
707 fusion::for_each(m_mipSparse, op);
708 return op.count;
709}

References FieldGroup< BaseTypeList_T, Dims_T >::CountFields::count.

◆ sample() [1/2]

template<typename BaseTypeList_T , int Dims_T>
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.

720{
721 size_t numHits = 0;
722
723 // Handle ordinary fields
724 Sample op(wsP, result, numHits);
725 fusion::for_each(m_dense, op);
726 fusion::for_each(m_sparse, op);
727
728 // Handle MIP fields
729 SampleMIP mipOp(wsP, wsSpotSize, result, numHits);
730 fusion::for_each(m_mipDense, mipOp);
731 fusion::for_each(m_mipSparse, mipOp);
732
733 // Check composite op
734 if (compOp == Add) {
735 // Nothing
736 } else {
737 if (numHits > 1) {
738 for (size_t i = 0; i < Dims_T; ++i) {
739 result[i] /= static_cast<float>(numHits);
740 }
741 }
742 }
743}

References FIELD3D_MTX_T.

◆ sample() [2/2]

template<typename BaseTypeList_T , int Dims_T>
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.

Warning
To be deprecated in favor of sample(wsP, wsSpotSize, time, ...)

Definition at line 749 of file FieldGroup.h.

752{
753 size_t numHits = 0;
754
755 Sample op(vsP, result, numHits);
756 fusion::for_each(m_dense, op);
757 fusion::for_each(m_sparse, op);
758}

References FIELD3D_MTX_T.

◆ sampleMIP()

template<typename BaseTypeList_T , int Dims_T>
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.

Warning
To be deprecated in favor of sample(wsP, wsSpotSize, time, ...)

Definition at line 779 of file FieldGroup.h.

783{
784 size_t numHits = 0;
785
786 SampleMIP op(vsP, wsSpotSize, result, numHits);
787 fusion::for_each(m_mipDense, op);
788 fusion::for_each(m_mipSparse, op);
789}

References FIELD3D_MTX_T.

◆ sampleMultiple()

template<typename BaseTypeList_T , int Dims_T>
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.

767{
768 size_t numHits = 0;
769
770 SampleMultiple op(n, wsP, result, numHits);
771 fusion::for_each(m_dense, op);
772 fusion::for_each(m_sparse, op);
773}

References FIELD3D_MTX_T.

◆ sampleMIPMultiple()

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::sampleMIPMultiple ( const size_t n,
const float * wsP,
const float * wsSpotSize,
float * result ) const

Samples all the MIP fields in the group.

Definition at line 795 of file FieldGroup.h.

799{
800 size_t numHits = 0;
801
802 SampleMIPMultiple op(n, wsP, wsSpotSize, result, numHits);
803 fusion::for_each(m_mipDense, op);
804 fusion::for_each(m_mipSparse, op);
805}

References FIELD3D_MTX_T.

◆ wsBounds()

template<typename BaseTypeList_T , int Dims_T>
Box3d FieldGroup< BaseTypeList_T, Dims_T >::wsBounds ( ) const

Returns the bounds of the group.

Definition at line 811 of file FieldGroup.h.

812{
814 GetWsBounds op(wsBounds);
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);
819 return wsBounds;
820}
Imath::Box3d Box3d
Definition SpiMathLib.h:79
Box3d wsBounds() const
Returns the bounds of the group.
Definition FieldGroup.h:811

◆ intersects()

template<typename BaseTypeList_T , int Dims_T>
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.

827{
828 PointIsect op(wsP);
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);
833 return op.result();
834}

References FIELD3D_MTX_T, and FieldGroup< BaseTypeList_T, Dims_T >::PointIsect::result().

◆ getIntersections()

template<typename BaseTypeList_T , int Dims_T>
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.

842{
843 GetIntersections op(ray, intervals);
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);
848 return intervals.size() > 0;
849}

References FIELD3D_MTX_T.

◆ getMinMax()

template<typename BaseTypeList_T , int Dims_T>
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.

858{
859 if (m_hasPrefiltMinMax) {
860 // Pre-filtered types
861 GetMinMaxPrefilt opMin(wsBounds, min, GetMinMaxPrefilt::Min);
862 GetMinMaxPrefilt opMax(wsBounds, max, GetMinMaxPrefilt::Max);
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);
867 } else {
868 // Non-prefiltered types
869 GetMinMax op(wsBounds, min, max);
870 fusion::for_each(m_dense, op);
871 fusion::for_each(m_sparse, op);
872 // Non-prefiltered MIP types
873 GetMinMaxMIP opMIP(wsBounds, min, max);
874 fusion::for_each(m_mipDense, opMIP);
875 fusion::for_each(m_mipSparse, opMIP);
876 }
877}
MIPDenseTypes m_mipDenseMin
Definition FieldGroup.h:432
MIPSparseTypes m_mipSparseMax
Definition FieldGroup.h:433
MIPSparseTypes m_mipSparseMin
Definition FieldGroup.h:433
MIPDenseTypes m_mipDenseMax
Definition FieldGroup.h:432

References FIELD3D_MTX_T.

◆ hasPrefiltMinMax()

template<typename BaseTypeList_T , int Dims_T>
bool FieldGroup< BaseTypeList_T, Dims_T >::hasPrefiltMinMax ( ) const
inline

Whether the FieldGroup has a pre-filtered min/max representation.

Definition at line 412 of file FieldGroup.h.

413 { return m_hasPrefiltMinMax; }

References FieldGroup< BaseTypeList_T, Dims_T >::m_hasPrefiltMinMax.

◆ memSize()

template<typename BaseTypeList_T , int Dims_T>
long long int FieldGroup< BaseTypeList_T, Dims_T >::memSize ( ) const

Returns the memory use in bytes for the fields in the group.

Definition at line 883 of file FieldGroup.h.

884{
885 long long int result = 0;
886 MemSize op(result);
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);
891 return result;
892}

◆ fields()

template<typename BaseTypeList_T , int Dims_T>
const FieldRes::Vec & FieldGroup< BaseTypeList_T, Dims_T >::fields ( ) const
inline

Returns a vector of FieldRes::Ptrs to the fields in the group.

Definition at line 417 of file FieldGroup.h.

418 { return m_allFields; }

References FieldGroup< BaseTypeList_T, Dims_T >::m_allFields.

Referenced by FieldGroup< BaseTypeList_T, Dims_T >::FieldGroup().

◆ setupMinMax()

template<typename BaseTypeList_T , int Dims_T>
void FieldGroup< BaseTypeList_T, Dims_T >::setupMinMax ( const FieldRes::Vec & minFields,
const FieldRes::Vec & maxFields )
protected

Set up the min/max MIP representations.

Definition at line 584 of file FieldGroup.h.

587{
588 // Record minFields and maxFields as auxiliary fields
589 m_auxFields.insert(m_auxFields.end(), minFields.begin(), minFields.end());
590 m_auxFields.insert(m_auxFields.end(), maxFields.begin(), maxFields.end());
591
592 // Pick out min fields
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);
597 }
598 // Pick out max fields
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);
603 }
604 // Check if we have pre-filtered fields
605 CountFields countMinOp, countMaxOp;
606 fusion::for_each(m_mipDenseMin, countMinOp);
607 fusion::for_each(m_mipDenseMax, countMaxOp);
608 fusion::for_each(m_mipSparseMin, countMinOp);
609 fusion::for_each(m_mipSparseMax, countMaxOp);
610 if (countMinOp.count > 0 && countMaxOp.count > 0) {
611 m_hasPrefiltMinMax = true;
612 }
613}
FieldRes::Vec m_auxFields
Stores all the auxiliary fields owned by the FieldGroup.
Definition FieldGroup.h:450

References FIELD3D_MTX_T.

Member Data Documentation

◆ k_missingFile

template<typename BaseTypeList_T , int Dims_T>
const int FieldGroup< BaseTypeList_T, Dims_T >::k_missingFile = -1
static

Used by load() to indicate missing file.

Definition at line 341 of file FieldGroup.h.

◆ m_dense

template<typename BaseTypeList_T , int Dims_T>
DenseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_dense
protected

Definition at line 430 of file FieldGroup.h.

◆ m_sparse

template<typename BaseTypeList_T , int Dims_T>
SparseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_sparse
protected

Definition at line 431 of file FieldGroup.h.

◆ m_mipDense

template<typename BaseTypeList_T , int Dims_T>
MIPDenseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipDense
protected

Definition at line 432 of file FieldGroup.h.

◆ m_mipDenseMin

template<typename BaseTypeList_T , int Dims_T>
MIPDenseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipDenseMin
protected

Definition at line 432 of file FieldGroup.h.

◆ m_mipDenseMax

template<typename BaseTypeList_T , int Dims_T>
MIPDenseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipDenseMax
protected

Definition at line 432 of file FieldGroup.h.

◆ m_mipSparse

template<typename BaseTypeList_T , int Dims_T>
MIPSparseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipSparse
protected

Definition at line 433 of file FieldGroup.h.

◆ m_mipSparseMin

template<typename BaseTypeList_T , int Dims_T>
MIPSparseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipSparseMin
protected

Definition at line 433 of file FieldGroup.h.

◆ m_mipSparseMax

template<typename BaseTypeList_T , int Dims_T>
MIPSparseTypes FieldGroup< BaseTypeList_T, Dims_T >::m_mipSparseMax
protected

Definition at line 433 of file FieldGroup.h.

◆ m_hasPrefiltMinMax

template<typename BaseTypeList_T , int Dims_T>
bool FieldGroup< BaseTypeList_T, Dims_T >::m_hasPrefiltMinMax
protected

Whether pre-filtered min/max are present.

Definition at line 436 of file FieldGroup.h.

Referenced by FieldGroup< BaseTypeList_T, Dims_T >::hasPrefiltMinMax().

◆ m_osToWs

template<typename BaseTypeList_T , int Dims_T>
M44d FieldGroup< BaseTypeList_T, Dims_T >::m_osToWs
protected

Current object to world transform.

Definition at line 439 of file FieldGroup.h.

Referenced by FieldGroup< BaseTypeList_T, Dims_T >::GrabFields::operator()().

◆ m_doWsBoundsOptimization

template<typename BaseTypeList_T , int Dims_T>
bool FieldGroup< BaseTypeList_T, Dims_T >::m_doWsBoundsOptimization
protected

◆ m_valueRemapOp

template<typename BaseTypeList_T , int Dims_T>
ValueRemapOp::Ptr FieldGroup< BaseTypeList_T, Dims_T >::m_valueRemapOp
protected

Current value remap op. Defaults to null pointer.

Definition at line 445 of file FieldGroup.h.

◆ m_allFields

template<typename BaseTypeList_T , int Dims_T>
FieldRes::Vec FieldGroup< BaseTypeList_T, Dims_T >::m_allFields
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().

◆ m_auxFields

template<typename BaseTypeList_T , int Dims_T>
FieldRes::Vec FieldGroup< BaseTypeList_T, Dims_T >::m_auxFields
protected

Stores all the auxiliary fields owned by the FieldGroup.

Definition at line 450 of file FieldGroup.h.


The documentation for this class was generated from the following file: