9 #ifndef RMF_UNCERTAINTY_DECORATORS_H
10 #define RMF_UNCERTAINTY_DECORATORS_H
12 #include <RMF/config.h>
19 #include <RMF/internal/paths.h>
21 #include <boost/lexical_cast.hpp>
42 scale_lower_(scale_lower),
43 scale_upper_(scale_upper) {
47 Float get_scale()
const {
49 return get_node().get_value(scale_);
50 } RMF_DECORATOR_CATCH( );
52 Float get_frame_scale()
const {
54 return get_node().get_frame_value(scale_);
55 } RMF_DECORATOR_CATCH( );
57 Float get_static_scale()
const {
59 return get_node().get_static_value(scale_);
60 } RMF_DECORATOR_CATCH( );
64 Float get_lower()
const {
66 return get_node().get_value(scale_lower_);
67 } RMF_DECORATOR_CATCH( );
69 Float get_frame_lower()
const {
71 return get_node().get_frame_value(scale_lower_);
72 } RMF_DECORATOR_CATCH( );
74 Float get_static_lower()
const {
76 return get_node().get_static_value(scale_lower_);
77 } RMF_DECORATOR_CATCH( );
81 Float get_upper()
const {
83 return get_node().get_value(scale_upper_);
84 } RMF_DECORATOR_CATCH( );
86 Float get_frame_upper()
const {
88 return get_node().get_frame_value(scale_upper_);
89 } RMF_DECORATOR_CATCH( );
91 Float get_static_upper()
const {
93 return get_node().get_static_value(scale_upper_);
94 } RMF_DECORATOR_CATCH( );
97 static std::string get_decorator_type_name() {
100 RMF_SHOWABLE(
ScaleConst,
"Scale: " << get_node());
116 void set_scale(
Float v) {
119 } RMF_DECORATOR_CATCH( );
121 void set_frame_scale(
Float v) {
124 } RMF_DECORATOR_CATCH( );
126 void set_static_scale(
Float v) {
129 } RMF_DECORATOR_CATCH( );
133 void set_lower(
Float v) {
136 } RMF_DECORATOR_CATCH( );
138 void set_frame_lower(
Float v) {
141 } RMF_DECORATOR_CATCH( );
143 void set_static_lower(
Float v) {
146 } RMF_DECORATOR_CATCH( );
150 void set_upper(
Float v) {
153 } RMF_DECORATOR_CATCH( );
155 void set_frame_upper(
Float v) {
158 } RMF_DECORATOR_CATCH( );
160 void set_static_upper(
Float v) {
163 } RMF_DECORATOR_CATCH( );
166 static std::string get_decorator_type_name() {
184 cat_(fh.get_category(
"uncertainty")),
185 scale_(fh.
get_key<FloatTag>(cat_,
"scale")), scale_lower_(fh.
get_key<FloatTag>(cat_,
"scale lower")), scale_upper_(fh.
get_key<FloatTag>(cat_,
"scale upper")) {
188 cat_(fh.get_category(
"uncertainty")),
189 scale_(fh.
get_key<FloatTag>(cat_,
"scale")), scale_lower_(fh.
get_key<FloatTag>(cat_,
"scale lower")), scale_upper_(fh.
get_key<FloatTag>(cat_,
"scale upper")) {
193 RMF_USAGE_CHECK((nh.get_type() ==
RMF::REPRESENTATION), std::string(
"Bad node type. Got \"")
194 + boost::lexical_cast<std::string>(nh.get_type())
195 +
"\" in decorator type Scale");
202 RMF_USAGE_CHECK((nh.get_type() ==
RMF::REPRESENTATION), std::string(
"Bad node type. Got \"")
203 + boost::lexical_cast<std::string>(nh.get_type())
204 +
"\" in decorator type Scale");
205 return Scale(nh, scale_,
213 && !nh.get_value(scale_).get_is_null();
217 && !nh.get_static_value(scale_).get_is_null()
218 && !nh.get_static_value(scale_lower_).get_is_null()
219 && !nh.get_static_value(scale_upper_).get_is_null();
221 RMF_SHOWABLE(ScaleFactory,
"ScaleFactory");
224 struct ScaleConstFactory:
public ScaleFactory {
225 ScaleConstFactory(FileConstHandle fh):
228 ScaleConstFactory(FileHandle fh):
Mostly empty base classes for decorators and factories.
const NodeType REPRESENTATION
Represent part of a molecule.
A handle for a particular node in the hierarchy.
The base class for decorators.
NodeType get_type() const
get the type of this node
A handle for a particular node in a read-only hierarchy.
A handle for a read-only RMF file.
void set_value(ID< Tag > k, typename Tag::ArgumentType v) const
A handle for an RMF file.
The base class for Factories.
Declaration for RMF::FileHandle.
Declaration of NodeHandle.
void set_static_value(ID< Tag > k, typename Tag::ArgumentType v) const
set the value of the attribute k for all frames.
ID< Tag > get_key(Category category, std::string name) const
Various general useful macros for IMP.
bool get_is(NodeConstHandle nh) const
void set_frame_value(ID< Tag > k, typename Tag::ArgumentType v) const
set the value of the attribute k for this node on the current frame.