[brlcad-commits] SF.net SVN: brlcad:[35226]
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <ra...@us...> - 2009-07-20 23:52:17
|
Revision: 35226 http://brlcad.svn.sourceforge.net/brlcad/?rev=35226&view=rev Author: ralith Date: 2009-07-20 23:52:12 +0000 (Mon, 20 Jul 2009) Log Message: ----------- Fixed miscellaneous accidental omissions and errors. Modified Paths: -------------- rt^3/trunk/src/g3d/CameraMode.cxx rt^3/trunk/src/g3d/CameraMode.h rt^3/trunk/src/g3d/CameraModeBlender.cxx rt^3/trunk/src/g3d/CameraModeMGED.cxx rt^3/trunk/src/g3d/CameraModeOrbital.cxx Modified: rt^3/trunk/src/g3d/CameraMode.cxx =================================================================== --- rt^3/trunk/src/g3d/CameraMode.cxx 2009-07-20 23:42:20 UTC (rev 35225) +++ rt^3/trunk/src/g3d/CameraMode.cxx 2009-07-20 23:52:12 UTC (rev 35226) @@ -39,7 +39,7 @@ /******************************************************************************* * CameraMode ******************************************************************************/ -const float CameraMode::ROTATION_DEFAULT_SPEED = (2.0f*PI_NUMBER)/4.0f; // 4s for full revolution +const float CameraMode::ROTATION_DEFAULT_SPEED = (2.0f*M_PI)/4.0f; // 4s for full revolution const float CameraMode::ZOOM_DEFAULT_SPEED_RATIO = 4.0f; // 4 times per second const float CameraMode::RADIUS_MAX_DISTANCE = 10000.0f; // m const float CameraMode::RADIUS_MIN_DISTANCE = 0.1f; // m @@ -180,25 +180,25 @@ float CameraMode::getXRotation() const { // vertical rotation is only half - float radians = getVarWithinLimits(2.0f*(_camera->getRealOrientation().getPitch().valueRadians() + PI_NUMBER/2.0f), + float radians = getVarWithinLimits(2.0f*(_camera->getRealOrientation().getPitch().valueRadians() + M_PI/2.0f), 0.0f, - 2*PI_NUMBER); + 2*M_PI); return radians; } float CameraMode::getYRotation() const { - float radians = getVarWithinLimits(_camera->getRealOrientation().getYaw().valueRadians() + PI_NUMBER, + float radians = getVarWithinLimits(_camera->getRealOrientation().getYaw().valueRadians() + M_PI, 0.0f, - 2*PI_NUMBER); + 2*M_PI); return radians; } float CameraMode::getZRotation() const { - float radians = getVarWithinLimits(_camera->getRealOrientation().getRoll().valueRadians() + PI_NUMBER, + float radians = getVarWithinLimits(_camera->getRealOrientation().getRoll().valueRadians() + M_PI, 0.0f, - 2*PI_NUMBER); + 2*M_PI); return radians; } @@ -269,7 +269,7 @@ float CameraMode::degreesToRadians(float degrees) { - return (degrees*PI_NUMBER)/180.0f; + return (degrees*M_PI)/180.0f; } void CameraMode::increaseVarWithLimit(float& var, float value, float limit) Modified: rt^3/trunk/src/g3d/CameraMode.h =================================================================== --- rt^3/trunk/src/g3d/CameraMode.h 2009-07-20 23:42:20 UTC (rev 35225) +++ rt^3/trunk/src/g3d/CameraMode.h 2009-07-20 23:52:12 UTC (rev 35226) @@ -32,7 +32,8 @@ #include <cmath> -#include <Qt> +#include <QKeyEvent> +#include <QMouseEvent> namespace Ogre { Modified: rt^3/trunk/src/g3d/CameraModeBlender.cxx =================================================================== --- rt^3/trunk/src/g3d/CameraModeBlender.cxx 2009-07-20 23:42:20 UTC (rev 35225) +++ rt^3/trunk/src/g3d/CameraModeBlender.cxx 2009-07-20 23:52:12 UTC (rev 35226) @@ -37,7 +37,7 @@ /******************************************************************************* * CameraModeBlender ******************************************************************************/ -const float CameraModeBlender::ROTATION_STEP = PI_NUMBER/12.0f; // 15 degrees, in radians +const float CameraModeBlender::ROTATION_STEP = M_PI/12.0f; // 15 degrees, in radians const float CameraModeBlender::PAN_FRACTION = 20.0f; // m const float CameraModeBlender::ZOOM_STEP = 1.25f; // ratio @@ -117,6 +117,8 @@ return false; } } + + return false; } bool CameraModeBlender::injectKeyReleased(QKeyEvent *e) @@ -141,7 +143,7 @@ // Logger::logDEBUG("%.03f %.03f", horizDiffNorm, vertDiffNorm); // orbit freely, setting absolute position - _horizontalRot = _dragOriginalHorizontalRotation + horizDiffNorm*PI_NUMBER; + _horizontalRot = _dragOriginalHorizontalRotation + horizDiffNorm*M_PI; _verticalRot = _dragOriginalVerticalRotation + vertDiffNorm*VERTICAL_ROTATION_MAX_LIMIT; return true; @@ -154,8 +156,8 @@ { if (e->button() == Qt::MidButton) { _dragModeEnabled = true; - _dragModeOriginX = x; - _dragModeOriginY = y; + _dragModeOriginX = e->x(); + _dragModeOriginY = e->y(); _dragOriginalHorizontalRotation = _horizontalRot; _dragOriginalVerticalRotation = _verticalRot; Modified: rt^3/trunk/src/g3d/CameraModeMGED.cxx =================================================================== --- rt^3/trunk/src/g3d/CameraModeMGED.cxx 2009-07-20 23:42:20 UTC (rev 35225) +++ rt^3/trunk/src/g3d/CameraModeMGED.cxx 2009-07-20 23:52:12 UTC (rev 35226) @@ -171,8 +171,8 @@ switch (e->button()) { case Qt::LeftButton: _constrainedToAxis = X; - _dragOriginX = x; - _dragOriginY = y; + _dragOriginX = e->x(); + _dragOriginY = e->y(); _dragOriginalRadius = _radius; _dragOriginalHorizontalRotation = _horizontalRot; _dragOriginalVerticalRotation = _verticalRot; @@ -181,8 +181,8 @@ case Qt::MidButton: _constrainedToAxis = Y; - _dragOriginX = x; - _dragOriginY = y; + _dragOriginX = e->x(); + _dragOriginY = e->y(); _dragOriginalRadius = _radius; _dragOriginalHorizontalRotation = _horizontalRot; _dragOriginalVerticalRotation = _verticalRot; @@ -191,8 +191,8 @@ case Qt::RightButton: _constrainedToAxis = Z; - _dragOriginX = x; - _dragOriginY = y; + _dragOriginX = e->x(); + _dragOriginY = e->y(); _dragOriginalRadius = _radius; _dragOriginalHorizontalRotation = _horizontalRot; _dragOriginalVerticalRotation = _verticalRot; Modified: rt^3/trunk/src/g3d/CameraModeOrbital.cxx =================================================================== --- rt^3/trunk/src/g3d/CameraModeOrbital.cxx 2009-07-20 23:42:20 UTC (rev 35225) +++ rt^3/trunk/src/g3d/CameraModeOrbital.cxx 2009-07-20 23:52:12 UTC (rev 35226) @@ -76,12 +76,13 @@ return false; } } + return false; } -bool CameraModeOrbital::injectKeyReleased(OIS::KeyCode keyCode) +bool CameraModeOrbital::injectKeyReleased(QKeyEvent *e) { if(e->modifiers() & Qt::KeypadModifier) { - switch (keyCode) { + switch (e->key()) { case Qt::Key_Plus: case Qt::Key_Minus: // zoom @@ -101,6 +102,7 @@ return false; } } + return false; } void CameraModeOrbital::cameraControlUpPressed() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |