Bottom part of Coordinate system class. More...
#include <utl/CoordinateSystem.h>
Public Types | |
typedef CoordinateSystemPtr | type |
Type to use to hold objects of this type. More... | |
Public Member Functions | |
const TransformationMatrix & | GetInverseTransformationTo (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 TransformationMatrix & | GetTransformation () 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 TransformationMatrix & | GetTransformationTo (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 |
CoordinateTransformer & | operator= (const CoordinateTransformer &theSystem) |
Private Attributes | |
TransformationMatrix * | fLastInverseTransformation = nullptr |
WeakCoordinateSystemPtr | fLastTarget |
TransformationMatrix * | fLastTransformation = 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... | |
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.
Type to use to hold objects of this type.
This is the type returned by the TransformerConstructor factory methods.
Definition at line 95 of file CoordinateSystem.h.
|
protected |
Definition at line 83 of file CoordinateSystem.h.
|
inlineprotected |
Definition at line 128 of file CoordinateSystem.h.
|
protected |
Definition at line 17 of file CoordinateSystem.cc.
References utl::CoordinateSystemValid().
|
protectedvirtual |
Definition at line 26 of file CoordinateSystem.cc.
References fLastInverseTransformation, and fLastTransformation.
|
private |
|
private |
Definition at line 126 of file CoordinateSystem.cc.
References GetReferenceSystem(), GetTransformation(), and result.
Referenced by GetTransformationTo().
|
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().
|
pure virtual |
Get reference system for the creation of new coordinate systems.
Implemented in utl::BaseCSPolicy, and utl::DerivedCSPolicy.
|
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().
|
static |
Definition at line 49 of file CoordinateSystem.cc.
References RootCoordinateSystem.
Referenced by FindCommonBase(), GetReferenceSystem(), and TestProbability::setUp().
|
protected |
Get a CoordinateSystemPointer
for this
.
Definition at line 34 of file CoordinateSystem.cc.
Referenced by utl::BaseCSPolicy::GetReferenceForNewCS().
|
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().
|
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().
|
private |
|
mutableprivate |
Definition at line 166 of file CoordinateSystem.h.
Referenced by GetInverseTransformationTo(), and ~CoordinateTransformer().
|
mutableprivate |
Definition at line 164 of file CoordinateSystem.h.
Referenced by GetInverseTransformationTo(), and GetTransformationTo().
|
mutableprivate |
Definition at line 165 of file CoordinateSystem.h.
Referenced by GetTransformationTo(), and ~CoordinateTransformer().
|
private |
The base system - 0 for default base.
Definition at line 161 of file CoordinateSystem.h.
Referenced by GetReferenceSystem().
|
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().
|
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().