The Gnome Chemistry Utils  0.14.0
fragment-atom.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * GChemPaint library
5  * fragment-atom.h
6  *
7  * Copyright (C) 2003-2009 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 3 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 GCHEMPAINT_FRAGMENT_ATOM_H
26 #define GCHEMPAINT_FRAGMENT_ATOM_H
27 
28 #include "atom.h"
29 #include <gcu/macros.h>
30 
32 namespace gcp {
33 
34 class Fragment;
35 class View;
36 
40 class FragmentAtom: public Atom
41 {
42 public:
46  FragmentAtom ();
54  FragmentAtom (Fragment *fragment, int Z);
58  virtual ~FragmentAtom ();
59 
65  void SetZ (int Z);
73  bool AcceptNewBonds (int nb);
77  void Update ();
81  void AddItem ();
85  void UpdateItem ();
92  void SetSelected (int state);
99  xmlNodePtr Save (xmlDocPtr xml) const;
107  bool Load (xmlNodePtr node);
120  gccv::Anchor GetChargePosition (unsigned char& Pos, double Angle, double& x, double& y);
130  int GetAvailablePosition (double& x, double& y);
140  bool GetPosition (double angle, double& x, double& y);
147  bool AcceptCharge (int charge);
148 
154  void AddToMolecule (Molecule* Mol);
165  bool Match (gcu::Atom *atom, gcu::AtomMatchState &state);
171  void DoBuildSymbolGeometry (View *pView);
172 
177 };
178 
179 } // namespace gcp
180 
181 #endif // GCHEMPAINT_FRAGMENT_ATOM_H