#include <glc_3dwidgetmanagerhandle.h>
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_3DViewInstance * | instanceHandle (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_Camera * | cameraHandle () 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_Viewport * | viewport () const |
| Return the viewport of this manager. | |
| bool | contains3DWidget (GLC_uint id) const |
| Return true if this manager contains the given widget id. | |
| GLC_3DWidget * | widget (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_3DWidget * | take (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_Point3d > | select (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_uint > | m_MapBetweenInstanceWidget |
| The papping between 3D view instance and 3DWidget. | |
| GLC_Viewport * | m_pViewport |
| The viewport of this 3d widget manager handle. | |
| GLC_uint | m_Active3DWidgetId |
| The active 3Dwidget id. | |
| GLC_uint | m_Preselected3DWidgetId |
| The preselected 3DWidget. | |
Definition at line 34 of file glc_3dwidgetmanagerhandle.h.
| 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 | ( | ) |
| 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 | ) |
Recieve Mouse press event with the given instance id Return true if the event is catch.
Definition at line 163 of file glc_3dwidgetmanagerhandle.cpp.
References hasAnActiveWidget(), glc::IgnoreEvent, GLC_3DWidget::instanceBelongTo(), m_3DWidgetHash, m_Active3DWidgetId, m_MapBetweenInstanceWidget, GLC_3DWidget::mousePressed(), GLC_3DWidget::select(), select(), and GLC_3DWidget::unselect().
| 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 | ( | ) |
Render the 3DWidget of this manager.
Definition at line 225 of file glc_3dwidgetmanagerhandle.cpp.
References GLC_State::glslUsed(), m_3DWidgetHash, m_Collection, GLC_3DViewCollection::render(), GLC_3DViewCollection::renderShaderGroup(), glc::TransparentRenderFlag, and glc::WireRenderFlag.
| 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.
QHash<GLC_uint, GLC_3DWidget*> GLC_3DWidgetManagerHandle::m_3DWidgetHash [private] |
The 3D widget hash table.
Definition at line 180 of file glc_3dwidgetmanagerhandle.h.
Referenced by add3DWidget(), clear(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), remove3DWidget(), render(), setWidgetVisible(), take(), and ~GLC_3DWidgetManagerHandle().
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().
int GLC_3DWidgetManagerHandle::m_Count [private] |
Widget manager count.
Definition at line 177 of file glc_3dwidgetmanagerhandle.h.
QHash<GLC_uint, GLC_uint> GLC_3DWidgetManagerHandle::m_MapBetweenInstanceWidget [private] |
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().