Show using aliases to provide two different organization schemes for manipulating a hierarchy.
7 tfn = RMF._get_temporary_file_path(
"aliases.rmf")
14 fh.add_frame(
"root", RMF.FRAME)
16 rh = fh.get_root_node()
18 mrh = rh.add_child(
"molecules", RMF.REPRESENTATION)
20 pf = RMF.ParticleFactory(fh)
21 cf = RMF.ColoredFactory(fh)
26 for i
in range(0, 10):
27 curph = mrh.add_child(
"mol" + str(i), RMF.REPRESENTATION)
28 for j
in range(0, 10):
29 curh = curph.add_child(
"atom" + str(j), RMF.REPRESENTATION)
46 crh = rh.add_child(
"colors", RMF.REPRESENTATION)
48 redh = crh.add_child(
"red", RMF.REPRESENTATION)
49 greenh = crh.add_child(
"green", RMF.REPRESENTATION)
50 blueh = crh.add_child(
"blue", RMF.REPRESENTATION)
52 af = RMF.AliasFactory(fh)
54 af.get(redh.add_child(
"red", RMF.ALIAS)).set_aliased(r)
56 af.get(greenh.add_child(
"green", RMF.ALIAS)).set_aliased(g)
58 af.get(blueh.add_child(
"blue", RMF.ALIAS)).set_aliased(b)