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
18RMF_ENABLE_WARNINGS
19
20namespace RMF {
21
22class FileConstHandle;
23class FileHandle;
24class NodeConstHandle;
25class 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.*/
36RMFEXPORT void clone_file_info(FileConstHandle input, FileHandle output);
37
38/** Copy the hierarchy structure and set structure from one RMF
39 file to another.*/
40RMFEXPORT void clone_hierarchy(FileConstHandle input, FileHandle output);
41
42/** Copy the data of a single frame from between two files.*/
43RMFEXPORT 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.*/
47RMFEXPORT void clone_static_frame(FileConstHandle input, FileHandle output);
48/** @} */
49
50/** Return true of the two have the same structure.*/
52 FileConstHandle output,
53 bool print_diff = false);
54/** Return true of the two have the same values in the current frame.*/
56 FileConstHandle out);
57
58/** Return true if the two have the same values in the static frame.*/
60 FileConstHandle out);
61
62/** This function simply throws an exception. It is here for testing.*/
63RMFEXPORT void test_throw_exception();
64
65/** Return a lower bound/upper bound pair that bounds the data stored in the
66 * tree.
67 */
68RMFEXPORT 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. */
72RMFEXPORT float get_diameter(NodeConstHandle root);
73
74} /* namespace RMF */
75
76RMF_DISABLE_WARNINGS
77
78#endif /* RMF_UTILITY_H */
Declaration of NodeConstHandle.
Represent coordinates.
A handle for a read-only RMF file.
A handle for an RMF file.
Definition FileHandle.h:54
A handle for a particular node in a read-only hierarchy.
A handle for a particular node in the hierarchy.
Definition NodeHandle.h:60
The namespace for all functionality in the library.
void test_throw_exception()
void clone_loaded_frame(FileConstHandle input, FileHandle output)
void clone_static_frame(FileConstHandle input, FileHandle output)
std::array< RMF::Vector3, 2 > get_bounding_box(NodeConstHandle root)
float get_diameter(NodeConstHandle root)
bool get_equal_static_values(FileConstHandle input, FileConstHandle out)
bool get_equal_current_values(FileConstHandle input, FileConstHandle out)
void clone_hierarchy(FileConstHandle input, FileHandle output)
bool get_equal_structure(FileConstHandle input, FileConstHandle output, bool print_diff=false)
void clone_file_info(FileConstHandle input, FileHandle output)