GLC_3DWidgetManagerHandle Class Reference

#include <glc_3dwidgetmanagerhandle.h>

List of all members.

Public Member Functions

Constructor / Destructor

 GLC_3DWidgetManagerHandle (GLC_Viewport *pViewport)
 Construct a 3D widget manager attached to the given viewport.
 ~GLC_3DWidgetManagerHandle ()
 Destructor.
Get Functions

bool isOrphan () const
 Return true if there is only one widget manager associated to this handle.
GLC_3DViewInstanceinstanceHandle (GLC_uint id)
 Return the 3DView instance of the given id.
bool hasAnActiveWidget () const
 Return true if this 3DWidget manager has active widget.
const GLC_CameracameraHandle () const
 Return an handle to the camera of the viewport of this manager.
GLC_BoundingBox boundingBox ()
 Return the boundingBox of 3dwidget.
bool useOrtho () const
 Return true if the viewport use orthographic projection.
double viewportTangent () const
 Return the tangent value of the viewport.
GLC_Viewportviewport () const
 Return the viewport of this manager.
bool contains3DWidget (GLC_uint id) const
 Return true if this manager contains the given widget id.
GLC_3DWidgetwidget (GLC_uint id) const
 Return the 3DWidget of the given widget id.
Set Functions

void increment ()
 Increment the number of world.
void decrement ()
 Decrement the number of world.
void add3DWidget (GLC_3DWidget *p3DWidget)
 Add the given 3D widget into this manager.
void remove3DWidget (GLC_uint id)
 Remove the 3D widget with the given id from this manager.
GLC_3DWidgettake (GLC_uint id)
 Take the 3D widget with the given id from this manager.
void add3DViewInstance (const GLC_3DViewInstance &instance, GLC_uint widgetId)
 Add the given 3D view instance link to the given 3D widget into this manager.
void remove3DViewInstance (GLC_uint id)
 Remove the 3D view instance with the given id from this manager collection.
void clear ()
 Remove all 3D view instance from this manager.
void setWidgetVisible (GLC_uint id, bool visible)
 Set the visibility of the given 3D widget id.
Interaction Functions

glc::WidgetEventFlag mouseDoubleClickEvent (QMouseEvent *pEvent)
 Recieve Mouse double click event with the given instance id Return true if the event is catch.
glc::WidgetEventFlag mouseMoveEvent (QMouseEvent *pEvent)
 Recieve Mouse move event with the given instance id Return true if the event is catch.
glc::WidgetEventFlag mousePressEvent (QMouseEvent *pEvent)
 Recieve Mouse press event with the given instance id Return true if the event is catch.
glc::WidgetEventFlag mouseReleaseEvent (QMouseEvent *pEvent)
 Recieve Mouse release event with the given instance id Return true if the event is catch.
OpenGL Functions

void render ()
 Render the 3DWidget of this manager.

Private Member Functions

QPair< GLC_uint, GLC_Point3dselect (QMouseEvent *event)
 Make selection according to the given mouse event.

Private Attributes

GLC_3DViewCollection m_Collection
 The Collection.
int m_Count
 Widget manager count.
QHash< GLC_uint, GLC_3DWidget * > m_3DWidgetHash
 The 3D widget hash table.
QHash< GLC_uint, GLC_uintm_MapBetweenInstanceWidget
 The papping between 3D view instance and 3DWidget.
GLC_Viewportm_pViewport
 The viewport of this 3d widget manager handle.
GLC_uint m_Active3DWidgetId
 The active 3Dwidget id.
GLC_uint m_Preselected3DWidgetId
 The preselected 3DWidget.

Detailed Description

Definition at line 34 of file glc_3dwidgetmanagerhandle.h.


Constructor & Destructor Documentation

GLC_3DWidgetManagerHandle::GLC_3DWidgetManagerHandle ( GLC_Viewport pViewport  ) 

Construct a 3D widget manager attached to the given viewport.

Definition at line 31 of file glc_3dwidgetmanagerhandle.cpp.

GLC_3DWidgetManagerHandle::~GLC_3DWidgetManagerHandle (  ) 

Destructor.

Definition at line 43 of file glc_3dwidgetmanagerhandle.cpp.

References m_3DWidgetHash.


Member Function Documentation

void GLC_3DWidgetManagerHandle::add3DViewInstance ( const GLC_3DViewInstance instance,
GLC_uint  widgetId 
)

Add the given 3D view instance link to the given 3D widget into this manager.

Definition at line 74 of file glc_3dwidgetmanagerhandle.cpp.

References GLC_3DViewCollection::add(), GLC_3DViewCollection::contains(), GLC_Object::id(), m_Collection, and m_MapBetweenInstanceWidget.

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

void GLC_3DWidgetManagerHandle::add3DWidget ( GLC_3DWidget p3DWidget  ) 

Add the given 3D widget into this manager.

Definition at line 53 of file glc_3dwidgetmanagerhandle.cpp.

References GLC_3DWidget::id(), m_3DWidgetHash, m_MapBetweenInstanceWidget, and GLC_3DWidget::setWidgetManager().

GLC_BoundingBox GLC_3DWidgetManagerHandle::boundingBox ( void   )  [inline]

Return the boundingBox of 3dwidget.

Definition at line 71 of file glc_3dwidgetmanagerhandle.h.

const GLC_Camera* GLC_3DWidgetManagerHandle::cameraHandle (  )  const [inline]

Return an handle to the camera of the viewport of this manager.

Definition at line 67 of file glc_3dwidgetmanagerhandle.h.

void GLC_3DWidgetManagerHandle::clear ( void   ) 

Remove all 3D view instance from this manager.

Definition at line 92 of file glc_3dwidgetmanagerhandle.cpp.

References GLC_3DViewCollection::clear(), m_3DWidgetHash, m_Active3DWidgetId, m_Collection, and m_MapBetweenInstanceWidget.

bool GLC_3DWidgetManagerHandle::contains3DWidget ( GLC_uint  id  )  const [inline]

Return true if this manager contains the given widget id.

Definition at line 87 of file glc_3dwidgetmanagerhandle.h.

void GLC_3DWidgetManagerHandle::decrement (  )  [inline]

Decrement the number of world.

Definition at line 106 of file glc_3dwidgetmanagerhandle.h.

Referenced by GLC_3DWidgetManager::~GLC_3DWidgetManager().

bool GLC_3DWidgetManagerHandle::hasAnActiveWidget (  )  const [inline]

Return true if this 3DWidget manager has active widget.

Definition at line 63 of file glc_3dwidgetmanagerhandle.h.

Referenced by mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

void GLC_3DWidgetManagerHandle::increment (  )  [inline]

Increment the number of world.

Definition at line 102 of file glc_3dwidgetmanagerhandle.h.

Referenced by GLC_3DWidgetManager::GLC_3DWidgetManager().

GLC_3DViewInstance* GLC_3DWidgetManagerHandle::instanceHandle ( GLC_uint  id  )  [inline]

Return the 3DView instance of the given id.

Definition at line 59 of file glc_3dwidgetmanagerhandle.h.

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

bool GLC_3DWidgetManagerHandle::isOrphan (  )  const [inline]

Return true if there is only one widget manager associated to this handle.

Definition at line 55 of file glc_3dwidgetmanagerhandle.h.

Referenced by GLC_3DWidgetManager::~GLC_3DWidgetManager().

glc::WidgetEventFlag GLC_3DWidgetManagerHandle::mouseDoubleClickEvent ( QMouseEvent *  pEvent  ) 

Recieve Mouse double click event with the given instance id Return true if the event is catch.

Definition at line 113 of file glc_3dwidgetmanagerhandle.cpp.

References hasAnActiveWidget(), and glc::IgnoreEvent.

glc::WidgetEventFlag GLC_3DWidgetManagerHandle::mouseMoveEvent ( QMouseEvent *  pEvent  ) 

Recieve Mouse move event with the given instance id Return true if the event is catch.

Definition at line 123 of file glc_3dwidgetmanagerhandle.cpp.

References hasAnActiveWidget(), glc::IgnoreEvent, m_3DWidgetHash, m_Active3DWidgetId, m_MapBetweenInstanceWidget, m_Preselected3DWidgetId, GLC_3DWidget::mouseMove(), GLC_3DWidget::mouseOver(), and select().

glc::WidgetEventFlag GLC_3DWidgetManagerHandle::mousePressEvent ( QMouseEvent *  pEvent  ) 
glc::WidgetEventFlag GLC_3DWidgetManagerHandle::mouseReleaseEvent ( QMouseEvent *  pEvent  ) 

Recieve Mouse release event with the given instance id Return true if the event is catch.

Definition at line 212 of file glc_3dwidgetmanagerhandle.cpp.

References hasAnActiveWidget(), glc::IgnoreEvent, m_3DWidgetHash, m_Active3DWidgetId, and GLC_3DWidget::mouseReleased().

void GLC_3DWidgetManagerHandle::remove3DViewInstance ( GLC_uint  id  ) 

Remove the 3D view instance with the given id from this manager collection.

Definition at line 84 of file glc_3dwidgetmanagerhandle.cpp.

References GLC_3DViewCollection::contains(), m_Collection, m_MapBetweenInstanceWidget, and GLC_3DViewCollection::remove().

Referenced by GLC_3DWidget::remove3DViewInstance().

void GLC_3DWidgetManagerHandle::remove3DWidget ( GLC_uint  id  ) 

Remove the 3D widget with the given id from this manager.

Associated 3D view instance are removed

Definition at line 60 of file glc_3dwidgetmanagerhandle.cpp.

References m_3DWidgetHash, and m_Active3DWidgetId.

void GLC_3DWidgetManagerHandle::render (  ) 
QPair< GLC_uint, GLC_Point3d > GLC_3DWidgetManagerHandle::select ( QMouseEvent *  event  )  [private]

Make selection according to the given mouse event.

Definition at line 246 of file glc_3dwidgetmanagerhandle.cpp.

References m_pViewport, GLC_Viewport::selectOnPreviousRender(), and GLC_Viewport::unProject().

Referenced by mouseMoveEvent(), and mousePressEvent().

void GLC_3DWidgetManagerHandle::setWidgetVisible ( GLC_uint  id,
bool  visible 
)

Set the visibility of the given 3D widget id.

Definition at line 106 of file glc_3dwidgetmanagerhandle.cpp.

References m_3DWidgetHash, and m_Active3DWidgetId.

GLC_3DWidget * GLC_3DWidgetManagerHandle::take ( GLC_uint  id  ) 

Take the 3D widget with the given id from this manager.

Associated 3D view instance are NOT removed

Definition at line 68 of file glc_3dwidgetmanagerhandle.cpp.

References m_3DWidgetHash.

Referenced by GLC_3DWidget::setWidgetManager().

bool GLC_3DWidgetManagerHandle::useOrtho (  )  const [inline]

Return true if the viewport use orthographic projection.

Definition at line 75 of file glc_3dwidgetmanagerhandle.h.

GLC_Viewport* GLC_3DWidgetManagerHandle::viewport (  )  const [inline]

Return the viewport of this manager.

Definition at line 83 of file glc_3dwidgetmanagerhandle.h.

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

double GLC_3DWidgetManagerHandle::viewportTangent (  )  const [inline]

Return the tangent value of the viewport.

Definition at line 79 of file glc_3dwidgetmanagerhandle.h.

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

GLC_3DWidget* GLC_3DWidgetManagerHandle::widget ( GLC_uint  id  )  const [inline]

Return the 3DWidget of the given widget id.

Definition at line 91 of file glc_3dwidgetmanagerhandle.h.


Member Data Documentation

The active 3Dwidget id.

Definition at line 189 of file glc_3dwidgetmanagerhandle.h.

Referenced by clear(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), remove3DWidget(), and setWidgetVisible().

The Collection.

Definition at line 174 of file glc_3dwidgetmanagerhandle.h.

Referenced by add3DViewInstance(), clear(), remove3DViewInstance(), and render().

Widget manager count.

Definition at line 177 of file glc_3dwidgetmanagerhandle.h.

The papping between 3D view instance and 3DWidget.

Definition at line 183 of file glc_3dwidgetmanagerhandle.h.

Referenced by add3DViewInstance(), add3DWidget(), clear(), mouseMoveEvent(), mousePressEvent(), and remove3DViewInstance().

The preselected 3DWidget.

Definition at line 192 of file glc_3dwidgetmanagerhandle.h.

Referenced by mouseMoveEvent().

The viewport of this 3d widget manager handle.

Definition at line 186 of file glc_3dwidgetmanagerhandle.h.

Referenced by select().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon