8 #ifndef IMPATOM_BOND_DECORATORS_H
9 #define IMPATOM_BOND_DECORATORS_H
11 #include <IMP/atom/atom_config.h>
12 #include <IMP/core/internal/graph_base.h>
13 #include "internal/bond_helpers.h"
21 #include <IMP/internal/IndexingIterator.h>
22 IMPATOM_BEGIN_NAMESPACE
48 return IMP::core::internal::graph_is_edge(p,
49 internal::get_bond_data().graph_);
54 NONBIOLOGICAL, SINGLE=1, DOUBLE=2, TRIPLE=3, HYDROGEN,
63 Bonded get_bonded(
unsigned int i)
const ;
66 internal::get_bond_data().type_,
Int,
Int,
70 internal::get_bond_data().order_,
74 internal::get_bond_data().length_,
Float,
77 internal::get_bond_data().stiffness_,
82 return internal::get_bond_data().length_;
95 typedef Bond result_type;
97 GetBond():d_(
nullptr){}
99 Bond operator()(
unsigned int i)
const;
100 bool operator==(
const GetBond &o)
const {
105 typedef Bonded result_type;
107 GetBonded():d_(
nullptr){}
109 Bonded operator()(
unsigned int i)
const;
110 bool operator==(
const GetBonded &o)
const {
118 return IMP::core::internal::graph_is_node(p,
119 internal::get_bond_data().graph_);
123 graph_initialize_node(p, internal::get_bond_data().graph_);
128 unsigned int get_number_of_bonds()
const {
130 internal::get_bond_data().graph_);
136 internal::get_bond_data().graph_);
146 internal::get_bond_data().graph_);
162 internal::get_bond_data().graph_);
174 typedef IMP::internal::IndexingIterator<GetBond> BondIterator;
177 BondIterator bonds_begin()
const {
180 BondIterator bonds_end()
const {
181 return BondIterator(GetBond(
get_particle()), get_number_of_bonds());
189 class BondedIterator;
191 typedef IMP::internal::IndexingIterator<GetBonded> BondedIterator;
194 BondedIterator bondeds_begin()
const {
197 BondedIterator bondeds_end()
const {
198 return BondedIterator(GetBonded(
get_particle()), get_number_of_bonds());
208 inline Bonded Bond::get_bonded(
unsigned int i)
const
210 Particle *p= graph_get_node(get_particle(), i,
211 internal::get_bond_data().graph_);
216 inline Bond Bonded::GetBond::operator()(
unsigned int i)
220 inline Bonded Bonded::GetBonded::operator()(
unsigned int i)
257 bd.set_length(length);
261 if (stiffness >=0) bd.set_stiffness(stiffness);
277 if (o.get_length() > 0) bd.set_length(o.get_length());
281 if (o.get_stiffness() >=0) bd.set_stiffness(o.get_stiffness());
313 IMP_PARTICLE_GEOMETRY(Bond, Bond,{
319 epi1.get_coordinates());
324 IMPATOM_END_NAMESPACE