OpenWalnut  1.4.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
WROIBox Class Reference

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

#include <WROIBox.h>

+ Inheritance diagram for WROIBox:

List of all members.

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.
WPropPosition getMinPosProperty ()
 Get the corner of the box that has minimal x, y and z values.
WPropPosition getMaxPosProperty ()
 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.

Private Member Functions

void registerRedrawRequest (WPickInfo pickInfo)
 note that there was a pick
virtual void updateGFX ()
 updates the graphics
void boxPropertiesChanged (boost::shared_ptr< WPropertyBase > property)
 Called when the specified property has changed.
void updateColor (osg::Vec4 color)
 Set new color of the box in the geometry.

Private Attributes

size_t boxId
 Id of the current box.
WPropGroup m_propGrp
 Group for box specific props.
WPropPosition m_minPos
 The minimum position of the box.
WPropPosition m_maxPos
 The maximum position of the box.
WGEShader::RefPtr m_lightShader
 Shader for proper lighting.
bool m_needVertexUpdate
 If true, the box' vertex data is updated.
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.
int16_t m_oldScrollWheel
 caches scroll wheel value
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< 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

Static Private Attributes

static size_t maxBoxId = 0
 Current maximum boxId over all boxes.

Detailed Description

A box representing a region of interest.

Definition at line 45 of file WROIBox.h.


Constructor & Destructor Documentation

WROIBox::WROIBox ( WPosition  minPos,
WPosition  maxPos 
)

Yields box with desired extremal points minPos and maxPos.

Parameters:
minPosLeft, lower, front corner. Minimal x, y and z coordinates.
maxPosRight, upper, back corner. Maximal x, y and z coordinates.

Definition at line 43 of file WROIBox.cpp.

References boxId, boxPropertiesChanged(), WGraphicsEngine::getGraphicsEngine(), m_lightShader, m_maxPos, m_minPos, m_needVertexUpdate, WROI::m_not, WROI::m_pickHandler, WROI::m_properties, m_propGrp, m_viewer, registerRedrawRequest(), and WROI::setDirty().


Member Function Documentation

void WROIBox::boxPropertiesChanged ( boost::shared_ptr< WPropertyBase property) [private]

Called when the specified property has changed.

Used to update the ROI when modifying box properties.

Parameters:
propertythe property

Definition at line 133 of file WROIBox.cpp.

References m_needVertexUpdate.

Referenced by WROIBox().

Get the corner of the box that has maximal x, y and z values.

Returns:
the corner position

Definition at line 108 of file WROIBox.cpp.

References m_maxPos.

Referenced by updateGFX().

WPropPosition WROIBox::getMaxPosProperty ( )

Get the corner of the box that has maximal x, y and z values.

Returns:
the corner position

Definition at line 118 of file WROIBox.cpp.

References m_maxPos.

Get the corner of the box that has minimal x, y and z values.

Returns:
the corner position

Definition at line 103 of file WROIBox.cpp.

References m_minPos.

Referenced by updateGFX().

WPropPosition WROIBox::getMinPosProperty ( )

Get the corner of the box that has minimal x, y and z values.

Returns:
the corner position

Definition at line 113 of file WROIBox.cpp.

References m_minPos.

void WROIBox::registerRedrawRequest ( WPickInfo  pickInfo) [private]

note that there was a pick

Parameters:
pickInfoinfo from pick

Definition at line 123 of file WROIBox.cpp.

References m_pickInfo, and m_updateLock.

Referenced by WROIBox().

void WROIBox::setColor ( osg::Vec4  color)

Setter for standard color.

Parameters:
colorThe new color.

Definition at line 285 of file WROIBox.cpp.

References m_color.

void WROIBox::setNotColor ( osg::Vec4  color)

Setter for color in negated state.

Parameters:
colorThe new color.

Definition at line 290 of file WROIBox.cpp.

References m_notColor.

void WROIBox::updateColor ( osg::Vec4  color) [private]

Set new color of the box in the geometry.

Parameters:
colorthe new color

Definition at line 295 of file WROIBox.cpp.

References m_surfaceGeometry.

Referenced by updateGFX().

void WROIBox::updateGFX ( ) [private, virtual]

Member Data Documentation

Id of the current box.

Definition at line 100 of file WROIBox.h.

Referenced by updateGFX(), and WROIBox().

osg::Vec4 WROIBox::m_color [private]

the color of the box

Reimplemented from WROI.

Definition at line 130 of file WROIBox.h.

Referenced by setColor(), and updateGFX().

bool WROIBox::m_isPicked [private]

Indicates whether the box is currently picked or not.

Definition at line 118 of file WROIBox.h.

Referenced by updateGFX().

Shader for proper lighting.

Definition at line 112 of file WROIBox.h.

Referenced by WROIBox().

WPropPosition WROIBox::m_maxPos [private]

The maximum position of the box.

Definition at line 107 of file WROIBox.h.

Referenced by getMaxPos(), getMaxPosProperty(), updateGFX(), and WROIBox().

WPropPosition WROIBox::m_minPos [private]

The minimum position of the box.

Definition at line 106 of file WROIBox.h.

Referenced by getMinPos(), getMinPosProperty(), updateGFX(), and WROIBox().

If true, the box' vertex data is updated.

Definition at line 117 of file WROIBox.h.

Referenced by boxPropertiesChanged(), updateGFX(), and WROIBox().

osg::Vec4 WROIBox::m_notColor [private]

the color of the box when negated

Definition at line 132 of file WROIBox.h.

Referenced by setNotColor(), and updateGFX().

Caches the old picked position to a allow for cmoparison.

Definition at line 121 of file WROIBox.h.

Referenced by updateGFX().

int16_t WROIBox::m_oldScrollWheel [private]

caches scroll wheel value

Definition at line 122 of file WROIBox.h.

Referenced by updateGFX().

Caches the old picked position to a allow for cmoparison.

Definition at line 119 of file WROIBox.h.

Stores the pick information for potential redraw.

Definition at line 126 of file WROIBox.h.

Referenced by registerRedrawRequest(), and updateGFX().

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

Definition at line 120 of file WROIBox.h.

Referenced by updateGFX().

WPropGroup WROIBox::m_propGrp [private]

Group for box specific props.

Definition at line 105 of file WROIBox.h.

Referenced by WROIBox().

osg::ref_ptr< osg::Geometry > WROIBox::m_surfaceGeometry [private]

store this pointer for use in updates

Definition at line 124 of file WROIBox.h.

Referenced by updateColor(), and updateGFX().

boost::shared_mutex WROIBox::m_updateLock [private]

Lock to prevent concurrent threads trying to update the osg node.

Definition at line 123 of file WROIBox.h.

Referenced by registerRedrawRequest(), and updateGFX().

boost::shared_ptr< WGEViewer > WROIBox::m_viewer [private]

makes viewer available all over this class.

Definition at line 128 of file WROIBox.h.

Referenced by updateGFX(), and WROIBox().

size_t WROIBox::maxBoxId = 0 [static, private]

Current maximum boxId over all boxes.

Definition at line 99 of file WROIBox.h.


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