29 #include <osg/ShapeDrawable>
31 #include "callbacks/WGEFunctorCallback.h"
33 #include "WROISphere.h"
34 #include "WGraphicsEngine.h"
42 sphereId( maxSphereId++ ),
43 m_position( position ),
44 m_originalPosition( position ),
48 m_color( osg::Vec4( 0.f, 1.f, 1.f, 0.4f ) ),
49 m_notColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 0.4f ) ),
50 m_lockPoint(
WVector3d( 0.0, 0.0, 0.0 ) ),
51 m_lockVector(
WVector3d( 1.0, 1.0, 1.0 ) ),
52 m_lockOnVector( false ),
59 boost::shared_ptr< WGEViewer > viewer = ge->getViewerByName(
"Main View" );
85 shape->setName( ss.str() );
149 std::stringstream ss;
150 ss <<
"ROISphere" <<
sphereId <<
"";
151 bool mouseMove =
false;
158 osg::Vec3 in( newPixelPos.x(), newPixelPos.y(), 0.0 );
161 WPosition newPixelWorldPos( world[0], world[1], world[2] );
165 oldPixelWorldPos = newPixelWorldPos;
171 oldPixelWorldPos =
WPosition( world[0], world[1], world[2] );
174 WVector3d moveVec = newPixelWorldPos - oldPixelWorldPos;
176 osg::ref_ptr<osg::Vec3Array> vertices = osg::ref_ptr<osg::Vec3Array>(
new osg::Vec3Array );
233 ( m_lockVector[0] * m_lockVector[0] + m_lockVector[1] * m_lockVector[1] + m_lockVector[2] * m_lockVector[2] ) * -1.0;