9 #ifndef IMPRMF_ATOM_LINKS_H
10 #define IMPRMF_ATOM_LINKS_H
12 #include <IMP/rmf/rmf_config.h>
16 #include <RMF/NodeHandle.h>
17 #include <RMF/FileHandle.h>
22 #include <RMF/decorators.h>
24 IMPRMF_BEGIN_NAMESPACE
26 class IMPRMFEXPORT HierarchyLoadLink:
public SimpleLoadLink<Particle> {
27 IMP_NAMED_TUPLE_2(ConstData, ConstDatas, RMF::NodeIDs, nodes,
28 ParticlesTemp, particles,);
29 typedef SimpleLoadLink<Particle> P;
31 RMF::ParticleConstFactory particle_factory_;
32 RMF::IntermediateParticleConstFactory intermediate_particle_factory_;
33 RMF::RigidParticleConstFactory rigid_factory_;
34 RMF::AtomConstFactory atom_factory_;
35 RMF::ResidueConstFactory residue_factory_;
36 RMF::ChainConstFactory chain_factory_;
37 RMF::ColoredConstFactory colored_factory_;
38 RMF::CopyConstFactory copy_factory_;
39 RMF::DiffuserConstFactory diffuser_factory_;
40 RMF::TypedConstFactory typed_factory_;
41 RMF::DomainConstFactory domain_factory_;
42 RMF::ReferenceFrameConstFactory reference_frame_factory_;
43 RMF::IndexKey rigid_body_key_;
45 base::map<Particle*, ConstData> contents_;
46 base::map<unsigned int, ParticlesTemp> rigid_bodies_;
50 (RMF::NodeConstHandle nh,
55 ( RMF::NodeConstHandle nh,
57 bool get_is(RMF::NodeConstHandle nh)
const {
58 return nh.get_type()==RMF::REPRESENTATION;
61 RMF::NodeConstHandle nh,
68 RMF::NodeConstHandle name,
71 Particle* do_create(RMF::NodeConstHandle name);
76 Particle *o, RMF::NodeConstHandle node),,);
78 void do_add_link(
Particle *o, RMF::NodeConstHandle node);
80 HierarchyLoadLink(RMF::FileConstHandle fh,
Model *m);
86 class IMPRMFEXPORT HierarchySaveLink:
public SimpleSaveLink<Particle> {
87 typedef SimpleSaveLink<Particle> P;
88 IMP_NAMED_TUPLE_2(Data, Datas, RMF::NodeIDs, nodes,
89 ParticlesTemp, particles,);
91 RMF::ParticleFactory particle_factory_;
92 RMF::IntermediateParticleFactory intermediate_particle_factory_;
93 RMF::RigidParticleFactory rigid_factory_;
94 RMF::AtomFactory atom_factory_;
95 RMF::ResidueFactory residue_factory_;
96 RMF::ChainFactory chain_factory_;
97 RMF::ColoredFactory colored_factory_;
98 RMF::CopyFactory copy_factory_;
99 RMF::DiffuserFactory diffuser_factory_;
100 RMF::TypedFactory typed_factory_;
101 RMF::DomainFactory domain_factory_;
102 RMF::ReferenceFrameFactory reference_frame_factory_;
103 RMF::IndexKey rigid_body_key_;
106 RMF::ForceFactory force_factory_;
107 RMF::TorqueFactory torque_factory_;
110 base::set<Particle*> internal_;
111 base::map<Particle*, Data> contents_;
112 base::map<Particle*, unsigned int> rigid_bodies_;
113 void setup_node(
Particle *p, RMF::NodeHandle n) ;
114 void do_add(
Particle *p, RMF::NodeHandle cur);
117 RMF::NodeType get_type(
Particle*)
const {
118 return RMF::REPRESENTATION;
122 RMF::NodeHandle cur),,);
124 RMF::NodeHandle n),,);
126 HierarchySaveLink(RMF::FileHandle fh);