23 #ifndef QGLVIEWER_FRAME_H 24 #define QGLVIEWER_FRAME_H 174 void setPosition(
const Vec& position);
175 void setPosition(qreal x, qreal y, qreal z);
176 void setPositionWithConstraint(
Vec& position);
178 void setOrientation(
const Quaternion& orientation);
179 void setOrientation(qreal q0, qreal q1, qreal q2, qreal q3);
180 void setOrientationWithConstraint(
Quaternion& orientation);
182 void setPositionAndOrientation(
const Vec& position,
const Quaternion& orientation);
183 void setPositionAndOrientationWithConstraint(
Vec& position,
Quaternion& orientation);
185 Vec position()
const;
188 void getPosition(qreal& x, qreal& y, qreal& z)
const;
189 void getOrientation(qreal& q0, qreal& q1, qreal& q2, qreal& q3)
const;
202 void setTranslation(qreal x, qreal y, qreal z);
203 void setTranslationWithConstraint(
Vec& translation);
216 void setRotation(qreal q0, qreal q1, qreal q2, qreal q3);
217 void setRotationWithConstraint(
Quaternion& rotation);
219 void setTranslationAndRotation(
const Vec& translation,
const Quaternion& rotation);
220 void setTranslationAndRotationWithConstraint(
Vec& translation,
Quaternion& rotation);
239 void getTranslation(qreal& x, qreal& y, qreal& z)
const;
240 void getRotation(qreal& q0, qreal& q1, qreal& q2, qreal& q3)
const;
263 void setReferenceFrame(
const Frame*
const refFrame);
264 bool settingAsReferenceFrameWillCreateALoop(
const Frame*
const frame);
270 void translate(
Vec& t);
271 void translate(
const Vec& t);
274 void translate(qreal x, qreal y, qreal z);
275 void translate(qreal& x, qreal& y, qreal& z);
281 void rotate(qreal q0, qreal q1, qreal q2, qreal q3);
282 void rotate(qreal& q0, qreal& q1, qreal& q2, qreal& q3);
284 void rotateAroundPoint(
Quaternion& rotation,
const Vec& point);
285 void rotateAroundPoint(
const Quaternion& rotation,
const Vec& point);
287 void alignWithFrame(
const Frame*
const frame,
bool move=
false, qreal threshold=0.0);
288 void projectOnLine(
const Vec& origin,
const Vec& direction);
294 Vec coordinatesOf(
const Vec& src)
const;
295 Vec inverseCoordinatesOf(
const Vec& src)
const;
296 Vec localCoordinatesOf(
const Vec& src)
const;
297 Vec localInverseCoordinatesOf(
const Vec& src)
const;
298 Vec coordinatesOfIn(
const Vec& src,
const Frame*
const in)
const;
299 Vec coordinatesOfFrom(
const Vec& src,
const Frame*
const from)
const;
301 void getCoordinatesOf(
const qreal src[3], qreal res[3])
const;
302 void getInverseCoordinatesOf(
const qreal src[3], qreal res[3])
const;
303 void getLocalCoordinatesOf(
const qreal src[3], qreal res[3])
const;
304 void getLocalInverseCoordinatesOf(
const qreal src[3], qreal res[3])
const;
305 void getCoordinatesOfIn(
const qreal src[3], qreal res[3],
const Frame*
const in)
const;
306 void getCoordinatesOfFrom(
const qreal src[3], qreal res[3],
const Frame*
const from)
const;
332 Vec transformOf(
const Vec& src)
const;
333 Vec inverseTransformOf(
const Vec& src)
const;
334 Vec localTransformOf(
const Vec& src)
const;
335 Vec localInverseTransformOf(
const Vec& src)
const;
336 Vec transformOfIn(
const Vec& src,
const Frame*
const in)
const;
337 Vec transformOfFrom(
const Vec& src,
const Frame*
const from)
const;
339 void getTransformOf(
const qreal src[3], qreal res[3])
const;
340 void getInverseTransformOf(
const qreal src[3], qreal res[3])
const;
341 void getLocalTransformOf(
const qreal src[3], qreal res[3])
const;
342 void getLocalInverseTransformOf(
const qreal src[3], qreal res[3])
const;
343 void getTransformOfIn(
const qreal src[3], qreal res[3],
const Frame*
const in)
const;
344 void getTransformOfFrom(
const qreal src[3], qreal res[3],
const Frame*
const from)
const;
367 const GLdouble* matrix()
const;
368 void getMatrix(GLdouble m[4][4])
const;
369 void getMatrix(GLdouble m[16])
const;
371 const GLdouble* worldMatrix()
const;
372 void getWorldMatrix(GLdouble m[4][4])
const;
373 void getWorldMatrix(GLdouble m[16])
const;
375 void setFromMatrix(
const GLdouble m[4][4]);
376 void setFromMatrix(
const GLdouble m[16]);
381 Frame inverse()
const;
396 virtual QDomElement domElement(
const QString& name, QDomDocument& document)
const;
398 virtual void initFromDOMElement(
const QDomElement& element);
415 #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.