23 #ifndef QGLVIEWER_FRAME_H 24 #define QGLVIEWER_FRAME_H 26 #if QT_VERSION >= 0x040000 179 void setPosition(
const Vec& position);
180 void setPosition(
float x,
float y,
float z);
181 void setPositionWithConstraint(
Vec& position);
183 void setOrientation(
const Quaternion& orientation);
184 void setOrientation(
double q0,
double q1,
double q2,
double q3);
185 void setOrientationWithConstraint(
Quaternion& orientation);
187 void setPositionAndOrientation(
const Vec& position,
const Quaternion& orientation);
188 void setPositionAndOrientationWithConstraint(
Vec& position,
Quaternion& orientation);
195 void getPosition(
float& x,
float& y,
float& z)
const;
196 void getOrientation(
double& q0,
double& q1,
double& q2,
double& q3)
const;
209 void setTranslation(
float x,
float y,
float z);
210 void setTranslationWithConstraint(
Vec& translation);
223 void setRotation(
double q0,
double q1,
double q2,
double q3);
224 void setRotationWithConstraint(
Quaternion& rotation);
226 void setTranslationAndRotation(
const Vec& translation,
const Quaternion& rotation);
227 void setTranslationAndRotationWithConstraint(
Vec& translation,
Quaternion& rotation);
246 void getTranslation(
float& x,
float& y,
float& z)
const;
247 void getRotation(
double& q0,
double& q1,
double& q2,
double& q3)
const;
270 void setReferenceFrame(
const Frame*
const refFrame);
271 bool settingAsReferenceFrameWillCreateALoop(
const Frame*
const frame);
277 void translate(
Vec& t);
278 void translate(
const Vec& t);
281 void translate(
float x,
float y,
float z);
282 void translate(
float& x,
float& y,
float& z);
288 void rotate(
double q0,
double q1,
double q2,
double q3);
289 void rotate(
double& q0,
double& q1,
double& q2,
double& q3);
291 void rotateAroundPoint(
Quaternion& rotation,
const Vec& point);
292 void rotateAroundPoint(
const Quaternion& rotation,
const Vec& point);
294 void alignWithFrame(
const Frame*
const frame,
bool move=
false,
float threshold=0.85f);
295 void projectOnLine(
const Vec& origin,
const Vec& direction);
301 Vec coordinatesOf(
const Vec& src)
const;
302 Vec inverseCoordinatesOf(
const Vec& src)
const;
303 Vec localCoordinatesOf(
const Vec& src)
const;
304 Vec localInverseCoordinatesOf(
const Vec& src)
const;
305 Vec coordinatesOfIn(
const Vec& src,
const Frame*
const in)
const;
306 Vec coordinatesOfFrom(
const Vec& src,
const Frame*
const from)
const;
308 void getCoordinatesOf(
const float src[3],
float res[3])
const;
309 void getInverseCoordinatesOf(
const float src[3],
float res[3])
const;
310 void getLocalCoordinatesOf(
const float src[3],
float res[3])
const;
311 void getLocalInverseCoordinatesOf(
const float src[3],
float res[3])
const;
312 void getCoordinatesOfIn(
const float src[3],
float res[3],
const Frame*
const in)
const;
313 void getCoordinatesOfFrom(
const float src[3],
float res[3],
const Frame*
const from)
const;
339 Vec transformOf(
const Vec& src)
const;
340 Vec inverseTransformOf(
const Vec& src)
const;
341 Vec localTransformOf(
const Vec& src)
const;
342 Vec localInverseTransformOf(
const Vec& src)
const;
343 Vec transformOfIn(
const Vec& src,
const Frame*
const in)
const;
344 Vec transformOfFrom(
const Vec& src,
const Frame*
const from)
const;
346 void getTransformOf(
const float src[3],
float res[3])
const;
347 void getInverseTransformOf(
const float src[3],
float res[3])
const;
348 void getLocalTransformOf(
const float src[3],
float res[3])
const;
349 void getLocalInverseTransformOf(
const float src[3],
float res[3])
const;
350 void getTransformOfIn(
const float src[3],
float res[3],
const Frame*
const in)
const;
351 void getTransformOfFrom(
const float src[3],
float res[3],
const Frame*
const from)
const;
374 const GLdouble* matrix()
const;
375 void getMatrix(GLdouble m[4][4])
const;
376 void getMatrix(GLdouble m[16])
const;
378 const GLdouble* worldMatrix()
const;
379 void getWorldMatrix(GLdouble m[4][4])
const;
380 void getWorldMatrix(GLdouble m[16])
const;
382 void setFromMatrix(
const GLdouble m[4][4]);
383 void setFromMatrix(
const GLdouble m[16]);
388 Frame inverse()
const;
403 virtual QDomElement domElement(
const QString& name, QDomDocument& document)
const;
405 virtual void initFromDOMElement(
const QDomElement& element);
422 #endif // QGLVIEWER_FRAME_H
void setConstraint(Constraint *const constraint)
Frame worldInverse() const
void setRotation(const Quaternion &rotation)
The Vec class represents 3D positions and 3D vectors.
void setTranslation(const Vec &translation)
Quaternion rotation() const
The Quaternion class represents 3D rotations and orientations.
Constraint * constraint() const
const Frame * referenceFrame_
The Frame class represents a coordinate system, defined by a position and an orientation.
const Frame * referenceFrame() const
An interface class for Frame constraints.