Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
46dae2bb
Commit
46dae2bb
authored
Aug 11, 2010
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CHANGE] - checking selection change not really needed -> removed.
parent
b9ea66d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
48 deletions
+31
-48
src/modules/coordinateHUD/WMCoordinateHUD.cpp
src/modules/coordinateHUD/WMCoordinateHUD.cpp
+31
-48
No files found.
src/modules/coordinateHUD/WMCoordinateHUD.cpp
View file @
46dae2bb
...
...
@@ -91,7 +91,7 @@ void WMCoordinateHUD::properties()
m_possibleSelections
->
addItem
(
"colored cube"
,
"colorfull coordinate cube"
,
option_3_xpm
);
m_aSingleSelection
=
m_properties
->
addProperty
(
"HUD structure"
,
"Which look should the coordinateHUD have?"
,
m_possibleSelections
->
getSelector
First
(
),
"Which look should the coordinateHUD have?"
,
m_possibleSelections
->
getSelector
(
2
),
m_propCondition
);
WPropertyHelper
::
PC_SELECTONLYONE
::
addTo
(
m_aSingleSelection
);
...
...
@@ -108,6 +108,7 @@ void WMCoordinateHUD::moduleMain()
m_rootNode
=
new
WGEManagedGroupNode
(
m_active
);
m_rootNode
->
setName
(
"coordHUDNode"
);
m_shader
->
apply
(
m_rootNode
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_rootNode
);
// let the main loop awake if the properties changed.
debugLog
()
<<
"Entering moduleMain()"
;
...
...
@@ -118,16 +119,30 @@ void WMCoordinateHUD::moduleMain()
ready
();
debugLog
()
<<
"Module is now ready."
;
// default visualisation
buildColorAxis
();
m_rootNode
->
insert
(
m_geode
);
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_rootNode
);
//buildCaption();
//m_rootNode->insert( m_txtGeode );
//WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_txtGeode );
while
(
!
m_shutdownFlag
()
)
{
WItemSelector
s
=
m_aSingleSelection
->
get
(
true
);
debugLog
()
<<
"New mode selected: "
<<
s
.
at
(
0
).
name
;
if
(
s
.
at
(
0
).
name
==
"colored axis"
)
{
buildColorAxis
();
}
else
if
(
s
.
at
(
0
).
name
==
"b/w axis"
)
{
buildBWAxis
();
}
else
if
(
s
.
at
(
0
).
name
==
"colored cube"
)
{
buildColorCube
();
}
//update node
m_rootNode
->
clear
();
m_geode
->
setCullingActive
(
false
);
// this disables frustrum culling for the geode to avoid the coordinate system to disappear.
m_rootNode
->
setCullingActive
(
false
);
m_rootNode
->
insert
(
m_geode
);
debugLog
()
<<
"Waiting ..."
;
m_moduleState
.
wait
();
...
...
@@ -136,40 +151,8 @@ void WMCoordinateHUD::moduleMain()
{
break
;
}
// select choosen mode
if
(
m_aSingleSelection
->
changed
()
)
{
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
remove
(
m_rootNode
);
WItemSelector
s
=
m_aSingleSelection
->
get
(
true
);
infoLog
()
<<
"New mode selected: "
<<
s
.
at
(
0
).
name
;
if
(
s
.
at
(
0
).
name
==
"colored axis"
)
{
buildColorAxis
();
}
else
if
(
s
.
at
(
0
).
name
==
"b/w axis"
)
{
buildBWAxis
();
}
else
if
(
s
.
at
(
0
).
name
==
"colored cube"
)
{
buildColorCube
();
}
//update node
m_rootNode
->
clear
();
m_geode
->
setCullingActive
(
false
);
// this disables frustrum culling for the geode to avoid the coordinate system to disappear.
m_rootNode
->
insert
(
m_geode
);
//m_rootNode->insert( m_txtGeode );
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_rootNode
);
}
}
// Since the modules run in a separate thread: wait
waitForStop
();
// remove the node from the graph
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
remove
(
m_rootNode
);
}
...
...
@@ -278,12 +261,12 @@ void WMCoordinateHUD::buildColorCube()
vertices
=
buildCubeVertices
();
// Colors
osg
::
Vec4
x_color
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
);
// red
osg
::
Vec4
xl_color
(
1.0
f
,
0.
9
f
,
0.9
f
,
1.0
f
);
// lightred
osg
::
Vec4
y_color
(
0.0
f
,
1.0
f
,
0.0
f
,
1.0
f
);
// green
osg
::
Vec4
yl_color
(
0.
9
f
,
1.0
f
,
0.9
f
,
1.0
f
);
// lightgreen
osg
::
Vec4
z_color
(
0.0
f
,
0.0
f
,
1.0
f
,
1.0
f
);
// blue
osg
::
Vec4
zl_color
(
0.
9
f
,
0.9
f
,
1.0
f
,
1.0
f
);
// lightblue
osg
::
Vec4
x_color
(
0.9
f
,
0.0
f
,
0.0
f
,
1.0
f
);
// red
osg
::
Vec4
xl_color
(
1.0
f
,
0.
7
f
,
0.7
f
,
1.0
f
);
// lightred
osg
::
Vec4
y_color
(
0.0
f
,
0.9
f
,
0.0
f
,
1.0
f
);
// green
osg
::
Vec4
yl_color
(
0.
7
f
,
1.0
f
,
0.7
f
,
1.0
f
);
// lightgreen
osg
::
Vec4
z_color
(
0.0
f
,
0.0
f
,
0.9
f
,
1.0
f
);
// blue
osg
::
Vec4
zl_color
(
0.
7
f
,
0.7
f
,
1.0
f
,
1.0
f
);
// lightblue
osg
::
Vec4
neg_color
(
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
);
// white
// x direction transition from red to lightred
...
...
@@ -370,7 +353,7 @@ osg::Vec3Array* WMCoordinateHUD::buildCubeVertices()
return
vertices
;
}
// TODO(
Sebastian Eichel
baum):
// TODO(
e
baum):
// text only shown as huge rectangle with the WMCoordinateHUD shader
// up: kranial, bottom: kaudal, front: anterior, back: posterior,
// left: sinistra, right: dexter
...
...
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