IMP logo
IMP Reference Guide  2.15.0
The Integrative Modeling Platform
geometry_io.h
Go to the documentation of this file.
1 /**
2  * \file IMP/rmf/geometry_io.h
3  * \brief Handle read/write of geometry data from/to files.
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPRMF_GEOMETRY_IO_H
10 #define IMPRMF_GEOMETRY_IO_H
11 
12 #include <IMP/rmf/rmf_config.h>
14 #include <RMF/NodeHandle.h>
15 #include <RMF/FileHandle.h>
16 
17 IMPRMF_BEGIN_NAMESPACE
18 
19 /** \name Geometry I/O
20 
21  The geometry I/O support currently handles geometry composed of
22  - IMP::display::SegmentGeometry
23  - IMP::display::CylinderGeometry
24  - IMP::display::SphereGeometry
25 
26  Other types can be supported when requested. Be aware, many
27  more complex geometry types are automatically decomposed into
28  the above types and are so, more or less, supported.
29  @{
30  */
31 //! Add geometries to the file.
32 IMPRMFEXPORT void add_geometries(RMF::FileHandle file,
33  const display::GeometriesTemp &r);
34 
35 //! Add geometries to a given parent node.
36 IMPRMFEXPORT void add_geometries(RMF::NodeHandle parent,
37  const display::GeometriesTemp &r);
38 
39 //! Add geometries, assuming they do not move between frames.
40 /** This can be space saving compared to resaving
41  the constant position each frame. */
42 IMPRMFEXPORT void add_static_geometries(RMF::FileHandle parent,
43  const display::GeometriesTemp &r);
44 
45 //! Add a single geometry to the file.
46 IMPRMFEXPORT void add_geometry(RMF::FileHandle file, display::Geometry *r);
47 
48 //! Create geometry objects for the geometry nodes found in the file.
49 IMPRMFEXPORT display::Geometries create_geometries(RMF::FileConstHandle parent);
50 
51 //! Link the passed geometry objects to corresponding ones in the file.
52 /** \note The geometries must be in the same order;
53  we don't search around for matches.
54  */
55 IMPRMFEXPORT void link_geometries(RMF::FileConstHandle parent,
56  const display::GeometriesTemp &r);
57 /** @} */
58 
59 IMPRMF_END_NAMESPACE
60 
61 #endif /* IMPRMF_GEOMETRY_IO_H */
display::Geometries create_geometries(RMF::FileConstHandle parent)
Create geometry objects for the geometry nodes found in the file.
Implement geometry for the basic shapes from IMP.algebra.
IMP::Vector< IMP::WeakPointer< Geometry > > GeometriesTemp
void link_geometries(RMF::FileConstHandle parent, const display::GeometriesTemp &r)
Link the passed geometry objects to corresponding ones in the file.
void add_geometries(RMF::NodeHandle parent, const display::GeometriesTemp &r)
Add geometries to a given parent node.
IMP::Vector< IMP::Pointer< Geometry > > Geometries
void add_geometry(RMF::FileHandle file, display::Geometry *r)
Add a single geometry to the file.
void add_static_geometries(RMF::FileHandle parent, const display::GeometriesTemp &r)
Add geometries, assuming they do not move between frames.