29 #include <osg/Texture3D>
31 #include "../common/math/WLinearAlgebraFunctions.h"
32 #include "../graphicsEngine/WGEViewer.h"
33 #include "../graphicsEngine/WGEZoomTrackballManipulator.h"
34 #include "../graphicsEngine/WGraphicsEngine.h"
35 #include "../graphicsEngine/WPickHandler.h"
37 #include "WSelectionManager.h"
41 m_paintMode( PAINTMODE_NONE ),
42 m_textureOpacity( 1.0 ),
48 "Properties relating to the Axial,Coronal and Sagittal Slices." ) );
82 std::shared_ptr< WGEViewer > viewer;
84 viewer->getCamera()->getViewMatrix();
85 osg::Matrix rm = viewer->getCamera()->getViewMatrix();
88 for(
size_t i = 0; i < 4; ++i )
90 for(
size_t j = 0; j < 4; ++j )
92 rotMat( i, j ) = rm( i, j );
97 view = transformPosition3DWithMatrix4D( rotMat, v1 );
99 std::vector<float> dots( 8 );
101 dots[0] = dot( v2, view );
104 dots[1] = dot( v2, view );
107 dots[2] = dot( v2, view );
110 dots[3] = dot( v2, view );
113 dots[4] = dot( v2, view );
116 dots[5] = dot( v2, view );
119 dots[6] = dot( v2, view );
122 dots[7] = dot( v2, view );
126 for(
int i = 0; i < 8; ++i )
141 osg::static_pointer_cast<WGEZoomTrackballManipulator>(
This class stores the position of the crossing navigation slices, which is also represented as crossh...
static WKernel * getRunningKernel()
Returns pointer to the currently running kernel.
std::shared_ptr< WGraphicsEngine > getGraphicsEngine() const
Returns pointer to currently running instance of graphics engine.
This only is a 3d double vector.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
boost::signals2::connection m_coronalUpdateConnection
The connection for the coronal property.
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 setShader(int shader)
setter for the shader index to be used with the custom texture
WPropDouble getPropAxialPos()
The property controlling the current axial position of slices.
boost::signals2::connection m_axialUpdateConnection
The connection for the axial property.
bool m_useTexture
flag indicating if this additional texture should be used.
WSelectionManager()
standard constructor
void setUseTexture(bool flag=true)
setter
int m_shader
index of the shader to use with the texture
WPropDouble getPropSagittalPos()
The property controlling the current sagittal position of slices.
int getFrontSector()
function returns an index of the direction one is currently looking at the scene
WProperties::SPtr m_sliceGroup
Contains the slice related properties.
void setPaintMode(WPaintMode mode)
setter for paint mode, also forwards it to the graphics engine
bool getUseTexture()
getter
WPropDouble m_sagittalPos
Sagittal slice position.
float getTextureOpacity()
getter
WPropDouble m_axialPos
Axial slice position.
WPropBool getPropAxialShow()
The property controlling the current axial visible-flag.
WPaintMode m_paintMode
stores the currently selected paint mode
WPropDouble getPropCoronalPos()
The property controlling the current coronal position of slices.
std::shared_ptr< WGridRegular3D > getGrid()
getter
std::shared_ptr< WCrosshair > getCrosshair()
Return the current position of the point selection.
WPropBool m_sagittalShow
Sagittal visible-flag.
float m_textureOpacity
the texture opacity
boost::signals2::connection m_sagittalUpdateConnection
The connection for the sagittal property.
std::shared_ptr< WGridRegular3D > m_textureGrid
stores a pointer to the grid to be used together with the texture
WPaintMode getPaintMode()
getter for paint mode
void setTextureOpacity(float value)
setter
WPropBool getPropCoronalShow()
The property controlling the current coronal visible-flag.
WPropBool getPropSagittalShow()
The property controlling the current sagittal visible-flag.
WPropBool m_coronalShow
Coronal visible-flag.
void setTexture(osg::ref_ptr< osg::Texture3D > texture, std::shared_ptr< WGridRegular3D >grid)
setter for texture and grid
void updateCrosshairPosition()
Updates the crosshair position.
WPropBool m_axialShow
Axial visible-flag.
std::shared_ptr< WCrosshair > m_crosshair
stores pointer to crosshair
WPropDouble m_coronalPos
Coronal slice position.
virtual ~WSelectionManager()
destructor