Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ObjCryst::ZScatterer Class Reference

ZScatterer: the basic type of complex scatterers, where atom positions are defined using a standard "Z-Matrix" description. This is used to describe inorganic polyhedras, as well as molecules. More...

#include <ZScatterer.h>

Inheritance diagram for ObjCryst::ZScatterer::

ObjCryst::Scatterer ObjCryst::RefinableObj ObjCryst::ZPolyhedron List of all members.

Public Methods

 ZScatterer (const string &name, const Crystal &cryst, const double x=0., const double y=0., const double z=0., const double phi=0., const double chi=0., const double psi=0.)
 ZScatterer constructor. More...

 ZScatterer (const ZScatterer &old)
 Copy constructor.

 ~ZScatterer ()
virtual ZScatterer * CreateCopy () const
  so-called Virtual copy constructor, needed to make copies of arrays of Scatterers.

virtual const string GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry.

void AddAtom (const string &name, const ScatteringPower *pow, const long atomBond, const double bondLength, const long atomAngle, const double bondAngle, const long atomDihedral, const double dihedralAngle, const double popu=1.)
 Add an atom to the Zscatterer. If &ScatteringPower=0, then it is a 'dummy' atom and will be ignored for any scattering analysis. The 'name' supplied may not be respected, and can be replaced by 'ZScatterer_name'+'AtomNum'+'ScattPowName'.

virtual int GetNbComponent () const
 Number of components in the scatterer (eg number of point scatterers).

virtual const ScatteringComponentListGetScatteringComponentList () const
 Get the list of all scattering components for this scatterer. More...

virtual string GetComponentName (const int i) const
 Name for the i-th component of this scatterer. If the component is an Atom, Then the name is that of the atom. Else, it is the name of the scatterer plus the component number in the scatterer plus the name of the ScatteringPower.
Note:
It would be better to return a reference, but we don't want to keep a name for all components... Weeelll, needs some more thinking... see what performance hit results (if any).
More...


void Print () const
 Print a single line of information about this scatterer.

double GetPhi () const
 Access to phi parameter (overall orientation of the scatterer).

double GetChi () const
 Access to chi parameter (overall orientation of the scatterer).

double GetPsi () const
 Access to psi parameter (overall orientation of the scatterer).

void SetPhi (const double)
 Access to phi parameter (overall orientation of the scatterer).

void SetChi (const double)
 Access to chi parameter (overall orientation of the scatterer).

void SetPsi (const double)
 Access to psi parameter (overall orientation of the scatterer).

long GetZBondAtom (const int i) const
 Index of the 1st atom used to define the i-th atom in the Z-Matrix (the one from which the bondlength is calculated).

long GetZAngleAtom (const int i) const
 Index of the 2nd atom used to define the i-th atom in the Z-Matrix (the one from which the angle is calculated).

long GetZDihedralAngleAtom (const int i) const
 Index of the 3rd atom used to define the i-th atom in the Z-Matrix (the one from which the dihedral angle is calculated).

double GetZBondLength (const int i) const
 Const access to bondlength parameter, for the i-th row in the Z-Matrix.

double GetZAngle (const int i) const
 Const access to the angle parameter, for the i-th row in the Z-Matrix.

double GetZDihedralAngle (const int i) const
 Const access to the dihedral angle parameter, for the i-th row in the Z-Matrix.

void SetZBondLength (const int i, const double)
 Access to bondlength parameter, for the i-th row in the Z-Matrix.

void SetZAngle (const int i, const double)
 Access to the angle parameter, for the i-th row in the Z-Matrix.

void SetZDihedralAngle (const int i, const double)
 Access to the dihedral angle parameter, for the i-th row in the Z-Matrix.

const ObjRegistry< ZAtom > & GetZAtomRegistry () const
 Access to the registry of ZAtoms.

virtual ostream & POVRayDescription (ostream &os, const bool onlyIndependentAtoms=false) const
 
Warning:
Not implemented for ZScatterer.


virtual void GLInitDisplayList (const bool onlyIndependentAtoms=false, const double xMin=-.1, const double xMax=1.1, const double yMin=-.1, const double yMax=1.1, const double zMin=-.1, const double zMax=1.1) const
virtual void SetUseGlobalScatteringPower (const bool useIt)
 use a Global scattering power for this scatterer ? More...

virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML. More...

virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream. More...


Protected Methods

void Update () const
 Update the scatterer's parameters (scattering positions, occupancy). More...


Protected Attributes

CrystMatrix_long m3DDisplayIndex
 For 3D display of the structure, bonds, triangular and quadric faces can be displayed. More...

ScatteringComponentList mScattCompList
 The list of scattering components.

long mNbAtom
 Total number of atoms in the structure.


Private Methods

virtual void InitRefParList ()
 Prepare refinable parameters for the scatterer object.


Private Attributes

long mNbDummyAtom
 Number of "dummy" atoms in the structure.

CrystVector_int mComponentIndex
 Index of atoms in the ScatteringComponentList. We need this list because Dummy atoms are not included in it. So this is an integer array with [ 0 1 2 4 5 6].. where the missing '3' marks a Dummy atom. Thus to get the name of component 'i' in the component list, you must take the mComponentIndex(i) atom in the ZAtom Registry.

double mPhi
 Angles giving the orientation of the ZScatterer (stored in radian). More...

double mChi
 Angles giving the orientation of the ZScatterer (stored in radian). More...

double mPsi
 Angles giving the orientation of the ZScatterer (stored in radian). More...

ObjRegistry< ZAtommZAtomRegistry
 Registry for ZAtoms in this Scatterer.

long mCenterAtomIndex
 Index of the atom used as a pivot (the scatterer is rotated around this atom). This should more or less be at the center of the Scatterer.

CrystMatrix_double mPhiChiPsiMatrix
 Rotation matrix for the orientation of the scatterer.

bool mUseGlobalScattPow
 Does the ZScatterer use a global scattering power ?
Warning:
EXPERIMENTAL.


GlobalScatteringPowermpGlobalScattPow
 the global scattering power used, if mUseGlobalScattPow=true
Warning:
EXPERIMENTAL.


CrystVector_double mXCoord
 Storage for Cartesian coordinates. The (0,0,0) is on the central atom. This includes Dummy atoms.

CrystVector_double mYCoord
 Storage for Cartesian coordinates. The (0,0,0) is on the central atom. This includes Dummy atoms.

CrystVector_double mZCoord
 Storage for Cartesian coordinates. The (0,0,0) is on the central atom. This includes Dummy atoms.


Detailed Description

ZScatterer: the basic type of complex scatterers, where atom positions are defined using a standard "Z-Matrix" description. This is used to describe inorganic polyhedras, as well as molecules.


Constructor & Destructor Documentation

ZScatterer const string &    name,
const Crystal   cryst,
const double    x = 0.,
const double    y = 0.,
const double    z = 0.,
const double    phi = 0.,
const double    chi = 0.,
const double    psi = 0.
 

ZScatterer constructor.

Parameters:
name:  the name of the scatterer
cryst:  the crystal in which the scatterer is (needed to convert from cartesian to fractionnal coordinates).
x,y,z:  fractionnal coordinates of the scatterer
phi,chi:  angles defining the orientation of the scatterer


Member Function Documentation

virtual void GLInitDisplayList const bool    onlyIndependentAtoms = false,
const double    xMin = -.1,
const double    xMax = 1.1,
const double    yMin = -.1,
const double    yMax = 1.1,
const double    zMin = -.1,
const double    zMax = 1.1
const [virtual]
 

Create an OpenGL Display List of the scatterer. This should only be called by a Crystal object.

Parameters:
noSymmetrics:  if false (the default), then all symmetrics are shown in the 3D display, within the limits defined by the min/max parameters \ param xMin,xMax,yMin,yMax,zMin,zMax: in fractionnal coordinates, the region in which we want scaterrer to be displayed. The test is made on the center of the scatterer (eg a ZScatterer (molecule) will not be 'cut' on the border).

Reimplemented from ObjCryst::Scatterer.

virtual string GetComponentName const int    i const [virtual]
 

Name for the i-th component of this scatterer. If the component is an Atom, Then the name is that of the atom. Else, it is the name of the scatterer plus the component number in the scatterer plus the name of the ScatteringPower.

Note:
It would be better to return a reference, but we don't want to keep a name for all components... Weeelll, needs some more thinking... see what performance hit results (if any).

Bug:
does not take into account dummy atoms !!

Reimplemented from ObjCryst::Scatterer.

virtual const ScatteringComponentList& GetScatteringComponentList   const [virtual]
 

Get the list of all scattering components for this scatterer.

This is the most important function of this class, giving the list of scattering positions along with the associated ScatteringPower.

Reimplemented from ObjCryst::Scatterer.

virtual void SetUseGlobalScatteringPower const bool    useIt [virtual]
 

use a Global scattering power for this scatterer ?

If true, then the overall scattering power of this ZScatterer will be approximated to an isotropic scattering power computed for this scatterer. Of course, only use this if the "isotropic" approximation is reasonable for this scatterer (typically true for 'large' polyhedra). See GlobalScatteringPower.

Warning:
EXPERIMENTAL

void Update   const [protected, virtual]
 

Update the scatterer's parameters (scattering positions, occupancy).

This is necessary for composite scatterers (eg not atoms), which include more than a single scattering center. The coordinates of all scattering points are updated from the scatterer's parameters.

This is automatically called each time GetScatteringComponentList() is used.

As always, update is only made if nessary (ie if one parameter determining the atom positions has changed).

Note:
This is not necessary in all Scatterer, so this could be removed from the base Scatterer class.

Reimplemented from ObjCryst::Scatterer.

virtual void XMLInput istream &    is,
const XMLCrystTag   tag
[virtual]
 

Input From stream.

Todo:
Add an bool XMLInputTag(is,tag) function to recognize all the tags from the stream. So that each inherited class can use the XMLInputTag function from its parent (ie take advantage of inheritance). The children class would first try to interpret the tag, then if unsuccessful would pass it to its parent (thus allowing overloading), etc...

Reimplemented from ObjCryst::RefinableObj.

virtual void XMLOutput ostream &    os,
int    indent = 0
const [virtual]
 

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Reimplemented from ObjCryst::RefinableObj.


Member Data Documentation

CrystMatrix_long m3DDisplayIndex [protected]
 

For 3D display of the structure, bonds, triangular and quadric faces can be displayed.

This matrix determines what is drawn. This is a 5-column matrix. The first column indicates the type of drawing (0: : nothing, 1: display the atom (a sphere), 2: bond, 3: triangular face, 4: quadric face) the other columns indicate the index of the atoms involved in the drawing (2 atoms for a bond, 3 for....)

If the matrix is empty only the individual atoms are displayed.

Todo:
This is still experimental. This is only used for the display of ZPolyhedron, and should be more developped (and it should also be saved in XML files !)

double mChi [private]
 

Angles giving the orientation of the ZScatterer (stored in radian).

The position of any atom can be transformed from internal coordinates (orthonormal coordinates derived from the ZMatrix, with first atom at (0,0,0), second atom at (x,0,0), third atom at (x,y,0),...) to orthonormal coordinates in the crystal reference frame (ie with orientation of the ZScatterer) using :

, where x0(i), y0(i) and z0(i) describe the position for atom (i) in internal coordinates, and x(i), y(i), z(i) are coordinates of the rotated ZScatterer.

The rotation is performed around a 'pivot' atom (see ZScatterer::mPivotAtom)

double mPhi [private]
 

Angles giving the orientation of the ZScatterer (stored in radian).

The position of any atom can be transformed from internal coordinates (orthonormal coordinates derived from the ZMatrix, with first atom at (0,0,0), second atom at (x,0,0), third atom at (x,y,0),...) to orthonormal coordinates in the crystal reference frame (ie with orientation of the ZScatterer) using :

, where x0(i), y0(i) and z0(i) describe the position for atom (i) in internal coordinates, and x(i), y(i), z(i) are coordinates of the rotated ZScatterer.

The rotation is performed around a 'pivot' atom (see ZScatterer::mPivotAtom)

double mPsi [private]
 

Angles giving the orientation of the ZScatterer (stored in radian).

The position of any atom can be transformed from internal coordinates (orthonormal coordinates derived from the ZMatrix, with first atom at (0,0,0), second atom at (x,0,0), third atom at (x,y,0),...) to orthonormal coordinates in the crystal reference frame (ie with orientation of the ZScatterer) using :

, where x0(i), y0(i) and z0(i) describe the position for atom (i) in internal coordinates, and x(i), y(i), z(i) are coordinates of the rotated ZScatterer.

The rotation is performed around a 'pivot' atom (see ZScatterer::mPivotAtom)


The documentation for this class was generated from the following file:
Generated on Wed Nov 14 19:48:39 2001 for ObjCryst++ by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001