29 #include "../common/math/WLinearAlgebraFunctions.h"
30 #include "../graphicsEngine/WGEViewer.h"
31 #include "../graphicsEngine/WGEZoomTrackballManipulator.h"
32 #include "../graphicsEngine/WGraphicsEngine.h"
34 #include "WSelectionManager.h"
38 m_paintMode( PAINTMODE_NONE ),
39 m_textureOpacity( 1.0 ),
45 "Properties relating to the Axial,Coronal and Sagittal Slices." ) );
48 m_axialPos = m_sliceGroup->addProperty(
"Axial Position",
"Slice X position.", 0.0,
true );
49 m_coronalPos = m_sliceGroup->addProperty(
"Coronal Position",
"Slice Y position.", 0.0,
true );
50 m_sagittalPos = m_sliceGroup->addProperty(
"Sagittal Position",
"Slice Z position.", 0.0,
true );
53 m_axialShow = m_sliceGroup->addProperty(
"Show Axial Slice",
"Slice visible?",
true,
true );
54 m_coronalShow = m_sliceGroup->addProperty(
"Show Coronal Slice",
"Slice visible?",
true,
true );
55 m_sagittalShow = m_sliceGroup->addProperty(
"Show Sagittal Slice",
"Slice visible?",
true,
true );
58 m_axialPos->setMin( 0.0 );
61 m_axialPos->setMax( 0.0 );
87 boost::shared_ptr< WGEViewer > viewer;
89 viewer->getCamera()->getViewMatrix();
90 osg::Matrix rm = viewer->getCamera()->getViewMatrix();
93 for(
size_t i = 0; i < 4; ++i )
95 for(
size_t j = 0; j < 4; ++j )
97 rotMat( i, j ) = rm( i, j );
102 view = transformPosition3DWithMatrix4D( rotMat, v1 );
104 std::vector<float> dots( 8 );
106 dots[0] = dot( v2, view );
109 dots[1] = dot( v2, view );
112 dots[2] = dot( v2, view );
115 dots[3] = dot( v2, view );
118 dots[4] = dot( v2, view );
121 dots[5] = dot( v2, view );
124 dots[6] = dot( v2, view );
127 dots[7] = dot( v2, view );
131 for(
int i = 0; i < 8; ++i )