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 )