23 #ifndef QGLVIEWER_CONSTRAINT_H
24 #define QGLVIEWER_CONSTRAINT_H
121 virtual ~Constraint() {}
133 virtual void constrainTranslation(Vec& translation, Frame*
const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
142 virtual void constrainRotation(Quaternion& rotation, Frame*
const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
171 AxisPlaneConstraint();
173 virtual ~AxisPlaneConstraint() {}
207 enum Type {
FREE, AXIS, PLANE, FORBIDDEN };
212 virtual void constrainTranslation(Vec& translation, Frame*
const frame) { Q_UNUSED(translation); Q_UNUSED(frame); }
214 void setTranslationConstraint(Type type,
const Vec& direction);
216 void setTranslationConstraintType(Type type) { translationConstraintType_ = type; }
217 void setTranslationConstraintDirection(
const Vec& direction);
228 Type translationConstraintType()
const {
return translationConstraintType_; }
238 Vec translationConstraintDirection()
const {
return translationConstraintDir_; }
244 virtual void constrainRotation(Quaternion& rotation, Frame*
const frame) { Q_UNUSED(rotation); Q_UNUSED(frame); }
246 void setRotationConstraint(Type type,
const Vec& direction);
247 void setRotationConstraintType(Type type);
248 void setRotationConstraintDirection(
const Vec& direction);
251 Type rotationConstraintType()
const {
return rotationConstraintType_; }
259 Vec rotationConstraintDirection()
const {
return rotationConstraintDir_; }
264 Type translationConstraintType_;
265 Type rotationConstraintType_;
267 Vec translationConstraintDir_;
268 Vec rotationConstraintDir_;
285 virtual void constrainTranslation(
Vec& translation,
Frame*
const frame);
286 virtual void constrainRotation (
Quaternion& rotation,
Frame*
const frame);
305 virtual void constrainTranslation(
Vec& translation,
Frame*
const frame);
306 virtual void constrainRotation (
Quaternion& rotation,
Frame*
const frame);
326 virtual void constrainTranslation(
Vec& translation,
Frame*
const frame);
327 virtual void constrainRotation (
Quaternion& rotation,
Frame*
const frame);
330 const Camera* camera()
const {
return camera_; }
333 const Camera*
const camera_;
338 #endif // QGLVIEWER_CONSTRAINT_H