FOX/ObjCryst++  2022
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 
130 #ifdef OBJCRYST_GL
131  virtual void GLInitDisplayList(const bool noSymmetrics=false,
132  const REAL xMin=-.1,const REAL xMax=1.1,
133  const REAL yMin=-.1,const REAL yMax=1.1,
134  const REAL zMin=-.1,const REAL zMax=1.1,
135  const bool displayEnantiomer=false,
136  const bool displayNames=false,
137  const bool hideHydrogens=false,
138  const REAL fadeDistance=0,
139  const bool fullMoleculeInLimits=false)const;
140 #endif // OBJCRYST_GL
141 
144  bool IsDummy()const;
145 
146  virtual void XMLOutput(ostream &os,int indent=0)const;
147  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
148  //virtual void XMLInputOld(istream &is,const IOCrystTag &tag);
150  const ScatteringPower& GetScatteringPower()const;
152  void SetScatteringPower(const ScatteringPower &pow);
153  virtual void GetGeneGroup(const RefinableObj &obj,
154  CrystVector_uint & groupIndex,
155  unsigned int &firstGroup) const;
156  protected:
157  private:
159  virtual void InitRefParList();
160 
165  #ifdef __WX__CRYST__
166  public:
167  virtual WXCrystObjBasic* WXCreate(wxWindow*);
168  friend class WXAtom;
169  #endif
170 };
171 
172 }//namespace Objcryst
173 
174 // do we need this ?
175 #include "ObjCryst/ObjCryst/Crystal.h"
176 
177 #endif //_OBJCRYST_ATOM_H_
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: doc-main.h:25
The basic atom scatterer, in a crystal.
Definition: Atom.h:58
void SetScatteringPower(const ScatteringPower &pow)
Change the ScatteringPower for this atom.
Definition: Atom.cpp:487
const ScatteringPower * mpScattPowAtom
The ScatteringPowerAtom associated to that atom.
Definition: Atom.h:164
REAL GetRadius() const
Returns the radius (in Angstroems) of the atom.
Definition: Atom.cpp:201
bool IsDummy() const
Is this a dummy atom ? (ie no ScatteringPower) Dummy atoms should not exist !
Definition: Atom.cpp:482
virtual void InitRefParList()
Prepare refinable parameters for the scatterer object.
Definition: Atom.cpp:519
~Atom()
Destructor...
Definition: Atom.cpp:102
virtual void Print() const
Print some info about the scatterer (ideally this should be one line...).
Definition: Atom.cpp:169
virtual const ScatteringComponentList & GetScatteringComponentList() const
Get the list of all scattering components for this scatterer.
Definition: Atom.cpp:157
REAL GetMass() const
Returns the molar mass of the atom.
Definition: Atom.cpp:195
virtual int GetNbComponent() const
Number of components in the scatterer (eg number of point scatterers)
Definition: Atom.cpp:156
ScatteringComponentList mScattCompList
The list of scattering components.
Definition: Atom.h:162
virtual ostream & POVRayDescription(ostream &os, const CrystalPOVRayOptions &options) const
XMLOutput a description of the scatterer for POVRay.
Definition: Atom.cpp:207
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:130
const ScatteringPower & GetScatteringPower() const
Get the ScatteringPowerAtom corresponding to this atom.
Definition: Atom.cpp:484
virtual string GetComponentName(const int i) const
Name for the i-th component of this scatterer.
Definition: Atom.cpp:167
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
Get the gene group assigned to each parameter.
Definition: Atom.cpp:499
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
Definition: Atom.cpp:108
virtual Atom * CreateCopy() const
Definition: Atom.cpp:95
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
Atom()
Default constructor.
Definition: Atom.cpp:57
Class to store POV-Ray output options.
Definition: General.h:178
Generic type of scatterer: can be an atom, or a more complex assembly of atoms.
Definition: Scatterer.h:131
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal.
list of scattering positions in a crystal, associated with the corresponding occupancy and a pointer ...
class to input or output a well-formatted xml beginning or ending tag.
Generic Refinable Object.
Definition: RefinableObj.h:784
wxCryst class for Atoms
Definition: wxAtom.h:35
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:128