32 #include <boost/thread.hpp>
35 #include <osg/Geometry>
37 #include "WPickHandler.h"
38 #include "shaders/WGEShader.h"
159 virtual void operator()( osg::Node* node, osg::NodeVisitor* nv )
161 osg::ref_ptr< WROIBox > module =
static_cast< WROIBox*
> ( node->getUserData() );
166 traverse( node, nv );
WPropGroup m_propGrp
Group for box specific props.
static size_t maxBoxId
Current maximum boxId over all boxes.
void updateColor(osg::Vec4 color)
Set new color of the box in the geometry.
WPropPosition getMinPosProperty()
Get the corner of the box that has minimal x, y and z values.
Superclass for different ROI (region of interest) types.
boost::shared_mutex m_updateLock
Lock to prevent concurrent threads trying to update the osg node.
void setNotColor(osg::Vec4 color)
Setter for color in negated state.
WPickInfo m_pickInfo
Stores the pick information for potential redraw.
WPosition m_pickedPosition
Caches the old picked position to a allow for cmoparison.
osg::Vec4 m_notColor
the color of the box when negated
This only is a 3d double vector.
WPosition getMaxPos() const
Get the corner of the box that has maximal x, y and z values.
WPosition getMinPos() const
Get the corner of the box that has minimal x, y and z values.
int16_t m_oldScrollWheel
caches scroll wheel value
virtual void updateGFX()
updates the graphics
WVector3d m_pickNormal
Store the normal that occured when the pick action was started.
WPropPosition getMaxPosProperty()
Get the corner of the box that has maximal x, y and z values.
osg::ref_ptr< WGEShader > RefPtr
Convenience typedef for an osg::ref_ptr.
A box representing a region of interest.
boost::shared_ptr< WGEViewer > m_viewer
makes viewer available all over this class.
WROIBox(WPosition minPos, WPosition maxPos)
Yields box with desired extremal points minPos and maxPos.
A fixed size matrix class.
WVector2d m_oldPixelPosition
Caches the old picked position to a allow for cmoparison.
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
operator ()
void boxPropertiesChanged(boost::shared_ptr< WPropertyBase > property)
Called when the specified property has changed.
bool m_isPicked
Indicates whether the box is currently picked or not.
Class for managing one view to the scene.
void registerRedrawRequest(WPickInfo pickInfo)
note that there was a pick
WPropPosition m_minPos
The minimum position of the box.
Encapsulates info for pick action.
Node callback to handle updates properly.
bool m_needVertexUpdate
If true, the box' vertex data is updated.
WGEShader::RefPtr m_lightShader
Shader for proper lighting.
osg::Vec4 m_color
the color of the box
void setColor(osg::Vec4 color)
Setter for standard color.
size_t boxId
Id of the current box.
WPropPosition m_maxPos
The maximum position of the box.
osg::ref_ptr< osg::Geometry > m_surfaceGeometry
store this pointer for use in updates