OpenWalnut  1.4.0
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
WROISphere Class Reference

A sphere representing a region of interest. More...

#include <WROISphere.h>

+ Inheritance diagram for WROISphere:

List of all members.

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< WGEViewerm_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.

Detailed Description

A sphere representing a region of interest.

Definition at line 43 of file WROISphere.h.


Constructor & Destructor Documentation

WROISphere::WROISphere ( WPosition  position,
float  radius = 5.0 
)

Yields sphere with desired center point and radius.

Parameters:
positionposition of the center of the sphere
radiusradius 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.


Member Function Documentation

getter

Returns:
position

Definition at line 98 of file WROISphere.cpp.

References m_position.

move the sphere with a given offset

Parameters:
offsetthe 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().

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

Parameters:
pickInfoinfo 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.

Parameters:
colorThe new color.

Definition at line 257 of file WROISphere.cpp.

References m_color, and redrawSphere().

void WROISphere::setLockOnVector ( bool  value = true)

setter

Parameters:
valueif the the movement of the sphere is restricted to a given vector

Definition at line 274 of file WROISphere.cpp.

References m_lockOnVector.

setter

Parameters:
vectortogether 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

Parameters:
valuethe 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

Parameters:
valuethe 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

Parameters:
valuethe 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.

Parameters:
colorThe new color.

Definition at line 263 of file WROISphere.cpp.

References m_notColor.

void WROISphere::setPosition ( WPosition  position)

setter

Parameters:
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

Parameters:
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

Parameters:
xsets 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

Parameters:
ysets 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

Parameters:
zsets 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]

Member Data Documentation

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().

flag indicatin wether the movement of the sphere is restricted

Definition at line 185 of file WROISphere.h.

Referenced by moveSphere(), and setLockOnVector().

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().

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().

Caches the old picked position to a allow for cmoparison.

Definition at line 171 of file WROISphere.h.

Referenced by updateGFX().

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().

Caches the old picked position to a allow for comparison.

Definition at line 167 of file WROISphere.h.

Stores the pick information for potential redraw.

Definition at line 173 of file WROISphere.h.

Referenced by registerRedrawRequest(), and updateGFX().

Store the normal that occured when the pick action was started.

Definition at line 169 of file WROISphere.h.

Referenced by updateGFX().

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.

Id of the current sphere.

Definition at line 157 of file WROISphere.h.

Referenced by redrawSphere(), and updateGFX().


The documentation for this class was generated from the following files: