GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
GLC_Axis Class Reference

GLC_Axis : 3d Widget axis use to translate objects. More...

#include <glc_axis.h>

+ Inheritance diagram for GLC_Axis:

Public Member Functions

Constructor / Destructor
 GLC_Axis (const GLC_Point3d &center, 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_Axisoperator= (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.
 
- Public Member Functions inherited from GLC_3DWidget
 GLC_3DWidget (GLC_3DWidgetManagerHandle *pWidgetManagerHandle=NULL)
 Construct a 3d widget with the given 3DWidget manager handle.
 
 GLC_3DWidget (const GLC_3DWidget &widget)
 Construct a 3d widget form the given 3d widget.
 
virtual ~GLC_3DWidget ()
 Destructor.
 
GLC_uint id () const
 Return this widget id.
 
bool operator== (const GLC_3DWidget &widget) const
 Return true if this 3d widget is equal to the given 3d widget.
 
bool instanceBelongTo (GLC_uint id) const
 Return true if the given instance id belongs to this widget.
 
const GLC_3DWidgetManagerHandlewidgetManagerHandle () const
 Return the widget manager of this 3d widget.
 
bool has3DWidgetManager () const
 Return true if this widget has a 3DWidgetManager.
 
bool useOrtho () const
 Return true if otho is used.
 
virtual GLC_3DWidgetoperator= (const GLC_3DWidget &widget)
 Copy the given widget in this widget and return a reference on this widget.
 
void setWidgetManager (GLC_3DWidgetManagerHandle *pWidgetManagerHandle)
 Set the given widgetManager to this widget.
 
void setVisible (bool visible)
 Set the visibility of 3DView Instance of this widget.
 
virtual glc::WidgetEventFlag mouseOver (const GLC_Point3d &, GLC_uint id)
 The mouse is over this widget.
 

Protected Member Functions

virtual void create3DviewInstance ()
 Create the 3DView instance of this 3d widget.
 
virtual void resetViewState ()
 Reset the view state of this 3DWidget.
 
- Protected Member Functions inherited from GLC_3DWidget
bool isEmpty () const
 Return true if this 3DWidget hasen't 3d instance.
 
void add3DViewInstance (const GLC_3DViewInstance &instance)
 Add 3D view instance in the widget manager handle.
 
GLC_3DViewInstanceinstanceHandle (int index)
 Return the 3D view instance handle from the given index.
 
void remove3DViewInstance ()
 Remove instance of this 3d widget from the 3D widget manager handle.
 
void set3DViewInstanceVisibility (int index, bool visibility)
 Set the specified 3D view instance visibility.
 
int indexOfIntsanceId (GLC_uint id)
 Return the index of the given instance id.
 

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_AbstractManipulatorm_pCurrentManipulator
 The current manipulator of this cutting plane.
 
double m_AxisLength
 The axis length.
 
double m_AxisRadiusRatio
 The axis radius Ratio : Radius / Length.
 

Additional Inherited Members

- Signals inherited from GLC_3DWidget
void asChanged ()
 Sub class must emit this signal if they changed.
 

Detailed Description

GLC_Axis : 3d Widget axis use to translate objects.

GLC_Axis

Definition at line 38 of file glc_axis.h.

Member Enumeration Documentation

enum GLC_Axis::Manipulator
private
Enumerator
NoneManipulator 
X_AxisManipulator 
Y_AxisManipulator 
Z_AxisManipulator 

Definition at line 40 of file glc_axis.h.

Constructor & Destructor Documentation

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

Destructor.

Definition at line 59 of file glc_axis.cpp.

References m_pCurrentManipulator.

Member Function Documentation

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 ( )
protectedvirtual
glc::WidgetEventFlag GLC_Axis::mouseMove ( const GLC_Point3d pos,
Qt::MouseButtons  button,
GLC_uint  id 
)
virtual
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
void GLC_Axis::moveManipulatorRep ( const GLC_Point3d pos)
private
GLC_Axis & GLC_Axis::operator= ( const GLC_Axis axis)
virtual

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, m_pCurrentManipulator, and GLC_3DWidget::operator=().

void GLC_Axis::resetViewState ( )
protectedvirtual

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
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().

Member Data Documentation

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().

GLC_AbstractManipulator* GLC_Axis::m_pCurrentManipulator
private

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().


The documentation for this class was generated from the following files:

©2005-2013 Laurent Ribon