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

GLC_3DWidget : The base class for 3D user interface class. More...

#include <glc_3dwidget.h>

+ Inheritance diagram for GLC_3DWidget:

Signals

void asChanged ()
 Sub class must emit this signal if they changed.
 

Public Member Functions

Constructor / Destructor
 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.
 
Get Functions
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.
 
Set Functions
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.
 
virtual void updateWidgetRep ()
 Update widget representation.
 
void setVisible (bool visible)
 Set the visibility of 3DView Instance of this widget.
 
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 mouseOver (const GLC_Point3d &, GLC_uint id)
 The mouse is over this widget.
 
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 ()=0
 Create the 3DView instance of this 3d widget.
 
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.
 
virtual void resetViewState ()=0
 Reset the view state of this 3DWidget.
 

Private Types

typedef QList< GLC_uintInstanceIdList
 

Private Attributes

GLC_uint m_Uid
 The id of this 3d widget.
 
GLC_3DWidgetManagerHandlem_pWidgetManagerHandle
 Pointer to this widget manager handle.
 
QList< GLC_uintm_InstanceIdList
 The List of this widget instance id.
 

Detailed Description

GLC_3DWidget : The base class for 3D user interface class.

GLC_3DWidget The 3D widget has a 3d representation and react on user interactions

Definition at line 41 of file glc_3dwidget.h.

Member Typedef Documentation

typedef QList<GLC_uint> GLC_3DWidget::InstanceIdList
private

Definition at line 45 of file glc_3dwidget.h.

Constructor & Destructor Documentation

GLC_3DWidget::GLC_3DWidget ( GLC_3DWidgetManagerHandle pWidgetManagerHandle = NULL)

Construct a 3d widget with the given 3DWidget manager handle.

Definition at line 27 of file glc_3dwidget.cpp.

GLC_3DWidget::GLC_3DWidget ( const GLC_3DWidget widget)
GLC_3DWidget::~GLC_3DWidget ( )
virtual

Destructor.

Definition at line 53 of file glc_3dwidget.cpp.

References remove3DViewInstance().

Member Function Documentation

void GLC_3DWidget::add3DViewInstance ( const GLC_3DViewInstance instance)
protected
void GLC_3DWidget::asChanged ( )
signal

Sub class must emit this signal if they changed.

Referenced by GLC_Axis::mouseMove(), and GLC_CuttingPlane::mouseMove().

virtual void GLC_3DWidget::create3DviewInstance ( )
protectedpure virtual

Create the 3DView instance of this 3d widget.

Implemented in GLC_CuttingPlane, and GLC_Axis.

Referenced by setWidgetManager().

bool GLC_3DWidget::has3DWidgetManager ( ) const
inline

Return true if this widget has a 3DWidgetManager.

Definition at line 83 of file glc_3dwidget.h.

Referenced by GLC_CuttingPlane::updateLength().

GLC_uint GLC_3DWidget::id ( ) const
inline

Return this widget id.

Definition at line 68 of file glc_3dwidget.h.

Referenced by GLC_3DWidgetManagerHandle::add3DWidget().

int GLC_3DWidget::indexOfIntsanceId ( GLC_uint  id)
inlineprotected

Return the index of the given instance id.

Definition at line 165 of file glc_3dwidget.h.

Referenced by GLC_CuttingPlane::mousePressed(), and GLC_Axis::select().

bool GLC_3DWidget::instanceBelongTo ( GLC_uint  id) const
inline

Return true if the given instance id belongs to this widget.

Definition at line 75 of file glc_3dwidget.h.

Referenced by GLC_3DWidgetManagerHandle::mousePressEvent().

GLC_3DViewInstance* GLC_3DWidget::instanceHandle ( int  index)
inlineprotected
bool GLC_3DWidget::isEmpty ( void  ) const
inlineprotected
glc::WidgetEventFlag GLC_3DWidget::mouseMove ( const GLC_Point3d ,
Qt::MouseButtons  ,
GLC_uint  id 
)
virtual

This widget is selected and the mousse move with a pressed buttons.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 138 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mouseMoveEvent().

glc::WidgetEventFlag GLC_3DWidget::mouseOver ( const GLC_Point3d ,
GLC_uint  id 
)
virtual

The mouse is over this widget.

Definition at line 123 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mouseMoveEvent().

glc::WidgetEventFlag GLC_3DWidget::mousePressed ( const GLC_Point3d ,
Qt::MouseButton  ,
GLC_uint  id 
)
virtual

The mouse is over this widget and a mousse button is pressed.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 128 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mousePressEvent().

glc::WidgetEventFlag GLC_3DWidget::mouseReleased ( Qt::MouseButton  )
virtual

The mouse is over this widget and a mousse button is released.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 133 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mouseReleaseEvent().

GLC_3DWidget & GLC_3DWidget::operator= ( const GLC_3DWidget widget)
virtual
bool GLC_3DWidget::operator== ( const GLC_3DWidget widget) const

Return true if this 3d widget is equal to the given 3d widget.

Definition at line 58 of file glc_3dwidget.cpp.

void GLC_3DWidget::remove3DViewInstance ( )
protected

Remove instance of this 3d widget from the 3D widget manager handle.

Definition at line 154 of file glc_3dwidget.cpp.

References m_InstanceIdList, m_pWidgetManagerHandle, and GLC_3DWidgetManagerHandle::remove3DViewInstance().

Referenced by operator=(), GLC_Axis::setAxisLength(), setWidgetManager(), GLC_CuttingPlane::updateLength(), and ~GLC_3DWidget().

virtual void GLC_3DWidget::resetViewState ( )
protectedpure virtual

Reset the view state of this 3DWidget.

Implemented in GLC_CuttingPlane, and GLC_Axis.

Referenced by setVisible().

glc::WidgetEventFlag GLC_3DWidget::select ( const GLC_Point3d ,
GLC_uint  id 
)
virtual

This widget as been selected.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 113 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mousePressEvent().

void GLC_3DWidget::set3DViewInstanceVisibility ( int  index,
bool  visibility 
)
protected
void GLC_3DWidget::setVisible ( bool  visible)

Set the visibility of 3DView Instance of this widget.

Definition at line 98 of file glc_3dwidget.cpp.

References GLC_3DWidgetManagerHandle::instanceHandle(), m_InstanceIdList, m_pWidgetManagerHandle, and resetViewState().

void GLC_3DWidget::setWidgetManager ( GLC_3DWidgetManagerHandle pWidgetManagerHandle)

Set the given widgetManager to this widget.

Definition at line 86 of file glc_3dwidget.cpp.

References create3DviewInstance(), m_pWidgetManagerHandle, m_Uid, remove3DViewInstance(), and GLC_3DWidgetManagerHandle::take().

Referenced by GLC_3DWidgetManagerHandle::add3DWidget().

glc::WidgetEventFlag GLC_3DWidget::unselect ( const GLC_Point3d ,
GLC_uint  id 
)
virtual

This widget as been unselected.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 118 of file glc_3dwidget.cpp.

References glc::IgnoreEvent.

Referenced by GLC_3DWidgetManagerHandle::mousePressEvent().

virtual void GLC_3DWidget::updateWidgetRep ( )
inlinevirtual

Update widget representation.

Reimplemented in GLC_CuttingPlane, and GLC_Axis.

Definition at line 104 of file glc_3dwidget.h.

bool GLC_3DWidget::useOrtho ( ) const
inline

Return true if otho is used.

Definition at line 87 of file glc_3dwidget.h.

References GLC_3DWidgetManagerHandle::useOrtho().

const GLC_3DWidgetManagerHandle* GLC_3DWidget::widgetManagerHandle ( ) const
inline

Member Data Documentation

QList<GLC_uint> GLC_3DWidget::m_InstanceIdList
private

The List of this widget instance id.

Definition at line 188 of file glc_3dwidget.h.

Referenced by add3DViewInstance(), GLC_3DWidget(), operator=(), remove3DViewInstance(), set3DViewInstanceVisibility(), and setVisible().

GLC_3DWidgetManagerHandle* GLC_3DWidget::m_pWidgetManagerHandle
private

Pointer to this widget manager handle.

Definition at line 185 of file glc_3dwidget.h.

Referenced by add3DViewInstance(), GLC_3DWidget(), operator=(), remove3DViewInstance(), set3DViewInstanceVisibility(), setVisible(), and setWidgetManager().

GLC_uint GLC_3DWidget::m_Uid
private

The id of this 3d widget.

Generated on GLC_3DWidget construction

Definition at line 182 of file glc_3dwidget.h.

Referenced by add3DViewInstance(), GLC_3DWidget(), operator=(), and setWidgetManager().


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

©2005-2013 Laurent Ribon