Field3D
NullFieldMapping Class Reference

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:
FieldMapping RefBase

List of all members.

Public Types

typedef NullFieldMapping class_type
typedef boost::intrusive_ptr
< NullFieldMapping
Ptr
 Convenience typedef.

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.

Static Public Member Functions

static const char * classType ()

Public Attributes

 DEFINE_FIELD_RTTI_CONCRETE_CLASS

Private Types

typedef FieldMapping base
 Convenience typedef for referring to base class.

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 218 of file FieldMapping.h.


Member Typedef Documentation

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

Convenience typedef.

Reimplemented from FieldMapping.

Definition at line 225 of file FieldMapping.h.

Reimplemented from FieldMapping.

Definition at line 229 of file FieldMapping.h.

Convenience typedef for referring to base class.

Reimplemented from FieldMapping.

Definition at line 293 of file FieldMapping.h.


Constructor & Destructor Documentation

NullFieldMapping::NullFieldMapping ( ) [inline]

Definition at line 242 of file FieldMapping.h.

Referenced by clone().

    : FieldMapping()
  { /* Empty */ }
NullFieldMapping::NullFieldMapping ( const Box3i extents) [inline]

Definition at line 245 of file FieldMapping.h.

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

Member Function Documentation

static const char* NullFieldMapping::classType ( ) [inline, static]

Reimplemented from FieldMapping.

Definition at line 232 of file FieldMapping.h.

Referenced by className().

  {
    return "NullFieldMapping";
  }
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 256 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, vsP); }
virtual void NullFieldMapping::worldToVoxel ( const V3d wsP,
V3d vsP,
float   
) const [inline, virtual]

Implements FieldMapping.

Definition at line 258 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, vsP); }
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 261 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { voxelToLocal(vsP, wsP); }
virtual void NullFieldMapping::voxelToWorld ( const V3d vsP,
V3d wsP,
float   
) const [inline, virtual]

Implements FieldMapping.

Definition at line 263 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { voxelToLocal(vsP, wsP); }
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 266 of file FieldMapping.h.

  { lsP = wsP; }
virtual void NullFieldMapping::worldToLocal ( const V3d wsP,
V3d lsP,
float   
) const [inline, virtual]

Implements FieldMapping.

Definition at line 268 of file FieldMapping.h.

  { lsP = wsP; }
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 271 of file FieldMapping.h.

  { wsP = lsP; }
virtual void NullFieldMapping::localToWorld ( const V3d lsP,
V3d wsP,
float   
) const [inline, virtual]

Implements FieldMapping.

Definition at line 273 of file FieldMapping.h.

  { wsP = lsP; }
std::string NullFieldMapping::className ( ) const [virtual]

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

Implements FieldMapping.

Definition at line 169 of file FieldMapping.cpp.

References classType().

{
  return std::string(classType());
}
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 176 of file FieldMapping.cpp.

References FIELD3D_NAMESPACE_OPEN::k_nullMappingName().

{
  // 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;
}
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 281 of file FieldMapping.h.

References FieldMapping::m_res.

  { return V3d(1.0 / m_res.x, 1.0 / m_res.y, 1.0 / m_res.z); }
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 187 of file FieldMapping.cpp.

References NullFieldMapping().

{
  return Ptr(new NullFieldMapping(*this));
}

Member Data Documentation


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