OpenWalnut
1.5.0dev
|
A sphere representing a region of interest. More...
#include <WROISphere.h>
Public Member Functions | |
WROISphere (WPosition position, float radius=5.0) | |
Yields sphere with desired center point and radius. More... | |
virtual | ~WROISphere () |
standard destructor More... | |
WPosition | getPosition () const |
getter More... | |
void | setPosition (WPosition position) |
setter More... | |
void | setPosition (float x, float y, float z) |
setter More... | |
void | setColor (osg::Vec4 color) |
Setter for standard color. More... | |
void | setNotColor (osg::Vec4 color) |
Setter for color in negated state. More... | |
void | redrawSphere () |
removes the old drawable from the osg geode and adds a new one at the current position and size More... | |
void | setLockX (bool value=true) |
sets the flag that allows or disallows movement along the x axis More... | |
void | setLockY (bool value=true) |
sets the flag that allows or disallows movement along the y axis More... | |
void | setLockZ (bool value=true) |
sets the flag that allows or disallows movement along the z axis More... | |
void | moveSphere (WVector3d offset) |
move the sphere with a given offset More... | |
void | setX (float x) |
setter More... | |
void | setY (float y) |
setter More... | |
void | setZ (float z) |
setter More... | |
void | setLockVector (WVector3d vector) |
setter More... | |
void | setLockOnVector (bool value=true) |
setter More... | |
Public Member Functions inherited from WROI | |
virtual | ~WROI () |
Need virtual destructor because of virtual function. More... | |
void | setNot (bool isNot=true) |
sets the NOT flag More... | |
bool | isNot () |
getter for NOT flag More... | |
bool | active () |
getter More... | |
void | setActive (bool active) |
setter More... | |
void | hide () |
hides the roi in the scene More... | |
void | unhide () |
unhides the roi in the scene More... | |
bool | dirty () |
Getter for modified flag. More... | |
void | setDirty () |
sets the dirty flag More... | |
std::shared_ptr< WProperties > | getProperties () |
Getter. More... | |
void | addROIChangeNotifier (std::shared_ptr< boost::function< void() > > notifier) |
Add a specified notifier to the list of default notifiers which get connected to each roi. More... | |
void | removeROIChangeNotifier (std::shared_ptr< boost::function< void() > > notifier) |
Remove a specified notifier from the list of default notifiers which get connected to each roi. More... | |
WPropBool | invertProperty () |
Invert property. More... | |
WPropBool | showProperty () |
The property for toggling ROI visibility. More... | |
WPropBool | activeProperty () |
The active property. More... | |
WPropString | nameProperty () |
The name property. More... | |
Private Member Functions | |
void | registerRedrawRequest (WPickInfo pickInfo) |
note that there was a pick More... | |
virtual void | updateGFX () |
updates the graphics More... | |
Private Attributes | |
size_t | sphereId |
Id of the current sphere. More... | |
WPosition | m_position |
The position of the sphere. More... | |
WPosition | m_originalPosition |
The position of the sphere when created, used for locking. More... | |
float | m_radius |
The radius of the sphere. More... | |
bool | m_isPicked |
Indicates whether the box is currently picked or not. More... | |
WPosition | m_pickedPosition |
Caches the old picked position to a allow for comparison. More... | |
WVector3d | m_pickNormal |
Store the normal that occured when the pick action was started. More... | |
WVector2d | m_oldPixelPosition |
Caches the old picked position to a allow for cmoparison. More... | |
WPickInfo | m_pickInfo |
Stores the pick information for potential redraw. More... | |
std::shared_ptr< WGEViewer > | m_viewer |
makes viewer available all over this class. More... | |
osg::Vec4 | m_color |
the color of the box More... | |
osg::Vec4 | m_notColor |
the color of the box when negated More... | |
WVector3d | m_lockPoint |
stores to point of origin of the lock vector More... | |
WVector3d | m_lockVector |
stores the lock vector More... | |
bool | m_lockOnVector |
flag indicatin wether the movement of the sphere is restricted More... | |
bool | m_lockX |
flag indicatin wether the movement of the sphere is restricted More... | |
bool | m_lockY |
flag indicatin wether the movement of the sphere is restricted More... | |
bool | m_lockZ |
flag indicatin wether the movement of the sphere is restricted More... | |
Static Private Attributes | |
static size_t | maxSphereId = 0 |
Current maximum boxId over all spheres. More... | |
Additional Inherited Members | |
Public Types inherited from WROI | |
typedef osg::ref_ptr< WROI > | RefPtr |
Ref Pointer type. More... | |
Protected Member Functions inherited from WROI | |
void | properties () |
initializes the roi's properties More... | |
void | propertyChanged () |
callback when a property gets changed More... | |
void | signalRoiChange () |
signals a roi change to all subscribers More... | |
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. More... | |
std::shared_ptr< WProperties > | m_properties |
the property object for the module More... | |
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 More... | |
WPropBool | m_active |
indicates if the roi is active More... | |
WPropBool | m_show |
indicates if the roi is visible in the scene More... | |
WPropBool | m_not |
indicates if the roi is negated More... | |
WPropString | m_name |
name of the ROI. More... | |
WPropDouble | m_threshold |
threshold for an arbitrary roi More... | |
WPropColor | m_color |
A color for painting the roi in the scene. More... | |
std::list< std::shared_ptr< boost::function< void() > > > | m_changeNotifiers |
The notifiers connected to added rois by default. More... | |
std::shared_mutex | m_associatedNotifiersLock |
Lock for associated notifiers set. More... | |
A sphere representing a region of interest.
Definition at line 43 of file WROISphere.h.
WROISphere::WROISphere | ( | WPosition | position, |
float | radius = 5.0 |
||
) |
Yields sphere with desired center point and radius.
position | position of the center of the sphere |
radius | radius of the sphere |
Definition at line 40 of file WROISphere.cpp.
References WGraphicsEngine::getGraphicsEngine(), WROI::m_dirty, WROI::m_pickHandler, m_viewer, redrawSphere(), registerRedrawRequest(), and updateGFX().
|
virtual |
standard destructor
Definition at line 90 of file WROISphere.cpp.
WPosition WROISphere::getPosition | ( | ) | const |
void WROISphere::moveSphere | ( | WVector3d | offset | ) |
move the sphere with a given offset
offset | the distance to move |
Definition at line 209 of file WROISphere.cpp.
References m_lockOnVector, m_lockPoint, m_lockVector, m_lockX, m_lockY, m_lockZ, and m_position.
Referenced by updateGFX().
void WROISphere::redrawSphere | ( | ) |
removes the old drawable from the osg geode and adds a new one at the current position and size
Definition at line 74 of file WROISphere.cpp.
References m_color, m_position, m_radius, and sphereId.
Referenced by setColor(), updateGFX(), and WROISphere().
|
private |
note that there was a pick
pickInfo | info from pick |
Definition at line 142 of file WROISphere.cpp.
References m_pickInfo.
Referenced by WROISphere().
void WROISphere::setColor | ( | osg::Vec4 | color | ) |
Setter for standard color.
color | The new color. |
Definition at line 257 of file WROISphere.cpp.
References m_color, and redrawSphere().
void WROISphere::setLockOnVector | ( | bool | value = true | ) |
setter
value | if the the movement of the sphere is restricted to a given vector |
Definition at line 274 of file WROISphere.cpp.
References m_lockOnVector.
void WROISphere::setLockVector | ( | WVector3d | vector | ) |
setter
vector | together witht he current position this sets line in space to which the movement of the sphere is restricted |
Definition at line 268 of file WROISphere.cpp.
References m_lockPoint, m_lockVector, and m_position.
void WROISphere::setLockX | ( | bool | value = true | ) |
sets the flag that allows or disallows movement along the x axis
value | the flag |
Definition at line 238 of file WROISphere.cpp.
References m_lockPoint, m_lockX, and m_position.
void WROISphere::setLockY | ( | bool | value = true | ) |
sets the flag that allows or disallows movement along the y axis
value | the flag |
Definition at line 244 of file WROISphere.cpp.
References m_lockPoint, m_lockY, and m_position.
void WROISphere::setLockZ | ( | bool | value = true | ) |
sets the flag that allows or disallows movement along the z axis
value | the flag |
Definition at line 250 of file WROISphere.cpp.
References m_lockPoint, m_lockZ, and m_position.
void WROISphere::setNotColor | ( | osg::Vec4 | color | ) |
Setter for color in negated state.
color | The new color. |
Definition at line 263 of file WROISphere.cpp.
References m_notColor.
void WROISphere::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
setter
x | |
y | |
z |
Definition at line 111 of file WROISphere.cpp.
References WROI::m_dirty, m_lockPoint, m_originalPosition, and m_position.
void WROISphere::setPosition | ( | WPosition | position | ) |
setter
position |
Definition at line 103 of file WROISphere.cpp.
References WROI::m_dirty, m_lockPoint, m_originalPosition, and m_position.
void WROISphere::setX | ( | float | x | ) |
setter
x | sets the x component of the position of this sphere |
Definition at line 120 of file WROISphere.cpp.
References WROI::m_dirty, m_originalPosition, and m_position.
void WROISphere::setY | ( | float | y | ) |
setter
y | sets the y component of the position of this sphere |
Definition at line 127 of file WROISphere.cpp.
References WROI::m_dirty, m_originalPosition, and m_position.
void WROISphere::setZ | ( | float | z | ) |
setter
z | sets the z component of the position of this sphere |
Definition at line 134 of file WROISphere.cpp.
References WROI::m_dirty, m_originalPosition, and m_position.
|
privatevirtual |
updates the graphics
Implements WROI.
Definition at line 147 of file WROISphere.cpp.
References WPickInfo::getModifierKey(), WPickInfo::getName(), WPickInfo::getPickPixel(), WROI::m_dirty, m_isPicked, m_oldPixelPosition, m_pickInfo, m_pickNormal, m_viewer, moveSphere(), redrawSphere(), WROI::signalRoiChange(), sphereId, WPickHandler::unpickString, wge::unprojectFromScreen(), WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::x(), and WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::y().
Referenced by WROISphere().
|
private |
the color of the box
Definition at line 177 of file WROISphere.h.
Referenced by redrawSphere(), and setColor().
|
private |
Indicates whether the box is currently picked or not.
Definition at line 165 of file WROISphere.h.
Referenced by updateGFX().
|
private |
flag indicatin wether the movement of the sphere is restricted
Definition at line 185 of file WROISphere.h.
Referenced by moveSphere(), and setLockOnVector().
|
private |
stores to point of origin of the lock vector
Definition at line 181 of file WROISphere.h.
Referenced by moveSphere(), setLockVector(), setLockX(), setLockY(), setLockZ(), and setPosition().
|
private |
stores the lock vector
Definition at line 183 of file WROISphere.h.
Referenced by moveSphere(), and setLockVector().
|
private |
flag indicatin wether the movement of the sphere is restricted
Definition at line 187 of file WROISphere.h.
Referenced by moveSphere(), and setLockX().
|
private |
flag indicatin wether the movement of the sphere is restricted
Definition at line 188 of file WROISphere.h.
Referenced by moveSphere(), and setLockY().
|
private |
flag indicatin wether the movement of the sphere is restricted
Definition at line 189 of file WROISphere.h.
Referenced by moveSphere(), and setLockZ().
|
private |
the color of the box when negated
Definition at line 179 of file WROISphere.h.
Referenced by setNotColor().
|
private |
Caches the old picked position to a allow for cmoparison.
Definition at line 171 of file WROISphere.h.
Referenced by updateGFX().
|
private |
The position of the sphere when created, used for locking.
Definition at line 161 of file WROISphere.h.
Referenced by setPosition(), setX(), setY(), and setZ().
|
private |
Caches the old picked position to a allow for comparison.
Definition at line 167 of file WROISphere.h.
|
private |
Stores the pick information for potential redraw.
Definition at line 173 of file WROISphere.h.
Referenced by registerRedrawRequest(), and updateGFX().
|
private |
Store the normal that occured when the pick action was started.
Definition at line 169 of file WROISphere.h.
Referenced by updateGFX().
|
private |
The position of the sphere.
Definition at line 159 of file WROISphere.h.
Referenced by getPosition(), moveSphere(), redrawSphere(), setLockVector(), setLockX(), setLockY(), setLockZ(), setPosition(), setX(), setY(), and setZ().
|
private |
The radius of the sphere.
Definition at line 163 of file WROISphere.h.
Referenced by redrawSphere().
|
private |
makes viewer available all over this class.
Definition at line 175 of file WROISphere.h.
Referenced by updateGFX(), and WROISphere().
|
staticprivate |
Current maximum boxId over all spheres.
Definition at line 156 of file WROISphere.h.
|
private |
Id of the current sphere.
Definition at line 157 of file WROISphere.h.
Referenced by redrawSphere(), and updateGFX().