27 #if QT_VERSION >= 0x040000 28 # include <QMouseEvent> 40 : driveSpeed_(0.0), flyUpVector_(0.0, 1.0, 0.0)
83 static Vec flyDisp(0.0, 0.0, 0.0);
135 QDomElement mcp = document.createElement(
"ManipulatedCameraParameters");
136 mcp.setAttribute(
"flySpeed", QString::number(
flySpeed()));
153 QDomElement child=element.firstChild().toElement();
154 while (!child.isNull())
156 if (child.tagName() ==
"ManipulatedCameraParameters")
160 QDomElement schild=child.firstChild().toElement();
161 while (!schild.isNull())
163 if (schild.tagName() ==
"flyUpVector")
166 schild = schild.nextSibling().toElement();
169 child = child.nextSibling().toElement();
189 #if QT_VERSION >= 0x040000 211 const QPoint delta =
prevPos_ -
event->pos();
212 Vec trans(static_cast<float>(delta.x()), static_cast<float>(-delta.y()), 0.0);
214 switch (camera->
type())
292 const float angle = atan2(event->y() - trans[1],
event->
x() - trans[0]) - atan2(
prevPos_.y()-trans[1],
prevPos_.x()-trans[0]);
322 switch (camera->
type())
384 const float wheelSensitivityCoef = 8E-4f;
410 const int finalDrawAfterWheelEventDelay = 400;
413 #if QT_VERSION >= 0x040000 415 flyTimer_.start(finalDrawAfterWheelEventDelay);
417 flyTimer_.start(finalDrawAfterWheelEventDelay,
true);
void setValue(double X, double Y, double Z)
Vec revolveAroundPoint() const
virtual void initFromDOMElement(const QDomElement &element)
The ManipulatedCameraFrame class represents a ManipulatedFrame with Camera specific mouse bindings...
Vec inverseTransformOf(const Vec &src) const
A ManipulatedFrame is a Frame that can be rotated and translated using the mouse. ...
virtual void mouseMoveEvent(QMouseEvent *const event, Camera *const camera)
Quaternion pitchYawQuaternion(int x, int y, const Camera *const camera)
Constraint * previousConstraint_
virtual void mouseReleaseEvent(QMouseEvent *const event, Camera *const camera)
Vec projectedCoordinatesOf(const Vec &src, const Frame *frame=NULL) const
float translationSensitivity() const
Vec transformOf(const Vec &src) const
ManipulatedCameraFrame & operator=(const ManipulatedCameraFrame &mcf)
void setConstraint(Constraint *const constraint)
void setFlyUpVector(const Vec &up)
float wheelSensitivity() const
ManipulatedCameraFrame * frame() const
void fitScreenRegion(const QRect &rectangle)
void rotate(Quaternion &q)
The Vec class represents 3D positions and 3D vectors.
float sceneRadius() const
virtual void getOrthoWidthHeight(GLdouble &halfWidth, GLdouble &halfHeight) const
Quaternion turnQuaternion(int x, const Camera *const camera)
float rotationSensitivity() const
Vec revolveAroundPoint() const
virtual QDomElement domElement(const QString &name, QDomDocument &document) const
virtual void wheelEvent(QWheelEvent *const event, Camera *const camera)
void setSpinningQuaternion(const Quaternion &spinningQuaternion)
Vec coordinatesOf(const Vec &src) const
void computeMouseSpeed(const QMouseEvent *const e)
A perspective or orthographic camera.
virtual void initFromDOMElement(const QDomElement &element)
ManipulatedFrame & operator=(const ManipulatedFrame &mf)
The Quaternion class represents 3D rotations and orientations.
virtual void startAction(int ma, bool withConstraint=true)
virtual void mouseReleaseEvent(QMouseEvent *const event, Camera *const camera)
float fieldOfView() const
int mouseOriginalDirection(const QMouseEvent *const e)
Quaternion deformedBallQuaternion(int x, int y, float cx, float cy, const Camera *const camera)
Quaternion spinningQuaternion() const
void removeFromMouseGrabberPool()
Vec localInverseTransformOf(const Vec &src) const
void setFlySpeed(float speed)
virtual QDomElement domElement(const QString &name, QDomDocument &document) const
static float floatFromDom(const QDomElement &e, const QString &attribute, float defValue)
virtual void startAction(int ma, bool withConstraint=true)
void rotateAroundPoint(Quaternion &rotation, const Vec &point)