GLC_Axis : 3d Widget axis use to translate objects. More...
#include <glc_axis.h>
Public Member Functions | |
Constructor / Destructor | |
| GLC_Axis (const GLC_Point3d ¢er, GLC_3DWidgetManagerHandle *pWidgetManagerHandle=NULL) | |
| Construct a axis widget. | |
| GLC_Axis (const GLC_Axis &axis) | |
| Copy constructor. | |
| virtual | ~GLC_Axis () |
| Destructor. | |
Get Functions | |
| GLC_Point3d | center () const |
| Return this axis center. | |
| double | axisLength () const |
| Return this axis length. | |
Set Functions | |
| virtual GLC_Axis & | operator= (const GLC_Axis &axis) |
| Copy the given cutting plane in this cutting plane and return a reference on this cutting plane. | |
| virtual void | updateWidgetRep () |
| Update widget representation. | |
| void | setAxisLength (double length) |
| Set the axis length. | |
| void | setCenter (const GLC_Point3d &newCenter) |
| Set Axis center. | |
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. | |
| virtual void | resetViewState () |
| Reset the view state of this 3DWidget. | |
Private Types | |
| enum | Manipulator { NoneManipulator, X_AxisManipulator, Y_AxisManipulator, Z_AxisManipulator } |
Private Member Functions | |
| void | moveManipulatorRep (const GLC_Point3d &pos) |
| Move the manipulator 3D representation. | |
Private Attributes | |
| GLC_Point3d | m_Center |
| The axis center. | |
| double | m_ScaleFactor |
| The manipulator scale factor. | |
| Manipulator | m_CurrentManipulator |
| Current manipulator enum. | |
| GLC_AbstractManipulator * | m_pCurrentManipulator |
| The current manipulator of this cutting plane. | |
| double | m_AxisLength |
| The axis length. | |
| double | m_AxisRadiusRatio |
| The axis radius Ratio : Radius / Length. | |
GLC_Axis : 3d Widget axis use to translate objects.
Definition at line 38 of file glc_axis.h.
enum GLC_Axis::Manipulator [private] |
Definition at line 40 of file glc_axis.h.
| GLC_Axis::GLC_Axis | ( | const GLC_Point3d & | center, | |
| GLC_3DWidgetManagerHandle * | pWidgetManagerHandle = NULL | |||
| ) |
Construct a axis widget.
Definition at line 32 of file glc_axis.cpp.
| GLC_Axis::GLC_Axis | ( | const GLC_Axis & | axis | ) |
Copy constructor.
Definition at line 44 of file glc_axis.cpp.
References GLC_AbstractManipulator::clone(), and m_pCurrentManipulator.
| GLC_Axis::~GLC_Axis | ( | ) | [virtual] |
| double GLC_Axis::axisLength | ( | ) | const [inline] |
Return this axis length.
Definition at line 73 of file glc_axis.h.
| GLC_Point3d GLC_Axis::center | ( | void | ) | const [inline] |
Return this axis center.
Definition at line 69 of file glc_axis.h.
| void GLC_Axis::create3DviewInstance | ( | ) | [protected, virtual] |
Create the 3DView instance of this 3d widget.
Implements GLC_3DWidget.
Definition at line 220 of file glc_axis.cpp.
References GLC_3DWidget::add3DViewInstance(), GLC_Factory::createCone(), GLC_Factory::createCylinder(), GLC_3DRep::geomAt(), GLC_Factory::instance(), GLC_3DWidget::isEmpty(), m_AxisLength, m_AxisRadiusRatio, GLC_3DViewInstance::multMatrix(), glc::PI, GLC_Geometry::replaceMasterMaterial(), GLC_3DViewInstance::representation(), GLC_3DViewInstance::translate(), glc::X_AXIS(), and glc::Y_AXIS().
Referenced by setAxisLength().
| glc::WidgetEventFlag GLC_Axis::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 195 of file glc_axis.cpp.
References glc::AcceptEvent, GLC_3DWidget::asChanged(), GLC_AbstractManipulator::enterManipulateState(), glc::IgnoreEvent, GLC_3DWidget::instanceHandle(), m_Center, m_pCurrentManipulator, GLC_AbstractManipulator::manipulate(), GLC_3DViewInstance::multMatrix(), and GLC_AbstractManipulator::previousPosition().
| glc::WidgetEventFlag GLC_Axis::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 141 of file glc_axis.cpp.
References glc::IgnoreEvent, and select().
| glc::WidgetEventFlag GLC_Axis::mouseReleased | ( | Qt::MouseButton | button | ) | [virtual] |
The mouse is over this widget and a mousse button is released.
Reimplemented from GLC_3DWidget.
Definition at line 153 of file glc_axis.cpp.
References glc::BlockedEvent, GLC_Geometry::firstMaterial(), GLC_3DViewInstance::geomAt(), glc::IgnoreEvent, GLC_3DWidget::instanceHandle(), m_CurrentManipulator, m_pCurrentManipulator, NoneManipulator, GLC_Material::setDiffuseColor(), X_AxisManipulator, Y_AxisManipulator, and Z_AxisManipulator.
| void GLC_Axis::moveManipulatorRep | ( | const GLC_Point3d & | pos | ) | [private] |
Move the manipulator 3D representation.
Definition at line 281 of file glc_axis.cpp.
References GLC_3DWidget::instanceHandle(), m_AxisLength, m_ScaleFactor, glc::PI, GLC_3DViewInstance::setMatrix(), GLC_Matrix4x4::setMatRot(), GLC_Matrix4x4::setMatScaling(), GLC_Matrix4x4::setMatTranslate(), glc::X_AXIS(), and glc::Y_AXIS().
Referenced by setCenter(), and updateWidgetRep().
Copy the given cutting plane in this cutting plane and return a reference on this cutting plane.
Definition at line 64 of file glc_axis.cpp.
References GLC_AbstractManipulator::clone(), m_Center, and m_pCurrentManipulator.
| void GLC_Axis::resetViewState | ( | ) | [protected, virtual] |
Reset the view state of this 3DWidget.
Implements GLC_3DWidget.
Definition at line 276 of file glc_axis.cpp.
| glc::WidgetEventFlag GLC_Axis::select | ( | const GLC_Point3d & | pos, | |
| GLC_uint | id | |||
| ) | [virtual] |
This widget as been selected.
Create the corresponding manipulator
Reimplemented from GLC_3DWidget.
Definition at line 105 of file glc_axis.cpp.
References glc::BlockedEvent, GLC_AbstractManipulator::enterManipulateState(), GLC_Geometry::firstMaterial(), GLC_3DViewInstance::geomAt(), GLC_3DWidget::indexOfIntsanceId(), GLC_3DWidget::instanceHandle(), m_CurrentManipulator, m_pCurrentManipulator, NoneManipulator, GLC_Material::setDiffuseColor(), updateWidgetRep(), GLC_3DWidgetManagerHandle::viewport(), GLC_3DWidget::widgetManagerHandle(), glc::X_AXIS(), X_AxisManipulator, glc::Y_AXIS(), Y_AxisManipulator, glc::Z_AXIS(), and Z_AxisManipulator.
Referenced by mousePressed().
| void GLC_Axis::setAxisLength | ( | double | length | ) |
Set the axis length.
Definition at line 89 of file glc_axis.cpp.
References create3DviewInstance(), GLC_3DWidget::isEmpty(), m_AxisLength, and GLC_3DWidget::remove3DViewInstance().
| void GLC_Axis::setCenter | ( | const GLC_Point3d & | newCenter | ) |
Set Axis center.
Definition at line 99 of file glc_axis.cpp.
References m_Center, and moveManipulatorRep().
| glc::WidgetEventFlag GLC_Axis::unselect | ( | const GLC_Point3d & | , | |
| GLC_uint | id | |||
| ) | [virtual] |
This widget as been unselected.
Reimplemented from GLC_3DWidget.
Definition at line 184 of file glc_axis.cpp.
References glc::AcceptEvent, m_CurrentManipulator, m_pCurrentManipulator, and NoneManipulator.
| void GLC_Axis::updateWidgetRep | ( | ) | [virtual] |
Update widget representation.
Reimplemented from GLC_3DWidget.
Definition at line 78 of file glc_axis.cpp.
References m_Center, m_ScaleFactor, moveManipulatorRep(), GLC_3DWidgetManagerHandle::viewportTangent(), and GLC_3DWidget::widgetManagerHandle().
Referenced by select().
double GLC_Axis::m_AxisLength [private] |
The axis length.
Definition at line 153 of file glc_axis.h.
Referenced by create3DviewInstance(), moveManipulatorRep(), and setAxisLength().
double GLC_Axis::m_AxisRadiusRatio [private] |
The axis radius Ratio : Radius / Length.
Definition at line 156 of file glc_axis.h.
Referenced by create3DviewInstance().
GLC_Point3d GLC_Axis::m_Center [private] |
The axis center.
Definition at line 141 of file glc_axis.h.
Referenced by mouseMove(), operator=(), setCenter(), and updateWidgetRep().
Manipulator GLC_Axis::m_CurrentManipulator [private] |
Current manipulator enum.
Definition at line 147 of file glc_axis.h.
Referenced by mouseReleased(), select(), and unselect().
The current manipulator of this cutting plane.
Definition at line 150 of file glc_axis.h.
Referenced by GLC_Axis(), mouseMove(), mouseReleased(), operator=(), select(), unselect(), and ~GLC_Axis().
double GLC_Axis::m_ScaleFactor [private] |
The manipulator scale factor.
Definition at line 144 of file glc_axis.h.
Referenced by moveManipulatorRep(), and updateWidgetRep().