177 |
|
} |
178 |
|
|
179 |
|
//below code still have some kind of hard-coding smell |
180 |
< |
if (stamp->haveOrientation()){ |
181 |
< |
DirectionalAtom* dAtom; |
182 |
< |
double phi; |
183 |
< |
double theta; |
184 |
< |
double psi; |
185 |
< |
|
180 |
> |
if (atomType->isDirectional()){ |
181 |
> |
|
182 |
|
DirectionalAtomType* dAtomType = dynamic_cast<DirectionalAtomType*>(atomType); |
183 |
+ |
|
184 |
|
if (dAtomType == NULL) { |
185 |
|
sprintf(painCave.errMsg, "Can not cast AtomType to DirectionalAtomType"); |
186 |
|
|
187 |
|
painCave.isFatal = 1; |
188 |
|
simError(); |
189 |
|
} |
193 |
– |
|
194 |
– |
dAtom = new DirectionalAtom(dAtomType); |
190 |
|
|
191 |
< |
// Directional Atoms have standard unit vectors which are oriented |
192 |
< |
// in space using the three Euler angles. We assume the standard |
198 |
< |
// unit vector was originally along the z axis below. |
199 |
< |
|
200 |
< |
phi = stamp->getEulerPhi() * M_PI / 180.0; |
201 |
< |
theta = stamp->getEulerTheta() * M_PI / 180.0; |
202 |
< |
psi = stamp->getEulerPsi()* M_PI / 180.0; |
203 |
< |
|
204 |
< |
dAtom->setUnitFrameFromEuler(phi, theta, psi); |
191 |
> |
DirectionalAtom* dAtom; |
192 |
> |
dAtom = new DirectionalAtom(dAtomType); |
193 |
|
atom = dAtom; |
194 |
|
} |
195 |
|
else{ |