FOX/ObjCryst++  1.10.X (development)
Atom.cpp
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.cpp
20 * source file for the Atom scatterer
21 *
22 */
23 #include <cmath>
24 #include <typeinfo>
25 #include <stdio.h> //for sprintf()
26 
27 #include "ObjCryst/ObjCryst/Atom.h"
28 
29 #include "ObjCryst/Quirks/VFNStreamFormat.h" //simple formatting of integers, REALs..
30 #include "ObjCryst/Quirks/VFNDebug.h"
31 
32 #ifdef OBJCRYST_GL
33  #ifdef __DARWIN__
34  #include <OpenGL/glu.h>
35  #else
36  #include <GL/glu.h>
37  #endif
38 #endif
39 
40 #ifdef __WX__CRYST__
41  #include "ObjCryst/wxCryst/wxAtom.h"
42 #endif
43 
44 #include <fstream>
45 #include <iomanip>
46 
47 namespace ObjCryst
48 {
49 
51 //
52 // ATOM : the basic atom, within the crystal
53 //
54 //includes thermic factor (betas) and x,y,z,population
55 //
58 :mScattCompList(1),mpScattPowAtom(0)
59 {
60  VFN_DEBUG_MESSAGE("Atom::Atom()",5)
61  this->InitRefParList();
62  mScattCompList(0).mpScattPow=mpScattPowAtom;
63 }
64 
65 Atom::Atom( const REAL x, const REAL y, const REAL z,
66  const string &name,const ScatteringPower *pow)
67 :mScattCompList(1),mpScattPowAtom(pow)
68 {
69  VFN_DEBUG_MESSAGE("Atom::Atom(x,y,z,name,ScatteringPower):"<<name,5)
70  this->Init(x,y,z,name,pow,1);
71 }
72 
73 Atom::Atom( const REAL x, const REAL y, const REAL z, const string &name,
74  const ScatteringPower *pow,const REAL popu)
75 :mScattCompList(1),mpScattPowAtom(pow)
76 {
77  VFN_DEBUG_MESSAGE("Atom::Atom(x,y,z,P,B,name,ScatteringPower):"<<name,5)
78  this->Init(x,y,z,name,mpScattPowAtom,popu);
79 }
80 
81 Atom::Atom(const Atom &old)
82 :Scatterer(old),mScattCompList(1),mpScattPowAtom(old.mpScattPowAtom)
83 {
84  VFN_DEBUG_MESSAGE("Atom::Atom(&old):/Name="<<old.mName,5)
85  //:TODO: Check if this is enough (copy constructor for Scatterer ??)
86  this->Init(old.mXYZ(0),old.mXYZ(1),old.mXYZ(2),
88  old.mOccupancy);
89  this->GetPar(mXYZ.data()). CopyAttributes(old.GetPar(old.mXYZ.data()));
90  this->GetPar(mXYZ.data()+1).CopyAttributes(old.GetPar(old.mXYZ.data()+1));
91  this->GetPar(mXYZ.data()+2).CopyAttributes(old.GetPar(old.mXYZ.data()+2));
92  this->GetPar(&mOccupancy). CopyAttributes(old.GetPar(&(old.mOccupancy)));
93 }
94 
96 {
97  VFN_DEBUG_MESSAGE("Atom::CreateCopy():/Name="<<mName,10)
98  return new Atom(*this);
99 }
100 
101 
103 {
104  VFN_DEBUG_MESSAGE("Atom::~Atom():("<<mName<<")",5)
105 }
106 
107 const string& Atom::GetClassName()const
108 {
109  const static string className="Atom";
110  return className;
111 }
112 
113 void Atom::operator=(const Atom &rhs)
114 {
115  VFN_DEBUG_MESSAGE("Atom::operator=():/Name="<<rhs.mName,5)
116  //:TODO: Check if this is enough (copy constructor for Scatterer ??)
117  mScattCompList.Reset();
118  ++mScattCompList;
119 
120  this->Init(rhs.mXYZ(0),rhs.mXYZ(1),rhs.mXYZ(2),
121  rhs.mName,rhs.mpScattPowAtom,
122  rhs.mOccupancy);
123  this->GetPar(mXYZ.data()). CopyAttributes(rhs.GetPar(rhs.mXYZ.data()));
124  this->GetPar(mXYZ.data()+1).CopyAttributes(rhs.GetPar(rhs.mXYZ.data()+1));
125  this->GetPar(mXYZ.data()+2).CopyAttributes(rhs.GetPar(rhs.mXYZ.data()+2));
126  this->GetPar(&mOccupancy). CopyAttributes(rhs.GetPar(&(rhs.mOccupancy)));
127 }
128 
129 void Atom::Init(const REAL x, const REAL y, const REAL z,
130  const string &name, const ScatteringPower *pow,
131  const REAL popu)
132 {
133  VFN_DEBUG_MESSAGE("Atom::Init():"<<name,3)
134  mName=name;
135  mpScattPowAtom=pow;
136  mScattCompList(0).mpScattPow=mpScattPowAtom;
137  mXYZ(0)=x;
138  mXYZ(1)=y;
139  mXYZ(2)=z;
140  if(0==mpScattPowAtom)
141  {//Dummy atom
142  VFN_DEBUG_MESSAGE("Atom::Init()Dummy Atom:/Name="<<this->GetName(),5)
143  mOccupancy=0;
144  return;
145  }
146  mpScattPowAtom->RegisterClient(*this);
147  mOccupancy=popu;
148 
149  if(this->GetNbPar()<4) this->InitRefParList();
150 
152  VFN_DEBUG_MESSAGE("Atom::Init():End.",5)
153 }
154 
155 int Atom::GetNbComponent() const {return 1;}
157 {
158  mScattCompList(0).mX=mXYZ(0);
159  mScattCompList(0).mY=mXYZ(1);
160  mScattCompList(0).mZ=mXYZ(2);
161  mScattCompList(0).mOccupancy=mOccupancy;
163  return mScattCompList;
164 }
165 
166 string Atom::GetComponentName(const int i) const{ return this->GetName();}
167 
168 void Atom::Print() const
169 {
170  VFN_DEBUG_MESSAGE("Atom::Print()",1)
171  cout << "Atom ("
172  << FormatString(mpScattPowAtom->GetSymbol(),4) << ") :"
173  << FormatString(this->GetName(),16) << " at : "
174  << FormatFloat(this->GetX())
175  << FormatFloat(this->GetY())
176  << FormatFloat(this->GetZ());
177  if(this->IsDummy()) cout << " DUMMY! ";
178  else
179  {
180  cout << ", Biso="
182  << ", Popu=" << FormatFloat(this->GetOccupancy());
183  }
184  cout << endl;
185 }
186 
187 REAL Atom::GetMass() const
188 {
189  if(true==this->IsDummy()) return 0;
190  return mpScattPowAtom->GetBiso();
191 }
192 
193 REAL Atom::GetRadius() const
194 {
195  if(this->IsDummy()) return 0.5;
196  return mpScattPowAtom->GetRadius();
197 }
198 
199 ostream& Atom::POVRayDescription(ostream &os,
200  const CrystalPOVRayOptions &options)const
201 {
202  if(this->IsDummy()) return os;
203  if(options.mShowHydrogens==false && (mpScattPowAtom->GetForwardScatteringFactor(RAD_XRAY)<1.5)) return os;
204  const REAL xMin=options.mXmin; const REAL xMax=options.mXmax;
205  const REAL yMin=options.mYmin; const REAL yMax=options.mYmax;
206  const REAL zMin=options.mZmin; const REAL zMax=options.mZmax;
207  REAL x0,y0,z0;
208  x0=mXYZ(0);
209  y0=mXYZ(1);
210  z0=mXYZ(2);
211  const REAL aa=this->GetCrystal().GetLatticePar(0);
212  const REAL bb=this->GetCrystal().GetLatticePar(1);
213  const REAL cc=this->GetCrystal().GetLatticePar(2);
214  CrystMatrix_REAL xyzCoords ;
215  xyzCoords=this->GetCrystal().GetSpaceGroup().GetAllSymmetrics(x0,y0,z0,false,false,true);
216  int nbSymmetrics=xyzCoords.rows();
217  os << "// Description of Atom :" << this->GetName()<< endl;
218  for(int i=0;i<nbSymmetrics;i++)
219  {
220  x0=xyzCoords(i,0);
221  y0=xyzCoords(i,1);
222  z0=xyzCoords(i,2);
223  x0 = fmod((float) x0,(float)1); if(x0<0) x0+=1.;
224  y0 = fmod((float) y0,(float)1); if(y0<0) y0+=1.;
225  z0 = fmod((float) z0,(float)1); if(z0<0) z0+=1.;
226  //Generate also translated atoms near the unit cell
227  CrystMatrix_int translate(27,3);
228  translate= -1,-1,-1,
229  -1,-1, 0,
230  -1,-1, 1,
231  -1, 0,-1,
232  -1, 0, 0,
233  -1, 0, 1,
234  -1, 1,-1,
235  -1, 1, 0,
236  -1, 1, 1,
237  0,-1,-1,
238  0,-1, 0,
239  0,-1, 1,
240  0, 0,-1,
241  0, 0, 0,
242  0, 0, 1,
243  0, 1,-1,
244  0, 1, 0,
245  0, 1, 1,
246  1,-1,-1,
247  1,-1, 0,
248  1,-1, 1,
249  1, 0,-1,
250  1, 0, 0,
251  1, 0, 1,
252  1, 1,-1,
253  1, 1, 0,
254  1, 1, 1;
255  for(int j=0;j<translate.rows();j++)
256  {
257  REAL x=x0+translate(j,0);
258  REAL y=y0+translate(j,1);
259  REAL z=z0+translate(j,2);
260  const bool isinside=((x>=xMin) && (x<=xMax)) && ((y>=yMin) && (y<=yMax)) && ((z>=zMin) && (z<=zMax));
261  REAL borderdist;
262  if(isinside) borderdist=0;
263  else
264  {
265  borderdist=0;
266  if(xMin>x) borderdist+=(xMin-x)*aa*(xMin-x)*aa;
267  if(yMin>y) borderdist+=(yMin-y)*bb*(yMin-y)*bb;
268  if(zMin>z) borderdist+=(zMin-z)*cc*(zMin-z)*cc;
269  if(xMax<x) borderdist+=(xMax-x)*aa*(xMax-x)*aa;
270  if(yMax<y) borderdist+=(yMax-y)*bb*(yMax-y)*bb;
271  if(zMax<z) borderdist+=(zMax-z)*cc*(zMax-z)*cc;
272  borderdist=sqrt(borderdist);
273  }
274  REAL fout=1.0;
275  if(isinside==false) fout=exp(-borderdist)*this->GetCrystal().GetDynPopCorr(this,0);
276  if(fout>0.001)
277  {
279  os << " ObjCrystAtom("
280  <<x<<","
281  <<y<<","
282  <<z<<","
283  <<this->GetScatteringPower().GetRadius()/3.0<<","
284  <<"colour_"+this->GetScatteringPower().GetName()<<","
285  <<this->GetOccupancy()<<","<<fout
286  <<")"<<endl;
287  }
288  }
289  }
290  return os;
291 }
292 
293 void Atom::GLInitDisplayList(const bool onlyIndependentAtoms,
294  const REAL xMin,const REAL xMax,
295  const REAL yMin,const REAL yMax,
296  const REAL zMin,const REAL zMax,
297  const bool displayEnantiomer,
298  const bool displayNames,
299  const bool hideHydrogens)const
300 {
301  #ifdef OBJCRYST_GL
302  VFN_DEBUG_MESSAGE("Atom::GLInitDisplayList():"<<this->GetName(),5)
303  REAL en=1;
304  if(displayEnantiomer==true) en=-1;
305 
306  const float r=mpScattPowAtom->GetColourRGB()[0];
307  const float g=mpScattPowAtom->GetColourRGB()[1];
308  const float b=mpScattPowAtom->GetColourRGB()[2];
309  const float f=mOccupancy;
310 
311  const GLfloat colour0[] = {.0, .0, .0, 0.0};
312  GLfloat colourChar [] = {1.0, 1.0, 1.0, 1.0};
313  if((r>0.8)&&(g>0.8)&&(b>0.8))
314  {
315  colourChar[0] = 0.5;
316  colourChar[1] = 0.5;
317  colourChar[2] = 0.5;
318  }
319  const REAL aa=this->GetCrystal().GetLatticePar(0);
320  const REAL bb=this->GetCrystal().GetLatticePar(1);
321  const REAL cc=this->GetCrystal().GetLatticePar(2);
322 
323  if(this->IsDummy()) return ;
324  if(hideHydrogens && (mpScattPowAtom->GetForwardScatteringFactor(RAD_XRAY)<1.5)) return;
325  GLUquadricObj* pQuadric = gluNewQuadric();
326  if(true==onlyIndependentAtoms)
327  {
328  const GLfloat colourAtom [] = {r, g, b, f};
329  REAL x,y,z;
330  x=mXYZ(0);
331  y=mXYZ(1);
332  z=mXYZ(2);
333  x = fmod((REAL)x,(int)1); if(x<0) x+=1.;
334  y = fmod((REAL)y,(int)1); if(y<0) y+=1.;
335  z = fmod((REAL)z,(int)1); if(z<0) z+=1.;
337  glPushMatrix();
338  glTranslatef(x*en, y, z);
339  if(displayNames)
340  {
341  glMaterialfv(GL_FRONT, GL_AMBIENT, colour0);
342  glMaterialfv(GL_FRONT, GL_DIFFUSE, colour0);
343  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
344  glMaterialfv(GL_FRONT, GL_EMISSION, colourChar);
345  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
346  glRasterPos3f(0,0,0);
347  crystGLPrint(this->GetName());
348  }
349  else
350  {
351  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, colourAtom);
352  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
353  glMaterialfv(GL_FRONT, GL_EMISSION, colour0);
354  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
355  glPolygonMode(GL_FRONT, GL_FILL);
356  gluSphere(pQuadric,this->GetRadius()/3.,20,20);
357  }
358  glPopMatrix();
359  }
360  else
361  {
362  REAL x0,y0,z0;
363  x0=mXYZ(0);
364  y0=mXYZ(1);
365  z0=mXYZ(2);
366  CrystMatrix_REAL xyzCoords ;
367  xyzCoords=this->GetCrystal().GetSpaceGroup().GetAllSymmetrics(x0,y0,z0,false,false,true);
368  int nbSymmetrics=xyzCoords.rows();
369  for(int i=0;i<nbSymmetrics;i++)
370  {
371  x0=xyzCoords(i,0);
372  y0=xyzCoords(i,1);
373  z0=xyzCoords(i,2);
374  x0 = fmod((REAL) x0,(int)1); if(x0<0) x0+=1.;
375  y0 = fmod((REAL) y0,(int)1); if(y0<0) y0+=1.;
376  z0 = fmod((REAL) z0,(int)1); if(z0<0) z0+=1.;
377  //Generate also translated atoms near the unit cell
378  CrystMatrix_int translate(27,3);
379  translate= -1,-1,-1,
380  -1,-1, 0,
381  -1,-1, 1,
382  -1, 0,-1,
383  -1, 0, 0,
384  -1, 0, 1,
385  -1, 1,-1,
386  -1, 1, 0,
387  -1, 1, 1,
388  0,-1,-1,
389  0,-1, 0,
390  0,-1, 1,
391  0, 0,-1,
392  0, 0, 0,
393  0, 0, 1,
394  0, 1,-1,
395  0, 1, 0,
396  0, 1, 1,
397  1,-1,-1,
398  1,-1, 0,
399  1,-1, 1,
400  1, 0,-1,
401  1, 0, 0,
402  1, 0, 1,
403  1, 1,-1,
404  1, 1, 0,
405  1, 1, 1;
406  for(int j=0;j<translate.rows();j++)
407  {
408  REAL x=x0+translate(j,0);
409  REAL y=y0+translate(j,1);
410  REAL z=z0+translate(j,2);
411  const bool isinside=((x>=xMin) && (x<=xMax)) && ((y>=yMin) && (y<=yMax)) && ((z>=zMin) && (z<=zMax));
412  REAL borderdist;
413  if(isinside) borderdist=0;
414  else
415  {
416  borderdist=0;
417  if(xMin>x) borderdist+=(xMin-x)*aa*(xMin-x)*aa;
418  if(yMin>y) borderdist+=(yMin-y)*bb*(yMin-y)*bb;
419  if(zMin>z) borderdist+=(zMin-z)*cc*(zMin-z)*cc;
420  if(xMax<x) borderdist+=(xMax-x)*aa*(xMax-x)*aa;
421  if(yMax<y) borderdist+=(yMax-y)*bb*(yMax-y)*bb;
422  if(zMax<z) borderdist+=(zMax-z)*cc*(zMax-z)*cc;
423  borderdist=sqrt(borderdist);
424  }
425  REAL fout=1;
426  // NB about dyn pop corr: it's not taken into account for atoms inside the view range,
427  // to avoid transparency for fully occupied atoms.
428  // :TODO: Maybe it should for partially occupied atoms ?
429  if(isinside==false) fout*=exp(-borderdist)*this->GetCrystal().GetDynPopCorr(this,0);
430  if(fout>0.01)
431  {
432  const GLfloat colourAtom [] = {r, g, b, f*fout};
434  glPushMatrix();
435  glTranslatef(x*en, y, z);
436  if(displayNames)
437  {
438  if(fout>0.99)
439  {
440  glMaterialfv(GL_FRONT, GL_AMBIENT, colour0);
441  glMaterialfv(GL_FRONT, GL_DIFFUSE, colour0);
442  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
443  glMaterialfv(GL_FRONT, GL_EMISSION, colourChar);
444  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
445  glRasterPos3f(0,0,0);
446  crystGLPrint(this->GetName());
447  }
448  }
449  else
450  {
451  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, colourAtom);
452  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
453  glMaterialfv(GL_FRONT, GL_EMISSION, colour0);
454  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
455  glPolygonMode(GL_FRONT, GL_FILL);
456  gluSphere(pQuadric,this->GetRadius()/3.,20,20);
457  }
458  glPopMatrix();
459  }
460  }
461  }
462  }
463  gluDeleteQuadric(pQuadric);
464  VFN_DEBUG_MESSAGE("Atom::GLInitDisplayList():End",5)
465  #endif
466 }
467 
468 bool Atom::IsDummy()const { if(0==mScattCompList(0).mpScattPow) return true; return false;}
469 
471 { return *mpScattPowAtom;}
472 
474  CrystVector_uint & groupIndex,
475  unsigned int &first) const
476 {
477  //One group for all translation parameters
478  unsigned int posIndex=0;
479  VFN_DEBUG_MESSAGE("Atom::GetGeneGroup()",4)
480  for(long i=0;i<obj.GetNbPar();i++)
481  for(long j=0;j<this->GetNbPar();j++)
482  if(&(obj.GetPar(i)) == &(this->GetPar(j)))
483  {
484  if(this->GetPar(j).GetType()->IsDescendantFromOrSameAs(gpRefParTypeScattTransl))
485  {
486  if(posIndex==0) posIndex=first++;
487  groupIndex(i)=posIndex;
488  }
489  else groupIndex(i)= first++;
490  }
491 }
492 
494 {
496  VFN_DEBUG_MESSAGE("Atom::InitRefParList()",5)
497  this->ResetParList();
498  //:TODO: Add thermic factors
499  {
500  RefinablePar tmp("x",&mXYZ(0),0,1.,gpRefParTypeScattTranslX,
501  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
503  this->AddPar(tmp);
504  }
505  {
506  RefinablePar tmp("y",&mXYZ(1),0,1.,gpRefParTypeScattTranslY,
507  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
509  this->AddPar(tmp);
510  }
511  {
512  RefinablePar tmp("z",&mXYZ(2),0,1.,gpRefParTypeScattTranslZ,
513  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
515  this->AddPar(tmp);
516  }
517  if(false==this->IsDummy())
518  {
519  {
520  RefinablePar tmp(this->GetName()+(string)"occup",&mOccupancy,0.01,1.,
521  gpRefParTypeScattOccup,REFPAR_DERIV_STEP_ABSOLUTE,true,true);
523  tmp.SetGlobalOptimStep(.2);
524  this->AddPar(tmp);
525  }
526  }
527 }
528 #ifdef __WX__CRYST__
529 WXCrystObjBasic* Atom::WXCreate(wxWindow* parent)
530 {
531  //:TODO: Check mpWXCrystObj==0
532  mpWXCrystObj=new WXAtom(parent,this);
533  return mpWXCrystObj;
534 }
535 #endif
536 
537 }//namespace
CrystVector_REAL GetLatticePar() const
Lattice parameters (a,b,c,alpha,beta,gamma) as a 6-element vector in Angstroems and radians...
Definition: UnitCell.cpp:92
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
void AddPar(const RefinablePar &newRefPar)
Add a refinable parameter.
REAL mXmin
Display limits in reduced coordinates.
Definition: General.h:178
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
void FractionalToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const
Get orthonormal cartesian coordinates for a set of (x,y,z) fractional coordinates.
Definition: UnitCell.cpp:261
CrystVector_REAL mXYZ
coordinates of the scatterer (or of its center..)
Definition: Scatterer.h:273
void Click()
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made)
virtual void Print() const
Print some info about the scatterer (ideally this should be one line...).
Definition: Atom.cpp:168
long GetNbPar() const
Total number of refinable parameter in the object.
RefinablePar & GetPar(const long i)
Access all parameters in the order they were inputted.
virtual Atom * CreateCopy() const
Definition: Atom.cpp:95
virtual REAL GetRadius() const =0
Return the physical radius of this type of scatterer (for 3D display purposes).
Generic Refinable Object.
Definition: RefinableObj.h:752
REAL GetMass() const
Returns the molar mass of the atom.
Definition: Atom.cpp:187
const SpaceGroup & GetSpaceGroup() const
Access to the SpaceGroup object.
Definition: UnitCell.cpp:320
void ResetParList()
Re-init the list of refinable parameters, removing all parameters.
REAL GetZ() const
Z coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:105
REAL GetOccupancy() const
Get the occupancy of the scatterer (0.
Definition: Scatterer.cpp:106
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:127
string mName
Name for this RefinableObject. Should be unique, at least in the same scope.+.
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
RefinableObjClock mClockScattCompList
Definition: Scatterer.h:287
void AssignClock(RefinableObjClock &clock)
bool mShowHydrogens
Show hydrogens ?
Definition: General.h:182
REAL GetX() const
X coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:103
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
CrystMatrix_REAL GetAllSymmetrics(const REAL x, const REAL y, const REAL z, const bool noCenter=false, const bool noTransl=false, const bool noIdentical=false) const
Get all equivalent positions of a (xyz) position.
Definition: SpaceGroup.cpp:274
virtual const ScatteringComponentList & GetScatteringComponentList() const
Get the list of all scattering components for this scatterer.
Definition: Atom.cpp:156
REAL mOccupancy
Occupancy : 0 <= occ <= 1 For a multi-atom scatterer (polyhedron,..), this is the overall occupancy o...
Definition: Scatterer.h:279
output a number as a formatted float:
REAL GetDynPopCorr(const Scatterer *pscatt, unsigned int component) const
Access the Dynamical Occupancy Correction for a given component (atom) in a given Scatterer...
Definition: Crystal.cpp:773
Atom()
Default constructor.
Definition: Atom.cpp:57
output a string with a fixed length (adding necessary space or removing excess characters) : ...
const Crystal & GetCrystal() const
In which crystal is this Scatterer included ?
Definition: Scatterer.cpp:137
bool IsDescendantFromOrSameAs(const RefParType *type) const
Returns true if the parameter is a descendant of 'type'.
virtual REAL GetForwardScatteringFactor(const RadiationType) const =0
Get the scattering factor at (0,0,0).
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
Generic class for parameters of refinable objects.
Definition: RefinableObj.h:223
virtual string GetComponentName(const int i) const
Name for the i-th component of this scatterer.
Definition: Atom.cpp:166
virtual const string & GetName() const
Name of the object.
virtual void InitRefParList()
Prepare refinable parameters for the scatterer object.
Definition: Atom.cpp:493
~Atom()
Destructor...
Definition: Atom.cpp:102
REAL GetY() const
Y coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:104
REAL GetBiso() const
Returns the isotropic temperature B factor.
virtual ostream & POVRayDescription(ostream &os, const CrystalPOVRayOptions &options) const
XMLOutput a description of the scatterer for POVRay.
Definition: Atom.cpp:199
RefinableObjClock mClockScatterer
Last time anything (number of atoms, positions, scattering power) was changed.
Definition: Scatterer.h:285
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
virtual const string & GetSymbol() const
Symbol for this Scattering power (the atom name for atoms)
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
const ScatteringPower & GetScatteringPower() const
Get the ScatteringPowerAtom corresponding to this atom.
Definition: Atom.cpp:470
void SetGlobalOptimStep(const REAL)
Maximum step to use during Global Optimization algorithms.
const float * GetColourRGB() const
Get the float[3] array of RGB components defining the colour of this scattering power.
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal...