Open CASCADE Technology
7.6.0
|
Coordinate system converter defining the following tools: More...
#include <RWMesh_CoordinateSystemConverter.hxx>
Public Member Functions | |
RWMesh_CoordinateSystemConverter () | |
Empty constructor. More... | |
Standard_Boolean | IsEmpty () const |
Return TRUE if there is no transformation (target and current coordinates systems are same). More... | |
Standard_Real | InputLengthUnit () const |
Return source length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless output length unit). More... | |
void | SetInputLengthUnit (Standard_Real theInputScale) |
Set source length units as scale factor to m (meters). More... | |
Standard_Real | OutputLengthUnit () const |
Return destination length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless input length unit). More... | |
void | SetOutputLengthUnit (Standard_Real theOutputScale) |
Set destination length units as scale factor to m (meters). More... | |
Standard_Boolean | HasInputCoordinateSystem () const |
Return TRUE if source coordinate system has been set; FALSE by default. More... | |
const gp_Ax3 & | InputCoordinateSystem () const |
Source coordinate system; UNDEFINED by default. More... | |
void | SetInputCoordinateSystem (const gp_Ax3 &theSysFrom) |
Set source coordinate system. More... | |
void | SetInputCoordinateSystem (RWMesh_CoordinateSystem theSysFrom) |
Set source coordinate system. More... | |
Standard_Boolean | HasOutputCoordinateSystem () const |
Return TRUE if destination coordinate system has been set; FALSE by default. More... | |
const gp_Ax3 & | OutputCoordinateSystem () const |
Destination coordinate system; UNDEFINED by default. More... | |
void | SetOutputCoordinateSystem (const gp_Ax3 &theSysTo) |
Set destination coordinate system. More... | |
void | SetOutputCoordinateSystem (RWMesh_CoordinateSystem theSysTo) |
Set destination coordinate system. More... | |
void | Init (const gp_Ax3 &theInputSystem, Standard_Real theInputLengthUnit, const gp_Ax3 &theOutputSystem, Standard_Real theOutputLengthUnit) |
Initialize transformation. More... | |
void | TransformTransformation (gp_Trsf &theTrsf) const |
Transform transformation. More... | |
void | TransformPosition (gp_XYZ &thePos) const |
Transform position. More... | |
void | TransformNormal (Graphic3d_Vec3 &theNorm) const |
Transform normal (e.g. exclude translation/scale part of transformation). More... | |
Static Public Member Functions | |
static gp_Ax3 | StandardCoordinateSystem (RWMesh_CoordinateSystem theSys) |
Return a standard coordinate system definition. More... | |
Coordinate system converter defining the following tools:
RWMesh_CoordinateSystem enumeration is used for convenient conversion between two commonly used coordinate systems, to make sure that imported model is oriented up. But gp_Ax3 can be used instead for defining a conversion between arbitrary systems (e.g. including non-zero origin).
The converter requires defining explicitly both input and output systems, so that if either input or output is undefined, then conversion will be skipped. Length units conversion and coordinate system conversion are decomposed, so that application might specify no length units conversion but Y-up to Z-up coordinate system conversion.
Class defines dedicated methods for parameters of input and output systems. This allows passing tool through several initialization steps, so that a reader can initialize input length units (only if file format defines such information), while application specifies output length units, and conversion will be done only when both defined.
RWMesh_CoordinateSystemConverter::RWMesh_CoordinateSystemConverter | ( | ) |
Empty constructor.
|
inline |
Return TRUE if source coordinate system has been set; FALSE by default.
|
inline |
Return TRUE if destination coordinate system has been set; FALSE by default.
void RWMesh_CoordinateSystemConverter::Init | ( | const gp_Ax3 & | theInputSystem, |
Standard_Real | theInputLengthUnit, | ||
const gp_Ax3 & | theOutputSystem, | ||
Standard_Real | theOutputLengthUnit | ||
) |
Initialize transformation.
|
inline |
Source coordinate system; UNDEFINED by default.
|
inline |
Return source length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless output length unit).
|
inline |
Return TRUE if there is no transformation (target and current coordinates systems are same).
|
inline |
Destination coordinate system; UNDEFINED by default.
|
inline |
Return destination length units, defined as scale factor to m (meters). -1.0 by default, which means that NO conversion will be applied (regardless input length unit).
|
inline |
Set source coordinate system.
|
inline |
Set source coordinate system.
|
inline |
Set source length units as scale factor to m (meters).
|
inline |
Set destination coordinate system.
|
inline |
Set destination coordinate system.
|
inline |
Set destination length units as scale factor to m (meters).
|
inlinestatic |
Return a standard coordinate system definition.
|
inline |
Transform normal (e.g. exclude translation/scale part of transformation).
|
inline |
Transform position.
|
inline |
Transform transformation.