# gcu::Cycle Class Reference

`#include <gcu/cycle.h>`

Inheritance diagram for gcu::Cycle:

List of all members.

## Public Member Functions

| Cycle (Molecule *molecule)
virtual | ~Cycle ()
void | Simplify ()
virtual void | Erase (Atom *pAtom1, Atom *pAtom2)
virtual void | Insert (Atom *pAtom1, Atom *pAtom2, Chain &chain)
bool | IsBetterForBonds (Cycle *pCycle)
void | GetAngles2D (Bond *pBond, double *a1, double *a2)
int | GetFusedBonds ()

## Detailed Description

Represents a cycle.

Definition at line 36 of file cycle.h.

## Constructor & Destructor Documentation

gcu::Cycle::Cycle | ( | Molecule * | molecule | ) |

Parameters:

  | molecule | a molecule.

Constructs an initially empty cycle for the molecule.

virtual gcu::Cycle::~Cycle | ( |  | ) | `[virtual]`

The destructor.

## Member Function Documentation

void gcu::Cycle::Simplify | ( |  | ) |

Finds the smallest cycles collection in a polycyclic system.

virtual void gcu::Cycle::Erase | ( | Atom * | pAtom1,
|  | Atom * | pAtom2 |
| ) |  |  | `[virtual]`

Parameters:

  | pAtom1 | an atom in the source chain.
  | 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.

Reimplemented from gcu::Chain.

virtual void gcu::Cycle::Insert | ( | Atom * | pAtom1,
|  | Atom * | pAtom2,
|  | Chain & | chain |
| ) |  |  | `[virtual]`

Parameters:

  | pAtom1 | an atom in the source chain.
  | pAtom2 | an atom in the source chain.
  | chain | the source chain.

Inserts a chain. Bothe atoms must already be in the target cycle and the insertion should close the cycle.

Reimplemented from gcu::Chain.

bool gcu::Cycle::IsBetterForBonds | ( | Cycle * | pCycle | ) |

Parameters:

  | 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.

Returns:
  true if the this instance is to be preferred, false otherwise.

void gcu::Cycle::GetAngles2D | ( | Bond * | pBond,
|  | double * | a1,
|  | double * | a2 |
| ) |  |  |

Parameters:

  | pBond | a bond of the cycle.
  | a1 | where to put the result for the first angle.
  | a2 | where to put the result for the first angle.

Evaluates the angles between the bond and its two adjacent bonds in the cycle.

int gcu::Cycle::GetFusedBonds | ( |  | ) |

Returns:
  the number of bonds shared with other cycles.

The documentation for this class was generated from the following file:

- cycle.h