The ManipulatedCameraFrame class represents a ManipulatedFrame with Camera specific mouse bindings. More...
Public Member Functions | |
ManipulatedCameraFrame () | |
Default constructor. More... | |
ManipulatedCameraFrame (const ManipulatedCameraFrame &mcf) | |
Copy constructor. More... | |
virtual | ~ManipulatedCameraFrame () |
Virtual destructor. More... | |
ManipulatedCameraFrame & | operator= (const ManipulatedCameraFrame &mcf) |
Equal operator. More... | |
Public Member Functions inherited from ManipulatedFrame | |
ManipulatedFrame () | |
Default constructor. More... | |
ManipulatedFrame (const ManipulatedFrame &mf) | |
Copy constructor. More... | |
virtual | ~ManipulatedFrame () |
Virtual destructor. More... | |
ManipulatedFrame & | operator= (const ManipulatedFrame &mf) |
Equal operator. More... | |
float | rotationSensitivity () const |
Returns the influence of a mouse displacement on the ManipulatedFrame rotation. More... | |
float | translationSensitivity () const |
Returns the influence of a mouse displacement on the ManipulatedFrame translation. More... | |
float | spinningSensitivity () const |
Returns the minimum mouse speed required (at button release) to make the ManipulatedFrame spin(). More... | |
float | zoomSensitivity () const |
Returns the zoom sensitivity. More... | |
float | wheelSensitivity () const |
Returns the mouse wheel sensitivity. More... | |
bool | isSpinning () const |
Returns true when the ManipulatedFrame is spinning. More... | |
Quaternion | spinningQuaternion () const |
Returns the incremental rotation that is applied by spin() to the ManipulatedFrame orientation when it isSpinning(). More... | |
bool | isManipulated () const |
Returns true when the ManipulatedFrame is being manipulated with the mouse. More... | |
QGLViewer::MouseAction | currentMouseAction () const |
Returns the MouseAction currently applied to this ManipulatedFrame. More... | |
virtual void | checkIfGrabsMouse (int x, int y, const Camera *const camera) |
Implementation of the MouseGrabber main method. More... | |
Public Member Functions inherited from Frame | |
Frame () | |
Creates a default Frame. More... | |
Frame (const Frame &frame) | |
Copy constructor. More... | |
virtual | ~Frame () |
Virtual destructor. More... | |
Frame & | operator= (const Frame &frame) |
Equal operator. More... | |
Frame (const Vec &position, const Quaternion &orientation) | |
Creates a Frame with a position() and an orientation(). More... | |
void | setPosition (const Vec &position) |
Sets the position() of the Frame, defined in the world coordinate system. More... | |
void | setPosition (float x, float y, float z) |
Same as setPosition(), but with float parameters. More... | |
void | setPositionWithConstraint (Vec &position) |
Same as setPosition(), but position is modified so that the potential constraint() of the Frame is satisfied. More... | |
void | setOrientation (const Quaternion &orientation) |
Sets the orientation() of the Frame, defined in the world coordinate system. More... | |
void | setOrientation (double q0, double q1, double q2, double q3) |
Same as setOrientation(), but with float parameters. More... | |
void | setOrientationWithConstraint (Quaternion &orientation) |
Same as setOrientation(), but orientation is modified so that the potential constraint() of the Frame is satisfied. More... | |
void | setPositionAndOrientation (const Vec &position, const Quaternion &orientation) |
Same as successive calls to setPosition() and then setOrientation(). More... | |
void | setPositionAndOrientationWithConstraint (Vec &position, Quaternion &orientation) |
Same as setPositionAndOrientation() but position and orientation are modified to satisfy the constraint. More... | |
Vec | position () const |
Returns the position of the Frame, defined in the world coordinate system. More... | |
Quaternion | orientation () const |
Returns the orientation of the Frame, defined in the world coordinate system. More... | |
void | getPosition (float &x, float &y, float &z) const |
x , y and z are set to the position() of the Frame. More... | |
void | getOrientation (double &q0, double &q1, double &q2, double &q3) const |
Get the current orientation of the frame (same as orientation()). More... | |
void | setTranslation (const Vec &translation) |
Sets the translation() of the frame, locally defined with respect to the referenceFrame(). More... | |
void | setTranslation (float x, float y, float z) |
Same as setTranslation(), but with float parameters. More... | |
void | setTranslationWithConstraint (Vec &translation) |
Same as setTranslation(), but translation is modified so that the potential constraint() of the Frame is satisfied. More... | |
void | setRotation (const Quaternion &rotation) |
Set the current rotation Quaternion. More... | |
void | setRotation (double q0, double q1, double q2, double q3) |
Same as setRotation() but with float Quaternion parameters. More... | |
void | setRotationWithConstraint (Quaternion &rotation) |
Same as setRotation(), but rotation is modified so that the potential constraint() of the Frame is satisfied. More... | |
void | setTranslationAndRotation (const Vec &translation, const Quaternion &rotation) |
Same as successive calls to setTranslation() and then setRotation(). More... | |
void | setTranslationAndRotationWithConstraint (Vec &translation, Quaternion &rotation) |
Same as setTranslationAndRotation(), but translation and orientation are modified to satisfy the constraint(). More... | |
Vec | translation () const |
Returns the Frame translation, defined with respect to the referenceFrame(). More... | |
Quaternion | rotation () const |
Returns the Frame rotation, defined with respect to the referenceFrame(). More... | |
void | getTranslation (float &x, float &y, float &z) const |
Fill x , y and z with the translation() of the Frame. More... | |
void | getRotation (double &q0, double &q1, double &q2, double &q3) const |
The q are set to the rotation() of the Frame. More... | |
const Frame * | referenceFrame () const |
Returns the reference Frame, in which coordinates system the Frame is defined. More... | |
void | setReferenceFrame (const Frame *const refFrame) |
Sets the referenceFrame() of the Frame. More... | |
bool | settingAsReferenceFrameWillCreateALoop (const Frame *const frame) |
Returns true if setting frame as the Frame's referenceFrame() would create a loop in the Frame hierarchy. More... | |
void | translate (Vec &t) |
Same as translate(const Vec&) but t may be modified to satisfy the translation constraint(). More... | |
void | translate (const Vec &t) |
Translates the Frame of t (defined in the Frame coordinate system). More... | |
void | translate (float x, float y, float z) |
Same as translate(const Vec&) but with float parameters. More... | |
void | translate (float &x, float &y, float &z) |
Same as translate(Vec&) but with float parameters. More... | |
void | rotate (Quaternion &q) |
Same as rotate(const Quaternion&) but q may be modified to satisfy the rotation constraint(). More... | |
void | rotate (const Quaternion &q) |
Rotates the Frame by q (defined in the Frame coordinate system): R = R*q. More... | |
void | rotate (double q0, double q1, double q2, double q3) |
Same as rotate(const Quaternion&) but with float Quaternion parameters. More... | |
void | rotate (double &q0, double &q1, double &q2, double &q3) |
Same as rotate(Quaternion&) but with float Quaternion parameters. More... | |
void | rotateAroundPoint (Quaternion &rotation, const Vec &point) |
Makes the Frame rotate() by rotation around point . More... | |
void | rotateAroundPoint (const Quaternion &rotation, const Vec &point) |
Same as rotateAroundPoint(), but with a const rotation Quaternion. More... | |
void | alignWithFrame (const Frame *const frame, bool move=false, float threshold=0.0f) |
Aligns the Frame with frame , so that two of their axis are parallel. More... | |
void | projectOnLine (const Vec &origin, const Vec &direction) |
Translates the Frame so that its position() lies on the line defined by origin and direction (defined in the world coordinate system). More... | |
Vec | coordinatesOf (const Vec &src) const |
Returns the Frame coordinates of a point src defined in the world coordinate system (converts from world to Frame). More... | |
Vec | inverseCoordinatesOf (const Vec &src) const |
Returns the world coordinates of the point whose position in the Frame coordinate system is src (converts from Frame to world). More... | |
Vec | localCoordinatesOf (const Vec &src) const |
Returns the Frame coordinates of a point src defined in the referenceFrame() coordinate system (converts from referenceFrame() to Frame). More... | |
Vec | localInverseCoordinatesOf (const Vec &src) const |
Returns the referenceFrame() coordinates of a point src defined in the Frame coordinate system (converts from Frame to referenceFrame()). More... | |
Vec | coordinatesOfIn (const Vec &src, const Frame *const in) const |
Returns the in coordinates of the point whose position in the Frame coordinate system is src (converts from Frame to in ). More... | |
Vec | coordinatesOfFrom (const Vec &src, const Frame *const from) const |
Returns the Frame coordinates of the point whose position in the from coordinate system is src (converts from from to Frame). More... | |
void | getCoordinatesOf (const float src[3], float res[3]) const |
Same as coordinatesOf(), but with float parameters. More... | |
void | getInverseCoordinatesOf (const float src[3], float res[3]) const |
Same as inverseCoordinatesOf(), but with float parameters. More... | |
void | getLocalCoordinatesOf (const float src[3], float res[3]) const |
Same as localCoordinatesOf(), but with float parameters. More... | |
void | getLocalInverseCoordinatesOf (const float src[3], float res[3]) const |
Same as localInverseCoordinatesOf(), but with float parameters. More... | |
void | getCoordinatesOfIn (const float src[3], float res[3], const Frame *const in) const |
Same as coordinatesOfIn(), but with float parameters. More... | |
void | getCoordinatesOfFrom (const float src[3], float res[3], const Frame *const from) const |
Same as coordinatesOfFrom(), but with float parameters. More... | |
Vec | transformOf (const Vec &src) const |
Returns the Frame transform of a vector src defined in the world coordinate system (converts vectors from world to Frame). More... | |
Vec | inverseTransformOf (const Vec &src) const |
Returns the world transform of the vector whose coordinates in the Frame coordinate system is src (converts vectors from Frame to world). More... | |
Vec | localTransformOf (const Vec &src) const |
Returns the Frame transform of a vector src defined in the referenceFrame() coordinate system (converts vectors from referenceFrame() to Frame). More... | |
Vec | localInverseTransformOf (const Vec &src) const |
Returns the referenceFrame() transform of a vector src defined in the Frame coordinate system (converts vectors from Frame to referenceFrame()). More... | |
Vec | transformOfIn (const Vec &src, const Frame *const in) const |
Returns the in transform of the vector whose coordinates in the Frame coordinate system is src (converts vectors from Frame to in ). More... | |
Vec | transformOfFrom (const Vec &src, const Frame *const from) const |
Returns the Frame transform of the vector whose coordinates in the from coordinate system is src (converts vectors from from to Frame). More... | |
void | getTransformOf (const float src[3], float res[3]) const |
Same as transformOf(), but with float parameters. More... | |
void | getInverseTransformOf (const float src[3], float res[3]) const |
Same as inverseTransformOf(), but with float parameters. More... | |
void | getLocalTransformOf (const float src[3], float res[3]) const |
Same as localTransformOf(), but with float parameters. More... | |
void | getLocalInverseTransformOf (const float src[3], float res[3]) const |
Same as localInverseTransformOf(), but with float parameters. More... | |
void | getTransformOfIn (const float src[3], float res[3], const Frame *const in) const |
Same as transformOfIn(), but with float parameters. More... | |
void | getTransformOfFrom (const float src[3], float res[3], const Frame *const from) const |
Same as transformOfFrom(), but with float parameters. More... | |
Constraint * | constraint () const |
Returns the current constraint applied to the Frame. More... | |
void | setConstraint (Constraint *const constraint) |
Sets the constraint() attached to the Frame. More... | |
const GLdouble * | matrix () const |
Returns the 4x4 OpenGL transformation matrix represented by the Frame. More... | |
void | getMatrix (GLdouble m[4][4]) const |
GLdouble [4][4] version of matrix(). More... | |
void | getMatrix (GLdouble m[16]) const |
GLdouble [16] version of matrix(). More... | |
const GLdouble * | worldMatrix () const |
Returns the 4x4 OpenGL transformation matrix represented by the Frame. More... | |
void | getWorldMatrix (GLdouble m[4][4]) const |
float[4][4] parameter version of worldMatrix(). More... | |
void | getWorldMatrix (GLdouble m[16]) const |
float[16] parameter version of worldMatrix(). More... | |
void | setFromMatrix (const GLdouble m[4][4]) |
This is an overloaded method provided for convenience. More... | |
void | setFromMatrix (const GLdouble m[16]) |
Sets the Frame from an OpenGL matrix representation (rotation in the upper left 3x3 matrix and translation on the last line). More... | |
Frame | inverse () const |
Returns a Frame representing the inverse of the Frame space transformation. More... | |
Frame | worldInverse () const |
Returns the inverse() of the Frame world transformation. More... | |
Public Member Functions inherited from MouseGrabber | |
MouseGrabber () | |
Default constructor. More... | |
virtual | ~MouseGrabber () |
Virtual destructor. More... | |
bool | grabsMouse () const |
Returns true when the MouseGrabber grabs the QGLViewer's mouse events. More... | |
bool | isInMouseGrabberPool () const |
Returns true if the MouseGrabber is currently in the MouseGrabberPool() list. More... | |
void | addInMouseGrabberPool () |
Adds the MouseGrabber in the MouseGrabberPool(). More... | |
void | removeFromMouseGrabberPool () |
Removes the MouseGrabber from the MouseGrabberPool(). More... | |
void | clearMouseGrabberPool (bool autoDelete=false) |
Clears the MouseGrabberPool(). More... | |
Protected Member Functions | |
virtual void | startAction (int ma, bool withConstraint=true) |
Protected internal method used to handle mouse events. More... | |
Protected Member Functions inherited from ManipulatedFrame | |
void | computeMouseSpeed (const QMouseEvent *const e) |
Updates mouse speed, measured in pixels/milliseconds. More... | |
Quaternion | deformedBallQuaternion (int x, int y, float cx, float cy, const Camera *const camera) |
Returns a quaternion computed according to the mouse motion. More... | |
float | deltaWithPrevPos (QMouseEvent *const event, Camera *const camera) const |
Returns a screen scaled delta from event's position to prevPos_, along the X or Y direction, whichever has the largest magnitude. More... | |
int | mouseOriginalDirection (const QMouseEvent *const e) |
Return 1 if mouse motion was started horizontally and -1 if it was more vertical. More... | |
float | wheelDelta (const QWheelEvent *event) const |
Returns a normalized wheel delta, proportionnal to wheelSensitivity(). More... | |
virtual void | mousePressEvent (QMouseEvent *const event, Camera *const camera) |
Initiates the ManipulatedFrame mouse manipulation. More... | |
virtual void | mouseDoubleClickEvent (QMouseEvent *const event, Camera *const camera) |
Overloading of MouseGrabber::mouseDoubleClickEvent(). More... | |
Protected Member Functions inherited from MouseGrabber | |
void | setGrabsMouse (bool grabs) |
Sets the grabsMouse() flag. More... | |
Friends | |
class | ::QGLViewer |
class | Camera |
Pivot point | |
Vec | pivotPoint () const |
Returns the point the ManipulatedCameraFrame pivot point, around which the camera rotates. More... | |
void | setPivotPoint (const Vec &point) |
Sets the pivotPoint(), defined in the world coordinate system. More... | |
Vec | revolveAroundPoint () const |
void | setRevolveArountPoint (const Vec &point) |
Camera manipulation | |
bool | rotatesAroundUpVector () const |
Returns true when the frame's rotation is constrained around the sceneUpVector(), and false otherwise, when the rotation is completely free (default). More... | |
void | setRotatesAroundUpVector (bool constrained) |
Sets the value of rotatesAroundUpVector(). More... | |
bool | zoomsOnPivotPoint () const |
Returns whether or not the QGLViewer::ZOOM action zooms on the pivot point. More... | |
void | setZoomsOnPivotPoint (bool enabled) |
Sets the value of zoomsOnPivotPoint(). More... | |
Fly parameters | |
float | flySpeed () const |
Returns the fly speed, expressed in OpenGL units. More... | |
Vec | sceneUpVector () const |
Returns the up vector of the scene, expressed in the world coordinate system. More... | |
Vec | flyUpVector () const |
void | setFlyUpVector (const Vec &up) |
void | setFlySpeed (float speed) |
Sets the flySpeed(), defined in OpenGL units. More... | |
void | setSceneUpVector (const Vec &up) |
Sets the sceneUpVector(), defined in the world coordinate system. More... | |
Mouse event handlers | |
virtual void | mouseReleaseEvent (QMouseEvent *const event, Camera *const camera) |
This is an overload of ManipulatedFrame::mouseReleaseEvent(). More... | |
virtual void | mouseMoveEvent (QMouseEvent *const event, Camera *const camera) |
Overloading of ManipulatedFrame::mouseMoveEvent(). More... | |
virtual void | wheelEvent (QWheelEvent *const event, Camera *const camera) |
This is an overload of ManipulatedFrame::wheelEvent(). More... | |
Spinning | |
virtual void | spin () |
Overloading of ManipulatedFrame::spin(). More... | |
XML representation | |
virtual QDomElement | domElement (const QString &name, QDomDocument &document) const |
Returns an XML QDomElement that represents the ManipulatedCameraFrame. More... | |
virtual void | initFromDOMElement (const QDomElement &element) |
Restores the ManipulatedCameraFrame state from a QDomElement created by domElement(). More... | |
Additional Inherited Members | |
Public Slots inherited from ManipulatedFrame | |
void | setRotationSensitivity (float sensitivity) |
Defines the rotationSensitivity(). More... | |
void | setTranslationSensitivity (float sensitivity) |
Defines the translationSensitivity(). More... | |
void | setSpinningSensitivity (float sensitivity) |
Defines the spinningSensitivity(), in pixels per milliseconds. More... | |
void | setWheelSensitivity (float sensitivity) |
Defines the wheelSensitivity(). More... | |
void | setZoomSensitivity (float sensitivity) |
Defines the zoomSensitivity(). More... | |
void | setSpinningQuaternion (const Quaternion &spinningQuaternion) |
Defines the spinningQuaternion(). More... | |
virtual void | startSpinning (int updateInterval) |
Starts the spinning of the ManipulatedFrame. More... | |
virtual void | stopSpinning () |
Stops the spinning motion started using startSpinning(). More... | |
virtual void | initFromDOMElement (const QDomElement &element) |
Restores the ManipulatedFrame state from a QDomElement created by domElement(). More... | |
Public Slots inherited from Frame | |
virtual void | initFromDOMElement (const QDomElement &element) |
Restores the Frame state from a QDomElement created by domElement(). More... | |
Signals inherited from ManipulatedFrame | |
void | manipulated () |
This signal is emitted when ever the ManipulatedFrame is manipulated (i.e. More... | |
void | spun () |
This signal is emitted when the ManipulatedFrame isSpinning(). More... | |
Signals inherited from Frame | |
void | interpolated () |
This signal is emitted when the Frame is interpolated by a KeyFrameInterpolator. More... | |
void | modified () |
This signal is emitted whenever the position() or the orientation() of the Frame is modified. More... | |
Static Public Member Functions inherited from MouseGrabber | |
static const QList< MouseGrabber * > & | MouseGrabberPool () |
Returns a list containing pointers to all the active MouseGrabbers. More... | |
Protected Slots inherited from ManipulatedFrame | |
virtual void | spin () |
Rotates the ManipulatedFrame by its spinningQuaternion(). More... | |
Protected Attributes inherited from ManipulatedFrame | |
QGLViewer::MouseAction | action_ |
QPoint | pressPos_ |
Constraint * | previousConstraint_ |
QPoint | prevPos_ |
Detailed Description
The ManipulatedCameraFrame class represents a ManipulatedFrame with Camera specific mouse bindings.
A ManipulatedCameraFrame is a specialization of a ManipulatedFrame, designed to be set as the Camera::frame(). Mouse motions are basically interpreted in a negated way: when the mouse goes to the right, the ManipulatedFrame translation goes to the right, while the ManipulatedCameraFrame has to go to the left, so that the scene seems to move to the right.
A ManipulatedCameraFrame rotates around its pivotPoint(), which corresponds to the associated Camera::pivotPoint().
A ManipulatedCameraFrame can also "fly" in the scene. It basically moves forward, and turns according to the mouse motion. See flySpeed(), sceneUpVector() and the QGLViewer::MOVE_FORWARD and QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction.
See the mouse page for a description of the possible actions that can be performed using the mouse and their bindings.
Definition at line 47 of file manipulatedCameraFrame.h.
Constructor & Destructor Documentation
Default constructor.
flySpeed() is set to 0.0 and sceneUpVector() is (0,1,0). The pivotPoint() is set to (0,0,0).
- Attention
- Created object is removeFromMouseGrabberPool().
Definition at line 37 of file manipulatedCameraFrame.cpp.
References MouseGrabber::removeFromMouseGrabberPool(), and ManipulatedCameraFrame::setFlySpeed().
|
inlinevirtual |
ManipulatedCameraFrame | ( | const ManipulatedCameraFrame & | mcf | ) |
Copy constructor.
Performs a deep copy of all members using operator=().
Definition at line 59 of file manipulatedCameraFrame.cpp.
References MouseGrabber::removeFromMouseGrabberPool().
Member Function Documentation
|
virtual |
Returns an XML QDomElement
that represents the ManipulatedCameraFrame.
Adds to the ManipulatedFrame::domElement() the ManipulatedCameraFrame specific informations in a ManipulatedCameraParameters
child QDomElement.
name
is the name of the QDomElement tag. doc
is the QDomDocument
factory used to create QDomElement.
Use initFromDOMElement() to restore the ManipulatedCameraFrame state from the resulting QDomElement
.
See Vec::domElement() for a complete example. See also Quaternion::domElement(), Frame::domElement(), Camera::domElement()...
Reimplemented from ManipulatedFrame.
Definition at line 142 of file manipulatedCameraFrame.cpp.
References ManipulatedFrame::domElement(), ManipulatedCameraFrame::flySpeed(), ManipulatedCameraFrame::rotatesAroundUpVector(), ManipulatedCameraFrame::sceneUpVector(), and ManipulatedCameraFrame::zoomsOnPivotPoint().
|
inline |
Returns the fly speed, expressed in OpenGL units.
It corresponds to the incremental displacement that is periodically applied to the ManipulatedCameraFrame position when a QGLViewer::MOVE_FORWARD or QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction is proceeded.
- Attention
- When the ManipulatedCameraFrame is set as the Camera::frame(), this value is set according to the QGLViewer::sceneRadius() by QGLViewer::setSceneRadius().
Definition at line 156 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::domElement(), Camera::flySpeed(), ManipulatedCameraFrame::initFromDOMElement(), ManipulatedCameraFrame::operator=(), and ManipulatedCameraFrame::wheelEvent().
|
virtualslot |
Restores the ManipulatedCameraFrame state from a QDomElement
created by domElement().
First calls ManipulatedFrame::initFromDOMElement() and then initializes ManipulatedCameraFrame specific parameters.
Definition at line 158 of file manipulatedCameraFrame.cpp.
References ManipulatedCameraFrame::flySpeed(), ManipulatedFrame::initFromDOMElement(), ManipulatedCameraFrame::setFlySpeed(), ManipulatedCameraFrame::setRotatesAroundUpVector(), ManipulatedCameraFrame::setSceneUpVector(), and ManipulatedCameraFrame::setZoomsOnPivotPoint().
Referenced by Camera::initFromDOMElement().
|
protectedvirtual |
Overloading of ManipulatedFrame::mouseMoveEvent().
Motion depends on mouse binding (see mouse page for details). The resulting displacements are basically inverted from those of a ManipulatedFrame.
Reimplemented from ManipulatedFrame.
Definition at line 233 of file manipulatedCameraFrame.cpp.
References ManipulatedFrame::computeMouseSpeed(), Frame::coordinatesOf(), ManipulatedFrame::deformedBallQuaternion(), ManipulatedFrame::deltaWithPrevPos(), Camera::fieldOfView(), Camera::frame(), Camera::getOrthoWidthHeight(), Frame::inverseTransformOf(), ManipulatedFrame::manipulated(), ManipulatedFrame::mouseOriginalDirection(), ManipulatedCameraFrame::pivotPoint(), Camera::projectedCoordinatesOf(), Frame::rotate(), ManipulatedFrame::rotationSensitivity(), Camera::screenHeight(), Camera::screenWidth(), ManipulatedFrame::setSpinningQuaternion(), Vec::setValue(), ManipulatedCameraFrame::spin(), Frame::transformOf(), Frame::translate(), ManipulatedFrame::translationSensitivity(), and Camera::type().
Referenced by QGLViewer::mouseMoveEvent().
|
protectedvirtual |
This is an overload of ManipulatedFrame::mouseReleaseEvent().
The QGLViewer::MouseAction is terminated.
Reimplemented from ManipulatedFrame.
Definition at line 396 of file manipulatedCameraFrame.cpp.
References Camera::fitScreenRegion(), and ManipulatedFrame::mouseReleaseEvent().
Referenced by QGLViewer::mouseReleaseEvent().
ManipulatedCameraFrame & operator= | ( | const ManipulatedCameraFrame & | mcf | ) |
Equal operator.
Calls ManipulatedFrame::operator=() and then copy attributes.
Definition at line 46 of file manipulatedCameraFrame.cpp.
References ManipulatedCameraFrame::flySpeed(), ManipulatedFrame::operator=(), ManipulatedCameraFrame::sceneUpVector(), ManipulatedCameraFrame::setFlySpeed(), ManipulatedCameraFrame::setRotatesAroundUpVector(), ManipulatedCameraFrame::setSceneUpVector(), and ManipulatedCameraFrame::setZoomsOnPivotPoint().
|
inline |
Returns the point the ManipulatedCameraFrame pivot point, around which the camera rotates.
It is defined in the world coordinate system. Default value is (0,0,0).
When the ManipulatedCameraFrame is associated to a Camera, Camera::pivotPoint() also returns this value. This point can interactively be changed using the mouse (see Camera::setPivotPointFromPixel() and QGLViewer::RAP_FROM_PIXEL and QGLViewer::RAP_IS_CENTER in the mouse page).
Definition at line 75 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::mouseMoveEvent(), Camera::pivotPoint(), and ManipulatedCameraFrame::spin().
|
inline |
Returns true
when the frame's rotation is constrained around the sceneUpVector(), and false
otherwise, when the rotation is completely free (default).
In free mode, the associated camera can be arbitrarily rotated in the scene, along its three axis, thus possibly leading to any arbitrary orientation.
When you setRotatesAroundUpVector() to true
, the sceneUpVector() defines a 'vertical' direction around which the camera rotates. The camera can rotate left or right, around this axis. It can also be moved up or down to show the 'top' and 'bottom' views of the scene. As a result, the sceneUpVector() will always appear vertical in the scene, and the horizon is preserved and stays projected along the camera's horizontal axis.
Note that setting this value to true
when the sceneUpVector() is not already vertically projected will break these invariants. It will also limit the possible movement of the camera, possibly up to a lock when the sceneUpVector() is projected horizontally. Use Camera::setUpVector() to define the sceneUpVector() and align the camera before calling this method to ensure this does not happen.
Definition at line 106 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::domElement().
|
inline |
Returns the up vector of the scene, expressed in the world coordinate system.
In 'fly mode' (corresponding to the QGLViewer::MOVE_FORWARD and QGLViewer::MOVE_BACKWARD QGLViewer::MouseAction bindings), horizontal displacements of the mouse rotate the ManipulatedCameraFrame around this vector. Vertical displacements rotate always around the Camera X
axis.
This value is also used when setRotationIsConstrained() is set to true
to define the up vector (and incidentally the 'horizon' plane) around which the camera will rotate.
Default value is (0,1,0), but it is updated by the Camera when this object is set as its Camera::frame(). Camera::setOrientation() and Camera::setUpVector()) direclty modify this value and should be used instead.
Definition at line 171 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::domElement(), and ManipulatedCameraFrame::operator=().
|
inlineslot |
Sets the flySpeed(), defined in OpenGL units.
Default value is 0.0, but it is modified according to the QGLViewer::sceneRadius() when the ManipulatedCameraFrame is set as the Camera::frame().
Definition at line 139 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::initFromDOMElement(), ManipulatedCameraFrame::ManipulatedCameraFrame(), ManipulatedCameraFrame::operator=(), Camera::setFlySpeed(), and Camera::setSceneRadius().
|
inline |
Sets the pivotPoint(), defined in the world coordinate system.
Definition at line 77 of file manipulatedCameraFrame.h.
Referenced by Camera::setPivotPoint().
|
inline |
Sets the value of rotatesAroundUpVector().
Default value is false (free rotation).
Definition at line 110 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::initFromDOMElement(), and ManipulatedCameraFrame::operator=().
|
inlineslot |
Sets the sceneUpVector(), defined in the world coordinate system.
Default value is (0,1,0), but it is updated by the Camera when this object is set as its Camera::frame(). Using Camera::setUpVector() instead is probably a better solution.
Definition at line 145 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::initFromDOMElement(), and ManipulatedCameraFrame::operator=().
|
inline |
Sets the value of zoomsOnPivotPoint().
Default value is false.
Definition at line 124 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::initFromDOMElement(), and ManipulatedCameraFrame::operator=().
|
protectedvirtualslot |
Overloading of ManipulatedFrame::spin().
Rotates the ManipulatedCameraFrame around its pivotPoint() instead of its origin.
Definition at line 72 of file manipulatedCameraFrame.cpp.
References ManipulatedCameraFrame::pivotPoint(), Frame::rotateAroundPoint(), and ManipulatedFrame::spinningQuaternion().
Referenced by ManipulatedCameraFrame::mouseMoveEvent().
|
protectedvirtual |
Protected internal method used to handle mouse events.
Reimplemented from ManipulatedFrame.
Definition at line 194 of file manipulatedCameraFrame.cpp.
References ManipulatedFrame::startAction(), and Frame::transformOf().
Referenced by QGLViewer::mousePressEvent(), and QGLViewer::wheelEvent().
|
protectedvirtual |
This is an overload of ManipulatedFrame::wheelEvent().
The wheel behavior depends on the wheel binded action. Current possible actions are QGLViewer::ZOOM, QGLViewer::MOVE_FORWARD, QGLViewer::MOVE_BACKWARD. QGLViewer::ZOOM speed depends on wheelSensitivity() while QGLViewer::MOVE_FORWARD and QGLViewer::MOVE_BACKWARD depend on flySpeed(). See QGLViewer::setWheelBinding() to customize the binding.
Reimplemented from ManipulatedFrame.
Definition at line 413 of file manipulatedCameraFrame.cpp.
References ManipulatedCameraFrame::flySpeed(), Frame::inverseTransformOf(), ManipulatedFrame::manipulated(), Frame::setConstraint(), Frame::translate(), and ManipulatedFrame::wheelDelta().
Referenced by QGLViewer::wheelEvent().
|
inline |
Returns whether or not the QGLViewer::ZOOM action zooms on the pivot point.
When set to false
(default), a zoom action will move the camera along its Camera::viewDirection(), i.e. back and forth along a direction perpendicular to the projection screen.
setZoomsOnPivotPoint() to true
will move the camera along an axis defined by the Camera::pivotPoint() and its current position instead. As a result, the projected position of the pivot point on screen will stay the same during a zoom.
Definition at line 120 of file manipulatedCameraFrame.h.
Referenced by ManipulatedCameraFrame::domElement().
The documentation for this class was generated from the following files:
- worldsim/3rdParts/qglviewer/manipulatedCameraFrame.h
- worldsim/3rdParts/qglviewer/manipulatedCameraFrame.cpp