Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
e7bf7243
Commit
e7bf7243
authored
Aug 18, 2011
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] - navslices do not crash anymore if no sideviews are availabe
parent
cf0e6e22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
6 deletions
+32
-6
src/modules/navigationSlices/WMNavigationSlices.cpp
src/modules/navigationSlices/WMNavigationSlices.cpp
+32
-6
No files found.
src/modules/navigationSlices/WMNavigationSlices.cpp
View file @
e7bf7243
...
...
@@ -345,9 +345,23 @@ void WMNavigationSlices::moduleMain()
m_axialOutput
=
osg
::
ref_ptr
<
WGEGroupNode
>
(
new
WGEGroupNode
()
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_output
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Axial View"
)
->
getScene
()
->
insert
(
m_axialOutput
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Coronal View"
)
->
getScene
()
->
insert
(
m_coronalOutput
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Sagittal View"
)
->
getScene
()
->
insert
(
m_sagittalOutput
);
// add for side-views
boost
::
shared_ptr
<
WGEViewer
>
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Axial View"
);
if
(
v
)
{
v
->
getScene
()
->
insert
(
m_axialOutput
);
}
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Coronal View"
);
if
(
v
)
{
v
->
getScene
()
->
insert
(
m_coronalOutput
);
}
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Sagittal View"
);
if
(
v
)
{
v
->
getScene
()
->
insert
(
m_sagittalOutput
);
}
// disable the pick-coloring for the side views
m_axialOutput
->
getOrCreateStateSet
()
->
addUniform
(
new
osg
::
Uniform
(
"u_pickColorEnabled"
,
0.0
f
)
);
...
...
@@ -400,8 +414,20 @@ void WMNavigationSlices::moduleMain()
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
remove
(
m_output
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Axial View"
)
->
getScene
()
->
remove
(
m_axialOutput
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Coronal View"
)
->
getScene
()
->
remove
(
m_coronalOutput
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Sagittal View"
)
->
getScene
()
->
remove
(
m_sagittalOutput
);
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Axial View"
);
if
(
v
)
{
v
->
getScene
()
->
remove
(
m_axialOutput
);
}
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Coronal View"
);
if
(
v
)
{
v
->
getScene
()
->
remove
(
m_coronalOutput
);
}
v
=
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getViewerByName
(
"Sagittal View"
);
if
(
v
)
{
v
->
getScene
()
->
remove
(
m_sagittalOutput
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment