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_CuttingPlane Class Reference

GLC_CuttingPlane : 3d cutting plane widget. More...

#include <glc_cuttingplane.h>

+ Inheritance diagram for GLC_CuttingPlane:

Public Member Functions

Constructor / Destructor
 GLC_CuttingPlane (const GLC_Point3d &center, 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_CuttingPlaneoperator= (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.
 
- 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 { TranslationManipulator, RotationManipulator }
 

Private Member Functions

void moveManipulatorRep (const GLC_Point3d &pos)
 Move the manipulator 3D representation.
 
GLC_AbstractManipulatorrotationNavigator (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_AbstractManipulatorm_pCurrentManipulator
 The current manipulator of this cutting plane.
 
GLC_Point3d m_CurrentNavigatorPosition
 The current manipulator position.
 

Additional Inherited Members

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

Detailed Description

GLC_CuttingPlane : 3d cutting plane widget.

GLC_CuttingPlane

Definition at line 38 of file glc_cuttingplane.h.

Member Enumeration Documentation

Enumerator
TranslationManipulator 
RotationManipulator 

Definition at line 40 of file glc_cuttingplane.h.

Constructor & Destructor Documentation

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 33 of file glc_cuttingplane.cpp.

References create3DviewInstance(), m_CompMatrix, m_Normal, GLC_Matrix4x4::setMatRot(), 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 57 of file glc_cuttingplane.cpp.

References GLC_AbstractManipulator::clone(), and m_pCurrentManipulator.

GLC_CuttingPlane::~GLC_CuttingPlane ( )
virtual

Destructor.

Definition at line 79 of file glc_cuttingplane.cpp.

References m_pCurrentManipulator.

Member Function Documentation

GLC_Point3d GLC_CuttingPlane::center ( void  ) const
inline

Return this cutting plane center.

Definition at line 66 of file glc_cuttingplane.h.

QColor GLC_CuttingPlane::color ( ) const
inline

Return this plane color.

Definition at line 74 of file glc_cuttingplane.h.

void GLC_CuttingPlane::create3DviewInstance ( )
protectedvirtual
glc::WidgetEventFlag GLC_CuttingPlane::mouseMove ( const GLC_Point3d pos,
Qt::MouseButtons  button,
GLC_uint  id 
)
virtual
glc::WidgetEventFlag GLC_CuttingPlane::mousePressed ( const GLC_Point3d pos,
Qt::MouseButton  button,
GLC_uint  id 
)
virtual
glc::WidgetEventFlag GLC_CuttingPlane::mouseReleased ( Qt::MouseButton  button)
virtual
void GLC_CuttingPlane::moveManipulatorRep ( const GLC_Point3d pos)
private
GLC_Vector3d GLC_CuttingPlane::normal ( ) const
inline

Return this cutting plane normal.

Definition at line 70 of file glc_cuttingplane.h.

double GLC_CuttingPlane::opacity ( ) const
inline

Return this plane opacity.

Definition at line 78 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 84 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, m_pCurrentManipulator, and GLC_3DWidget::operator=().

void GLC_CuttingPlane::resetViewState ( )
protectedvirtual

Reset the view state of this 3DWidget.

Implements GLC_3DWidget.

Definition at line 340 of file glc_cuttingplane.cpp.

References m_CurrentManipulator, m_pCurrentManipulator, m_SelectionIndex, GLC_3DWidget::set3DViewInstanceVisibility(), and TranslationManipulator.

Referenced by unselect().

GLC_AbstractManipulator * GLC_CuttingPlane::rotationNavigator ( int  index)
private

Create the rotation navigator of the given instance index.

Definition at line 380 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
void GLC_CuttingPlane::setColor ( const QColor &  color)
inline

Set this plane color.

Definition at line 95 of file glc_cuttingplane.h.

void GLC_CuttingPlane::setOpacity ( double  opacity)
inline

Set this plane opacity.

Definition at line 99 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 235 of file glc_cuttingplane.cpp.

References glc::AcceptEvent, and resetViewState().

void GLC_CuttingPlane::updateLength ( double  l1,
double  l2 
)

Update the lenght of this cutting plane.

Definition at line 105 of file glc_cuttingplane.cpp.

References create3DviewInstance(), GLC_3DWidget::has3DWidgetManager(), m_L1, m_L2, and GLC_3DWidget::remove3DViewInstance().

void GLC_CuttingPlane::updateWidgetRep ( )
virtual

Member Data Documentation

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

Manipulator GLC_CuttingPlane::m_CurrentManipulator
private

current manipulator enum

Definition at line 182 of file glc_cuttingplane.h.

Referenced by mouseMove(), mousePressed(), mouseReleased(), resetViewState(), and select().

GLC_Point3d GLC_CuttingPlane::m_CurrentNavigatorPosition
private

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

GLC_AbstractManipulator* GLC_CuttingPlane::m_pCurrentManipulator
private

The current manipulator of this cutting plane.

Definition at line 185 of file glc_cuttingplane.h.

Referenced by GLC_CuttingPlane(), mouseMove(), mousePressed(), mouseReleased(), operator=(), resetViewState(), select(), 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 resetViewState().


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

©2005-2013 Laurent Ribon