NullFieldMapping Class Reference
Fields

Trivial class, world space is equal to local space, i.e. the field is contained in the unit cube [0..1] in all axes. More...

`#include <FieldMapping.h>`

Inheritance diagram for NullFieldMapping:

## Public Types

typedef NullFieldMapping | class_type
typedef boost::intrusive_ptr< NullFieldMapping > | Ptr
| Convenience typedef.
Public Types inherited from FieldMapping
typedef FieldMapping | class_type
typedef boost::intrusive_ptr< FieldMapping > | Ptr
Public Types inherited from RefBase
typedef boost::intrusive_ptr< RefBase > | Ptr
typedef boost::weak_ptr< RefBase > | WeakPtr

## Public Member Functions

Constructors & destructor
| NullFieldMapping ()
| NullFieldMapping (const Box3i &extents)
From FieldMapping
virtual void | worldToVoxel (const V3d &wsP, V3d &vsP) const
| Transform from world space position into voxel space.
virtual void | worldToVoxel (const V3d &wsP, V3d &vsP, float) const
virtual void | voxelToWorld (const V3d &vsP, V3d &wsP) const
| Transform from voxel space position into world space.
virtual void | voxelToWorld (const V3d &vsP, V3d &wsP, float) const
virtual void | worldToLocal (const V3d &wsP, V3d &lsP) const
| Transform from world space position into local space.
virtual void | worldToLocal (const V3d &wsP, V3d &lsP, float) const
virtual void | localToWorld (const V3d &lsP, V3d &wsP) const
| Transform from local space position into world space.
virtual void | localToWorld (const V3d &lsP, V3d &wsP, float) const
virtual std::string | className () const
| Returns the FieldMapping type name. Used when writing/reading from disk.
virtual bool | isIdentical (FieldMapping::Ptr other, double tolerance=0.0) const
| Whether the mapping is identical to another mapping.
virtual V3d | wsVoxelSize (int, int, int) const
| Returns world-space size of a voxel at the specified coordinate.
virtual FieldMapping::Ptr | clone () const
| Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement it.
Public Member Functions inherited from FieldMapping
const V3d & | origin () const
| Returns the origin.
const V3d & | resolution () const
| Returns the resolution.
void | setExtents (const Box3i &extents)
| This sets the field extents information to use for defining the local coordinate space.
| FieldMapping ()
| Constructor.
| FieldMapping (const Box3i &extents)
| Construct with known extents.
virtual | ~FieldMapping ()
| Destructor.
virtual void | extentsChanged ()
| Implement this if the subclass needs to update itself when the resolution changes.
void | localToVoxel (const V3d &lsP, V3d &vsP) const
| Transform from local space to voxel space. This is just a multiplication by the resolution of the Field that we're mapping.
void | voxelToLocal (const V3d &vsP, V3d &lsP) const
| Inverse of localToVoxel.
Public Member Functions inherited from RefBase
void | ref () const
| Used by boost::intrusive_pointer.
size_t | refcnt ()
| Used by boost::intrusive_pointer.
void | unref () const
| Used by boost::intrusive_pointer.
WeakPtr | weakPtr () const
| RefBase ()
| RefBase (const RefBase &)
| Copy constructor.
RefBase & | operator= (const RefBase &)
| Assignment operator.
virtual | ~RefBase ()
| Destructor.
virtual bool | checkRTTI (const char *typenameStr)=0
| This function is only implemented by concrete classes and triggers the actual RTTI check through matchRTTI();.
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.

## Static Public Member Functions

static const char * | staticClassType ()
Static Public Member Functions inherited from FieldMapping
static const char * | staticClassType ()
static const char * | staticClassType ()

## Public Attributes

| DEFINE_FIELD_RTTI_CONCRETE_CLASS
Public Attributes inherited from FieldMapping
| DEFINE_FIELD_RTTI_ABSTRACT_CLASS

## Private Types

typedef FieldMapping | base
| Convenience typedef for referring to base class.

## Additional Inherited Members

Protected Attributes inherited from FieldMapping
V3d | m_origin
| The integer voxel-space origin of the underlying Field object. Is equal to field.extents.min.
V3d | m_res
| The integer voxel-space resolution of the underlying Field object. Is equal to field.extents.max - field.extents.min + 1.

## Detailed Description

Trivial class, world space is equal to local space, i.e. the field is contained in the unit cube [0..1] in all axes.

Refer to using_mappings for examples of how to use this in your code.

Definition at line 236 of file FieldMapping.h.

## Member Typedef Documentation

## Ptr

typedef boost::intrusive_ptr<NullFieldMapping> NullFieldMapping::Ptr

Convenience typedef.

Definition at line 243 of file FieldMapping.h.

## class_type

typedef NullFieldMapping NullFieldMapping::class_type

Definition at line 247 of file FieldMapping.h.

## base

typedef FieldMapping NullFieldMapping::base

private

Convenience typedef for referring to base class.

Definition at line 311 of file FieldMapping.h.

## Constructor & Destructor Documentation

## NullFieldMapping() [1/2]

NullFieldMapping::NullFieldMapping | ( |  | ) |

inline

Definition at line 260 of file FieldMapping.h.

: FieldMapping()
{ /* Empty */ }
FieldMapping::FieldMapping
FieldMapping()
Constructor.
Definition FieldMapping.cpp:113

References FieldMapping::FieldMapping().

Referenced by clone().

## NullFieldMapping() [2/2]

NullFieldMapping::NullFieldMapping | ( | const Box3i & | extents | ) |

inline

Definition at line 263 of file FieldMapping.h.

: FieldMapping(extents)
{ /* Empty */ }

References FieldMapping::FieldMapping().

## Member Function Documentation

## staticClassType()

const char * NullFieldMapping::staticClassType | ( |  | ) |

inline static

Definition at line 250 of file FieldMapping.h.

{
return "NullFieldMapping";
}

Referenced by className().

## worldToVoxel() [1/2]

virtual void NullFieldMapping::worldToVoxel | ( | const V3d & | wsP,
|  | V3d & | vsP ) const

inline virtual

Transform from world space position into voxel space.

Implements FieldMapping.

Definition at line 274 of file FieldMapping.h.

{ localToVoxel(wsP, vsP); }
FieldMapping::localToVoxel
void localToVoxel(const V3d &lsP, V3d &vsP) const
Transform from local space to voxel space. This is just a multiplication by the resolution of the Fie...
Definition FieldMapping.cpp:155

References FieldMapping::localToVoxel().

## worldToVoxel() [2/2]

virtual void NullFieldMapping::worldToVoxel | ( | const V3d & | wsP,
|  | V3d & | vsP,
|  | float | ) const

inline virtual

Implements FieldMapping.

Definition at line 276 of file FieldMapping.h.

{ localToVoxel(wsP, vsP); }

References FieldMapping::localToVoxel().

## voxelToWorld() [1/2]

virtual void NullFieldMapping::voxelToWorld | ( | const V3d & | vsP,
|  | V3d & | wsP ) const

inline virtual

Transform from voxel space position into world space.

Implements FieldMapping.

Definition at line 279 of file FieldMapping.h.

{ voxelToLocal(vsP, wsP); }
FieldMapping::voxelToLocal
void voxelToLocal(const V3d &vsP, V3d &lsP) const
Inverse of localToVoxel.
Definition FieldMapping.cpp:162

References FieldMapping::voxelToLocal().

## voxelToWorld() [2/2]

virtual void NullFieldMapping::voxelToWorld | ( | const V3d & | vsP,
|  | V3d & | wsP,
|  | float | ) const

inline virtual

Implements FieldMapping.

Definition at line 281 of file FieldMapping.h.

{ voxelToLocal(vsP, wsP); }

References FieldMapping::voxelToLocal().

## worldToLocal() [1/2]

virtual void NullFieldMapping::worldToLocal | ( | const V3d & | wsP,
|  | V3d & | lsP ) const

inline virtual

Transform from world space position into local space.

Implements FieldMapping.

Definition at line 284 of file FieldMapping.h.

{ lsP = wsP; }

## worldToLocal() [2/2]

virtual void NullFieldMapping::worldToLocal | ( | const V3d & | wsP,
|  | V3d & | lsP,
|  | float | ) const

inline virtual

Implements FieldMapping.

Definition at line 286 of file FieldMapping.h.

{ lsP = wsP; }

## localToWorld() [1/2]

virtual void NullFieldMapping::localToWorld | ( | const V3d & | lsP,
|  | V3d & | wsP ) const

inline virtual

Transform from local space position into world space.

Implements FieldMapping.

Definition at line 289 of file FieldMapping.h.

{ wsP = lsP; }

## localToWorld() [2/2]

virtual void NullFieldMapping::localToWorld | ( | const V3d & | lsP,
|  | V3d & | wsP,
|  | float | ) const

inline virtual

Implements FieldMapping.

Definition at line 291 of file FieldMapping.h.

{ wsP = lsP; }

## className()

std::string NullFieldMapping::className | ( |  | ) | const

virtual

Returns the FieldMapping type name. Used when writing/reading from disk.

Implements FieldMapping.

Definition at line 226 of file FieldMapping.cpp.

{
return std::string(staticClassType());
}
NullFieldMapping::staticClassType
static const char * staticClassType()
Definition FieldMapping.h:250

References staticClassType().

## isIdentical()

bool NullFieldMapping::isIdentical | ( | FieldMapping::Ptr | other,
|  | double | tolerance = 0.0 ) const

virtual

Whether the mapping is identical to another mapping.

Implements FieldMapping.

Definition at line 233 of file FieldMapping.cpp.

{
// For null mappings it's simple - if the other one is also a null mapping
// then true, otherwise it's false.
return other->className() == k_nullMappingName;
}
FIELD3D_NAMESPACE_OPEN::k_nullMappingName
const string k_nullMappingName("NullFieldMapping")

## wsVoxelSize()

virtual V3d NullFieldMapping::wsVoxelSize | ( | int | i,
|  | int | j,
|  | int | k ) const

inline virtual

Returns world-space size of a voxel at the specified coordinate.

Implements FieldMapping.

Definition at line 299 of file FieldMapping.h.

{ return V3d(1.0 / m_res.x, 1.0 / m_res.y, 1.0 / m_res.z); }
V3d
Imath::V3d V3d
Definition SpiMathLib.h:74
FieldMapping::m_res
V3d m_res
The integer voxel-space resolution of the underlying Field object. Is equal to field....
Definition FieldMapping.h:193

References FieldMapping::m_res.

## clone()

FieldMapping::Ptr NullFieldMapping::clone | ( |  | ) | const

virtual

Returns a pointer to a copy of the mapping, pure virtual so ensure derived classes properly implement it.

Implements FieldMapping.

Definition at line 244 of file FieldMapping.cpp.

{
return Ptr(new NullFieldMapping(*this));
}
NullFieldMapping::NullFieldMapping
NullFieldMapping()
Definition FieldMapping.h:260
NullFieldMapping::Ptr
boost::intrusive_ptr< NullFieldMapping > Ptr
Convenience typedef.
Definition FieldMapping.h:243

References NullFieldMapping().

## Member Data Documentation

## DEFINE_FIELD_RTTI_CONCRETE_CLASS

NullFieldMapping::DEFINE_FIELD_RTTI_CONCRETE_CLASS

Definition at line 248 of file FieldMapping.h.

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

- export/FieldMapping.h
- src/FieldMapping.cpp