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
00023
00024 #ifndef GLC_CUTTINGPLANE_H_
00025 #define GLC_CUTTINGPLANE_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_CuttingPlane : public GLC_3DWidget
00039 {
00040 enum Manipulator
00041 {
00042 TranslationManipulator,
00043 RotationManipulator
00044 };
00046
00048
00049 public:
00051 GLC_CuttingPlane(const GLC_Point3d& center, const GLC_Vector3d& normal, double l1, double l2, GLC_3DWidgetManagerHandle* pWidgetManagerHandle= NULL);
00052
00054 GLC_CuttingPlane(const GLC_CuttingPlane& cuttingPlane);
00055
00057 virtual ~GLC_CuttingPlane();
00059
00061
00063
00064 public:
00066 inline GLC_Point3d center() const
00067 {return m_Center;}
00068
00070 inline GLC_Vector3d normal() const
00071 {return m_Normal;}
00072
00074 inline QColor color() const
00075 {return m_Color;}
00076
00078 inline double opacity() const
00079 {return m_Opacity;}
00080
00082
00084
00086
00087 public:
00089 virtual GLC_CuttingPlane& operator=(const GLC_CuttingPlane& cuttingPlane);
00090
00092 void updateLength(double l1, double l2);
00093
00095 inline void setColor(const QColor& color)
00096 {m_Color= color;}
00097
00099 inline void setOpacity(double opacity)
00100 {m_Opacity= opacity;}
00101
00103 virtual void updateWidgetRep();
00104
00106
00108
00110
00111 public:
00112
00114 virtual glc::WidgetEventFlag select(const GLC_Point3d&, GLC_uint id);
00115
00117 virtual glc::WidgetEventFlag unselect(const GLC_Point3d&, GLC_uint id);
00118
00120 virtual glc::WidgetEventFlag mousePressed(const GLC_Point3d&, Qt::MouseButton, GLC_uint id);
00121
00123 virtual glc::WidgetEventFlag mouseReleased(Qt::MouseButton);
00124
00126 virtual glc::WidgetEventFlag mouseMove(const GLC_Point3d&, Qt::MouseButtons, GLC_uint id);
00127
00129
00131
00133 protected:
00135 virtual void create3DviewInstance();
00136
00138 virtual void resetViewState();
00139
00141
00143 private:
00145 void moveManipulatorRep(const GLC_Point3d& pos);
00146
00148 GLC_AbstractManipulator* rotationNavigator(int index);
00149
00151
00153 private:
00155 GLC_Point3d m_Center;
00156
00158 GLC_Vector3d m_Normal;
00159
00161 GLC_Matrix4x4 m_CompMatrix;
00162
00164 double m_L1, m_L2;
00165
00167 QColor m_Color;
00168
00170 double m_Opacity;
00171
00173 double m_ManipulatorOffsetFactor;
00174
00176 double m_ScaleFactor;
00177
00179 int m_SelectionIndex;
00180
00182 Manipulator m_CurrentManipulator;
00183
00185 GLC_AbstractManipulator* m_pCurrentManipulator;
00186
00188 GLC_Point3d m_CurrentNavigatorPosition;
00189
00190
00191 };
00192
00193 #endif