FOX/ObjCryst++  1.10.X (development)
Atom.h
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2002 Vincent Favre-Nicolin vincefn@users.sourceforge.net
3  2000-2001 University of Geneva (Switzerland)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* Atom.h
20 * header file for the Atom scatterer
21 *
22 */
23 #ifndef _OBJCRYST_ATOM_H_
24 #define _OBJCRYST_ATOM_H_
25 
26 #include "ObjCryst/CrystVector/CrystVector.h"
27 
28 #include "ObjCryst/ObjCryst/General.h"
29 
30 #include "ObjCryst/ObjCryst/ScatteringPower.h"
31 #include "ObjCryst/ObjCryst/Scatterer.h"
32 
33 //#include <stdlib.h>
34 #include <string>
35 //#include <iomanip>
36 //#include <cmath>
37 //#include <typeinfo>
38 //#include <fstream>
39 //#include <ctime>
40 //using namespace std;
41 
42 namespace ObjCryst
43 {
44 
45 //######################################################################
46 //
55 //######################################################################
56 
57 class Atom: public Scatterer
58 {
59  public:
62  Atom();
69  Atom( const REAL x, const REAL y, const REAL z,
70  const string &name, const ScatteringPower *pow);
84  Atom( const REAL x, const REAL y, const REAL z,const string &name,
85  const ScatteringPower *pow, const REAL popu);
87  Atom(const Atom &old);
88  virtual Atom* CreateCopy() const;
90  ~Atom();
91  virtual const string& GetClassName() const;
93  virtual void operator=(const Atom & rhs);
94 
100  void Init(const REAL x, const REAL y, const REAL z,
101  const string &name, const ScatteringPower *pow,
102  const REAL popu=1);
103 
104  virtual int GetNbComponent() const;
106  virtual string GetComponentName(const int i) const;
107 
108  virtual void Print() const;
109 
116  REAL GetMass() const;
123  REAL GetRadius() const;
127  virtual ostream& POVRayDescription(ostream &os,
128  const CrystalPOVRayOptions &options)const;
129  virtual void GLInitDisplayList(const bool onlyIndependentAtoms=false,
130  const REAL xMin=-.1,const REAL xMax=1.1,
131  const REAL yMin=-.1,const REAL yMax=1.1,
132  const REAL zMin=-.1,const REAL zMax=1.1,
133  const bool displayEnantiomer=false,
134  const bool displayNames=false,
135  const bool hideHydrogens=false)const;
136 
139  bool IsDummy()const;
140 
141  virtual void XMLOutput(ostream &os,int indent=0)const;
142  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
143  //virtual void XMLInputOld(istream &is,const IOCrystTag &tag);
145  const ScatteringPower& GetScatteringPower()const;
146  virtual void GetGeneGroup(const RefinableObj &obj,
147  CrystVector_uint & groupIndex,
148  unsigned int &firstGroup) const;
149  protected:
150  private:
152  virtual void InitRefParList();
153 
158  #ifdef __WX__CRYST__
159  public:
160  virtual WXCrystObjBasic* WXCreate(wxWindow*);
161  friend class WXAtom;
162  #endif
163 };
164 
165 }//namespace Objcryst
166 
167 // do we need this ?
168 #include "ObjCryst/ObjCryst/Crystal.h"
169 
170 #endif //_OBJCRYST_ATOM_H_
void Init(const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *pow, const REAL popu=1)
initialize the atom (used for arrays of atoms).
Definition: Atom.cpp:129
virtual int GetNbComponent() const
Number of components in the scatterer (eg number of point scatterers)
Definition: Atom.cpp:155
virtual void GLInitDisplayList(const bool onlyIndependentAtoms=false, const REAL xMin=-.1, const REAL xMax=1.1, const REAL yMin=-.1, const REAL yMax=1.1, const REAL zMin=-.1, const REAL zMax=1.1, const bool displayEnantiomer=false, const bool displayNames=false, const bool hideHydrogens=false) const
Definition: Atom.cpp:293
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void Print() const
Print some info about the scatterer (ideally this should be one line...).
Definition: Atom.cpp:168
virtual Atom * CreateCopy() const
Definition: Atom.cpp:95
Generic Refinable Object.
Definition: RefinableObj.h:752
REAL GetMass() const
Returns the molar mass of the atom.
Definition: Atom.cpp:187
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:127
The basic atom scatterer, in a crystal.
Definition: Atom.h:57
ScatteringComponentList mScattCompList
The list of scattering components.
Definition: Atom.h:155
Class to store POV-Ray output options.
Definition: General.h:175
const ScatteringPower * mpScattPowAtom
The ScatteringPowerAtom associated to that atom.
Definition: Atom.h:157
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
Get the gene group assigned to each parameter.
Definition: Atom.cpp:473
wxCryst class for Atoms
Definition: wxAtom.h:34
virtual const ScatteringComponentList & GetScatteringComponentList() const
Get the list of all scattering components for this scatterer.
Definition: Atom.cpp:156
Atom()
Default constructor.
Definition: Atom.cpp:57
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
Definition: Atom.cpp:107
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47
virtual string GetComponentName(const int i) const
Name for the i-th component of this scatterer.
Definition: Atom.cpp:166
virtual void InitRefParList()
Prepare refinable parameters for the scatterer object.
Definition: Atom.cpp:493
~Atom()
Destructor...
Definition: Atom.cpp:102
class to input or output a well-formatted xml beginning or ending tag.
virtual ostream & POVRayDescription(ostream &os, const CrystalPOVRayOptions &options) const
XMLOutput a description of the scatterer for POVRay.
Definition: Atom.cpp:199
list of scattering positions in a crystal, associated with the corresponding occupancy and a pointer ...
bool IsDummy() const
Is this a dummy atom ? (ie no ScatteringPower) Dummy atoms should not exist !
Definition: Atom.cpp:468
Generic type of scatterer: can be an atom, or a more complex assembly of atoms.
Definition: Scatterer.h:130
REAL GetRadius() const
Returns the radius (in Angstroems) of the atom.
Definition: Atom.cpp:193
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
const ScatteringPower & GetScatteringPower() const
Get the ScatteringPowerAtom corresponding to this atom.
Definition: Atom.cpp:470
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal...