Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
f5534a1b
Commit
f5534a1b
authored
Nov 30, 2010
by
Alexander Wiebel
Browse files
[ADD
#452
] enabled hiding coordinate values in scene
parent
7b1b9b8d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
src/modules/boundingBox/WMBoundingBox.cpp
src/modules/boundingBox/WMBoundingBox.cpp
+18
-16
src/modules/boundingBox/WMBoundingBox.h
src/modules/boundingBox/WMBoundingBox.h
+7
-0
No files found.
src/modules/boundingBox/WMBoundingBox.cpp
View file @
f5534a1b
...
...
@@ -49,7 +49,8 @@
W_LOADABLE_MODULE
(
WMBoundingBox
)
WMBoundingBox
::
WMBoundingBox
()
:
WModule
()
WModule
(),
m_recompute
(
boost
::
shared_ptr
<
WCondition
>
(
new
WCondition
()
)
)
{
// WARNING: initializing connectors inside the constructor will lead to an exception.
// Implement WModule::initializeConnectors instead.
...
...
@@ -86,6 +87,7 @@ void WMBoundingBox::moduleMain()
// use the m_input "data changed" flag
m_moduleState
.
setResetable
(
true
,
true
);
m_moduleState
.
add
(
m_input
->
getDataChangedCondition
()
);
m_moduleState
.
add
(
m_recompute
);
// signal ready state
ready
();
...
...
@@ -93,7 +95,6 @@ void WMBoundingBox::moduleMain()
// loop until the module container requests the module to quit
while
(
!
m_shutdownFlag
()
)
{
bool
dataUpdated
=
m_input
->
updated
();
boost
::
shared_ptr
<
WDataSetSingle
>
dataSet
=
m_input
->
getData
();
bool
dataValid
=
(
dataSet
);
...
...
@@ -106,10 +107,7 @@ void WMBoundingBox::moduleMain()
continue
;
}
if
(
dataUpdated
)
{
createGFX
();
}
// this waits for m_moduleState to fire. By default, this is only the m_shutdownFlag condition.
// NOTE: you can add your own conditions to m_moduleState using m_moduleState.add( ... )
...
...
@@ -136,6 +134,8 @@ void WMBoundingBox::createGFX()
m_bBoxNode
->
insert
(
wge
::
generateBoundingBoxGeode
(
bb
.
first
,
bb
.
second
,
WColor
(
0.3
,
0.3
,
0.3
,
1
)
)
);
if
(
m_showCornerCoordinates
->
get
(
true
)
)
{
wmath
::
WVector3D
pos1
=
bb
.
first
;
wmath
::
WVector3D
pos2
=
bb
.
second
;
m_bBoxNode
->
addChild
(
wge
::
vector2label
(
osg
::
Vec3
(
pos1
[
0
],
pos1
[
1
],
pos1
[
2
]
)
)
);
...
...
@@ -146,6 +146,7 @@ void WMBoundingBox::createGFX()
m_bBoxNode
->
addChild
(
wge
::
vector2label
(
osg
::
Vec3
(
pos1
[
0
],
pos2
[
1
],
pos2
[
2
]
)
)
);
m_bBoxNode
->
addChild
(
wge
::
vector2label
(
osg
::
Vec3
(
pos2
[
0
],
pos1
[
1
],
pos2
[
2
]
)
)
);
m_bBoxNode
->
addChild
(
wge
::
vector2label
(
osg
::
Vec3
(
pos1
[
0
],
pos1
[
1
],
pos2
[
2
]
)
)
);
}
WGraphicsEngine
::
getGraphicsEngine
()
->
getScene
()
->
insert
(
m_bBoxNode
);
...
...
@@ -169,6 +170,7 @@ void WMBoundingBox::connectors()
void
WMBoundingBox
::
properties
()
{
m_showCornerCoordinates
=
m_properties
->
addProperty
(
"Show coordinates"
,
"Show coordinates at the corners of the box."
,
true
,
m_recompute
);
WModule
::
properties
();
}
...
...
src/modules/boundingBox/WMBoundingBox.h
View file @
f5534a1b
...
...
@@ -117,6 +117,13 @@ private:
*/
void
createGFX
();
/**
* This condition denotes whether we need to recompute the surface
*/
boost
::
shared_ptr
<
WCondition
>
m_recompute
;
WPropBool
m_showCornerCoordinates
;
//!< Show/hide the coordinates in the rendering.
osg
::
ref_ptr
<
WGEGroupNode
>
m_bBoxNode
;
//!< OSG root node for this module
boost
::
shared_ptr
<
WModuleInputData
<
WDataSetSingle
>
>
m_input
;
//!< Input connector required by this module.
};
...
...
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