Field3D
|
#include <Field.h>
Public Types | |
typedef FieldRes | class_type |
typedef boost::intrusive_ptr< FieldRes > | Ptr |
typedef std::vector< Ptr > | Vec |
![]() | |
typedef FieldBase | class_type |
typedef boost::intrusive_ptr< FieldBase > | Ptr |
![]() | |
typedef boost::intrusive_ptr< RefBase > | Ptr |
typedef boost::weak_ptr< RefBase > | WeakPtr |
Public Member Functions | |
V3i const | dataResolution () const |
virtual std::string | dataTypeString () const |
const Box3i & | dataWindow () const |
Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field subclass. More... | |
const Box3i & | extents () const |
Returns the extents of the data. This signifies the relevant area that the data exists over. However, the data window (below) may be smaller than the extents, in which case it is only safe to call value() for those coordinate inside the data window. More... | |
FieldRes () | |
This constructor ensures that we have a valid mapping at all times. More... | |
FieldRes (const FieldRes &src) | |
Base class copy constructor. More... | |
bool | isInBounds (int i, int j, int k) const |
Returns true is the indicies are in bounds of the data window. More... | |
FieldMapping::Ptr | mapping () |
Returns a pointer to the mapping. More... | |
const FieldMapping::Ptr | mapping () const |
Returns a pointer to the mapping. More... | |
virtual void | mappingChanged () |
Tells the subclass that the mapping changed. More... | |
virtual long long int | memSize () const |
Returns the memory usage (in bytes) More... | |
void | setMapping (FieldMapping::Ptr mapping) |
Sets the field's mapping. More... | |
virtual size_t | voxelCount () const |
Counts the number of voxels. For most fields, this is just the volume of the data window, but sparse data structures can override this to return a better value. More... | |
![]() | |
FieldBase () | |
Constructor. More... | |
FieldBase (const FieldBase &) | |
Copy Constructor. More... | |
virtual | ~FieldBase () |
Destructor. More... | |
virtual std::string | className () const =0 |
Returns the class name of the object. Used by the class pool and when writing the data to disk. More... | |
virtual std::string | classType () const =0 |
Returns the full class type string. More... | |
virtual Ptr | clone () const =0 |
Returns a pointer to a copy of the field, pure virtual so ensure derived classes properly implement it. More... | |
FieldMetadata & | metadata () |
accessor to the m_metadata class More... | |
const FieldMetadata & | metadata () const |
Read only access to the m_metadata class. More... | |
void | copyMetadata (const FieldBase &field) |
Copies the metadata from a second field. More... | |
![]() | |
void | ref () const |
Used by boost::intrusive_pointer. More... | |
size_t | refcnt () |
Used by boost::intrusive_pointer. More... | |
void | unref () const |
Used by boost::intrusive_pointer. More... | |
WeakPtr | weakPtr () const |
RefBase () | |
RefBase (const RefBase &) | |
Copy constructor. More... | |
RefBase & | operator= (const RefBase &) |
Assignment operator. More... | |
virtual | ~RefBase () |
Destructor. More... | |
virtual bool | checkRTTI (const char *typenameStr)=0 |
This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();. More... | |
bool | matchRTTI (const char *typenameStr) |
Performs a check to see if the given typename string matches this class' This needs to be implemented in -all- subclasses, even abstract ones. More... | |
![]() | |
virtual void | metadataHasChanged (const std::string &) |
Alerts the callback holder that the metadata has changed. More... | |
Static Public Member Functions | |
static const char * | staticClassName () |
static const char * | staticClassType () |
![]() | |
static const char * | staticClassName () |
static const char * | staticClassType () |
![]() | |
static const char * | staticClassType () |
Public Attributes | |
DEFINE_FIELD_RTTI_ABSTRACT_CLASS | |
![]() | |
std::string | attribute |
Optional name of the attribute the field represents. More... | |
std::string | name |
Optional name of the field. More... | |
Protected Types | |
typedef MatrixFieldMapping | default_mapping |
Protected Attributes | |
Box3i | m_dataWindow |
Defines the area where data is allocated. This should be treated as a closed (i.e. inclusive) interval. More... | |
Box3i | m_extents |
Defines the extents of the the storage. This may be larger or smaller than the data window, and in the case where it is larger, care must be taken not to access voxels outside the data window. This should be treated as a closed (i.e. inclusive) interval. More... | |
FieldMapping::Ptr | m_mapping |
Pointer to the field's mapping. More... | |
Private Types | |
typedef FieldBase | base |
Convenience typedef for referring to base class. More... | |
This class serves to isolate the extents and data window from its templated subclasses. Thus, anything that needs to access the extents or data window don't need to know about what data type the subclass is templated on.
It also owns the field's mapping.
Why do we have both an extent and a data window? The extents are used to define which range of voxels define the [0..1] local coordinate system. The data window in turn defines the voxels that are legal to read/write from. Thus, for optimization we may have a large extents but a small data window, or a small extents and a larger data window which would let us apply large-kernel filters without having to deal with boundary conditions.
typedef boost::intrusive_ptr<FieldRes> FieldRes::Ptr |
typedef std::vector<Ptr> FieldRes::Vec |
typedef FieldRes FieldRes::class_type |
|
protected |
|
private |
|
inline |
This constructor ensures that we have a valid mapping at all times.
Definition at line 325 of file Field.h.
References m_dataWindow, m_extents, and m_mapping.
|
inline |
|
inlinevirtual |
Reimplemented in Field< Data_T >.
|
inlinestatic |
Definition at line 224 of file Field.h.
Referenced by staticClassType().
|
inlinestatic |
Definition at line 229 of file Field.h.
References staticClassName().
|
inline |
Returns the extents of the data. This signifies the relevant area that the data exists over. However, the data window (below) may be smaller than the extents, in which case it is only safe to call value() for those coordinate inside the data window.
Definition at line 249 of file Field.h.
References m_extents.
Referenced by convertCellCenteredToMAC(), convertMACToCellCentered(), ResizableField< Data_T >::copyFrom(), and sameDefinition().
|
inline |
Returns the data window. Any coordinate inside this window is safe to pass to value() in the Field subclass.
Definition at line 253 of file Field.h.
References m_dataWindow.
Referenced by detail::checkInputEmpty(), convertCellCenteredToMAC(), convertMACToCellCentered(), ResizableField< Data_T >::copyFrom(), makeMinMax(), sameDefinition(), LinearFieldInterp< Data_T >::sample(), CubicFieldInterp< Data_T >::sample(), LinearMACFieldInterp< Data_T >::sample(), CubicMACFieldInterp< Data_T >::sample(), and LinearSparseFieldInterp< Data_T >::sample().
|
inline |
Definition at line 256 of file Field.h.
References m_dataWindow.
Referenced by DenseField< Data_T >::begin(), WritableField< Data_T >::begin(), SparseField< Data_T >::begin(), MACField< Data_T >::begin_comp(), SparseField< Data_T >::blockBegin(), DenseField< Data_T >::cbegin(), Field< Data_T >::cbegin(), SparseField< Data_T >::cbegin(), MACField< Data_T >::cbegin_comp(), SparseField< Data_T >::releaseBlocks(), and ProceduralFieldLookup< Data_T >::sample().
|
inline |
Sets the field's mapping.
Definition at line 347 of file Field.h.
References m_extents, m_mapping, mapping(), mappingChanged(), Msg::print(), and Msg::SevWarning.
Referenced by convertCellCenteredToMAC(), ResizableField< Data_T >::copyFrom(), ResizableField< Data_T >::matchDefinition(), Field3DInputFile::readLayer(), Field3DInputFileHDF5::readLayer(), Field3DInputFileHDF5::readProxyLayer(), and Field3DInputFile::readProxyLayer().
|
inline |
Returns a pointer to the mapping.
Definition at line 263 of file Field.h.
References m_mapping.
Referenced by detail::adjustedMIPFieldMapping(), computeOffset(), convertCellCenteredToMAC(), convertMACToCellCentered(), ResizableField< Data_T >::copyFrom(), Field3DOutputFileHDF5::createNewPartition(), FieldRes(), sameDefinition(), setMapping(), Field3DOutputFileHDF5::writeLayer(), Field3DOutputFile::writeLayer(), and wsSample().
|
inline |
|
inline |
Returns true is the indicies are in bounds of the data window.
Definition at line 362 of file Field.h.
References m_dataWindow.
|
inlinevirtual |
Returns the memory usage (in bytes)
Reimplemented in SparseField< Data_T >, MIPField< Field_T >, MACField< Data_T >, EmptyField< Data_T >, and DenseField< Data_T >.
|
inlinevirtual |
Tells the subclass that the mapping changed.
Reimplemented in MIPField< Field_T >, MIPField< SparseField< Data_T > >, and MIPField< DenseField< Data_T > >.
Definition at line 283 of file Field.h.
Referenced by setMapping().
|
inlinevirtual |
Counts the number of voxels. For most fields, this is just the volume of the data window, but sparse data structures can override this to return a better value.
Reimplemented in SparseField< Data_T >, and MIPField< Field_T >.
Definition at line 289 of file Field.h.
References m_dataWindow.
|
protected |
Defines the extents of the the storage. This may be larger or smaller than the data window, and in the case where it is larger, care must be taken not to access voxels outside the data window. This should be treated as a closed (i.e. inclusive) interval.
Definition at line 307 of file Field.h.
Referenced by extents(), FieldRes(), setMapping(), and ResizableField< Data_T >::sizeChanged().
|
protected |
Defines the area where data is allocated. This should be treated as a closed (i.e. inclusive) interval.
Definition at line 310 of file Field.h.
Referenced by SparseField< Data_T >::applyDataWindowOffset(), dataResolution(), dataWindow(), FieldRes(), isInBounds(), and voxelCount().
|
protected |
Pointer to the field's mapping.
Definition at line 312 of file Field.h.
Referenced by FieldRes(), mapping(), setMapping(), and ResizableField< Data_T >::sizeChanged().