#include <GLViewer_Context.h>
Public Member Functions | |
| GLViewer_Context (GLViewer_Viewer2d *) | |
| A constructor. More... | |
| ~GLViewer_Context () | |
| A desructor. More... | |
| void | setUpdateAll (bool on) |
| A function installing update flag in highlighting technology. More... | |
| bool | isUpdateAll () const |
| Returns update flag in highlighting technology. More... | |
| int | MoveTo (int x, int y, bool byCircle=false) |
| Main interactive method. Trace mouse in viewer window. More... | |
| int | Select (bool Append=false, bool byCircle=false) |
| int | SelectByRect (const QRect &theRect, bool Append=false) |
| void | SetHighlightColor (Quantity_NameOfColor aCol) |
| A function installing highlight color for all presentation (does not work) More... | |
| void | SetSelectionColor (Quantity_NameOfColor aCol) |
| A function installing select color for all presentation (does not work) More... | |
| Quantity_NameOfColor | HighlightColor () |
| Returns highlight color. More... | |
| Quantity_NameOfColor | SelectionColor () |
| Returns select color. More... | |
| int | NbSelected () |
| Returns number of objects in current selection. More... | |
| void | InitSelected () |
| A function set iterator of selected objects on first object. More... | |
| bool | MoreSelected () |
| Retuns true if iterator of selected objects is not set on last object. More... | |
| bool | NextSelected () |
| Increment of iterator of selected objects. More... | |
| GLViewer_Object * | SelectedObject () |
| Returns object corresponding the current iterator of selected objects. More... | |
| bool | isSelected (GLViewer_Object *theObject) |
| Returns true if theObject is selected. More... | |
| int | insertObject (GLViewer_Object *theObject, bool display=false, bool isActive=true) |
| Insert new object in context. More... | |
| bool | replaceObject (GLViewer_Object *oldObject, GLViewer_Object *newObject) |
| Replacing objects in context. More... | |
| void | updateScales (GLfloat theX, GLfloat theY) |
| A function updating scales of all objects in context. More... | |
| void | setTolerance (int tol) |
| A function installing tolerance in window pixels for highlghting and selection methods. More... | |
| const ObjList & | getObjects (bool isActive=true) |
| Returns list of context objects. More... | |
| GLViewer_Object * | getFirstObject () |
| Returns first active object. More... | |
| void | clearHighlighted (bool updateViewer) |
| A function clear highlighted object information. More... | |
| void | clearSelected (bool updateViewer) |
| A function clear selection object information. More... | |
| void | setSelected (GLViewer_Object *theObject, bool updateViewer) |
| A function make theObject as selected object and update viewer if updateViewer = true. More... | |
| void | remSelected (GLViewer_Object *theObject, bool updateViewer) |
| A function make theObject as unselected object and update viewer if updateViewer = true. More... | |
| GLViewer_Object * | getCurrentObject () |
| Returns highlighted object. More... | |
| bool | currentObjectIsChanged () |
| Returns true if after last MoveTo method calling highlight object is changed. More... | |
| void | eraseObject (GLViewer_Object *theObject, bool updateViewer=true) |
| A function installing to theObject invisible status and update viewer if updateViewer = true. More... | |
| void | deleteObject (GLViewer_Object *theObject, bool updateViewer=true) |
| A function remove theObject from context and update viewer if updateViewer = true. More... | |
| bool | setActive (GLViewer_Object *theObject) |
| A function installing to theObject active status. More... | |
| bool | setInactive (GLViewer_Object *theObject) |
| A function installing to theObject inactive status. More... | |
Protected Attributes | |
| bool | myUpdateAll |
| Flag of updating viewer after highlight. More... | |
| GLViewer_Viewer2d * | myGLViewer2d |
| GLViewer_Object * | myLastPicked |
| Highlighted object. More... | |
| bool | myLastPickedChanged |
| = true if after last MoveTo method calling highlight object is changed More... | |
| ObjList | myActiveObjects |
| List of active object. More... | |
| ObjList | myInactiveObjects |
| List of inactive object. More... | |
| ObjList | mySelectedObjects |
| List of selected objects. More... | |
| int | mySelCurIndex |
| Selected object iterator. More... | |
| GLfloat | myXhigh |
| X coordinate of mouse cursor. More... | |
| GLfloat | myYhigh |
| Y coordinate of mouse cursor. More... | |
| Quantity_NameOfColor | myHighlightColor |
| Color for highlight. More... | |
| Quantity_NameOfColor | mySelectionColor |
| Color for selection. More... | |
| GLboolean | myHFlag |
| If = false - moveTo method is not any highlighting. More... | |
| GLboolean | mySFlag |
| If = false - select method is not any select. More... | |
| int | myTolerance |
| Tolerance in window pixels for highlghting and selection methods. More... | |
Class for manage of presentations in GLViewer
| GLViewer_Context::GLViewer_Context | ( | GLViewer_Viewer2d * | v | ) |
A constructor.
Constructor
References myHFlag, myLastPicked, myLastPickedChanged, mySelCurIndex, mySFlag, and myUpdateAll.
| GLViewer_Context::~GLViewer_Context | ( | ) |
| void GLViewer_Context::clearHighlighted | ( | bool | updateViewer | ) |
A function clear highlighted object information.
Clears hilighting of objects
| updateViewer | - if it is true, viewer must be updated |
References myGLViewer2d, myHFlag, myLastPicked, GLViewer_Object::unhighlight(), and GLViewer_Viewer2d::updateAll().
| void GLViewer_Context::clearSelected | ( | bool | updateViewer | ) |
A function clear selection object information.
Clears selection of objects
| updateViewer | - if it is true, viewer must be updated |
References GLViewer_Viewer2d::activateDrawers(), myGLViewer2d, mySelectedObjects, and mySFlag.
|
inline |
Returns true if after last MoveTo method calling highlight object is changed.
| void GLViewer_Context::deleteObject | ( | GLViewer_Object * | theObject, |
| bool | updateViewer = true |
||
| ) |
A function remove theObject from context and update viewer if updateViewer = true.
Deletes object in
| updateViewer | - if it is true, viewer must be updated |
References GLViewer_Object::getGroup(), myActiveObjects, myGLViewer2d, myInactiveObjects, myLastPicked, mySelectedObjects, GLViewer_Group::removeObject(), and GLViewer_Viewer2d::updateAll().
| void GLViewer_Context::eraseObject | ( | GLViewer_Object * | theObject, |
| bool | theUpdateViewer = true |
||
| ) |
A function installing to theObject invisible status and update viewer if updateViewer = true.
Erases object in viewer
| theUpdateViewer | - if it is true, viewer must be updated |
References myActiveObjects, myGLViewer2d, GLViewer_Object::setVisible(), GLViewer_Object::unhighlight(), GLViewer_Object::unselect(), and GLViewer_Viewer2d::updateAll().
|
inline |
Returns highlighted object.
|
inline |
Returns first active object.
|
inline |
Returns list of context objects.
|
inline |
Returns highlight color.
| void GLViewer_Context::InitSelected | ( | ) |
A function set iterator of selected objects on first object.
Inits iteration through selected objects
References mySelCurIndex.
| int GLViewer_Context::insertObject | ( | GLViewer_Object * | object, |
| bool | display = false, |
||
| bool | isActive = true |
||
| ) |
Insert new object in context.
| theObject | - inserting object |
| display | - true if needs display object immediatly after inserting, else false |
| isActive | - true if needs inserting object in active list |
Inserts new object in context
| theObject | - object to be inserted |
| display | - true if needs display object immediatly after inserting, else false |
| isActive | - true if needs inserting object in active list |
References GLViewer_Viewer2d::activateDrawer(), myActiveObjects, myGLViewer2d, and myInactiveObjects.
| bool GLViewer_Context::isSelected | ( | GLViewer_Object * | theObj | ) |
Returns true if theObject is selected.
| theObj | - object to be checked |
References mySelectedObjects.
|
inline |
Returns update flag in highlighting technology.
| bool GLViewer_Context::MoreSelected | ( | ) |
Retuns true if iterator of selected objects is not set on last object.
Checks if iteration through selected objects may be continued
References mySelCurIndex, and NbSelected().
Main interactive method. Trace mouse in viewer window.
| x | - X coord of mouse cursor |
| y | - Y coord of mouse cursor \paran byCircle - true if needs round sensitive area around mouse cursor, else rectangle function search object rectangle which intersect with sensitive area and call object highlight method |
Hiilights objects under cursor
| x | - X coord of mouse cursor |
| y | - Y coord of mouse cursor |
| byCircle | - true if needs round sensitive area around mouse cursor, else rectangle function search object rectangle which intersect with sensitive area and call object highlight method |
References GLViewer_Viewer2d::activateDrawers(), GLViewer_Rect::contains(), GLViewer_Object::highlight(), GLViewer_Object::isSelectable(), myActiveObjects, myGLViewer2d, myHFlag, myLastPicked, myLastPickedChanged, myTolerance, myUpdateAll, myXhigh, myYhigh, GLViewer_Viewer2d::transPoint(), GLViewer_Object::unhighlight(), and GLViewer_Viewer2d::updateAll().
| int GLViewer_Context::NbSelected | ( | ) |
Returns number of objects in current selection.
References mySelectedObjects.
| bool GLViewer_Context::NextSelected | ( | ) |
Increment of iterator of selected objects.
Iterates to next selected object
References mySelCurIndex, and NbSelected().
| void GLViewer_Context::remSelected | ( | GLViewer_Object * | object, |
| bool | updateViewer | ||
| ) |
A function make theObject as unselected object and update viewer if updateViewer = true.
Unselects object, other selected objects are left as selected
| updateViewer | - if it is true, viewer must be updated |
References GLViewer_Viewer2d::activateDrawer(), myGLViewer2d, and mySelectedObjects.
| bool GLViewer_Context::replaceObject | ( | GLViewer_Object * | oldObject, |
| GLViewer_Object * | newObject | ||
| ) |
Replacing objects in context.
Function search active and incative objects
Replaces object in context
| oldObject | - object to be replaced |
| newObject | - object for replacing |
References myActiveObjects, and myInactiveObjects.
| int GLViewer_Context::Select | ( | bool | Append = false, |
| bool | byCircle = false |
||
| ) |
A function selecting already highlighting object by calling object method select
| Append | - true if new selection will be append to existing selection, false - another |
| byCircle | - true if needs round selection area in complex object |
Selects already highlighting object by calling object method select
| Append | - true if new selection will be append to existing selection, false - another |
| byCircle | - true if needs round selection area in complex object |
References GLViewer_Viewer2d::activateDrawer(), GLViewer_Viewer2d::activateDrawers(), GLViewer_Rect::contains(), GLViewer_Viewer::getActiveView(), GLViewer_ViewPort2d::getScale(), GLViewer_ViewFrame::getViewPort(), GLViewer_Object::isSelected(), myActiveObjects, myGLViewer2d, myHFlag, myLastPicked, mySelectedObjects, mySFlag, myTolerance, myUpdateAll, myXhigh, myYhigh, GLViewer_Object::select(), SS_GlobalChanged, SS_Invalid, SS_LocalChanged, SS_NoChanged, GLViewer_Object::unselect(), and GLViewer_Viewer2d::updateAll().
| int GLViewer_Context::SelectByRect | ( | const QRect & | theRect, |
| bool | Append = false |
||
| ) |
A function selecting objects on scene by rectangle
| theRect | - rectangle of selection |
| Append | - true if new selection will be append to existing selection, false - another function search object rectangle which intersect with theRect and call object select method |
Selects objects on scene by rectangle
| theRect | - rectangle of selection |
| Append | - true if new selection will be append to existing selection, false - another function search object rectangle which intersect with theRect and call object select method |
References GLViewer_Viewer2d::activateDrawers(), GLViewer_Viewer::getActiveView(), GLViewer_Viewer2d::getGLVRect(), GLViewer_Viewer2d::getQRect(), GLViewer_ViewPort2d::getScale(), GLViewer_ViewFrame::getViewPort(), myActiveObjects, myGLViewer2d, mySelectedObjects, mySFlag, myTolerance, myUpdateAll, myXhigh, myYhigh, SS_GlobalChanged, SS_Invalid, SS_NoChanged, and GLViewer_Viewer2d::updateAll().
| GLViewer_Object * GLViewer_Context::SelectedObject | ( | ) |
Returns object corresponding the current iterator of selected objects.
References mySelCurIndex, and mySelectedObjects.
|
inline |
Returns select color.
| bool GLViewer_Context::setActive | ( | GLViewer_Object * | theObject | ) |
A function installing to theObject active status.
Installs active status to object
| theObject |
References myActiveObjects, and myInactiveObjects.
| void GLViewer_Context::SetHighlightColor | ( | Quantity_NameOfColor | aCol | ) |
A function installing highlight color for all presentation (does not work)
Sets color of hilighting
| aCol | - new color of highlighting |
References myGLViewer2d, myHighlightColor, mySelectionColor, and GLViewer_Viewer2d::updateColors().
| bool GLViewer_Context::setInactive | ( | GLViewer_Object * | theObject | ) |
A function installing to theObject inactive status.
Installs inactive status to object
| theObject |
References myActiveObjects, and myInactiveObjects.
| void GLViewer_Context::setSelected | ( | GLViewer_Object * | object, |
| bool | updateViewer | ||
| ) |
A function make theObject as selected object and update viewer if updateViewer = true.
Selects object, other selected objects are left as selected
| updateViewer | - if it is true, viewer must be updated |
References GLViewer_Viewer2d::activateDrawer(), myActiveObjects, myGLViewer2d, and mySelectedObjects.
| void GLViewer_Context::SetSelectionColor | ( | Quantity_NameOfColor | aCol | ) |
A function installing select color for all presentation (does not work)
Sets color of selection
| aCol | - new color of selection |
References myGLViewer2d, myHighlightColor, mySelectionColor, and GLViewer_Viewer2d::updateColors().
|
inline |
A function installing tolerance in window pixels for highlghting and selection methods.
|
inline |
A function installing update flag in highlighting technology.
| void GLViewer_Context::updateScales | ( | GLfloat | scX, |
| GLfloat | scY | ||
| ) |
A function updating scales of all objects in context.
Updates scales of all objects in context
References myActiveObjects, and myInactiveObjects.
|
protected |
List of active object.
Active objects if consider in highlight and select methods
|
protected |
|
protected |
If = false - moveTo method is not any highlighting.
|
protected |
Color for highlight.
|
protected |
List of inactive object.
Active objects isn't consider in highlight and select methods
|
protected |
Highlighted object.
|
protected |
= true if after last MoveTo method calling highlight object is changed
|
protected |
Selected object iterator.
|
protected |
List of selected objects.
|
protected |
Color for selection.
|
protected |
If = false - select method is not any select.
|
protected |
Tolerance in window pixels for highlghting and selection methods.
|
protected |
Flag of updating viewer after highlight.
if = true, the viewer update all objects after change of highlight object, else - only highlight object
|
protected |
X coordinate of mouse cursor.
|
protected |
Y coordinate of mouse cursor.