File: cycle.h

package info (click to toggle)
gnome-chemistry-utils 0.14.9-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 17,836 kB
  • ctags: 7,337
  • sloc: cpp: 72,977; sh: 11,381; xml: 6,304; makefile: 1,663; ansic: 1,061
file content (108 lines) | stat: -rw-r--r-- 2,920 bytes parent folder | download | duplicates (4)
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
// -*- C++ -*-

/*
 * Gnome Chemistry Utils
 * libs/gcu/cycle.h
 *
 * Copyright (C) 2001-2010 Jean Bréfort <jean.brefort@normalesup.org>
 *
 * This program 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 3 of the
 * License, or (at your option) any later version.
 *
 * This program 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 St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

#ifndef GCU_CYCLE_H
#define GCU_CYCLE_H
#include "chain.h"

/*!\file*/
namespace gcu {

/*! \class Cycle gcu/cycle.h

Represents a cycle.
*/
class Cycle: public Chain
{
public:
/*!
@param molecule a molecule.

Constructs an initially empty cycle for the molecule.
*/
	Cycle (Molecule* molecule);
/*!
The destructor.
*/
	virtual ~Cycle ();

/*!
Finds the smallest cycles collection in a polycyclic system.
*/
	void Simplify ();	//Reduce size of fused cycles
/*!
@param pAtom1 an atom in the source chain.
@param pAtom2 an atom in the source chain.

Erases a sub-chain. The result is not a cycle. This should be followed by
the insertion of a new chain to close the cycle again.
*/
	virtual void Erase (Atom* pAtom1, Atom* pAtom2);
/*!
@param pAtom1 an atom in the source chain.
@param pAtom2 an atom in the source chain.
@param chain the source chain.

Inserts a chain. Bothe atoms must already be in the target cycle and the
insertion should close the cycle.
*/
	virtual void Insert (Atom* pAtom1, Atom* pAtom2, Chain& chain);
/*!
@param pCycle another cycle sharing a bond.

Compares two cycles in competition to know which is the best to contain the
second line of a shared double bond.

@return true if the this instance is to be preferred, false otherwise.
*/
	bool IsBetterForBonds (Cycle* pCycle);
/*!
@param pBond a bond of the cycle.
@param a1 where to put the result for the first angle.
@param a2 where to put the result for the first angle.

Evaluates the angles between the bond and its two adjacent bonds in the cycle.
*/
	void GetAngles2D (Bond *pBond, double* a1, double* a2);
/*!
@return the number of bonds shared with other cycles.
*/
	int GetFusedBonds ();
/*!
@param c: a cycle.
@param atom: an atom common to both cycles.
@param bond: a bond common to both cycles and starting at atom.

@return the bridge length starting at atom and going through bond.
*/
	unsigned GetBridgeLength (Cycle *c, Atom *atom, Bond *bond);
/*!
@return the localized object generic name.
*/
	std::string Name ();
};

}	//	namespace gcu

#endif // GCU_CYCLE_H