/usr/include/avogadro/bond.h is in libavogadro-dev 1.2.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | /**********************************************************************
Bond - Bond class derived from the base Primitive class
Copyright (C) 2007 Donald Ephraim Curtis
Copyright (c) 2008-2009 Marcus D. Hanwell
Copyright (c) 2009 Tim Vandermeersch
Copyright (c) 2009 Geoff Hutchison
This file is part of the Avogadro molecular editor project.
For more information, see <http://avogadro.cc/>
Avogadro is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Avogadro is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
**********************************************************************/
#ifndef BOND_H
#define BOND_H
#include <avogadro/primitive.h>
namespace OpenBabel {
class OBBond;
}
namespace Avogadro {
/**
* @class Bond bond.h <avogadro/bond.h>
* @brief Representation of a chemical bond.
* @author Marcus D. Hanwell
*
* The Bond class is a Primitive subclass that provides a Bond object.
*/
class Atom;
class Molecule;
class BondPrivate;
class A_EXPORT Bond : public Primitive
{
Q_OBJECT
public:
/**
* Constructor
*
* @param parent the object parent.
*/
Bond(QObject *parent=0);
~Bond();
/** @name Set bonding information
* These functions are used to set bonding information.
* @{
*/
/**
* Set the unique ID of the first atom in the bond.
*/
void setBegin(Atom* atom);
/**
* Set the unique ID of the second atom in the bond.
*/
void setEnd(Atom* atom);
/**
* Set the unique ID of both atoms in the bond.
* @param atom1 First atom in the bond.
* @param atom2 Second atom in the bond.
* @param order Bond order (defaults to 1).
*/
void setAtoms(unsigned long atom1, unsigned long atom2,
short order = 1);
/**
* Set the order of the bond.
*/
void setOrder(short order) { m_order = order; }
/**
* Set the aromaticity of the bond.
*/
void setAromaticity(bool isAromatic) const;
/**
* Set the custom label for the bond
*/
void setCustomLabel(const QString &label) { m_customLabel = label; }
/** @} */
/** @name Get bonding information
* These functions are used to get bonding information.
* @{
*/
/**
* @return the unique ID of the first atom in the bond.
*/
unsigned long beginAtomId() const { return m_beginAtomId; }
/**
* @return Pointer to the first atom in the bond.
*/
Atom * beginAtom() const;
/**
* @return the unique ID of the second atom in the bond.
*/
unsigned long endAtomId() const { return m_endAtomId; }
/**
* @return Pointer to the second atom in the bond.
*/
Atom * endAtom() const;
/**
* @return The position of the start of the Bond.
*/
const Eigen::Vector3d * beginPos() const;
/**
* @return The position of the mid-point of the Bond.
*/
const Eigen::Vector3d * midPos() const;
/**
* @return The position of the end of the Bond.
*/
const Eigen::Vector3d * endPos() const;
/**
* Get the unique id of the other atom in the bond.
* @param atomId The unique id of the Atom.
* @return The unique if of the other Atom in the bond.
* @note This function does not perform checks to ensure the supplied
* Atom is actually in the bond.
*/
unsigned long otherAtom(unsigned long atomId) const;
/**
* @return the order of the bond - 1 = single, 2 = double etc.
*/
short order() const { return m_order; }
/**
* @return True if the bond is aromatic.
*/
bool isAromatic() const;
/**
* @return the length of the bond.
*/
double length() const;
/**
* @return the custom label of the bond
*/
QString customLabel() const { return m_customLabel; }
/** @} */
/** @name OpenBabel conversion functions
* These functions are used convert between Avogadro and OpenBabel bonds.
* @{
*/
/**
* Copy the data from an OpenBabel::OBBond to create a similar bond.
*/
bool setOBBond(OpenBabel::OBBond *obbond);
/** @} */
/** @name Operators
* Overloaded operators.
* @{
*/
Bond& operator=(const Bond& other);
/** @} */
friend class Molecule;
private:
unsigned long m_beginAtomId, m_endAtomId;
short m_order;
mutable bool m_isAromatic;
mutable Eigen::Vector3d m_midPos;
Molecule *m_molecule;
QString m_customLabel;
/* shared d_ptr with Primitive */
Q_DECLARE_PRIVATE(Bond)
};
} // End namespace Avogadro
#endif
|