FOX/ObjCryst++  2022
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)
106 }
107 
108 const string& Atom::GetClassName()const
109 {
110  const static string className="Atom";
111  return className;
112 }
113 
114 void Atom::operator=(const Atom &rhs)
115 {
116  VFN_DEBUG_MESSAGE("Atom::operator=():/Name="<<rhs.mName,5)
117  //:TODO: Check if this is enough (copy constructor for Scatterer ??)
118  mScattCompList.Reset();
119  ++mScattCompList;
120 
121  this->Init(rhs.mXYZ(0),rhs.mXYZ(1),rhs.mXYZ(2),
122  rhs.mName,rhs.mpScattPowAtom,
123  rhs.mOccupancy);
124  this->GetPar(mXYZ.data()). CopyAttributes(rhs.GetPar(rhs.mXYZ.data()));
125  this->GetPar(mXYZ.data()+1).CopyAttributes(rhs.GetPar(rhs.mXYZ.data()+1));
126  this->GetPar(mXYZ.data()+2).CopyAttributes(rhs.GetPar(rhs.mXYZ.data()+2));
127  this->GetPar(&mOccupancy). CopyAttributes(rhs.GetPar(&(rhs.mOccupancy)));
128 }
129 
130 void Atom::Init(const REAL x, const REAL y, const REAL z,
131  const string &name, const ScatteringPower *pow,
132  const REAL popu)
133 {
134  VFN_DEBUG_MESSAGE("Atom::Init():"<<name,3)
135  mName=name;
136  mpScattPowAtom=pow;
137  mScattCompList(0).mpScattPow=mpScattPowAtom;
138  mXYZ(0)=x;
139  mXYZ(1)=y;
140  mXYZ(2)=z;
141  if(0==mpScattPowAtom)
142  {//Dummy atom
143  VFN_DEBUG_MESSAGE("Atom::Init()Dummy Atom:/Name="<<this->GetName(),5)
144  mOccupancy=0;
145  return;
146  }
148  mOccupancy=popu;
149 
150  if(this->GetNbPar()<4) this->InitRefParList();
151 
153  VFN_DEBUG_MESSAGE("Atom::Init():End.",5)
154 }
155 
156 int Atom::GetNbComponent() const {return 1;}
158 {
159  mScattCompList(0).mX=mXYZ(0);
160  mScattCompList(0).mY=mXYZ(1);
161  mScattCompList(0).mZ=mXYZ(2);
162  mScattCompList(0).mOccupancy=mOccupancy;
164  return mScattCompList;
165 }
166 
167 string Atom::GetComponentName(const int i) const{ return this->GetName();}
168 
169 void Atom::Print() const
170 {
171  VFN_DEBUG_MESSAGE("Atom::Print()",1)
172  if(this->IsDummy())
173  {
174  cout << "Atom (DUMMY) :"
175  << FormatString(this->GetName(),16) << " at : "
176  << FormatFloat(this->GetX())
177  << FormatFloat(this->GetY())
178  << FormatFloat(this->GetZ());
179  }
180  else
181  {
182  cout << "Atom ("
183  << FormatString(mpScattPowAtom->GetSymbol(),4) << ") :"
184  << FormatString(this->GetName(),16) << " at : "
185  << FormatFloat(this->GetX())
186  << FormatFloat(this->GetY())
187  << FormatFloat(this->GetZ())
188  << ", Biso="
190  << ", Popu=" << FormatFloat(this->GetOccupancy());
191  }
192  cout << endl;
193 }
194 
195 REAL Atom::GetMass() const
196 {
197  if(true==this->IsDummy()) return 0;
198  return mpScattPowAtom->GetBiso();
199 }
200 
201 REAL Atom::GetRadius() const
202 {
203  if(this->IsDummy()) return 0.5;
204  return mpScattPowAtom->GetRadius();
205 }
206 
207 ostream& Atom::POVRayDescription(ostream &os,
208  const CrystalPOVRayOptions &options)const
209 {
210  if(this->IsDummy()) return os;
211  if(options.mShowHydrogens==false && (mpScattPowAtom->GetForwardScatteringFactor(RAD_XRAY)<1.5)) return os;
212  const REAL xMin=options.mXmin; const REAL xMax=options.mXmax;
213  const REAL yMin=options.mYmin; const REAL yMax=options.mYmax;
214  const REAL zMin=options.mZmin; const REAL zMax=options.mZmax;
215  REAL x0,y0,z0;
216  x0=mXYZ(0);
217  y0=mXYZ(1);
218  z0=mXYZ(2);
219  const REAL aa=this->GetCrystal().GetLatticePar(0);
220  const REAL bb=this->GetCrystal().GetLatticePar(1);
221  const REAL cc=this->GetCrystal().GetLatticePar(2);
222  CrystMatrix_REAL xyzCoords ;
223  xyzCoords=this->GetCrystal().GetSpaceGroup().GetAllSymmetrics(x0,y0,z0,false,false,true);
224  int nbSymmetrics=xyzCoords.rows();
225  os << "// Description of Atom :" << this->GetName()<< endl;
226  for(int i=0;i<nbSymmetrics;i++)
227  {
228  x0=xyzCoords(i,0);
229  y0=xyzCoords(i,1);
230  z0=xyzCoords(i,2);
231  x0 = fmod((float) x0,(float)1); if(x0<0) x0+=1.;
232  y0 = fmod((float) y0,(float)1); if(y0<0) y0+=1.;
233  z0 = fmod((float) z0,(float)1); if(z0<0) z0+=1.;
234  //Generate also translated atoms near the unit cell
235  CrystMatrix_int translate(27,3);
236  translate= -1,-1,-1,
237  -1,-1, 0,
238  -1,-1, 1,
239  -1, 0,-1,
240  -1, 0, 0,
241  -1, 0, 1,
242  -1, 1,-1,
243  -1, 1, 0,
244  -1, 1, 1,
245  0,-1,-1,
246  0,-1, 0,
247  0,-1, 1,
248  0, 0,-1,
249  0, 0, 0,
250  0, 0, 1,
251  0, 1,-1,
252  0, 1, 0,
253  0, 1, 1,
254  1,-1,-1,
255  1,-1, 0,
256  1,-1, 1,
257  1, 0,-1,
258  1, 0, 0,
259  1, 0, 1,
260  1, 1,-1,
261  1, 1, 0,
262  1, 1, 1;
263  for(int j=0;j<translate.rows();j++)
264  {
265  REAL x=x0+translate(j,0);
266  REAL y=y0+translate(j,1);
267  REAL z=z0+translate(j,2);
268  const bool isinside=((x>=xMin) && (x<=xMax)) && ((y>=yMin) && (y<=yMax)) && ((z>=zMin) && (z<=zMax));
269  REAL borderdist;
270  if(isinside) borderdist=0;
271  else
272  {
273  borderdist=0;
274  if(xMin>x) borderdist+=(xMin-x)*aa*(xMin-x)*aa;
275  if(yMin>y) borderdist+=(yMin-y)*bb*(yMin-y)*bb;
276  if(zMin>z) borderdist+=(zMin-z)*cc*(zMin-z)*cc;
277  if(xMax<x) borderdist+=(xMax-x)*aa*(xMax-x)*aa;
278  if(yMax<y) borderdist+=(yMax-y)*bb*(yMax-y)*bb;
279  if(zMax<z) borderdist+=(zMax-z)*cc*(zMax-z)*cc;
280  borderdist=sqrt(borderdist);
281  }
282  REAL fout=1.0;
283  if(isinside==false) fout=exp(-borderdist)*this->GetCrystal().GetDynPopCorr(this,0);
284  if(fout>0.001)
285  {
287  os << " ObjCrystAtom("
288  <<x<<","
289  <<y<<","
290  <<z<<","
291  <<this->GetScatteringPower().GetRadius()/3.0<<","
292  <<"colour_"+this->GetScatteringPower().GetName()<<","
293  <<this->GetOccupancy()<<","<<fout
294  <<")"<<endl;
295  }
296  }
297  }
298  return os;
299 }
300 
301 #ifdef OBJCRYST_GL
302 void Atom::GLInitDisplayList(const bool onlyIndependentAtoms,
303  const REAL xMin,const REAL xMax,
304  const REAL yMin,const REAL yMax,
305  const REAL zMin,const REAL zMax,
306  const bool displayEnantiomer,
307  const bool displayNames,
308  const bool hideHydrogens,
309  const REAL fadeDistance,
310  const bool fullMoleculeInLimits)const
311 {
312  VFN_DEBUG_MESSAGE("Atom::GLInitDisplayList():"<<this->GetName(),5)
313  if(this->IsDummy()) return ;
314  REAL en=1;
315  if(displayEnantiomer==true) en=-1;
316 
317  const float r=mpScattPowAtom->GetColourRGB()[0];
318  const float g=mpScattPowAtom->GetColourRGB()[1];
319  const float b=mpScattPowAtom->GetColourRGB()[2];
320  const float f=mOccupancy;
321 
322  const GLfloat colour0[] = {.0, .0, .0, 0.0};
323  GLfloat colourChar [] = {1.0, 1.0, 1.0, 1.0};
324  if((r>0.8)&&(g>0.8)&&(b>0.8))
325  {
326  colourChar[0] = 0.5;
327  colourChar[1] = 0.5;
328  colourChar[2] = 0.5;
329  }
330  const REAL aa=this->GetCrystal().GetLatticePar(0);
331  const REAL bb=this->GetCrystal().GetLatticePar(1);
332  const REAL cc=this->GetCrystal().GetLatticePar(2);
333 
334  if(hideHydrogens && (mpScattPowAtom->GetForwardScatteringFactor(RAD_XRAY)<1.5)) return;
335  GLUquadricObj* pQuadric = gluNewQuadric();
336  if(true==onlyIndependentAtoms)
337  {
338  const GLfloat colourAtom [] = {r, g, b, f};
339  REAL x,y,z;
340  x=mXYZ(0);
341  y=mXYZ(1);
342  z=mXYZ(2);
343  x = fmod((REAL)x,(int)1); if(x<0) x+=1.;
344  y = fmod((REAL)y,(int)1); if(y<0) y+=1.;
345  z = fmod((REAL)z,(int)1); if(z<0) z+=1.;
347  glPushMatrix();
348  glTranslatef(x*en, y, z);
349  if(displayNames)
350  {
351  glMaterialfv(GL_FRONT, GL_AMBIENT, colour0);
352  glMaterialfv(GL_FRONT, GL_DIFFUSE, colour0);
353  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
354  glMaterialfv(GL_FRONT, GL_EMISSION, colourChar);
355  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
356  glRasterPos3f(0,0,0);
357  crystGLPrint(this->GetName());
358  }
359  else
360  {
361  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, colourAtom);
362  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
363  glMaterialfv(GL_FRONT, GL_EMISSION, colour0);
364  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
365  glPolygonMode(GL_FRONT, GL_FILL);
366  gluSphere(pQuadric,this->GetRadius()/3.,20,20);
367  }
368  glPopMatrix();
369  }
370  else
371  {
372  REAL x0,y0,z0;
373  x0=mXYZ(0);
374  y0=mXYZ(1);
375  z0=mXYZ(2);
376  CrystMatrix_REAL xyzCoords ;
377  xyzCoords=this->GetCrystal().GetSpaceGroup().GetAllSymmetrics(x0,y0,z0,false,false,true);
378  int nbSymmetrics=xyzCoords.rows();
379  for(int i=0;i<nbSymmetrics;i++)
380  {
381  x0=xyzCoords(i,0);
382  y0=xyzCoords(i,1);
383  z0=xyzCoords(i,2);
384  x0 = fmod((REAL) x0,(int)1); if(x0<0) x0+=1.;
385  y0 = fmod((REAL) y0,(int)1); if(y0<0) y0+=1.;
386  z0 = fmod((REAL) z0,(int)1); if(z0<0) z0+=1.;
387  //Generate also translated atoms near the unit cell
388  CrystMatrix_int translate(27,3);
389  translate= -1,-1,-1,
390  -1,-1, 0,
391  -1,-1, 1,
392  -1, 0,-1,
393  -1, 0, 0,
394  -1, 0, 1,
395  -1, 1,-1,
396  -1, 1, 0,
397  -1, 1, 1,
398  0,-1,-1,
399  0,-1, 0,
400  0,-1, 1,
401  0, 0,-1,
402  0, 0, 0,
403  0, 0, 1,
404  0, 1,-1,
405  0, 1, 0,
406  0, 1, 1,
407  1,-1,-1,
408  1,-1, 0,
409  1,-1, 1,
410  1, 0,-1,
411  1, 0, 0,
412  1, 0, 1,
413  1, 1,-1,
414  1, 1, 0,
415  1, 1, 1;
416  for(int j=0;j<translate.rows();j++)
417  {
418  REAL x=x0+translate(j,0);
419  REAL y=y0+translate(j,1);
420  REAL z=z0+translate(j,2);
421  const bool isinside=((x>=xMin) && (x<=xMax)) && ((y>=yMin) && (y<=yMax)) && ((z>=zMin) && (z<=zMax));
422  REAL borderdist;
423  if(isinside) borderdist=0;
424  else
425  {
426  borderdist=0;
427  if(xMin>x) borderdist+=(xMin-x)*aa*(xMin-x)*aa;
428  if(yMin>y) borderdist+=(yMin-y)*bb*(yMin-y)*bb;
429  if(zMin>z) borderdist+=(zMin-z)*cc*(zMin-z)*cc;
430  if(xMax<x) borderdist+=(xMax-x)*aa*(xMax-x)*aa;
431  if(yMax<y) borderdist+=(yMax-y)*bb*(yMax-y)*bb;
432  if(zMax<z) borderdist+=(zMax-z)*cc*(zMax-z)*cc;
433  borderdist=sqrt(borderdist);
434  }
435  REAL fout=1;
436  // NB about dyn pop corr: it's not taken into account for atoms inside the view range,
437  // to avoid transparency for fully occupied atoms.
438  // :TODO: Maybe it should for partially occupied atoms ?
439  if(isinside==false)
440  {
441  if ((fadeDistance == 0) || borderdist>fadeDistance) fout = 0;
442  else fout*=(fadeDistance-borderdist)/fadeDistance*this->GetCrystal().GetDynPopCorr(this,0);
443  }
444  if(fout>0.01)
445  {
446  const GLfloat colourAtom [] = {r, g, b, f*fout};
448  glPushMatrix();
449  glTranslatef(x*en, y, z);
450  if(displayNames)
451  {
452  if(fout>0.99)
453  {
454  glMaterialfv(GL_FRONT, GL_AMBIENT, colour0);
455  glMaterialfv(GL_FRONT, GL_DIFFUSE, colour0);
456  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
457  glMaterialfv(GL_FRONT, GL_EMISSION, colourChar);
458  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
459  glRasterPos3f(0,0,0);
460  crystGLPrint(this->GetName());
461  }
462  }
463  else
464  {
465  glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, colourAtom);
466  glMaterialfv(GL_FRONT, GL_SPECULAR, colour0);
467  glMaterialfv(GL_FRONT, GL_EMISSION, colour0);
468  glMaterialfv(GL_FRONT, GL_SHININESS, colour0);
469  glPolygonMode(GL_FRONT, GL_FILL);
470  gluSphere(pQuadric,this->GetRadius()/3.,20,20);
471  }
472  glPopMatrix();
473  }
474  }
475  }
476  }
477  gluDeleteQuadric(pQuadric);
478  VFN_DEBUG_MESSAGE("Atom::GLInitDisplayList():End",5)
479 }
480 #endif // OBJCRYST_GL
481 
482 bool Atom::IsDummy()const { if(0==mScattCompList(0).mpScattPow) return true; return false;}
483 
485 { return *mpScattPowAtom;}
486 
488 {
489  if(mpScattPowAtom!=&p)
490  {
492  mpScattPowAtom = &p;
493  mScattCompList(0).mpScattPow=mpScattPowAtom;
496  }
497 }
498 
500  CrystVector_uint & groupIndex,
501  unsigned int &first) const
502 {
503  //One group for all translation parameters
504  unsigned int posIndex=0;
505  VFN_DEBUG_MESSAGE("Atom::GetGeneGroup()",4)
506  for(long i=0;i<obj.GetNbPar();i++)
507  for(long j=0;j<this->GetNbPar();j++)
508  if(&(obj.GetPar(i)) == &(this->GetPar(j)))
509  {
510  if(this->GetPar(j).GetType()->IsDescendantFromOrSameAs(gpRefParTypeScattTransl))
511  {
512  if(posIndex==0) posIndex=first++;
513  groupIndex(i)=posIndex;
514  }
515  else groupIndex(i)= first++;
516  }
517 }
518 
520 {
522  VFN_DEBUG_MESSAGE("Atom::InitRefParList()",5)
523  this->ResetParList();
524  //:TODO: Add thermic factors
525  {
526  RefinablePar tmp("x",&mXYZ(0),0,1.,gpRefParTypeScattTranslX,
527  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
529  this->AddPar(tmp);
530  }
531  {
532  RefinablePar tmp("y",&mXYZ(1),0,1.,gpRefParTypeScattTranslY,
533  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
535  this->AddPar(tmp);
536  }
537  {
538  RefinablePar tmp("z",&mXYZ(2),0,1.,gpRefParTypeScattTranslZ,
539  REFPAR_DERIV_STEP_ABSOLUTE,false,false,true,true,1.,1.);
541  this->AddPar(tmp);
542  }
543  if(false==this->IsDummy())
544  {
545  {
546  RefinablePar tmp(this->GetName()+(string)"occup",&mOccupancy,0.01,1.,
547  gpRefParTypeScattOccup,REFPAR_DERIV_STEP_ABSOLUTE,true,true);
549  tmp.SetGlobalOptimStep(.2);
550  this->AddPar(tmp);
551  }
552  }
553 }
554 #ifdef __WX__CRYST__
555 WXCrystObjBasic* Atom::WXCreate(wxWindow* parent)
556 {
557  //:TODO: Check mpWXCrystObj==0
558  mpWXCrystObj=new WXAtom(parent,this);
559  return mpWXCrystObj;
560 }
561 #endif
562 
563 }//namespace
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
Atom()
Default constructor.
Definition: Atom.cpp:57
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:841
Class to store POV-Ray output options.
Definition: General.h:178
bool mShowHydrogens
Show hydrogens ?
Definition: General.h:184
REAL mXmin
Display limits in reduced coordinates.
Definition: General.h:180
Generic type of scatterer: can be an atom, or a more complex assembly of atoms.
Definition: Scatterer.h:131
virtual const float * GetColourRGB() const
Colour associated to this scatterer, 3 RGB Coordinates.
Definition: Scatterer.cpp:131
REAL GetOccupancy() const
Get the occupancy of the scatterer (0.
Definition: Scatterer.cpp:106
const Crystal & GetCrystal() const
In which crystal is this Scatterer included ?
Definition: Scatterer.cpp:137
RefinableObjClock mClockScattCompList
Definition: Scatterer.h:297
CrystVector_REAL mXYZ
coordinates of the scatterer (or of its center..)
Definition: Scatterer.h:283
REAL GetX() const
X coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:103
REAL GetZ() const
Z coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:105
RefinableObjClock mClockScatterer
Last time anything (number of atoms, positions, scattering power) was changed.
Definition: Scatterer.h:295
REAL mOccupancy
Occupancy : 0 <= occ <= 1 For a multi-atom scatterer (polyhedron,..), this is the overall occupancy o...
Definition: Scatterer.h:289
REAL GetY() const
Y coordinate (fractionnal) of the scatterer (for complex scatterers, this corresponds to the position...
Definition: Scatterer.cpp:104
Abstract Base Class to describe the scattering power of any Scatterer component in a crystal.
REAL GetBiso() const
Returns the isotropic temperature B factor.
virtual REAL GetForwardScatteringFactor(const RadiationType) const =0
Get the scattering factor at (0,0,0).
virtual REAL GetRadius() const =0
Return the physical radius of this type of scatterer (for 3D display purposes).
virtual const string & GetSymbol() const
Symbol for this Scattering power (the atom name for atoms)
list of scattering positions in a crystal, associated with the corresponding occupancy and a pointer ...
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:276
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
const SpaceGroup & GetSpaceGroup() const
Access to the SpaceGroup object.
Definition: UnitCell.cpp:322
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:263
bool IsDescendantFromOrSameAs(const RefParType *type) const
Returns true if the parameter is a descendant of 'type'.
void Click()
Record an event for this clock (generally, the 'time' an object has been modified,...
Generic class for parameters of refinable objects.
Definition: RefinableObj.h:225
void CopyAttributes(const RefinablePar &)
Copy all attributes (limits, flags, etc...) from another RefinablePar object.
void SetGlobalOptimStep(const REAL)
Maximum step to use during Global Optimization algorithms.
void AssignClock(RefinableObjClock &clock)
Generic Refinable Object.
Definition: RefinableObj.h:784
void AddPar(const RefinablePar &newRefPar)
Add a refinable parameter.
virtual void RegisterClient(RefinableObj &) const
Register a new object using this object.
RefinablePar & GetPar(const long i)
Access all parameters in the order they were inputted.
virtual const string & GetName() const
Name of the object.
long GetNbPar() const
Total number of refinable parameter in the object.
void ResetParList()
Re-init the list of refinable parameters, removing all parameters.
virtual void DeRegisterClient(RefinableObj &) const
Deregister an object (which not any more) using this object.
string mName
Name for this RefinableObject. Should be unique, at least in the same scope.+.
output a number as a formatted float:
output a string with a fixed length (adding necessary space or removing excess characters) :
wxCryst class for Atoms
Definition: wxAtom.h:35
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:128