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

List of all members.

Public Types

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

Public Member Functions

Constructors & destructor
 NullFieldMapping ()
 NullFieldMapping (const Box3i &extents)
 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 time) const
virtual void worldToVoxel (std::vector< V3d >::const_iterator wsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator vsP) const
virtual void voxelToWorld (const V3d &vsP, V3d &wsP) const
 Transform from voxel space position into world space.
virtual void voxelToWorld (std::vector< V3d >::const_iterator vsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator wsP) const
 Transforms multiple positions at once. Mainly used to avoid the overhead of virtual calls when transforming large quantities of points.
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 worldToLocal (std::vector< V3d >::const_iterator wsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator lsP) const
virtual void localToWorld (const V3d &lsP, V3d &wsP) const
 Transform from local space position into world space.
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.
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 time) const
virtual void worldToVoxel (std::vector< V3d >::const_iterator wsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator vsP) const
virtual void voxelToWorld (const V3d &vsP, V3d &wsP) const
 Transform from voxel space position into world space.
virtual void voxelToWorld (std::vector< V3d >::const_iterator vsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator wsP) const
 Transforms multiple positions at once. Mainly used to avoid the overhead of virtual calls when transforming large quantities of points.
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 worldToLocal (std::vector< V3d >::const_iterator wsP, std::vector< V3d >::const_iterator end, std::vector< V3d >::iterator lsP) const
virtual void localToWorld (const V3d &lsP, V3d &wsP) const
 Transform from local space position into world space.
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.

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


Member Typedef Documentation

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

Convenience typedef.

Reimplemented from FieldMapping.

Definition at line 221 of file FieldMapping.h.

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

Convenience typedef.

Reimplemented from FieldMapping.

Definition at line 221 of file FieldMapping.h.


Constructor & Destructor Documentation

NullFieldMapping::NullFieldMapping ( ) [inline]

Definition at line 228 of file FieldMapping.h.

Referenced by clone().

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

Definition at line 231 of file FieldMapping.h.

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

Definition at line 228 of file FieldMapping.h.

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

Definition at line 231 of file FieldMapping.h.

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

Member Function Documentation

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

References FieldMapping::localToVoxel().

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

Implements FieldMapping.

Definition at line 244 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, vsP, time); }
virtual void NullFieldMapping::worldToVoxel ( std::vector< V3d >::const_iterator  wsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  vsP 
) const [inline, virtual]

Implements FieldMapping.

Definition at line 247 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, end, 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 251 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { voxelToLocal(vsP, wsP); }
virtual void NullFieldMapping::voxelToWorld ( std::vector< V3d >::const_iterator  vsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  wsP 
) const [inline, virtual]

Transforms multiple positions at once. Mainly used to avoid the overhead of virtual calls when transforming large quantities of points.

Note:
This would ideally be templated on the storage container, but since we can't have templated virtual calls, we only support std::vector for now

Implements FieldMapping.

Definition at line 254 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { 
    for (; vsP != end; ++vsP, ++wsP) 
      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 262 of file FieldMapping.h.

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

Implements FieldMapping.

Definition at line 264 of file FieldMapping.h.

  { lsP = wsP; }
virtual void NullFieldMapping::worldToLocal ( std::vector< V3d >::const_iterator  wsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  lsP 
) const [inline, virtual]

Implements FieldMapping.

Definition at line 267 of file FieldMapping.h.

  { std::copy(wsP, end, lsP); }
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; }
std::string NullFieldMapping::className ( ) const [virtual]

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

Implements FieldMapping.

Definition at line 149 of file FieldMapping.cpp.

References FIELD3D_NAMESPACE_OPEN::k_nullMappingName().

{
  return k_nullMappingName;
}
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 156 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 276 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 167 of file FieldMapping.cpp.

References NullFieldMapping().

{
  return Ptr(new NullFieldMapping(*this));
}
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 242 of file FieldMapping.h.

References FieldMapping::localToVoxel().

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

Implements FieldMapping.

Definition at line 244 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, vsP, time); }
virtual void NullFieldMapping::worldToVoxel ( std::vector< V3d >::const_iterator  wsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  vsP 
) const [inline, virtual]

Implements FieldMapping.

Definition at line 247 of file FieldMapping.h.

References FieldMapping::localToVoxel().

  { localToVoxel(wsP, end, 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 251 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { voxelToLocal(vsP, wsP); }
virtual void NullFieldMapping::voxelToWorld ( std::vector< V3d >::const_iterator  vsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  wsP 
) const [inline, virtual]

Transforms multiple positions at once. Mainly used to avoid the overhead of virtual calls when transforming large quantities of points.

Note:
This would ideally be templated on the storage container, but since we can't have templated virtual calls, we only support std::vector for now

Implements FieldMapping.

Definition at line 254 of file FieldMapping.h.

References FieldMapping::voxelToLocal().

  { 
    for (; vsP != end; ++vsP, ++wsP) 
      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 262 of file FieldMapping.h.

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

Implements FieldMapping.

Definition at line 264 of file FieldMapping.h.

  { lsP = wsP; }
virtual void NullFieldMapping::worldToLocal ( std::vector< V3d >::const_iterator  wsP,
std::vector< V3d >::const_iterator  end,
std::vector< V3d >::iterator  lsP 
) const [inline, virtual]

Implements FieldMapping.

Definition at line 267 of file FieldMapping.h.

  { std::copy(wsP, end, lsP); }
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 std::string NullFieldMapping::className ( ) const [virtual]

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

Implements FieldMapping.

virtual bool NullFieldMapping::isIdentical ( FieldMapping::Ptr  other,
double  tolerance = 0.0 
) const [virtual]

Whether the mapping is identical to another mapping.

Implements FieldMapping.

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 276 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); }
virtual 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.


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