|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Class representing an object location in 3D space. This class is used to hold data describing the location (position and orientation) of an object in a Fedem model. The location can be represented in a different ways and the class also contain methods for switching the representation types. More...
#include <FFa3DLocation.H>
Public Types | |
| enum | PosType { CART_X_Y_Z , CYL_R_YR_X , CYL_R_ZR_Y , CYL_R_XR_Z , SPH_R_XR_YZ , SPH_R_YR_ZX , SPH_R_ZR_XY } |
| Enum for position representation. More... | |
| enum | RotType { EUL_Z_Y_X , PNT_PX_PXY , PNT_PZ_PXZ , DIR_EX_EXY } |
| Enum for orientation representation. More... | |
Public Member Functions | |
| FFa3DLocation () | |
| Default constructor. More... | |
| FFa3DLocation (PosType t, const FaVec3 &v0, RotType r, const FaVec3 &v1, const FaVec3 &v2) | |
| Constructor defining the orientation from two direction vectors. More... | |
| FFa3DLocation (PosType t, const FaVec3 &v0, RotType r, const FaVec3 &v1) | |
| Constructor defining the orientation from a rotation angles. More... | |
| FFa3DLocation (const FaMat34 &m) | |
| Constructor defining the location from a position matrix. More... | |
| FFa3DLocation (const FFa3DLocation &m) | |
| Copy constructor. More... | |
| void | saveMyNumericalData () |
| Let this instance save its numerical data. More... | |
| FFa3DLocation & | operator= (const FFa3DLocation &m) |
| Assignment operator. More... | |
| bool | operator== (const FFa3DLocation &m) const |
| Comparison operator. More... | |
| const FaVec3 & | operator[] (int i) const |
| Indexing operator, for read access. More... | |
| FaVec3 & | operator[] (int i) |
| Indexing operator, for assignment. More... | |
| PosType | getPosType () const |
| Returns the positioning type. More... | |
| RotType | getRotType () const |
| Returns the orientation type. More... | |
| int | getNumFields () const |
| Returns number of numerical fields for defining the orientation. More... | |
| bool | changePosType (PosType newType) |
| Converts the position representation in *this to newType. More... | |
| bool | changeRotType (RotType newType) |
| Converts the orientation representation in *this to newType. More... | |
| FFa3DLocation & | changePosRefCS (const FaMat34 &newRef, const FaMat34 &oldRef) |
| Changes the position reference CS from oldRef to newRef. More... | |
| FFa3DLocation & | changeRotRefCS (const FaMat34 &newRef, const FaMat34 &oldRef) |
| Changes the orientation reference CS from oldRef to newRef. More... | |
| FFa3DLocation & | set (PosType p, const FaMat34 &posRelMx, RotType r, const FaMat34 &rotRelMx, const FaMat34 &glbPos) |
| Updates the location based on the provided parameters. More... | |
| FFa3DLocation & | set (PosType p, RotType r, const FaMat34 &glbPos) |
| Updates the location based on the provided parameters. More... | |
| FFa3DLocation & | setPos (PosType p, const FaVec3 &cartPos) |
| Updates the position in *this. More... | |
| FFa3DLocation & | setRot (RotType r, const FaMat33 &rotMat) |
| Updates the orientation in *this. More... | |
| FaVec3 | translation () const |
| Returns the cartesian position of *this. More... | |
| FaMat33 | direction () const |
| Returns the orientation of *this as a rotation matrix. More... | |
| FaMat34 | getMatrix () const |
| Returns a FaMat34 representation of *this. More... | |
| FaMat34 | getMatrix (const FaMat34 &posRelMx, const FaMat34 &rotRelMx) const |
| Returns a FaMat34 representation of a relative location. More... | |
| bool | isValid () const |
| Checks that the current data represent a valid location. More... | |
| std::ostream & | print (std::ostream &s, bool includeNumericalData=true) const |
| Prints the content of *this to the provided output stream. More... | |
Private Attributes | |
| PosTypeEnum | myPosTyp = CART_X_Y_Z |
| Current positioning type. More... | |
| RotTypeEnum | myRotTyp = EUL_Z_Y_X |
| Current orientation type. More... | |
| std::array< FaVec3, 3 > | myL |
| Vectors with position/orientation data. More... | |
| bool | saveNumericalData = false |
| If false, only the type enums are stored. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, const FFa3DLocation &m) |
| Global printing operator. More... | |
| std::istream & | operator>> (std::istream &s, FFa3DLocation &m) |
| Global reading operator. More... | |
Class representing an object location in 3D space. This class is used to hold data describing the location (position and orientation) of an object in a Fedem model. The location can be represented in a different ways and the class also contain methods for switching the representation types.
Enum for position representation.
|
inline |
Default constructor.
| FFa3DLocation::FFa3DLocation | ( | PosType | t, |
| const FaVec3 & | v0, | ||
| RotType | r, | ||
| const FaVec3 & | v1, | ||
| const FaVec3 & | v2 | ||
| ) |
Constructor defining the orientation from two direction vectors.
Constructor defining the orientation from a rotation angles.
| FFa3DLocation::FFa3DLocation | ( | const FaMat34 & | m | ) |
Constructor defining the location from a position matrix.
|
inline |
Copy constructor.
| FFa3DLocation & FFa3DLocation::changePosRefCS | ( | const FaMat34 & | newRef, |
| const FaMat34 & | oldRef | ||
| ) |
Changes the position reference CS from oldRef to newRef.
This is a convenience method which changes the imaginary reference coordinate system for the position values stored in *this to newRef from oldRef.
| bool FFa3DLocation::changePosType | ( | PosType | newType | ) |
Converts the position representation in *this to newType.
| FFa3DLocation & FFa3DLocation::changeRotRefCS | ( | const FaMat34 & | newRef, |
| const FaMat34 & | oldRef | ||
| ) |
Changes the orientation reference CS from oldRef to newRef.
This is a convenience method which changes the imaginary reference coordinate system for the orientation values stored in *this to newRef from oldRef.
| bool FFa3DLocation::changeRotType | ( | RotType | newType | ) |
Converts the orientation representation in *this to newType.
| FaMat33 FFa3DLocation::direction | ( | ) | const |
Returns the orientation of *this as a rotation matrix.
Returns a FaMat34 representation of a relative location.
This is a utility method returning a FaMat34 object that represents the global position of *this as if it was placed relative to the two matrices provided.
return FaMat34( rotRelMx * this->direction(), posRelMx * this->translation() )
|
inline |
Returns number of numerical fields for defining the orientation.
|
inline |
Returns the positioning type.
|
inline |
Returns the orientation type.
| bool FFa3DLocation::isValid | ( | ) | const |
Checks that the current data represent a valid location.
| FFa3DLocation & FFa3DLocation::operator= | ( | const FFa3DLocation & | m | ) |
Assignment operator.
| bool FFa3DLocation::operator== | ( | const FFa3DLocation & | m | ) | const |
Comparison operator.
|
inline |
Indexing operator, for assignment.
|
inline |
Indexing operator, for read access.
| std::ostream & FFa3DLocation::print | ( | std::ostream & | s, |
| bool | includeNumericalData = true |
||
| ) | const |
Prints the content of *this to the provided output stream.
|
inline |
Let this instance save its numerical data.
| FFa3DLocation & FFa3DLocation::set | ( | PosType | p, |
| const FaMat34 & | posRelMx, | ||
| RotType | r, | ||
| const FaMat34 & | rotRelMx, | ||
| const FaMat34 & | globalPosition | ||
| ) |
Updates the location based on the provided parameters.
This method sets *this to contain the position of globalPosition relative to posRelMx stored as type p, and the orientation of globalPosition relative to rotRelMx stored as type r.
| FFa3DLocation & FFa3DLocation::set | ( | PosType | p, |
| RotType | r, | ||
| const FaMat34 & | mx | ||
| ) |
Updates the location based on the provided parameters.
This method sets *this to be positioned and oriented as the provided matrix mx, converting it to the provided storage types p and r.
| FFa3DLocation & FFa3DLocation::setPos | ( | PosType | p, |
| const FaVec3 & | cartPos | ||
| ) |
Updates the position in *this.
This method sets the position in *this to the provided cartesian position cartPos, converting it to position type p way of storing it.
| FFa3DLocation & FFa3DLocation::setRot | ( | RotType | r, |
| const FaMat33 & | rotMat | ||
| ) |
Updates the orientation in *this.
This method sets the orientation in *this to the provided rotation matrix rotMat, converting it to orientation type r way of storing it. When needed, the current position is fetched by calling translation().
| FaVec3 FFa3DLocation::translation | ( | ) | const |
Returns the cartesian position of *this.
|
friend |
Global printing operator.
|
friend |
Global reading operator.
|
private |
Vectors with position/orientation data.
|
private |
Current positioning type.
|
private |
Current orientation type.
|
private |
If false, only the type enums are stored.