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 );
60 m_axialPos->setMin( 0.0 );
63 m_axialPos->setMax( 0.0 );
89 boost::shared_ptr< WGEViewer > viewer;
91 viewer->getCamera()->getViewMatrix();
92 osg::Matrix rm = viewer->getCamera()->getViewMatrix();
95 for(
size_t i = 0; i < 4; ++i )
97 for(
size_t j = 0; j < 4; ++j )
99 rotMat( i, j ) = rm( i, j );
104 view = transformPosition3DWithMatrix4D( rotMat, v1 );
106 std::vector<float> dots( 8 );
108 dots[0] = dot( v2, view );
111 dots[1] = dot( v2, view );
114 dots[2] = dot( v2, view );
117 dots[3] = dot( v2, view );
120 dots[4] = dot( v2, view );
123 dots[5] = dot( v2, view );
126 dots[6] = dot( v2, view );
129 dots[7] = dot( v2, view );
133 for(
int i = 0; i < 8; ++i )