The Gnome Chemistry Utils
0.12.13
Main Page
Namespaces
Classes
Files
File List
File Members
libs
gcu
chain.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
3
/*
4
* Gnome Chemistry Utils
5
* libs/gcu/chain.h
6
*
7
* Copyright (C) 2001-2010 Jean Bréfort <jean.brefort@normalesup.org>
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License as
11
* published by the Free Software Foundation; either version 2 of the
12
* License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22
* USA
23
*/
24
25
#ifndef GCU_CHAIN_H
26
#define GCU_CHAIN_H
27
28
#include "
object.h
"
29
#include <map>
30
32
namespace
gcu {
33
34
class
Atom;
35
class
Bond;
36
class
Molecule;
37
43
typedef
struct
44
{
48
Bond
*
fwd
;
52
Bond
*
rev
;
53
}
ChainElt
;
54
59
class
Chain
:
public
Object
60
{
61
public
:
72
Chain
(
Bond
* pBond,
Atom
* pAtom = NULL,
TypeId
Type = ChainType);
81
Chain
(
Molecule
* molecule,
Bond
* pBond,
TypeId
Type = ChainType);
90
Chain
(
Molecule
* molecule,
Atom
* pAtom,
TypeId
Type = ChainType);
94
virtual
~Chain
();
95
102
void
FindCycles
(
Atom
* pAtom);
112
bool
FindCycle
(
Atom
* pAtom,
Bond
* pBond);
119
virtual
void
Erase
(
Atom
* pAtom1,
Atom
* pAtom2);
127
virtual
void
Insert
(
Atom
* pAtom1,
Atom
* pAtom2,
Chain
& chain);
135
void
Extract
(
Atom
* pAtom1,
Atom
* pAtom2,
Chain
& chain);
139
void
Reverse
();
146
void
AddBond
(
Atom
* start,
Atom
* end);
150
unsigned
GetUnsaturations
();
154
unsigned
GetHeteroatoms
();
160
bool
Contains
(
Atom
* pAtom);
166
bool
Contains
(
Bond
* pBond);
170
unsigned
GetLength
();
174
double
GetMeanBondLength
();
179
Atom
*
GetNextAtom
(
Atom
* pAtom);
180
184
std::string
Name
();
185
186
protected
:
190
std::map<Atom*, ChainElt>
m_Bonds
;
194
Molecule
*
m_Molecule
;
195
};
196
197
}
// namespace gcu
198
199
#endif // GCHEMPAINT_CHAIN_H
Generated on Sat Aug 11 2012 14:48:00 for The Gnome Chemistry Utils by
1.8.1.2