Core 1.0
|
A transformation defined as the composition of a rotation, a translation and a scale. More...
#include <frame.h>
Public Member Functions | |
FrameScaled2 (const Matrix2 &=Matrix2::Identity, const Vector2 &=Vector2::Null, const Vector2 &=Vector2(1.0)) | |
Creates a frame. | |
FrameScaled2 (const Vector2 &, const Vector2 &) | |
Creates a frame given the translation and scaling vectors. | |
FrameScaled2 (const Vector2 &, const double &) | |
Creates a frame given the translation and scale. | |
FrameScaled2 (const Frame2 &, const Vector2 &=Vector2(1.0)) | |
Creates a frame. | |
~FrameScaled2 () | |
Empty. | |
Matrix2 | R () const |
Returns the rotation matrix of the frame. | |
Vector2 | T () const |
Returns the translation vector of the frame. | |
Vector2 | S () const |
Get scaling vector from transformation. | |
FrameScaled2 | Inverse () const |
Compute and return the inverse transformation. | |
void | Rotate (const double &) |
Rotate the shape. | |
void | Scale (const Vector2 &) |
Scale the shape. | |
void | Scale (const double &) |
Scale the shape. | |
void | Translate (const Vector2 &) |
Translate the shape. | |
Vector2 | Transform (const Vector2 &) const |
Transforms a given input point. | |
Vector2 | InverseTransform (const Vector2 &) const |
Inverse transformation of a given input point. | |
Vector2 | TransformDirection (const Vector2 &) const |
Transforms a given input normal. | |
Vector2 | InverseTransformDirection (const Vector2 &) const |
Transforms a given input normal. | |
void | Compose (const FrameScaled2 &) |
Compose two frames. | |
FrameScaled2 | Composed (const FrameScaled2 &) const |
Compose two frames. | |
Static Public Member Functions | |
static FrameScaled2 | Scaling (const Vector2 &) |
Create a scaling frame. | |
static FrameScaled2 | Scaling (const double &) |
Create a uniform scaling frame. | |
Static Public Attributes | |
static const FrameScaled2 | Id |
Identity. | |
Protected Attributes | |
Vector2 | s |
Scaling vector. | |
![]() | |
Matrix2 | r |
Rotation matrix. | |
Vector2 | t |
Translation vector. | |
Friends | |
std::ostream & | operator<< (std::ostream &s, const FrameScaled2 &frame) |
Overloaded. | |
Additional Inherited Members | |
![]() | |
Frame2 (const Matrix2 &=Matrix2::Identity, const Vector2 &=Vector2::Null) | |
Creates a frame given a rotation matrix and a translation vector. | |
Frame2 (const double &, const Vector2 &=Vector2::Null) | |
Creates a frame given a rotation angle and a translation vector. | |
Frame2 (const Vector2 &, const Vector2 &) | |
Creates a frame given the origin and its orthogonal unit vectors. | |
~Frame2 () | |
Empty. | |
Matrix2 | R () const |
Returns the rotation matrix of the frame. | |
Vector2 | T () const |
Returns the translation vector of the frame. | |
void | Compose (const Frame2 &) |
Compose the frame with another one. | |
Frame2 | Composed (const Frame2 &) const |
Compose the frame with another one. | |
Frame2 | Inverse () const |
Compute the inverse transformation. | |
Vector2 | Transform (const Vector2 &) const |
Transform a point out of the frame coordinate system. | |
Vector2 | InverseTransform (const Vector2 &) const |
Transform a point into the frame coordinate system. | |
Vector2 | TransformDirection (const Vector2 &) const |
Transform a direction vector out of the frame coordinate system. | |
Vector2 | InverseTransformDirection (const Vector2 &) const |
Transform a direction vector into the frame coordinate system. | |
void | Draw (QGraphicsScene &, const QPen &) const |
Draw a circle. | |
![]() | |
static Frame2 | Translation (const Vector2 &) |
Creates a translation transformation. | |
static Frame2 | Rotation (const double &) |
Create a rotation frame. | |
![]() | |
static const Frame2 | Id |
Identity. | |
A transformation defined as the composition of a rotation, a translation and a scale.
The data-structure groups the rotation matrix, the translation and scaling vectors.
The orientation of the frame should be defined by the appropriate rotation matrix.
In general, a FrameScaled2 is defined by its rotation matrix, and a translation and scaling vector:
When there is no rotation, the rotation matrix can be defined using the identity matrix:
It is also possible and simpler to use:
Some static member functions are not implemented and benefit on the conversion constructor. As an example, a translation can be coded as:
|
explicit |
Creates a frame.
r | Rotation matrix. |
t | Translation vector. |
s | Scaling vector. |
Creates a frame given the translation and scaling vectors.
t | Translation. |
s | Scaling vector. |
|
explicit |
Creates a frame given the translation and scale.
t | Translation. |
s | Uniform scaling factor. |
Creates a frame.
frame | The frame. |
s | Scaling. |
void FrameScaled2::Compose | ( | const FrameScaled2 & | frame | ) |
Compose two frames.
frame | The frame. |
FrameScaled2 FrameScaled2::Composed | ( | const FrameScaled2 & | frame | ) | const |
Compose two frames.
frame | The frame. |
Inverse transformation of a given input point.
p | Point. |
Transforms a given input normal.
n | Normal vector. |
void FrameScaled2::Rotate | ( | const double & | a | ) |
Rotate the shape.
a | Rotation angle. |
void FrameScaled2::Scale | ( | const double & | u | ) |
Scale the shape.
u | Scaling factor. |
void FrameScaled2::Scale | ( | const Vector2 & | u | ) |
Scale the shape.
u | Scaling vector. |
|
static |
Create a uniform scaling frame.
s | Scaling. |
|
static |
Create a scaling frame.
s | Scaling vector. |
Transforms a given input point.
p | Point. |
Transforms a given input normal.
n | Normal vector. |
void FrameScaled2::Translate | ( | const Vector2 & | t | ) |
Translate the shape.
t | Translation vector. |
|
friend |
Overloaded.
s | Stream. |
frame | The frame. |