summaryrefslogtreecommitdiffstats
path: root/lib/tqwtplot3d/src/qwt3d_movements.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-11 14:15:27 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-11 14:15:27 -0500
commitb85a292ce06475d560bfa1195b63a8bfe211f22d (patch)
tree463d71be55ff807513139f1de106aef6bdd7b4db /lib/tqwtplot3d/src/qwt3d_movements.cpp
parentce039289815e2802fdeca8d384126c807ca9cb58 (diff)
downloadulab-b85a292ce06475d560bfa1195b63a8bfe211f22d.tar.gz
ulab-b85a292ce06475d560bfa1195b63a8bfe211f22d.zip
Add 0.2.7 release of qwtplot3d for future TQt3 conversion and use
Diffstat (limited to 'lib/tqwtplot3d/src/qwt3d_movements.cpp')
-rw-r--r--lib/tqwtplot3d/src/qwt3d_movements.cpp106
1 files changed, 106 insertions, 0 deletions
diff --git a/lib/tqwtplot3d/src/qwt3d_movements.cpp b/lib/tqwtplot3d/src/qwt3d_movements.cpp
new file mode 100644
index 0000000..73ff9b1
--- /dev/null
+++ b/lib/tqwtplot3d/src/qwt3d_movements.cpp
@@ -0,0 +1,106 @@
+#if defined(_MSC_VER) /* MSVC Compiler */
+#pragma warning ( disable : 4305 )
+#pragma warning ( disable : 4786 )
+#endif
+
+#include <float.h>
+#include "qwt3d_plot.h"
+
+using namespace Qwt3D;
+
+
+/**
+ Set the rotation angle of the object. If you look along the respective axis towards ascending values,
+ the rotation is performed in mathematical \e negative sense
+ \param xVal angle in \e degree to rotate around the X axis
+ \param yVal angle in \e degree to rotate around the Y axis
+ \param zVal angle in \e degree to rotate around the Z axis
+*/
+void Plot3D::setRotation( double xVal, double yVal, double zVal )
+{
+ if (xRot_ == xVal && yRot_ == yVal && zRot_ == zVal)
+ return;
+
+ xRot_ = xVal;
+ yRot_ = yVal;
+ zRot_ = zVal;
+
+ updateGL();
+ emit rotationChanged(xVal, yVal, zVal);
+}
+
+/**
+ Set the shift in object (world) coordinates.
+ \param xVal shift along (world) X axis
+ \param yVal shift along (world) Y axis
+ \param zVal shift along (world) Z axis
+ \see setViewportShift()
+*/
+void Plot3D::setShift( double xVal, double yVal, double zVal )
+{
+ if (xShift_ == xVal && yShift_ == yVal && zShift_ == zVal)
+ return;
+
+ xShift_ = xVal;
+ yShift_ = yVal;
+ zShift_ = zVal;
+ updateGL();
+ emit shiftChanged(xVal, yVal, zVal);
+}
+
+/**
+ Performs shifting along screen axes.
+ The shift moves points inside a sphere,
+ which encloses the unscaled and unzoomed data
+ by multiples of the spheres diameter
+
+ \param xVal shift along (view) X axis
+ \param yVal shift along (view) Y axis
+ \see setShift()
+*/
+void Plot3D::setViewportShift( double xVal, double yVal )
+{
+ if (xVPShift_ == xVal && yVPShift_ == yVal)
+ return;
+
+ xVPShift_ = xVal;
+ yVPShift_ = yVal;
+
+ updateGL();
+ emit vieportShiftChanged(xVPShift_, yVPShift_);
+}
+
+/**
+ Set the scale in object (world) coordinates.
+ \param xVal scaling for X values
+ \param yVal scaling for Y values
+ \param zVal scaling for Z values
+
+ A respective value of 1 represents no scaling;
+*/
+void Plot3D::setScale( double xVal, double yVal, double zVal )
+{
+ if (xScale_ == xVal && yScale_ == yVal && zScale_ == zVal)
+ return;
+
+ xScale_ = (xVal < DBL_EPSILON ) ? DBL_EPSILON : xVal;
+ yScale_ = (yVal < DBL_EPSILON ) ? DBL_EPSILON : yVal;
+ zScale_ = (zVal < DBL_EPSILON ) ? DBL_EPSILON : zVal;
+
+ updateGL();
+ emit scaleChanged(xVal, yVal, zVal);
+}
+
+/**
+ Set the (zoom in addition to scale).
+ \param val zoom value (value == 1 indicates no zooming)
+*/
+void Plot3D::setZoom( double val )
+{
+ if (zoom_ == val)
+ return;
+
+ zoom_ = (val < DBL_EPSILON ) ? DBL_EPSILON : val;
+ updateGL();
+ emit zoomChanged(val);
+}