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