OpenWalnut
1.4.0
|
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. | |
virtual | ~WROISphere () |
standard destructor | |
WPosition | getPosition () const |
getter | |
void | setPosition (WPosition position) |
setter | |
void | setPosition (float x, float y, float z) |
setter | |
void | setColor (osg::Vec4 color) |
Setter for standard color. | |
void | setNotColor (osg::Vec4 color) |
Setter for color in negated state. | |
void | redrawSphere () |
removes the old drawable from the osg geode and adds a new one at the current position and size | |
void | setLockX (bool value=true) |
sets the flag that allows or disallows movement along the x axis | |
void | setLockY (bool value=true) |
sets the flag that allows or disallows movement along the y axis | |
void | setLockZ (bool value=true) |
sets the flag that allows or disallows movement along the z axis | |
void | moveSphere (WVector3d offset) |
move the sphere with a given offset | |
void | setX (float x) |
setter | |
void | setY (float y) |
setter | |
void | setZ (float z) |
setter | |
void | setLockVector (WVector3d vector) |
setter | |
void | setLockOnVector (bool value=true) |
setter | |
Private Member Functions | |
void | registerRedrawRequest (WPickInfo pickInfo) |
note that there was a pick | |
virtual void | updateGFX () |
updates the graphics | |
Private Attributes | |
size_t | sphereId |
Id of the current sphere. | |
WPosition | m_position |
The position of the sphere. | |
WPosition | m_originalPosition |
The position of the sphere when created, used for locking. | |
float | m_radius |
The radius of the sphere. | |
bool | m_isPicked |
Indicates whether the box is currently picked or not. | |
WPosition | m_pickedPosition |
Caches the old picked position to a allow for comparison. | |
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. | |
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 | |
WVector3d | m_lockPoint |
stores to point of origin of the lock vector | |
WVector3d | m_lockVector |
stores the lock vector | |
bool | m_lockOnVector |
flag indicatin wether the movement of the sphere is restricted | |
bool | m_lockX |
flag indicatin wether the movement of the sphere is restricted | |
bool | m_lockY |
flag indicatin wether the movement of the sphere is restricted | |
bool | m_lockZ |
flag indicatin wether the movement of the sphere is restricted | |
Static Private Attributes | |
static size_t | maxSphereId = 0 |
Current maximum boxId over all spheres. |
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().
WROISphere::~WROISphere | ( | ) | [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().
void WROISphere::registerRedrawRequest | ( | WPickInfo | pickInfo | ) | [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 | ( | 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::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::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.
void WROISphere::updateGFX | ( | ) | [private, virtual] |
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, wge::unprojectFromScreen(), WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::x(), and WMatrixFixed< ValueT, Rows, Cols, ValueStoreT >::y().
Referenced by WROISphere().
osg::Vec4 WROISphere::m_color [private] |
the color of the box
Reimplemented from WROI.
Definition at line 177 of file WROISphere.h.
Referenced by redrawSphere(), and setColor().
bool WROISphere::m_isPicked [private] |
Indicates whether the box is currently picked or not.
Definition at line 165 of file WROISphere.h.
Referenced by updateGFX().
bool WROISphere::m_lockOnVector [private] |
flag indicatin wether the movement of the sphere is restricted
Definition at line 185 of file WROISphere.h.
Referenced by moveSphere(), and setLockOnVector().
WVector3d WROISphere::m_lockPoint [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().
WVector3d WROISphere::m_lockVector [private] |
stores the lock vector
Definition at line 183 of file WROISphere.h.
Referenced by moveSphere(), and setLockVector().
bool WROISphere::m_lockX [private] |
flag indicatin wether the movement of the sphere is restricted
Definition at line 187 of file WROISphere.h.
Referenced by moveSphere(), and setLockX().
bool WROISphere::m_lockY [private] |
flag indicatin wether the movement of the sphere is restricted
Definition at line 188 of file WROISphere.h.
Referenced by moveSphere(), and setLockY().
bool WROISphere::m_lockZ [private] |
flag indicatin wether the movement of the sphere is restricted
Definition at line 189 of file WROISphere.h.
Referenced by moveSphere(), and setLockZ().
osg::Vec4 WROISphere::m_notColor [private] |
the color of the box when negated
Definition at line 179 of file WROISphere.h.
Referenced by setNotColor().
WVector2d WROISphere::m_oldPixelPosition [private] |
Caches the old picked position to a allow for cmoparison.
Definition at line 171 of file WROISphere.h.
Referenced by updateGFX().
WPosition WROISphere::m_originalPosition [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().
WPosition WROISphere::m_pickedPosition [private] |
Caches the old picked position to a allow for comparison.
Definition at line 167 of file WROISphere.h.
WPickInfo WROISphere::m_pickInfo [private] |
Stores the pick information for potential redraw.
Definition at line 173 of file WROISphere.h.
Referenced by registerRedrawRequest(), and updateGFX().
WVector3d WROISphere::m_pickNormal [private] |
Store the normal that occured when the pick action was started.
Definition at line 169 of file WROISphere.h.
Referenced by updateGFX().
WPosition WROISphere::m_position [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().
float WROISphere::m_radius [private] |
The radius of the sphere.
Definition at line 163 of file WROISphere.h.
Referenced by redrawSphere().
boost::shared_ptr< WGEViewer > WROISphere::m_viewer [private] |
makes viewer available all over this class.
Definition at line 175 of file WROISphere.h.
Referenced by updateGFX(), and WROISphere().
size_t WROISphere::maxSphereId = 0 [static, private] |
Current maximum boxId over all spheres.
Definition at line 156 of file WROISphere.h.
size_t WROISphere::sphereId [private] |
Id of the current sphere.
Definition at line 157 of file WROISphere.h.
Referenced by redrawSphere(), and updateGFX().