Inherited by qglviewer::ManipulatedFrame.
Signals | |
void | modified () |
Public Methods | |
Frame () | |
Frame (const qglviewer::Vec &pos, const qglviewer::Quaternion &orien) | |
virtual | ~Frame () |
Frame & | operator= (const Frame &f) |
virtual QDomElement | domElement (const QString &name, QDomDocument &doc) const |
virtual void | initFromDOMElement (const QDomElement &de) |
const GLdouble * | matrix () const |
void | getMatrix (GLdouble m[4][4]) const |
const GLdouble * | worldMatrix () const |
void | getWorldMatrix (GLdouble m[4][4]) const |
void | setFromMatrix (const float m[4][4]) |
Composition of frames | |
A frame is always defined with respect to a given coordinate system. Default is the world coordinate system, corresponding to a NULL referenceFrame().
Setting the reference frame to non | |
Frame * | referenceFrame () const |
void | setReferenceFrame (Frame *const fr) |
bool | settingAsReferenceFrameWillCreateALoop (Frame *const fr) |
Local frame translation and rotation | |
Methods to set and get the frame translation and rotation (defined with respect to the reference frame).
A frame is defined by its translation with respect to its reference frame, and then by a rotation of the coordinate system around the new translated origin. These values (translation and then rotation) are hence defined with respect to the local reference frame. Use position() and orientation() to get the world coordinates of the frame. | |
void | setTranslation (const float x, const float y, const float z) |
void | setTranslation (const qglviewer::Vec &t) |
void | setRotation (const float x, const float y, const float z, const float a) |
void | setRotation (const qglviewer::Quaternion &q) |
void | setRotationAxisAngle (const float x, const float y, const float z, const float a) |
void | setTranslationAndRotation (const qglviewer::Vec &t, const qglviewer::Quaternion &q) |
void | getTranslation (float &x, float &y, float &z) const |
qglviewer::Vec | translation () const |
void | getRotation (float &x, float &y, float &z, float &a) const |
qglviewer::Quaternion | rotation () const |
void | translate (qglviewer::Vec &t) |
void | translate (const qglviewer::Vec &t) |
void | translate (float t[3]) |
void | translate (float &x, float &y, float &z) |
void | translate (const float x, const float y, const float z) |
void | rotate (qglviewer::Quaternion &q) |
void | rotate (const qglviewer::Quaternion &q) |
void | rotate (float q[4]) |
void | rotate (float &x, float &y, float &z, float &a) |
void | rotate (const float x, const float y, const float z, const float a) |
World Coordinate position and orientation | |
Methods to set and restore the frame position and orientation (with respect to the world coordinate system).
Use translation() and rotation() to get the local (defined with respect to the referenceFrame) frame characteristics. | |
void | setPosition (const float x, const float y, const float z) |
void | setPosition (const qglviewer::Vec &t) |
void | setOrientation (const qglviewer::Quaternion &q) |
void | setOrientation (const float x, const float y, const float z, const float a) |
void | setOrientationAxisAngle (const float x, const float y, const float z, const float a) |
void | setPositionAndOrientation (const qglviewer::Vec &t, const qglviewer::Quaternion &q) |
qglviewer::Vec | position () const |
void | getPosition (float &x, float &y, float &z) const |
qglviewer::Quaternion | orientation () const |
void | getOrientation (float &x, float &y, float &z, float &a) const |
Coordinate system transformation of 3D points | |
A frame is as a new coordinate system, defined with respect to a reference frame (the world coordinate system by default, see the "Composition of frame" section).
The coordinatesOf() (resp. inverseCoordinatesOf()) functions transform a 3D point from (resp. to) the world coordinates system. This section defines the 3D point transformation functions. See the Coordinate system transformation of vectors below for the transformation of 3D vectors. The difference between the two sets of functions is simple : for vectors, only the rotational part of the transformations is taken into account, while translation is also considered for 3D points. When local is prepended to the names of the functions, the functions simply transform from (and to) the reference frame. When In (resp. From) is appended to the names, the functions transform from (and to) the frame that is given as an argument. The frame does not need to be in the same branch or the hierarchical tree, and can be NULL (the world coordinates system).
Combining any of these functions with its inverse (in any order) leads to the identity. | |
qglviewer::Vec | coordinatesOf (const qglviewer::Vec &src) const |
qglviewer::Vec | inverseCoordinatesOf (const qglviewer::Vec &src) const |
qglviewer::Vec | localCoordinatesOf (const qglviewer::Vec &src) const |
qglviewer::Vec | localInverseCoordinatesOf (const qglviewer::Vec &src) const |
qglviewer::Vec | coordinatesOfIn (const qglviewer::Vec &src, const Frame *in) const |
qglviewer::Vec | coordinatesOfFrom (const qglviewer::Vec &src, const Frame *from) const |
void | getCoordinatesOf (const float src[3], float res[3]) const |
void | getInverseCoordinatesOf (const float src[3], float res[3]) const |
void | getLocalCoordinatesOf (const float src[3], float res[3]) const |
void | getLocalInverseCoordinatesOf (const float src[3], float res[3]) const |
void | getCoordinatesOfIn (const float src[3], float res[3], const Frame *in) const |
void | getCoordinatesOfFrom (const float src[3], float res[3], const Frame *from) const |
Coordinate system transformation of vectors | |
A frame is as a new coordinate system, defined with respect to a reference frame (the world coordinate system by default, see the "Composition of frame" section).
The transformOf() (resp. inverseTransformOf()) functions transform a 3D vector from (resp. to) the world coordinates system. This section defines the 3D vector transformation functions. See the Coordinate system transformation of 3D points above for the transformation of 3D points. The difference between the two sets of functions is simple : for vectors, only the rotational part of the transformations is taken into account, while translation is also considered for 3D points. The length of the resulting transformed vector is identical to the one of the source vector for all the described functions. When local is prepended to the names of the functions, the functions simply transform from (and to) the reference frame. When In (resp. From) is appended to the names, the functions transform from (and to) the frame that is given as an argument. The frame does not need to be in the same branch or the hierarchical tree, and can be NULL (the world coordinates system).
Combining any of these functions with its inverse (in any order) leads to the identity. | |
qglviewer::Vec | transformOf (const qglviewer::Vec &src) const |
qglviewer::Vec | inverseTransformOf (const qglviewer::Vec &src) const |
qglviewer::Vec | localTransformOf (const qglviewer::Vec &src) const |
qglviewer::Vec | localInverseTransformOf (const qglviewer::Vec &src) const |
qglviewer::Vec | transformOfIn (const qglviewer::Vec &src, const Frame *in) const |
qglviewer::Vec | transformOfFrom (const qglviewer::Vec &src, const Frame *from) const |
void | getTransformOf (const float src[3], float res[3]) const |
void | getInverseTransformOf (const float src[3], float res[3]) const |
void | getLocalTransformOf (const float src[3], float res[3]) const |
void | getLocalInverseTransformOf (const float src[3], float res[3]) const |
void | getTransformOfIn (const float src[3], float res[3], const Frame *in) const |
void | getTransformOfFrom (const float src[3], float res[3], const Frame *from) const |
qglviewer::Vec | orientationOf (const qglviewer::Vec &src) const |
qglviewer::Vec | inverseOrientationOf (const qglviewer::Vec &src) const |
Constraints on the displacement | |
A constraint can be attached to the frame to limit its displacement. The translate() and rotate() function will satisfy this constraint. Default value is a non-constraint constraint. See the Constraint() and derived class documentation. | |
Constraint * | constraint () const |
void | setConstraint (Constraint *c) |
The position and orientation can be set and restored. Constraints can be attached to the frame in order to limit its displacements. A frame can be rotated and translated, with displacement constraints satisfied.
|
Creates a default frame. Positionned in (0,0,0), with an identity rotation (0,0,0,1). The reference frame is set to NULL (meaning world coordinate system). |
|
Creates an initialized frame, with a position and an orientation. The reference frame is set to NULL (meaning world coordinate system). |
|
Virtual destructor. Empty. |
|
Returns the current constraint. It is of type Constraint, or one of its derived classes. Consider using dynamic_cast. |
|
This returns the frame coordinates of a point
If inverseCoordinatesOf() performs the inverse transformation. |
|
This returns the frame coordinate system coordinates of the point whose position in the
If coordinatesOfIn() performs the inverse transformation. |
|
This returns the
If coordinatesOfFrom() performs the inverse transformation. |
|
Creates an XML QDomElement that represents the Frame. QDomDocument doc("myDocument"); // ... AnyNode.addElement(sunFrame.domElement("sunFrame", doc)); // ... See also Camera::domElement(), KeyFrameInterpolator::domElement()...
Reimplemented in qglviewer::ManipulatedFrame. |
|
Same as coordinatesOf(), but with float parameters. |
|
Same as coordinatesOfFrom(), but with float parameters. |
|
Same as coordinatesOfIn(), but with float parameters. |
|
Same as inverseCoordinatesOf(), but with float parameters. |
|
Same as inverseTransformOf(), but with float parameters. |
|
Same as localCoordinatesOf(), but with float parameters. |
|
Same as localInverseCoordinatesOf(), but with float parameters. |
|
Same as localInverseTransformOf(), but with float parameters. |
|
Same as localTransformOf(), but with float parameters. |
|
float[4][4] parameter version of matrix(). See also getWorldMatrix() and worldMatrix(). This function is very similar to Quaternion::getMatrix(), it simply includes the Frame translation in the last line. |
|
Get the current orientation of the frame (same as orientation()). Parameters are the orientation quaternion values. See also setOrientation() and setOrientationAxisAngle(). |
|
Get the current position of the frame (same as position()). See also setPosition(). |
|
Get the current rotation of the frame (same as rotation()). Parameters are the rotation quaternion values. See also setRotation() and setRotationAxisAngle(). |
|
Same as transformOf(), but with float parameters. |
|
Same as transformOfFrom(), but with float parameters. |
|
Same as transformOfIn(), but with float parameters. |
|
Get the current local translation of the frame (same as translation()). See also setTranslation(). |
|
float[4][4] parameter version of worldMatrix(). See also getMatrix() and matrix(). |
|
Restore the Frame state from a QDomElement created by domElement(). See Vec::initFromDOMElement() and Quaternion::initFromDOMElement() for details.
Reimplemented in qglviewer::ManipulatedFrame. |
|
This returns the world coordinates of the point whose position in the frame coordinate system is
If coordinatesOf() performs the inverse transformation. |
|
|
|
This returns the world transform of the vector whose coordinates in the frame coordinate system is For vectors, only the rotationnal part of the transformation is taken into account, see inverseCoordinatesOf() for the point equivalent function. transformOf() performs the inverse transformation. |
|
Returns the frame coordinates of a point
If localInverseCoordinatesOf() performs the inverse transformation. |
|
Returns the reference frame coordinates (default is the world coordinates system, see referenceFrame()) of a point
If localCoordinatesOf() performs the inverse transformation. |
|
Returns the reference frame transform (default is the world coordinates system, see referenceFrame()) of a vector For vectors, only the rotationnal part of the transformation is taken into account, see localCoordinatesOf() for the point equivalent function. localTransformOf() performs the inverse transformation. |
|
Returns the frame transform of a vector For vectors, only the rotationnal part of the transformation is taken into account, see localCoordinatesOf() for the point equivalent function. localInverseTransformOf() performs the inverse transformation. |
|
Returns the current 4x4 frame matrix. Can be used with worldMatrix() and matrix() will return identical results when the frame is not composed (referenceFrame() == NULL). See also getMatrix().
|
|
This signal is emitted whenever the position or the orientation of the Frame is changed. Connect this signal to any object that must be notified. QObject::connect(myFrame, SIGNAL(modified()), myObject, SLOT(update())); This signal can also be connected to all the viewers using QGLViewer::connectSignalToAllViewers().
|
|
operator= : referenceFrame() and constraint() pointers are copied. |
|
Returns the current frame orientation (defined with respect to the world coordinate system). See setOrientation(). |
|
|
|
Returns the current frame origin position (defined in the world coordinate system). See setPosition(). |
|
Returns the current reference frame, defined with setReferenceFrame().
The frame is "child" of the referenceFrame(), meaning that its position and orientation are defined with respect to the referenceFrame(). A Convenient functions allow you to convert 3D coordinates from one frame to an other : coordinatesOf(), localCoordinatesOf(), coordinatesOfIn() and their inverse functions. Vectors can also be converted from one frame to an other using transformOf(), transformOfIn, localTransformOf() and the inverse functions.
A warning is printed if setting |
|
Same as rotate(), but with float parameters (quaternion values). Actual rotation may differ from these values in order to satisfy the rotation constraint(). Use the non-const parameter version of this function to get the filtered values back. |
|
Same as rotate(), but with float parameters (quaternion values). Parameters may be modified to satisfy rotation constraint(). See also the const parameter version of this function. |
|
Same as rotate(), but parameter is given as a float[4]. Quaternion |
|
Compose current frame rotation with |
|
Compose current frame rotation with |
|
Returns the current quaternion orientation. See setRotation(). |
|
Set the constraint attached with the frame. A |
|
Set the frame state from a matrix representation. Matrix has to be a proper row-major order transformation representation (rotation is in the upper left 3x3 matrix, while translation is on the last line). matrix() returns the current matrix value |
|
Same as setOrientation(), but with float parameters. |
|
Set the current orientation of the frame (with respect to the world coordinate system). See orientation(). |
|
Set the current orientation of the frame. Parameters are the rotation axis vector and its angle (in radians). |
|
Set the position of the origin of the frame, with respect to the world coordinate system. Use setTranslation() to defined to local frame translation (with respect to the reference frame). See also position() and orientation(). |
|
Same as setPosition(), but with |
|
Same as successive calls to setPosition() and then setOrientation(). Only one modified() signal is emitted, which is convenient if this signal is connected to a viewer updateGL() slot. See also setTranslationAndRotation(). |
|
Set the current reference frame. The frame then becomes a "child" of the referenceFrame(), meaning that its position and orientation are defined with respect to the referenceFrame(). |
|
Set the current rotation quaternion. See rotation() and the different Quaternion() constructors. Emits the modified() signal. |
|
Set the current rotation of the frame. Parameters are the rotation quaternion float values. Get current rotation with rotation(). |
|
Set the current rotation of the frame. Parameters are the rotation axis vector and its angle (in radians). |
|
Returns |
|
Set the current translation of the frame. position() returns the current frame position. Emits the modified() signal. |
|
Set the current translation of the frame. Same as setTranslation(), but with |
|
Same as successive calls to setPosition() and then setOrientation(). Only one modified() signal is emitted, which is convenient if this signal is connected to a viewer updateGL() slot. See also setPositionAndOrientation(). |
|
This returns the frame transform of a vector For vectors, only the rotationnal part of the transformation is taken into account, see coordinatesOf() for the point equivalent function. inverseTransformOf() performs the inverse transformation. |
|
This returns the frame coordinate system transform of the vector whose coordinates in the For vectors, only the rotationnal part of the transformation is taken into account, see coordinatesOfFrom() for the point equivalent function. transformOfIn() performs the inverse transformation. |
|
This returns the For vectors, only the rotationnal part of the transformation is taken into account, see coordinatesOfIn() for the point equivalent function. transformOfFrom() performs the inverse transformation. |
|
Same as translate() but with const float parameter. The actual translation may differ from the given parameters in order to satisfy the constraint(). Use the non-const version to get the filtered values back. |
|
Same as translate() but with float parameters. Parameters are modified to satisfy translation constraints (see constraint()). See also the non-const parameters version of this version, if you are not interested in the filtered values. |
|
Same as translate() but with a float[3] parameter. |
|
Translate the frame of |
|
Translate the frame of |
|
Returns the current frame position. See setTranslation(). |
|
Returns the 4x4 frame matrix, defined in the world coordinate system. Can be used with worldMatrix() and matrix() will return identical results when the frame is not composed (referenceFrame() == NULL). See also getWorldMatrix().
|