glc_cuttingplane.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
00022
00023
00025
00026 #ifndef GLC_CUTTINGPLANE_H_
00027 #define GLC_CUTTINGPLANE_H_
00028
00029 #include "glc_3dwidget.h"
00030 #include "../glc_config.h"
00031
00032 class GLC_AbstractManipulator;
00033
00036
00039
00040 class GLC_LIB_EXPORT GLC_CuttingPlane : public GLC_3DWidget
00041 {
00042 enum Manipulator
00043 {
00044 TranslationManipulator,
00045 RotationManipulator
00046 };
00047 Q_OBJECT
00049
00051
00052 public:
00054 GLC_CuttingPlane(const GLC_Point3d& center, const GLC_Vector3d& normal, double l1, double l2, GLC_3DWidgetManagerHandle* pWidgetManagerHandle= NULL);
00055
00057 GLC_CuttingPlane(const GLC_CuttingPlane& cuttingPlane);
00058
00060 virtual ~GLC_CuttingPlane();
00062
00064
00066
00067 public:
00069 inline GLC_Point3d center() const
00070 {return m_Center;}
00071
00073 inline GLC_Vector3d normal() const
00074 {return m_Normal;}
00075
00077 inline QColor color() const
00078 {return m_Color;}
00079
00081 inline double opacity() const
00082 {return m_Opacity;}
00083
00085
00087
00089
00090 public:
00092 virtual GLC_CuttingPlane& operator=(const GLC_CuttingPlane& cuttingPlane);
00093
00095 void updateLength(double l1, double l2);
00096
00098 inline void setColor(const QColor& color)
00099 {m_Color= color;}
00100
00102 inline void setOpacity(double opacity)
00103 {m_Opacity= opacity;}
00104
00106 virtual void updateWidgetRep();
00107
00109
00111
00113
00114 public:
00115
00117 virtual glc::WidgetEventFlag select(const GLC_Point3d&, GLC_uint id);
00118
00120 virtual glc::WidgetEventFlag unselect(const GLC_Point3d&, GLC_uint id);
00121
00123 virtual glc::WidgetEventFlag mousePressed(const GLC_Point3d&, Qt::MouseButton, GLC_uint id);
00124
00126 virtual glc::WidgetEventFlag mouseReleased(Qt::MouseButton);
00127
00129 virtual glc::WidgetEventFlag mouseMove(const GLC_Point3d&, Qt::MouseButtons, GLC_uint id);
00130
00132
00134
00136 protected:
00138 virtual void create3DviewInstance();
00139
00140
00142
00144 private:
00146 void moveManipulatorRep(const GLC_Point3d& pos);
00147
00149 GLC_AbstractManipulator* rotationNavigator(int index);
00150
00152
00154 private:
00156 GLC_Point3d m_Center;
00157
00159 GLC_Vector3d m_Normal;
00160
00162 GLC_Matrix4x4 m_CompMatrix;
00163
00165 double m_L1, m_L2;
00166
00168 QColor m_Color;
00169
00171 double m_Opacity;
00172
00174 double m_ManipulatorOffsetFactor;
00175
00177 double m_ScaleFactor;
00178
00180 int m_SelectionIndex;
00181
00183 Manipulator m_CurrentManipulator;
00184
00186 GLC_AbstractManipulator* m_pCurrentManipulator;
00187
00189 GLC_Point3d m_CurrentNavigatorPosition;
00190
00191
00192 };
00193
00194 #endif