Choreonoid
1.8
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
p
q
r
s
t
v
w
z
Enumerations
Enumerator
a
b
c
d
f
g
i
k
l
m
n
p
s
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
i
l
n
p
r
s
t
u
v
Enumerations
a
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Properties
Related Functions
b
c
d
e
f
g
h
i
j
l
m
o
p
r
s
t
v
w
y
Files
File List
File Members
All
Functions
Variables
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Util
SceneNodeExtractor.h
Go to the documentation of this file.
1
#ifndef CNOID_UTIL_SCENE_NODE_EXTRACTOR_H
2
#define CNOID_UTIL_SCENE_NODE_EXTRACTOR_H
3
4
#include "
SceneGraph.h
"
5
#include <functional>
6
#include "exportdecl.h"
7
8
namespace
cnoid
{
9
10
class
CNOID_EXPORT
SceneNodeExtractor
11
{
12
public
:
13
template
<
class
NodeType>
14
SgNodePath
extractNode
(
SgNode
* root,
bool
includeRoot =
true
){
15
extractNode_(
16
root,
17
[](
SgNode
* node){
18
if
(
dynamic_cast<
NodeType*
>
(node)){
19
return
true
;
20
}
21
return
false
;
22
},
23
includeRoot);
24
return
std::move(nodePath_);
25
}
26
27
template
<
class
NodeType>
28
std::vector<SgNodePath>
extractNodes
(
SgNode
* root,
bool
includeRoot =
true
){
29
extractNodes_(
30
root,
31
[](
SgNode
* node){
32
if
(
dynamic_cast<
NodeType*
>
(node)){
33
return
true
;
34
}
35
return
false
;
36
},
37
includeRoot);
38
return
std::move(nodePathList_);
39
}
40
41
private
:
42
void
extractNode_(
SgNode
* root, std::function<
bool
(
SgNode
* node)> pred,
bool
includeRoot);
43
void
extractNodes_(
SgNode
* root, std::function<
bool
(
SgNode
* node)> pred,
bool
includeRoot);
44
bool
extractNodesIter(
SgNode
* node,
const
std::function<
bool
(
SgNode
* node)>& pred,
bool
extractMultiplePaths);
45
46
SgNodePath
nodePath_;
47
std::vector<SgNodePath> nodePathList_;
48
};
49
50
}
51
52
#endif
cnoid::SceneNodeExtractor
Definition:
SceneNodeExtractor.h:10
cnoid::SceneNodeExtractor::extractNodes
std::vector< SgNodePath > extractNodes(SgNode *root, bool includeRoot=true)
Definition:
SceneNodeExtractor.h:28
cnoid
Definition:
AbstractSceneLoader.h:11
SceneGraph.h
cnoid::SgNodePath
std::vector< SgNode * > SgNodePath
Definition:
SceneGraph.h:24
cnoid::SceneNodeExtractor::extractNode
SgNodePath extractNode(SgNode *root, bool includeRoot=true)
Definition:
SceneNodeExtractor.h:14
cnoid::SgNode
Definition:
SceneGraph.h:157
Generated by
1.8.17