|
OpenWalnut
1.2.5
|
A box representing a region of interest. More...
#include <WROIBox.h>
Inheritance diagram for WROIBox:Classes | |
| class | ROIBoxNodeCallback |
| Node callback to handle updates properly. More... | |
Public Member Functions | |
| WROIBox (WPosition minPos, WPosition maxPos) | |
| Yields box with desired extremal points minPos and maxPos. | |
| WPosition | getMinPos () const |
| Get the corner of the box that has minimal x, y and z values. | |
| WPosition | getMaxPos () const |
| Get the corner of the box that has maximal x, y and z values. | |
| void | setColor (osg::Vec4 color) |
| Setter for standard color. | |
| void | setNotColor (osg::Vec4 color) |
| Setter for color in negated state. | |
Public Member Functions inherited from WROI | |
| virtual | ~WROI () |
| Need virtual destructor because of virtual function. | |
| void | setNot (bool isNot=true) |
| sets the NOT flag | |
| bool | isNot () |
| getter for NOT flag | |
| bool | active () |
| getter | |
| void | setActive (bool active) |
| setter | |
| void | hide () |
| hides the roi in the scene | |
| void | unhide () |
| unhides the roi in the scene | |
| bool | dirty () |
| Getter for modified flag. | |
| void | setDirty () |
| sets the dirty flag | |
| boost::shared_ptr< WProperties > | getProperties () |
| Getter. | |
| void | addROIChangeNotifier (boost::shared_ptr< boost::function< void() > > notifier) |
| Add a specified notifier to the list of default notifiers which get connected to each roi. | |
| void | removeROIChangeNotifier (boost::shared_ptr< boost::function< void() > > notifier) |
| Remove a specified notifier from the list of default notifiers which get connected to each roi. | |
Private Member Functions | |
| void | registerRedrawRequest (WPickInfo pickInfo) |
| note that there was a pick | |
| virtual void | updateGFX () |
| updates the graphics | |
Private Attributes | |
| size_t | boxId |
| Id of the current box. | |
| WPosition | m_minPos |
| The minimum position of the box. | |
| WPosition | m_maxPos |
| The maximum position of the box. | |
| bool | m_isPicked |
| Indicates whether the box is currently picked or not. | |
| WPosition | m_pickedPosition |
| Caches the old picked position to a allow for cmoparison. | |
| WVector3d | m_pickNormal |
| Store the normal that occured when the pick action was started. | |
| WVector2d | m_oldPixelPosition |
| Caches the old picked position to a allow for cmoparison. | |
| boost::shared_mutex | m_updateLock |
| Lock to prevent concurrent threads trying to update the osg node. | |
| osg::ref_ptr< osg::Geometry > | m_surfaceGeometry |
| store this pointer for use in updates | |
| WPickInfo | m_pickInfo |
| Stores the pick information for potential redraw. | |
| boost::shared_ptr< WGEViewer > | m_viewer |
| makes viewer available all over this class. | |
| osg::Vec4 | m_color |
| the color of the box | |
| osg::Vec4 | m_notColor |
| the color of the box when negated | |
Static Private Attributes | |
| static size_t | maxBoxId = 0 |
| Current maximum boxId over all boxes. | |
Additional Inherited Members | |
Protected Member Functions inherited from WROI | |
| void | properties () |
| initializes the roi's properties | |
| void | propertyChanged () |
| callback when a property gets changed | |
| void | signalRoiChange () |
| signals a roi change to all subscribers | |
Protected Attributes inherited from WROI | |
| osg::ref_ptr< WPickHandler > | m_pickHandler |
| A pointer to the pick handler used to get gui events for moving the box. | |
| boost::shared_ptr< WProperties > | m_properties |
| the property object for the module | |
| WPropBool | m_dirty |
| dirty flag, indicating the graphics needs updating, it is no longer used for bitfield updating since these customers get the update notification via callback | |
| WPropBool | m_active |
| indicates if the roi is active | |
| WPropBool | m_show |
| indicates if the roi is visible in the scene | |
| WPropBool | m_not |
| indicates if the roi is negated | |
| WPropDouble | m_threshold |
| threshold for an arbitrary roi | |
| std::list< boost::shared_ptr < boost::function< void() > > > | m_changeNotifiers |
| The notifiers connected to added rois by default. | |
| boost::shared_mutex | m_associatedNotifiersLock |
| Lock for associated notifiers set. | |
Yields box with desired extremal points minPos and maxPos.
| minPos | Left, lower, front corner. Minimal x, y and z coordinates. |
| maxPos | Right, upper, back corner. Maximal x, y and z coordinates. |
Definition at line 113 of file WROIBox.cpp.
References boxId, WGraphicsEngine::getGraphicsEngine(), m_maxPos, m_minPos, WROI::m_not, WROI::m_pickHandler, m_surfaceGeometry, m_viewer, registerRedrawRequest(), and WROI::setDirty().
| WPosition WROIBox::getMaxPos | ( | ) | const |
Get the corner of the box that has maximal x, y and z values.
Definition at line 201 of file WROIBox.cpp.
References m_maxPos.
| WPosition WROIBox::getMinPos | ( | ) | const |
Get the corner of the box that has minimal x, y and z values.
Definition at line 196 of file WROIBox.cpp.
References m_minPos.
|
private |
note that there was a pick
| pickInfo | info from pick |
Definition at line 206 of file WROIBox.cpp.
References m_pickInfo, and m_updateLock.
Referenced by WROIBox().
| void WROIBox::setColor | ( | osg::Vec4 | color | ) |
Setter for standard color.
| color | The new color. |
Definition at line 338 of file WROIBox.cpp.
References m_color.
| void WROIBox::setNotColor | ( | osg::Vec4 | color | ) |
Setter for color in negated state.
| color | The new color. |
Definition at line 343 of file WROIBox.cpp.
References m_notColor.
|
privatevirtual |
updates the graphics
Implements WROI.
Definition at line 216 of file WROIBox.cpp.
References boxId, WPickInfo::getModifierKey(), WPickInfo::getName(), WPickInfo::getPickNormal(), WPickInfo::getPickPixel(), m_color, WROI::m_dirty, m_isPicked, m_maxPos, m_minPos, WROI::m_not, m_notColor, m_oldPixelPosition, m_pickInfo, m_pickNormal, m_surfaceGeometry, m_updateLock, m_viewer, WROI::setDirty(), WROI::signalRoiChange(), wge::unprojectFromScreen(), WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::x(), and WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::y().
Referenced by WROIBox::ROIBoxNodeCallback::operator()().
|
private |
Id of the current box.
Definition at line 84 of file WROIBox.h.
Referenced by updateGFX(), and WROIBox().
|
private |
the color of the box
Reimplemented from WROI.
Definition at line 99 of file WROIBox.h.
Referenced by setColor(), and updateGFX().
|
private |
Indicates whether the box is currently picked or not.
Definition at line 88 of file WROIBox.h.
Referenced by updateGFX().
|
private |
The maximum position of the box.
Definition at line 87 of file WROIBox.h.
Referenced by getMaxPos(), updateGFX(), and WROIBox().
|
private |
The minimum position of the box.
Definition at line 86 of file WROIBox.h.
Referenced by getMinPos(), updateGFX(), and WROIBox().
|
private |
the color of the box when negated
Definition at line 101 of file WROIBox.h.
Referenced by setNotColor(), and updateGFX().
|
private |
Caches the old picked position to a allow for cmoparison.
Definition at line 91 of file WROIBox.h.
Referenced by updateGFX().
|
private |
|
private |
Stores the pick information for potential redraw.
Definition at line 95 of file WROIBox.h.
Referenced by registerRedrawRequest(), and updateGFX().
|
private |
Store the normal that occured when the pick action was started.
Definition at line 90 of file WROIBox.h.
Referenced by updateGFX().
|
private |
store this pointer for use in updates
Definition at line 93 of file WROIBox.h.
Referenced by updateGFX(), and WROIBox().
|
private |
Lock to prevent concurrent threads trying to update the osg node.
Definition at line 92 of file WROIBox.h.
Referenced by registerRedrawRequest(), and updateGFX().
|
private |
makes viewer available all over this class.
Definition at line 97 of file WROIBox.h.
Referenced by updateGFX(), and WROIBox().
|
staticprivate |
1.8.1