Skip to content

Commit 19a7a1d

Browse files
committed
Avoid access to mpScattPow for dummy atom
1 parent c83d90c commit 19a7a1d

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

ObjCryst/ObjCryst/Atom.cpp

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,23 @@ string Atom::GetComponentName(const int i) const{ return this->GetName();}
169169
void Atom::Print() const
170170
{
171171
VFN_DEBUG_MESSAGE("Atom::Print()",1)
172-
cout << "Atom ("
173-
<< FormatString(mpScattPowAtom->GetSymbol(),4) << ") :"
174-
<< FormatString(this->GetName(),16) << " at : "
175-
<< FormatFloat(this->GetX())
176-
<< FormatFloat(this->GetY())
177-
<< FormatFloat(this->GetZ());
178-
if(this->IsDummy()) cout << " DUMMY! ";
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+
}
179180
else
180181
{
181-
cout << ", Biso="
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="
182189
<< FormatFloat(mpScattPowAtom->GetBiso())
183190
<< ", Popu=" << FormatFloat(this->GetOccupancy());
184191
}
@@ -303,6 +310,7 @@ void Atom::GLInitDisplayList(const bool onlyIndependentAtoms,
303310
const bool fullMoleculeInLimits)const
304311
{
305312
VFN_DEBUG_MESSAGE("Atom::GLInitDisplayList():"<<this->GetName(),5)
313+
if(this->IsDummy()) return ;
306314
REAL en=1;
307315
if(displayEnantiomer==true) en=-1;
308316

@@ -323,7 +331,6 @@ void Atom::GLInitDisplayList(const bool onlyIndependentAtoms,
323331
const REAL bb=this->GetCrystal().GetLatticePar(1);
324332
const REAL cc=this->GetCrystal().GetLatticePar(2);
325333

326-
if(this->IsDummy()) return ;
327334
if(hideHydrogens && (mpScattPowAtom->GetForwardScatteringFactor(RAD_XRAY)<1.5)) return;
328335
GLUquadricObj* pQuadric = gluNewQuadric();
329336
if(true==onlyIndependentAtoms)

0 commit comments

Comments
 (0)