RMF
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
rmf_decorator.py
1
## \example rmf_decorator.py
2
# The example shows how to use the decorators by printing the
3
# coordates and radius of every node that has them.
4
import
RMF
5
6
7
def
traverse(nh, pf):
8
# check if the current node has coordinates and radius
9
if
pf.get_is(nh):
10
# create a decorator for the current node
11
d = pf.get(nh)
12
print(nh.get_name(), d.get_coordinates())
13
# recurse on the children
14
children = nh.get_children()
15
for
c
in
children:
16
traverse(c, pf)
17
18
fch =
RMF.open_rmf_file_read_only
(RMF.get_example_path(
"simple.rmf3"
))
19
pf = RMF.ParticleFactory(fch)
20
fch.set_current_frame(
RMF.FrameID
(0))
21
traverse(fch.get_root_node(), pf)
RMF::open_rmf_file_read_only
FileConstHandle open_rmf_file_read_only(std::string path)
RMF::ID< FrameTag >