RMF
utility.h
Go to the documentation of this file.
1 /**
2  * \file RMF/utility.h
3  * \brief Helper functions for manipulating RMF files.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef RMF_UTILITY_H
10 #define RMF_UTILITY_H
11 
12 #include "NodeConstHandle.h"
13 #include "RMF/config.h"
14 #include "RMF/internal/errors.h"
15 #include "Vector.h"
16 #include <array>
17 
18 RMF_ENABLE_WARNINGS
19 
20 namespace RMF {
21 
22 class FileConstHandle;
23 class FileHandle;
24 class NodeConstHandle;
25 class NodeHandle;
26 
27 /** \name Copy functions
28 
29  See the example cloning.py for a usage example.
30 
31  @{
32  */
33 
34 /** Copy the hierarchy structure and set structure from one RMF
35  file to another.*/
36 RMFEXPORT void clone_file_info(FileConstHandle input, FileHandle output);
37 
38 /** Copy the hierarchy structure and set structure from one RMF
39  file to another.*/
40 RMFEXPORT void clone_hierarchy(FileConstHandle input, FileHandle output);
41 
42 /** Copy the data of a single frame from between two files.*/
43 RMFEXPORT void clone_loaded_frame(FileConstHandle input, FileHandle output);
44 
45 /** Copy the data of a single frame from between two files. Parts missing
46  in the output file will be skipped.*/
47 RMFEXPORT void clone_static_frame(FileConstHandle input, FileHandle output);
48 /** @} */
49 
50 /** Return true of the two have the same structure.*/
51 RMFEXPORT bool get_equal_structure(FileConstHandle input,
52  FileConstHandle output,
53  bool print_diff = false);
54 /** Return true of the two have the same values in the current frame.*/
55 RMFEXPORT bool get_equal_current_values(FileConstHandle input,
56  FileConstHandle out);
57 
58 /** Return true if the two have the same values in the static frame.*/
59 RMFEXPORT bool get_equal_static_values(FileConstHandle input,
60  FileConstHandle out);
61 
62 /** This function simply throws an exception. It is here for testing.*/
63 RMFEXPORT void test_throw_exception();
64 
65 /** Return a lower bound/upper bound pair that bounds the data stored in the
66  * tree.
67  */
68 RMFEXPORT std::array<RMF::Vector3, 2> get_bounding_box(NodeConstHandle root);
69 
70 /** Return the diameter of the system. Unlike bounding box, this one can
71  be called from python. */
72 RMFEXPORT float get_diameter(NodeConstHandle root);
73 
74 } /* namespace RMF */
75 
76 RMF_DISABLE_WARNINGS
77 
78 #endif /* RMF_UTILITY_H */
void test_throw_exception()
bool get_equal_structure(FileConstHandle input, FileConstHandle output, bool print_diff=false)
void clone_static_frame(FileConstHandle input, FileHandle output)
void clone_hierarchy(FileConstHandle input, FileHandle output)
void clone_file_info(FileConstHandle input, FileHandle output)
void clone_loaded_frame(FileConstHandle input, FileHandle output)
float get_diameter(NodeConstHandle root)
Represent coordinates.
Declaration of NodeConstHandle.
bool get_equal_current_values(FileConstHandle input, FileConstHandle out)
bool get_equal_static_values(FileConstHandle input, FileConstHandle out)
std::array< RMF::Vector3, 2 > get_bounding_box(NodeConstHandle root)