glc_axis.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #ifndef GLC_AXIS_H_
00025 #define GLC_AXIS_H_
00026
00027 #include "glc_3dwidget.h"
00028 #include "../glc_config.h"
00029
00030 class GLC_AbstractManipulator;
00031
00034
00037
00038 class GLC_LIB_EXPORT GLC_Axis : public GLC_3DWidget
00039 {
00040 enum Manipulator
00041 {
00042 NoneManipulator,
00043 X_AxisManipulator,
00044 Y_AxisManipulator,
00045 Z_AxisManipulator
00046 };
00047
00049
00051
00052 public:
00054 GLC_Axis(const GLC_Point3d& center, GLC_3DWidgetManagerHandle* pWidgetManagerHandle= NULL);
00055
00057 GLC_Axis(const GLC_Axis& axis);
00058
00060 virtual ~GLC_Axis();
00062
00064
00066
00067 public:
00069 inline GLC_Point3d center() const
00070 {return m_Center;}
00071
00073 inline double axisLength() const
00074 {return m_AxisLength;}
00076
00078
00080
00081 public:
00083 virtual GLC_Axis& operator=(const GLC_Axis& axis);
00084
00086 virtual void updateWidgetRep();
00087
00089 void setAxisLength(double length);
00090
00092 void setCenter(const GLC_Point3d& newCenter);
00093
00095
00097
00099
00100 public:
00101
00103 virtual glc::WidgetEventFlag select(const GLC_Point3d&, GLC_uint id);
00104
00106 virtual glc::WidgetEventFlag unselect(const GLC_Point3d&, GLC_uint id);
00107
00109 virtual glc::WidgetEventFlag mousePressed(const GLC_Point3d&, Qt::MouseButton, GLC_uint id);
00110
00112 virtual glc::WidgetEventFlag mouseReleased(Qt::MouseButton);
00113
00115 virtual glc::WidgetEventFlag mouseMove(const GLC_Point3d&, Qt::MouseButtons, GLC_uint id);
00116
00118
00120
00122 protected:
00124 virtual void create3DviewInstance();
00125
00127 virtual void resetViewState();
00128
00130
00132 private:
00134 void moveManipulatorRep(const GLC_Point3d& pos);
00135
00137
00139 private:
00141 GLC_Point3d m_Center;
00142
00144 double m_ScaleFactor;
00145
00147 Manipulator m_CurrentManipulator;
00148
00150 GLC_AbstractManipulator* m_pCurrentManipulator;
00151
00153 double m_AxisLength;
00154
00156 double m_AxisRadiusRatio;
00157
00158 };
00159
00160 #endif