GLC_CuttingPlane : 3d cutting plane widget. More...
#include <glc_cuttingplane.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_CuttingPlane (const GLC_Point3d ¢er, const GLC_Vector3d &normal, double l1, double l2, GLC_3DWidgetManagerHandle *pWidgetManagerHandle=NULL) | |
| Construct a 3d cutting plane widget. | |
| GLC_CuttingPlane (const GLC_CuttingPlane &cuttingPlane) | |
| Construct a 3d cutting plane with the given cutting plane. | |
| virtual | ~GLC_CuttingPlane () |
| Destructor. | |
Get Functions | |
| GLC_Point3d | center () const |
| Return this cutting plane center. | |
| GLC_Vector3d | normal () const |
| Return this cutting plane normal. | |
| QColor | color () const |
| Return this plane color. | |
| double | opacity () const |
| Return this plane opacity. | |
Set Functions | |
| virtual GLC_CuttingPlane & | operator= (const GLC_CuttingPlane &cuttingPlane) |
| Copy the given cutting plane in this cutting plane and return a reference on this cutting plane. | |
| void | updateLength (double l1, double l2) |
| Update the lenght of this cutting plane. | |
| void | setColor (const QColor &color) |
| Set this plane color. | |
| void | setOpacity (double opacity) |
| Set this plane opacity. | |
| virtual void | updateWidgetRep () |
| Update widget representation. | |
Interaction Functions | |
| virtual glc::WidgetEventFlag | select (const GLC_Point3d &, GLC_uint id) |
| This widget as been selected. | |
| virtual glc::WidgetEventFlag | unselect (const GLC_Point3d &, GLC_uint id) |
| This widget as been unselected. | |
| virtual glc::WidgetEventFlag | mousePressed (const GLC_Point3d &, Qt::MouseButton, GLC_uint id) |
| The mouse is over this widget and a mousse button is pressed. | |
| virtual glc::WidgetEventFlag | mouseReleased (Qt::MouseButton) |
| The mouse is over this widget and a mousse button is released. | |
| virtual glc::WidgetEventFlag | mouseMove (const GLC_Point3d &, Qt::MouseButtons, GLC_uint id) |
| This widget is selected and the mousse move with a pressed buttons. | |
Protected Member Functions | |
| virtual void | create3DviewInstance () |
| Create the 3DView instance of this 3d widget. | |
Private Types | |
| enum | Manipulator { TranslationManipulator, RotationManipulator } |
Private Member Functions | |
| void | moveManipulatorRep (const GLC_Point3d &pos) |
| Move the manipulator 3D representation. | |
| GLC_AbstractManipulator * | rotationNavigator (int index) |
| Create the rotation navigator of the given instance index. | |
Private Attributes | |
| GLC_Point3d | m_Center |
| The cutting plane center. | |
| GLC_Vector3d | m_Normal |
| The cutting plane Normal. | |
| GLC_Matrix4x4 | m_CompMatrix |
| The cutting plane compostion matrix. | |
| double | m_L1 |
| The cutting plane size. | |
| double | m_L2 |
| QColor | m_Color |
| The cutting plane color. | |
| double | m_Opacity |
| The cutting plane opacity. | |
| double | m_ManipulatorOffsetFactor |
| The manipulator offset. | |
| double | m_ScaleFactor |
| The manipulator scale factor. | |
| int | m_SelectionIndex |
| Index of the instance in selection. | |
| Manipulator | m_CurrentManipulator |
| current manipulator enum | |
| GLC_AbstractManipulator * | m_pCurrentManipulator |
| The current manipulator of this cutting plane. | |
| GLC_Point3d | m_CurrentNavigatorPosition |
| The current manipulator position. | |
GLC_CuttingPlane : 3d cutting plane widget.
Definition at line 40 of file glc_cuttingplane.h.
enum GLC_CuttingPlane::Manipulator [private] |
Definition at line 42 of file glc_cuttingplane.h.
| GLC_CuttingPlane::GLC_CuttingPlane | ( | const GLC_Point3d & | center, | |
| const GLC_Vector3d & | normal, | |||
| double | l1, | |||
| double | l2, | |||
| GLC_3DWidgetManagerHandle * | pWidgetManagerHandle = NULL | |||
| ) |
Construct a 3d cutting plane widget.
Definition at line 35 of file glc_cuttingplane.cpp.
References create3DviewInstance(), m_CompMatrix, m_Normal, glc::PI, GLC_Matrix4x4::setMatRot(), glc::X_AXIS(), and glc::Z_AXIS().
| GLC_CuttingPlane::GLC_CuttingPlane | ( | const GLC_CuttingPlane & | cuttingPlane | ) |
Construct a 3d cutting plane with the given cutting plane.
Definition at line 70 of file glc_cuttingplane.cpp.
References GLC_AbstractManipulator::clone(), and m_pCurrentManipulator.
| GLC_CuttingPlane::~GLC_CuttingPlane | ( | ) | [virtual] |
| GLC_Point3d GLC_CuttingPlane::center | ( | void | ) | const [inline] |
Return this cutting plane center.
Definition at line 68 of file glc_cuttingplane.h.
| QColor GLC_CuttingPlane::color | ( | ) | const [inline] |
Return this plane color.
Definition at line 76 of file glc_cuttingplane.h.
| void GLC_CuttingPlane::create3DviewInstance | ( | ) | [protected, virtual] |
Create the 3DView instance of this 3d widget.
Implements GLC_3DWidget.
Definition at line 303 of file glc_cuttingplane.cpp.
References GLC_3DWidget::add3DViewInstance(), GLC_3DRep::addGeom(), GLC_Factory::createCuttingPlane(), GLC_Factory::instance(), GLC_3DWidget::isEmpty(), m_Center, m_Color, m_L1, m_L2, m_Normal, m_Opacity, glc::PI, GLC_Mesh::replaceMasterMaterial(), GLC_3DWidget::set3DViewInstanceVisibility(), GLC_Disc::setAngle(), GLC_Arrow::setHeadLength(), GLC_Geometry::setLineWidth(), GLC_Material::setOpacity(), GLC_Geometry::setWireColor(), GLC_3DWidget::widgetManagerHandle(), and glc::Z_AXIS().
Referenced by GLC_CuttingPlane(), and updateLength().
| glc::WidgetEventFlag GLC_CuttingPlane::mouseMove | ( | const GLC_Point3d & | pos, | |
| Qt::MouseButtons | button, | |||
| GLC_uint | id | |||
| ) | [virtual] |
This widget is selected and the mousse move with a pressed buttons.
Reimplemented from GLC_3DWidget.
Definition at line 263 of file glc_cuttingplane.cpp.
References glc::AcceptEvent, GLC_3DWidget::asChanged(), GLC_AbstractManipulator::enterManipulateState(), glc::IgnoreEvent, GLC_3DWidget::instanceHandle(), m_Center, m_CompMatrix, m_CurrentManipulator, m_CurrentNavigatorPosition, m_Normal, m_pCurrentManipulator, m_SelectionIndex, GLC_AbstractManipulator::manipulate(), moveManipulatorRep(), GLC_3DViewInstance::multMatrix(), GLC_AbstractManipulator::previousPosition(), and RotationManipulator.
| glc::WidgetEventFlag GLC_CuttingPlane::mousePressed | ( | const GLC_Point3d & | pos, | |
| Qt::MouseButton | button, | |||
| GLC_uint | id | |||
| ) | [virtual] |
The mouse is over this widget and a mousse button is pressed.
Reimplemented from GLC_3DWidget.
Definition at line 162 of file glc_cuttingplane.cpp.
References glc::BlockedEvent, GLC_AbstractManipulator::enterManipulateState(), glc::IgnoreEvent, GLC_3DWidget::indexOfIntsanceId(), m_CurrentManipulator, m_CurrentNavigatorPosition, m_pCurrentManipulator, m_SelectionIndex, RotationManipulator, rotationNavigator(), and updateWidgetRep().
| glc::WidgetEventFlag GLC_CuttingPlane::mouseReleased | ( | Qt::MouseButton | button | ) | [virtual] |
The mouse is over this widget and a mousse button is released.
Reimplemented from GLC_3DWidget.
Definition at line 203 of file glc_cuttingplane.cpp.
References glc::BlockedEvent, GLC_AbstractManipulator::enterManipulateState(), glc::IgnoreEvent, m_CurrentManipulator, m_CurrentNavigatorPosition, m_Normal, m_pCurrentManipulator, m_SelectionIndex, moveManipulatorRep(), RotationManipulator, GLC_3DWidget::set3DViewInstanceVisibility(), TranslationManipulator, GLC_3DWidgetManagerHandle::viewport(), and GLC_3DWidget::widgetManagerHandle().
| void GLC_CuttingPlane::moveManipulatorRep | ( | const GLC_Point3d & | pos | ) | [private] |
Move the manipulator 3D representation.
Definition at line 362 of file glc_cuttingplane.cpp.
References GLC_3DViewInstance::geomAt(), GLC_3DWidget::instanceHandle(), m_CompMatrix, m_ManipulatorOffsetFactor, m_Normal, m_ScaleFactor, glc::PI, GLC_Matrix4x4::rotationMatrix(), GLC_3DViewInstance::setMatrix(), GLC_Matrix4x4::setMatScaling(), GLC_Arrow::setViewDir(), GLC_3DWidget::widgetManagerHandle(), glc::X_AXIS(), and glc::Y_AXIS().
Referenced by mouseMove(), mouseReleased(), and updateWidgetRep().
| GLC_Vector3d GLC_CuttingPlane::normal | ( | ) | const [inline] |
Return this cutting plane normal.
Definition at line 72 of file glc_cuttingplane.h.
| double GLC_CuttingPlane::opacity | ( | ) | const [inline] |
Return this plane opacity.
Definition at line 80 of file glc_cuttingplane.h.
| GLC_CuttingPlane & GLC_CuttingPlane::operator= | ( | const GLC_CuttingPlane & | cuttingPlane | ) | [virtual] |
Copy the given cutting plane in this cutting plane and return a reference on this cutting plane.
Definition at line 97 of file glc_cuttingplane.cpp.
References GLC_AbstractManipulator::clone(), m_Center, m_Color, m_CompMatrix, m_CurrentNavigatorPosition, m_L1, m_L2, m_Normal, m_Opacity, and m_pCurrentManipulator.
| GLC_AbstractManipulator * GLC_CuttingPlane::rotationNavigator | ( | int | index | ) | [private] |
Create the rotation navigator of the given instance index.
Definition at line 390 of file glc_cuttingplane.cpp.
References m_CompMatrix, m_CurrentNavigatorPosition, GLC_Matrix4x4::rotationMatrix(), GLC_3DWidget::widgetManagerHandle(), glc::X_AXIS(), glc::Y_AXIS(), and glc::Z_AXIS().
Referenced by mousePressed().
| glc::WidgetEventFlag GLC_CuttingPlane::select | ( | const GLC_Point3d & | pos, | |
| GLC_uint | id | |||
| ) | [virtual] |
This widget as been selected.
Create the default manipulator
Reimplemented from GLC_3DWidget.
Definition at line 143 of file glc_cuttingplane.cpp.
References glc::BlockedEvent, GLC_AbstractManipulator::enterManipulateState(), m_CurrentManipulator, m_CurrentNavigatorPosition, m_Normal, m_pCurrentManipulator, GLC_3DWidget::set3DViewInstanceVisibility(), TranslationManipulator, updateWidgetRep(), GLC_3DWidgetManagerHandle::viewport(), and GLC_3DWidget::widgetManagerHandle().
| void GLC_CuttingPlane::setColor | ( | const QColor & | color | ) | [inline] |
Set this plane color.
Definition at line 97 of file glc_cuttingplane.h.
| void GLC_CuttingPlane::setOpacity | ( | double | opacity | ) | [inline] |
Set this plane opacity.
Definition at line 101 of file glc_cuttingplane.h.
| glc::WidgetEventFlag GLC_CuttingPlane::unselect | ( | const GLC_Point3d & | , | |
| GLC_uint | id | |||
| ) | [virtual] |
This widget as been unselected.
Reimplemented from GLC_3DWidget.
Definition at line 248 of file glc_cuttingplane.cpp.
References glc::AcceptEvent, m_CurrentManipulator, m_pCurrentManipulator, m_SelectionIndex, GLC_3DWidget::set3DViewInstanceVisibility(), and TranslationManipulator.
| void GLC_CuttingPlane::updateLength | ( | double | l1, | |
| double | l2 | |||
| ) |
Update the lenght of this cutting plane.
Definition at line 118 of file glc_cuttingplane.cpp.
References create3DviewInstance(), GLC_3DWidget::has3DWidgetManager(), m_L1, m_L2, and GLC_3DWidget::remove3DViewInstance().
| void GLC_CuttingPlane::updateWidgetRep | ( | ) | [virtual] |
Update widget representation.
Reimplemented from GLC_3DWidget.
Definition at line 130 of file glc_cuttingplane.cpp.
References m_CurrentNavigatorPosition, m_ManipulatorOffsetFactor, m_ScaleFactor, moveManipulatorRep(), GLC_3DWidgetManagerHandle::viewportTangent(), and GLC_3DWidget::widgetManagerHandle().
Referenced by mousePressed(), and select().
GLC_Point3d GLC_CuttingPlane::m_Center [private] |
The cutting plane center.
Definition at line 155 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), mouseMove(), and operator=().
QColor GLC_CuttingPlane::m_Color [private] |
The cutting plane color.
Definition at line 167 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), and operator=().
GLC_Matrix4x4 GLC_CuttingPlane::m_CompMatrix [private] |
The cutting plane compostion matrix.
Definition at line 161 of file glc_cuttingplane.h.
Referenced by GLC_CuttingPlane(), mouseMove(), moveManipulatorRep(), operator=(), and rotationNavigator().
current manipulator enum
Definition at line 182 of file glc_cuttingplane.h.
Referenced by mouseMove(), mousePressed(), mouseReleased(), select(), and unselect().
The current manipulator position.
Definition at line 188 of file glc_cuttingplane.h.
Referenced by mouseMove(), mousePressed(), mouseReleased(), operator=(), rotationNavigator(), select(), and updateWidgetRep().
double GLC_CuttingPlane::m_L1 [private] |
The cutting plane size.
Definition at line 164 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), operator=(), and updateLength().
double GLC_CuttingPlane::m_L2 [private] |
Definition at line 164 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), operator=(), and updateLength().
double GLC_CuttingPlane::m_ManipulatorOffsetFactor [private] |
The manipulator offset.
Definition at line 173 of file glc_cuttingplane.h.
Referenced by moveManipulatorRep(), and updateWidgetRep().
GLC_Vector3d GLC_CuttingPlane::m_Normal [private] |
The cutting plane Normal.
Definition at line 158 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), GLC_CuttingPlane(), mouseMove(), mouseReleased(), moveManipulatorRep(), operator=(), and select().
double GLC_CuttingPlane::m_Opacity [private] |
The cutting plane opacity.
Definition at line 170 of file glc_cuttingplane.h.
Referenced by create3DviewInstance(), and operator=().
The current manipulator of this cutting plane.
Definition at line 185 of file glc_cuttingplane.h.
Referenced by GLC_CuttingPlane(), mouseMove(), mousePressed(), mouseReleased(), operator=(), select(), unselect(), and ~GLC_CuttingPlane().
double GLC_CuttingPlane::m_ScaleFactor [private] |
The manipulator scale factor.
Definition at line 176 of file glc_cuttingplane.h.
Referenced by moveManipulatorRep(), and updateWidgetRep().
int GLC_CuttingPlane::m_SelectionIndex [private] |
Index of the instance in selection.
Definition at line 179 of file glc_cuttingplane.h.
Referenced by mouseMove(), mousePressed(), mouseReleased(), and unselect().