Open CASCADE Technology  7.5.0.beta
Public Member Functions | Static Public Member Functions
RWMesh_CoordinateSystemConverter Class Reference

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_Ax3InputCoordinateSystem () 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_Ax3OutputCoordinateSystem () 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RWMesh_CoordinateSystemConverter()

RWMesh_CoordinateSystemConverter::RWMesh_CoordinateSystemConverter ( )

Empty constructor.

Member Function Documentation

◆ HasInputCoordinateSystem()

Standard_Boolean RWMesh_CoordinateSystemConverter::HasInputCoordinateSystem ( ) const
inline

Return TRUE if source coordinate system has been set; FALSE by default.

◆ HasOutputCoordinateSystem()

Standard_Boolean RWMesh_CoordinateSystemConverter::HasOutputCoordinateSystem ( ) const
inline

Return TRUE if destination coordinate system has been set; FALSE by default.

◆ Init()

void RWMesh_CoordinateSystemConverter::Init ( const gp_Ax3 theInputSystem,
Standard_Real  theInputLengthUnit,
const gp_Ax3 theOutputSystem,
Standard_Real  theOutputLengthUnit 
)

Initialize transformation.

◆ InputCoordinateSystem()

const gp_Ax3& RWMesh_CoordinateSystemConverter::InputCoordinateSystem ( ) const
inline

Source coordinate system; UNDEFINED by default.

◆ InputLengthUnit()

Standard_Real RWMesh_CoordinateSystemConverter::InputLengthUnit ( ) const
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).

◆ IsEmpty()

Standard_Boolean RWMesh_CoordinateSystemConverter::IsEmpty ( ) const
inline

Return TRUE if there is no transformation (target and current coordinates systems are same).

◆ OutputCoordinateSystem()

const gp_Ax3& RWMesh_CoordinateSystemConverter::OutputCoordinateSystem ( ) const
inline

Destination coordinate system; UNDEFINED by default.

◆ OutputLengthUnit()

Standard_Real RWMesh_CoordinateSystemConverter::OutputLengthUnit ( ) const
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).

◆ SetInputCoordinateSystem() [1/2]

void RWMesh_CoordinateSystemConverter::SetInputCoordinateSystem ( const gp_Ax3 theSysFrom)
inline

Set source coordinate system.

◆ SetInputCoordinateSystem() [2/2]

void RWMesh_CoordinateSystemConverter::SetInputCoordinateSystem ( RWMesh_CoordinateSystem  theSysFrom)
inline

Set source coordinate system.

◆ SetInputLengthUnit()

void RWMesh_CoordinateSystemConverter::SetInputLengthUnit ( Standard_Real  theInputScale)
inline

Set source length units as scale factor to m (meters).

◆ SetOutputCoordinateSystem() [1/2]

void RWMesh_CoordinateSystemConverter::SetOutputCoordinateSystem ( const gp_Ax3 theSysTo)
inline

Set destination coordinate system.

◆ SetOutputCoordinateSystem() [2/2]

void RWMesh_CoordinateSystemConverter::SetOutputCoordinateSystem ( RWMesh_CoordinateSystem  theSysTo)
inline

Set destination coordinate system.

◆ SetOutputLengthUnit()

void RWMesh_CoordinateSystemConverter::SetOutputLengthUnit ( Standard_Real  theOutputScale)
inline

Set destination length units as scale factor to m (meters).

◆ StandardCoordinateSystem()

static gp_Ax3 RWMesh_CoordinateSystemConverter::StandardCoordinateSystem ( RWMesh_CoordinateSystem  theSys)
inlinestatic

Return a standard coordinate system definition.

◆ TransformNormal()

void RWMesh_CoordinateSystemConverter::TransformNormal ( Graphic3d_Vec3 theNorm) const
inline

Transform normal (e.g. exclude translation/scale part of transformation).

◆ TransformPosition()

void RWMesh_CoordinateSystemConverter::TransformPosition ( gp_XYZ thePos) const
inline

Transform position.

◆ TransformTransformation()

void RWMesh_CoordinateSystemConverter::TransformTransformation ( gp_Trsf theTrsf) const
inline

Transform transformation.


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