This is the Transformation dedicated class. More...
Public Member Functions | |
void | addRotate_axeZ (Dtk_Double64 angle) |
2D operation, not yet generalized but soon More... | |
void | addScale (Dtk_Double64) |
Add a scale. More... | |
void | addTranslate (const Dtk_dir &V) |
Translate the Dtk_transfo. More... | |
Dtk_transfo () | |
default constructor More... | |
Dtk_transfo (const Dtk_dir &X, const Dtk_dir &Y, const Dtk_dir &Z, const Dtk_pnt &O, const Dtk_Double64 &scale=1.0) | |
Full featured constructor. More... | |
Dtk_transfo (const Dtk_matrix &m) | |
copy constructor More... | |
Dtk_transfo (Dtk_Double64 *d, Dtk_Int32 typefill=0) | |
create a tansfo from a double* More... | |
Dtk_Int32 | DtkDynamicType (const Dtk_Int32 &inId) |
virtual int | DtkDynamicType (const int &inId)=0 |
virtual void | dump (FILE *file=stdout) |
Dtk_matrix * | GetDtkMatrix () |
Dtk_matrix conversion. More... | |
const double & | getOcomponent (Dtk_Int32 n) const |
Return the n component of the O center point. More... | |
const Dtk_pnt & | getOrigin () const |
Return the O center point of the Dtk_transfo (the center O of the basis) More... | |
const double & | getScale () const |
Retrieves the scale factor. More... | |
virtual Dtk_Size_t | GetSize () const |
const double & | getXcomponent (Dtk_Int32 n) const |
Return the n component of the X vector. More... | |
const Dtk_dir & | getXdir () const |
Return the X vector. More... | |
const double & | getYcomponent (Dtk_Int32 n) const |
Return the n component of the Y vector. More... | |
const Dtk_dir & | getYdir () const |
Return the Y vector. More... | |
const double & | getZcomponent (Dtk_Int32 n) const |
Return the n component of the Z vector. More... | |
const Dtk_dir & | getZdir () const |
Return the Z vector. More... | |
int | inverse () |
Inverse the current Matrix. More... | |
int | is_identity () const |
Is transformation Identity. More... | |
Dtk_bool | IsDirect () const |
Is direct. More... | |
Dtk_bool | IsNormalized (const Dtk_Double64 &inTol=DTK_TOLERANCE) const |
Is normalized. More... | |
void | Normalize () |
int | operator== (const Dtk_transfo &in) const |
Compare 2 Dtk_transfo matrix. More... | |
double | scale () const |
Obsolete : use getScale instead. More... | |
void | setAxisRotation (Dtk_dir axis, Dtk_Double64 angle) |
turn the basis represented by Dtk_transfo around a given vector with origin on (0.0, 0.0, 0.0) and scale equal to 1.0 More... | |
void | setOrigin (const Dtk_pnt &O) |
Set a new O center point. More... | |
void | setOrigin (Dtk_Double64 x, Dtk_Double64 y, Dtk_Double64 z) |
Set a new O center point by giving its components. More... | |
void | setScale (Dtk_Double64 scale) |
Set a new scale. More... | |
void | setXdir (const Dtk_dir &X) |
Set a new X vector. More... | |
void | setXdir (Dtk_Double64 x, Dtk_Double64 y, Dtk_Double64 z) |
Set a new X vector by giving its components. More... | |
void | setYdir (const Dtk_dir &Y) |
Set a new Y vector. More... | |
void | setYdir (Dtk_Double64 x, Dtk_Double64 y, Dtk_Double64 z) |
Set a new Y vector by giving its components. More... | |
void | setZdir (const Dtk_dir &Z) |
Set a new Z vector. More... | |
void | setZdir (Dtk_Double64 x, Dtk_Double64 y, Dtk_Double64 z) |
Set a new Z vector by giving its components. More... | |
~Dtk_transfo () | |
Destructor. More... | |
Static Public Member Functions | |
static Dtk_SmartPtr< Dtk_transfo > | create () |
static Dtk_SmartPtr< Dtk_transfo > | create (const Dtk_transfo &) |
static Dtk_transfo * | DtkDynamicCast (Dtk_Object *s) |
Protected Types | |
enum | { _typeID = DTK_TYPE_OBJECT } |
Protected Member Functions | |
void | _copy (const Dtk_Object &s) |
void | _copy (const Dtk_transfo &s) |
void | _init () |
void | _reset () |
Protected Attributes | |
unsigned long | count_ |
Dtk_pnt | o |
double | sc |
Dtk_dir | v [3] |
Friends | |
class | Dtk_SmartPtr< Dtk_transfo > |
Dtk_transfo | Dtk_transfoPtr_to_Dtk_transfo (Dtk_SmartPtr< Dtk_transfo > &t) |
Dtk_transfo | operator* (const Dtk_transfo &, const Dtk_transfo &) |
Allow to multiply 2 Dtk_transfo (matrix multiplication) More... | |
Dtk_dir | operator* (const Dtk_transfo &M, const Dtk_dir &P) |
Allow to multiply a Dtk_transfo by a vector. More... | |
Dtk_transfo | operator* (const Dtk_transfo &M, const Dtk_Double64 d) |
Multiply a matrix by a scalar number. More... | |
Dtk_pnt | operator* (const Dtk_transfo &M, const Dtk_pnt &P) |
Allow to multiply a Dtk_transfo by a point. More... | |
Dtk_transfo | operator+ (const Dtk_transfo &t1, const Dtk_transfo &t2) |
Allow to add 2 Dtk_transfo (matrix addition) More... | |
Dtk_transfo | operator- (const Dtk_transfo &t1, const Dtk_transfo &t2) |
Allow to substracte 2 Dtk_transfo (matrix difference) More... | |
Dtk_transfo | operator/ (Dtk_transfo &M, Dtk_Double64 d) |
Divide a matrix by a scalar number. More... | |
std::ostream & | operator<< (std::ostream &o, const Dtk_transfo &d) |
This is the Transformation dedicated class.
A transformation a matrix is a basis : it contain a point, 3 vectors X,Y,Z, and a global scale.
Note that the implementation allow you to unnormalize the vectors if really needed (distortion matrix), but it is suggested that the X,Y,Z vectors are normalized, and the scale parameter define the global scale
This class lets you use transformation.
Dtk_transfo::Dtk_transfo | ( | ) |
default constructor
Dtk_transfo::Dtk_transfo | ( | Dtk_Double64 * | d, |
Dtk_Int32 | typefill = 0 |
||
) |
create a tansfo from a double*
[in] | d | array of double |
[in] | typefill | method to fill (see below) |
0 (default) : 13 elements : Xx,Xy,Xz,Yx,Yy,Yz,Zx,Zy,Zz,Ox,Oy,Oz,GlobalScale
Dtk_transfo::Dtk_transfo | ( | const Dtk_matrix & | m | ) |
Dtk_transfo::Dtk_transfo | ( | const Dtk_dir & | X, |
const Dtk_dir & | Y, | ||
const Dtk_dir & | Z, | ||
const Dtk_pnt & | O, | ||
const Dtk_Double64 & | scale = 1.0 |
||
) |
Full featured constructor.
[in] | X | the X direction. |
[in] | Y | the Y direction. |
[in] | Z | the Z direction. |
[in] | O | the Origin. |
[in] | scale | the scale factor : default is 1.0 |
Dtk_transfo::~Dtk_transfo | ( | ) |
Destructor.
|
protectedinherited |
|
protected |
|
protected |
|
protected |
void Dtk_transfo::addRotate_axeZ | ( | Dtk_Double64 | angle | ) |
2D operation, not yet generalized but soon
turn the basis represented by Dtk_transfo around Z vector
[in] | angle | angle of rotation (radian) |
void Dtk_transfo::addScale | ( | Dtk_Double64 | ) |
Add a scale.
Mathematics : just multiply the current scale by the given scale
[in] | scale | scale to add. |
void Dtk_transfo::addTranslate | ( | const Dtk_dir & | V | ) |
Translate the Dtk_transfo.
Mathematics : just sum the given vector to the O center point.
[in] | V | vector |
|
static |
|
static |
|
static |
|
pure virtualinherited |
Implemented in Dtk_Shell, Dtk_Body, Dtk_Lump, Dtk_Volume, Dtk_Face, Dtk_Loop, Dtk_Coedge, Dtk_Edge, Dtk_Vertex, Dtk_TopologicalEntity, Dtk_MeshPolyline, Dtk_MeshSurface, Dtk_TransformedSurface, Dtk_FilletSurface, Dtk_OffsetSurface, Dtk_SphericalSurface, Dtk_ToroidalSurface, Dtk_ConicalSurface, Dtk_CylindricalSurface, Dtk_RuledSurface, Dtk_LinearExtrusionSurface, Dtk_StandardRevolutionSurface, Dtk_RevolutionSurface, Dtk_PlaneSurface, Dtk_NurbsSurface, Dtk_Surface, Dtk_Hyperbola, Dtk_Parabola, Dtk_Ellipse, Dtk_Conic, Dtk_Line, Dtk_Polyline, Dtk_NurbsCurve, Dtk_Curve, Dtk_Point, Dtk_Constraint, Dtk_ConstraintReference, Dtk_AxisSystem, Dtk_Preview, Dtk_Entity, Dtk_picture, Dtk_OverrideSet, Dtk_OverrideInfo, Dtk_MainDoc, Dtk_Component, Dtk_Node, Dtk_DocElement, Dtk_Log, and Dtk_Properties.
|
virtualinherited |
Dtk_matrix* Dtk_transfo::GetDtkMatrix | ( | ) |
Dtk_matrix conversion.
const double& Dtk_transfo::getOcomponent | ( | Dtk_Int32 | n | ) | const |
Return the n component of the O center point.
[in] | n | coordinate of the O center point |
const Dtk_pnt& Dtk_transfo::getOrigin | ( | ) | const |
Return the O center point of the Dtk_transfo (the center O of the basis)
const double& Dtk_transfo::getScale | ( | ) | const |
Retrieves the scale factor.
|
virtualinherited |
Reimplemented in Dtk_Shell, Dtk_Body, Dtk_Lump, Dtk_Volume, Dtk_Face, Dtk_Loop, Dtk_Coedge, Dtk_Edge, Dtk_Vertex, Dtk_mesh_face, Dtk_mesh, Dtk_TransformedSurface, Dtk_FilletSurface, Dtk_OffsetSurface, Dtk_SphericalSurface, Dtk_ToroidalSurface, Dtk_ConicalSurface, Dtk_CylindricalSurface, Dtk_RuledSurface, Dtk_LinearExtrusionSurface, Dtk_StandardRevolutionSurface, Dtk_RevolutionSurface, Dtk_PlaneSurface, Dtk_NurbsSurface, Dtk_Surface, Dtk_Hyperbola, Dtk_Parabola, Dtk_Ellipse, Dtk_Conic, Dtk_Line, Dtk_Polyline, Dtk_NurbsCurve, Dtk_Curve, Dtk_Point, Dtk_Entity, and Dtk_Info.
const double& Dtk_transfo::getXcomponent | ( | Dtk_Int32 | n | ) | const |
Return the n component of the X vector.
[in] | n | coordinate of the X vector to return. |
const double& Dtk_transfo::getYcomponent | ( | Dtk_Int32 | n | ) | const |
Return the n component of the Y vector.
[in] | n | coordinate of the Y vector to return. |
const double& Dtk_transfo::getZcomponent | ( | Dtk_Int32 | n | ) | const |
Return the n component of the Z vector.
[in] | n | coordinate of the Z vector to return. |
int Dtk_transfo::inverse | ( | ) |
Inverse the current Matrix.
int Dtk_transfo::is_identity | ( | ) | const |
Is transformation Identity.
Dtk_bool Dtk_transfo::IsDirect | ( | ) | const |
Is direct.
Dtk_bool Dtk_transfo::IsNormalized | ( | const Dtk_Double64 & | inTol = DTK_TOLERANCE | ) | const |
Is normalized.
void Dtk_transfo::Normalize | ( | ) |
int Dtk_transfo::operator== | ( | const Dtk_transfo & | in | ) | const |
Compare 2 Dtk_transfo matrix.
[in] | in | the Dtk_transfo to test with this. |
double Dtk_transfo::scale | ( | ) | const |
Obsolete : use getScale instead.
void Dtk_transfo::setAxisRotation | ( | Dtk_dir | axis, |
Dtk_Double64 | angle | ||
) |
turn the basis represented by Dtk_transfo around a given vector with origin on (0.0, 0.0, 0.0) and scale equal to 1.0
[in] | axis | axis of the ratation |
[in] | angle | angle of rotation (radian) |
void Dtk_transfo::setOrigin | ( | const Dtk_pnt & | O | ) |
Set a new O center point.
[in] | O | the new O point |
void Dtk_transfo::setOrigin | ( | Dtk_Double64 | x, |
Dtk_Double64 | y, | ||
Dtk_Double64 | z | ||
) |
Set a new O center point by giving its components.
[in] | x | the x component of the O center point |
[in] | y | the y component of the O center point |
[in] | z | the z component of the O center point |
void Dtk_transfo::setScale | ( | Dtk_Double64 | scale | ) |
Set a new scale.
[in] | scale | the new scale. |
void Dtk_transfo::setXdir | ( | const Dtk_dir & | X | ) |
Set a new X vector.
[in] | X | the new X vector |
void Dtk_transfo::setXdir | ( | Dtk_Double64 | x, |
Dtk_Double64 | y, | ||
Dtk_Double64 | z | ||
) |
Set a new X vector by giving its components.
[in] | x | the x component of the X vector |
[in] | y | the y component of the X vector |
[in] | z | the z component of the X vector |
void Dtk_transfo::setYdir | ( | const Dtk_dir & | Y | ) |
Set a new Y vector.
[in] | Y | the new Y vector |
void Dtk_transfo::setYdir | ( | Dtk_Double64 | x, |
Dtk_Double64 | y, | ||
Dtk_Double64 | z | ||
) |
Set a new Y vector by giving its components.
[in] | x | the x component of the Y vector |
[in] | y | the y component of the Y vector |
[in] | z | the z component of the Y vector |
void Dtk_transfo::setZdir | ( | const Dtk_dir & | Z | ) |
Set a new Z vector.
[in] | Z | the new Z vector |
void Dtk_transfo::setZdir | ( | Dtk_Double64 | x, |
Dtk_Double64 | y, | ||
Dtk_Double64 | z | ||
) |
Set a new Z vector by giving its components.
[in] | x | the x component of the Z vector |
[in] | y | the y component of the Z vector |
[in] | z | the z component of the Z vector |
|
friend |
|
friend |
|
friend |
Allow to multiply 2 Dtk_transfo (matrix multiplication)
[in] | t1 | first matrix to multiply |
[in] | t2 | second matrix to multiply |
|
friend |
Allow to multiply a Dtk_transfo by a vector.
[in] | M | matrix to multiply |
[in] | P | vector to multiply by |
|
friend |
Multiply a matrix by a scalar number.
whole datas are multiplied.
[in] | M | matrix to multiply |
[in] | d | scalar |
|
friend |
Allow to multiply a Dtk_transfo by a point.
[in] | M | matrix to multiply |
[in] | P | point to multiply by |
|
friend |
Allow to add 2 Dtk_transfo (matrix addition)
[in] | t1 | first matrix to add |
[in] | t2 | second matrix to add |
|
friend |
Allow to substracte 2 Dtk_transfo (matrix difference)
[in] | t1 | first matrix to substracte |
[in] | t2 | second matrix to substracte |
|
friend |
Divide a matrix by a scalar number.
whole datas are divided.
[in] | M | matrix to divide |
[in] | d | scalar |
|
friend |
|
protectedinherited |
|
protected |
|
protected |
|
protected |