29 #include "../common/math/WLinearAlgebraFunctions.h"
30 #include "../graphicsEngine/WGEViewer.h"
31 #include "../graphicsEngine/WGEZoomTrackballManipulator.h"
32 #include "../graphicsEngine/WGraphicsEngine.h"
33 #include "../graphicsEngine/WPickHandler.h"
36 #include "WSelectionManager.h"
40 m_paintMode( PAINTMODE_NONE ),
41 m_textureOpacity( 1.0 ),
47 "Properties relating to the Axial,Coronal and Sagittal Slices." ) );
50 m_axialPos = m_sliceGroup->addProperty(
"Axial Position",
"Slice X position.", 0.0,
true );
51 m_coronalPos = m_sliceGroup->addProperty(
"Coronal Position",
"Slice Y position.", 0.0,
true );
52 m_sagittalPos = m_sliceGroup->addProperty(
"Sagittal Position",
"Slice Z position.", 0.0,
true );
55 m_axialShow = m_sliceGroup->addProperty(
"Show Axial Slice",
"Slice visible?",
true,
true );
56 m_coronalShow = m_sliceGroup->addProperty(
"Show Coronal Slice",
"Slice visible?",
true,
true );
57 m_sagittalShow = m_sliceGroup->addProperty(
"Show Sagittal Slice",
"Slice visible?",
true,
true );
81 boost::shared_ptr< WGEViewer > viewer;
83 viewer->getCamera()->getViewMatrix();
84 osg::Matrix rm = viewer->getCamera()->getViewMatrix();
87 for(
size_t i = 0; i < 4; ++i )
89 for(
size_t j = 0; j < 4; ++j )
91 rotMat( i, j ) = rm( i, j );
96 view = transformPosition3DWithMatrix4D( rotMat, v1 );
98 std::vector<float> dots( 8 );
100 dots[0] = dot( v2, view );
103 dots[1] = dot( v2, view );
106 dots[2] = dot( v2, view );
109 dots[3] = dot( v2, view );
112 dots[4] = dot( v2, view );
115 dots[5] = dot( v2, view );
118 dots[6] = dot( v2, view );
121 dots[7] = dot( v2, view );
125 for(
int i = 0; i < 8; ++i )
int getFrontSector()
function returns an index of the direction one is currently looking at the scene
WPropDouble m_coronalPos
Coronal slice position.
bool m_useTexture
flag indicating if this additional texture should be used.
static WKernel * getRunningKernel()
Returns pointer to the currently running kernel.
void setPaintMode(WPaintMode mode)
setter for paint mode, also forwards it to the graphics engine
float m_textureOpacity
the texture opacity
boost::shared_ptr< WCrosshair > m_crosshair
stores pointer to crosshair
WSelectionManager()
standard constructor
boost::shared_ptr< WGridRegular3D > m_textureGrid
stores a pointer to the grid to be used together with the texture
boost::signals2::connection m_sagittalUpdateConnection
The connection for the sagittal property.
void setShader(int shader)
setter for the shader index to be used with the custom texture
boost::signals2::connection m_coronalUpdateConnection
The connection for the coronal property.
WPropBool getPropSagittalShow()
The property controlling the current sagittal visible-flag.
This only is a 3d double vector.
WProperties::SPtr m_sliceGroup
Contains the slice related properties.
osg::ref_ptr< osg::Texture3D > m_texture
stores a pointer to a texture 3d, this is used to provide a faster texture generation process than cr...
void setUseTexture(bool flag=true)
setter
WPaintMode m_paintMode
stores the currently selected paint mode
virtual ~WSelectionManager()
destructor
int m_shader
index of the shader to use with the texture
WPropBool m_axialShow
Axial visible-flag.
WPropDouble getPropAxialPos()
The property controlling the current axial position of slices.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
void updateCrosshairPosition()
Updates the crosshair position.
WPropDouble m_sagittalPos
Sagittal slice position.
float getTextureOpacity()
getter
WPropDouble getPropCoronalPos()
The property controlling the current coronal position of slices.
boost::signals2::connection m_axialUpdateConnection
The connection for the axial property.
WPropBool m_coronalShow
Coronal visible-flag.
This class stores the position of the crossing navigation slices, which is also represented as crossh...
WPropBool m_sagittalShow
Sagittal visible-flag.
bool getUseTexture()
getter
WPropDouble m_axialPos
Axial slice position.
WPropBool getPropAxialShow()
The property controlling the current axial visible-flag.
WPropBool getPropCoronalShow()
The property controlling the current coronal visible-flag.
boost::shared_ptr< WGraphicsEngine > getGraphicsEngine() const
Returns pointer to currently running instance of graphics engine.
WPropDouble getPropSagittalPos()
The property controlling the current sagittal position of slices.
boost::shared_ptr< WCrosshair > getCrosshair()
Return the current position of the point selection.
WPaintMode getPaintMode()
getter for paint mode
void setTextureOpacity(float value)
setter
New OSG manipulator: TrackballManipulator with added mouse wheel zoom.
void setTexture(osg::ref_ptr< osg::Texture3D > texture, boost::shared_ptr< WGridRegular3D >grid)
setter for texture and grid
boost::shared_ptr< WGridRegular3D > getGrid()
getter