List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
utl::CoordinateTransformer Class Referenceabstract

Bottom part of Coordinate system class. More...

#include <utl/CoordinateSystem.h>

Inheritance diagram for utl::CoordinateTransformer:
Inheritance graph
[legend]

Public Types

typedef CoordinateSystemPtr type
 Type to use to hold objects of this type. More...
 

Public Member Functions

const TransformationMatrixGetInverseTransformationTo (const CoordinateSystemPtr &target) const
 Get the inverse transformation to other coordinate system (w/ caching) More...
 
virtual CoordinateSystemPtr GetReferenceForNewCS () const =0
 Get reference system for the creation of new coordinate systems. More...
 
CoordinateSystemPtr GetReferenceSystem () const
 Get the reference system for this coordinate system. More...
 
const TransformationMatrixGetTransformation () const
 Get the transformation matrix relative to reference system. More...
 
virtual TransformationMatrix GetTransformationForNewCS (const TransformationMatrix &theTransformation) const =0
 Calculate the correct transformation for the new CS. More...
 
const TransformationMatrixGetTransformationTo (const CoordinateSystemPtr &target) const
 Get the transformation to other coordinate system (with caching) More...
 

Static Public Member Functions

static CoordinateSystemPtr GetRootCoordinateSystem ()
 

Protected Types

typedef boost::weak_ptr< const
CoordinateTransformer
WeakCoordinateSystemPtr
 

Protected Member Functions

 CoordinateTransformer ()
 
 CoordinateTransformer (const TransformationMatrix &theTransformation, const CoordinateSystemPtr &theReferenceCS)
 
CoordinateSystemPtr GetThis () const
 Get a CoordinateSystemPointer for this. More...
 
virtual ~CoordinateTransformer ()
 

Private Member Functions

TransformationMatrix CollectTransformationFrom (const CoordinateSystemPtr &target) const
 
 CoordinateTransformer (const CoordinateTransformer &theSystem)
 
CoordinateSystemPtr FindCommonBase (const CoordinateSystemPtr &other) const
 
CoordinateTransformeroperator= (const CoordinateTransformer &theSystem)
 

Private Attributes

TransformationMatrixfLastInverseTransformation = nullptr
 
WeakCoordinateSystemPtr fLastTarget
 
TransformationMatrixfLastTransformation = nullptr
 
CoordinateSystemPtr fReferenceSystem
 The base system - 0 for default base. More...
 
TransformationMatrix fTransformation
 Transformation of the components of a vector or point. More...
 

Static Private Attributes

static CoordinateSystemPtr RootCoordinateSystem = CoordinateSystemPtr()
 The root coordinate system - the unique, ultimate reference system. More...
 

Detailed Description

Bottom part of Coordinate system class.

Both CoordinateSystem's and other geometry objects contain (a reference to) a coordinates system, relative to which the coordinates representing the objects are defined. To guarantee that a CoordinateSystem object exists as long as some other objects refers to it, and to make sure that it is deleted when no longer needed, all references should be held through a CoordinateSystemPtr smart pointer.

This implies that, under normal cirumstances, all CoordinateSystem's should be allocated on the heap. Creating CoordinateSystem objects on the stack is dangerous - one has to make sure that no geometry object refers to such a CoordinateSystem at the moment when it goes out of scope and is destroyed.

This class provides the common user interface for coordinate systems. Classes layered on top of this class implement the creation of coordinate systems and the policy for dealing with the base system relative to which the coordinate system is defined.

Definition at line 81 of file CoordinateSystem.h.

Member Typedef Documentation

Type to use to hold objects of this type.

This is the type returned by the TransformerConstructor factory methods.

Note
This is required by the policy interface of TransformerConstructor.

Definition at line 95 of file CoordinateSystem.h.

Definition at line 83 of file CoordinateSystem.h.

Constructor & Destructor Documentation

utl::CoordinateTransformer::CoordinateTransformer ( )
inlineprotected

Definition at line 128 of file CoordinateSystem.h.

CoordinateTransformer::CoordinateTransformer ( const TransformationMatrix theTransformation,
const CoordinateSystemPtr theReferenceCS 
)
protected

Definition at line 17 of file CoordinateSystem.cc.

References utl::CoordinateSystemValid().

CoordinateTransformer::~CoordinateTransformer ( )
protectedvirtual

Definition at line 26 of file CoordinateSystem.cc.

References fLastInverseTransformation, and fLastTransformation.

utl::CoordinateTransformer::CoordinateTransformer ( const CoordinateTransformer theSystem)
private

Member Function Documentation

TransformationMatrix CoordinateTransformer::CollectTransformationFrom ( const CoordinateSystemPtr target) const
private

Definition at line 126 of file CoordinateSystem.cc.

References GetReferenceSystem(), GetTransformation(), and result.

Referenced by GetTransformationTo().

CoordinateSystemPtr CoordinateTransformer::FindCommonBase ( const CoordinateSystemPtr other) const
private

Definition at line 106 of file CoordinateSystem.cc.

References GetReferenceSystem(), and GetRootCoordinateSystem().

Referenced by GetTransformationTo().

const TransformationMatrix & CoordinateTransformer::GetInverseTransformationTo ( const CoordinateSystemPtr target) const

Get the inverse transformation to other coordinate system (w/ caching)

Definition at line 160 of file CoordinateSystem.cc.

References fLastInverseTransformation, fLastTarget, and GetTransformationTo().

virtual CoordinateSystemPtr utl::CoordinateTransformer::GetReferenceForNewCS ( ) const
pure virtual

Get reference system for the creation of new coordinate systems.

Implemented in utl::BaseCSPolicy, and utl::DerivedCSPolicy.

CoordinateSystemPtr utl::CoordinateTransformer::GetReferenceSystem ( ) const
inline

Get the reference system for this coordinate system.

Takes care to keep the ultimate root coordinate system unique.

Definition at line 102 of file CoordinateSystem.h.

References fReferenceSystem, and GetRootCoordinateSystem().

Referenced by CollectTransformationFrom(), FindCommonBase(), and utl::DerivedCSPolicy::GetReferenceForNewCS().

CoordinateSystemPtr CoordinateTransformer::GetRootCoordinateSystem ( )
static

Definition at line 49 of file CoordinateSystem.cc.

References RootCoordinateSystem.

Referenced by FindCommonBase(), GetReferenceSystem(), and TestProbability::setUp().

CoordinateSystemPtr CoordinateTransformer::GetThis ( ) const
protected

Get a CoordinateSystemPointer for this.

Definition at line 34 of file CoordinateSystem.cc.

Referenced by utl::BaseCSPolicy::GetReferenceForNewCS().

const TransformationMatrix& utl::CoordinateTransformer::GetTransformation ( ) const
inline

Get the transformation matrix relative to reference system.

Definition at line 106 of file CoordinateSystem.h.

References fTransformation.

Referenced by CollectTransformationFrom(), and utl::DerivedCSPolicy::GetTransformationForNewCS().

virtual TransformationMatrix utl::CoordinateTransformer::GetTransformationForNewCS ( const TransformationMatrix theTransformation) const
pure virtual

Calculate the correct transformation for the new CS.

Implemented in utl::BaseCSPolicy, and utl::DerivedCSPolicy.

const TransformationMatrix & CoordinateTransformer::GetTransformationTo ( const CoordinateSystemPtr target) const

Get the transformation to other coordinate system (with caching)

Definition at line 139 of file CoordinateSystem.cc.

References CollectTransformationFrom(), FindCommonBase(), fLastTarget, fLastTransformation, and utl::TransformationMatrix::Inverse().

Referenced by GetInverseTransformationTo().

CoordinateTransformer& utl::CoordinateTransformer::operator= ( const CoordinateTransformer theSystem)
private

Member Data Documentation

TransformationMatrix* utl::CoordinateTransformer::fLastInverseTransformation = nullptr
mutableprivate

Definition at line 166 of file CoordinateSystem.h.

Referenced by GetInverseTransformationTo(), and ~CoordinateTransformer().

WeakCoordinateSystemPtr utl::CoordinateTransformer::fLastTarget
mutableprivate

Definition at line 164 of file CoordinateSystem.h.

Referenced by GetInverseTransformationTo(), and GetTransformationTo().

TransformationMatrix* utl::CoordinateTransformer::fLastTransformation = nullptr
mutableprivate

Definition at line 165 of file CoordinateSystem.h.

Referenced by GetTransformationTo(), and ~CoordinateTransformer().

CoordinateSystemPtr utl::CoordinateTransformer::fReferenceSystem
private

The base system - 0 for default base.

Definition at line 161 of file CoordinateSystem.h.

Referenced by GetReferenceSystem().

TransformationMatrix utl::CoordinateTransformer::fTransformation
private

Transformation of the components of a vector or point.

This is the transformation of the components of the vector represented in the reference system into this coordinate system.

Definition at line 158 of file CoordinateSystem.h.

Referenced by GetTransformation().

CoordinateSystemPtr CoordinateTransformer::RootCoordinateSystem = CoordinateSystemPtr()
staticprivate

The root coordinate system - the unique, ultimate reference system.

Global to hold the Root coordinate system. It has no further reference system.

Definition at line 169 of file CoordinateSystem.h.

Referenced by GetRootCoordinateSystem().


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

, generated on Tue Sep 26 2023.