gcu::CrystalDoc Class Reference

#include <gcu/crystaldoc.h>

Inheritance diagram for gcu::CrystalDoc:

gcu::GLDocument gcu::Document gcu::Object gcu::DialogOwner

List of all members.

Public Member Functions

 CrystalDoc (Application *App)
virtual ~CrystalDoc ()
void ParseXMLTree (xmlNode *xml)
void Update ()
CrystalViewGetView ()
void Draw (Matrix const &m) const
virtual CrystalViewCreateNewView ()
virtual CrystalAtomCreateNewAtom ()
virtual CrystalLineCreateNewLine ()
virtual CrystalCleavageCreateNewCleavage ()
xmlDocPtr BuildXMLTree () const
virtual const char * GetProgramId () const
bool SetProperty (unsigned property, char const *value)
std::string GetProperty (unsigned property) const
bool Loaded () throw (LoaderError)
void AddChild (Object *object)
void Reinit ()
std::string GetNameCommon (void) const

Protected Member Functions

void Init ()
virtual bool LoadNewView (xmlNodePtr node)

Protected Attributes

gcLattices m_lattice
gdouble m_a
gdouble m_b
gdouble m_c
gdouble m_alpha
gdouble m_beta
gdouble m_gamma
gdouble m_xmin
gdouble m_ymin
gdouble m_zmin
gdouble m_xmax
gdouble m_ymax
gdouble m_zmax
gboolean m_bFixedSize
CrystalAtomList AtomDef
CrystalAtomList Atoms
CrystalLineList LineDef
CrystalLineList Lines
CrystalCleavageList Cleavages
std::list< CrystalView * > m_Views


Detailed Description

The document containing the crystal structure.

Definition at line 85 of file crystaldoc.h.


Constructor & Destructor Documentation

gcu::CrystalDoc::CrystalDoc ( Application App  ) 

The constructor of CrystalDoc

virtual gcu::CrystalDoc::~CrystalDoc (  )  [virtual]

The destructor of CrystalDoc


Member Function Documentation

void gcu::CrystalDoc::AddChild ( Object object  )  [virtual]

Parameters:
object the Object instance to add as a child.

Reimplemented from gcu::Object.

xmlDocPtr gcu::CrystalDoc::BuildXMLTree (  )  const

Builds the xmlDoc corresponding to the crystal structure.

Returns:
a pointer to the XML document.

virtual CrystalAtom* gcu::CrystalDoc::CreateNewAtom (  )  [virtual]

Creates a new atom. This method should be overrided by programs deriving a new atom class from CrystalAtom.

Returns:
a pointer to the new CrystalAtom instance.

virtual CrystalCleavage* gcu::CrystalDoc::CreateNewCleavage (  )  [virtual]

Creates a new cleavage. This method should be overrided by programs deriving a new line class from CrystalCleavage

Returns:
a pointer to the new CrystalCleavage instance.

virtual CrystalLine* gcu::CrystalDoc::CreateNewLine (  )  [virtual]

Creates a new line. This method should be overrided by programs deriving a new view class from CrystalLine.

Returns:
a pointer to the new CrystalLine instance.

virtual CrystalView* gcu::CrystalDoc::CreateNewView (  )  [virtual]

Creates a view of the document. This method should be overrided by programs deriving a new view class from CrystalView.

Returns:
a pointer to the new CrystalView instance.

void gcu::CrystalDoc::Draw ( Matrix const &  m  )  const [virtual]

Parameters:
m the Matrix giving the current model orientation
Displays the molecule using OpenGL.

Implements gcu::GLDocument.

std::string gcu::CrystalDoc::GetNameCommon ( void   )  const [inline]

GetSpaceGroup()

Returns:
the space group associated with the lattice.

Definition at line 299 of file crystaldoc.h.

virtual const char* gcu::CrystalDoc::GetProgramId (  )  const [virtual]

Returns:
the identity of the program as saved in files in the generator tag. This method should be overrided by programs able to save crystal structures in XML files conforming to gcrystal.dtd. It is used mainly to ensure compatiblity with files created by older versions of the program.

std::string gcu::CrystalDoc::GetProperty ( unsigned  property  )  const [virtual]

Parameters:
property the property id as defined in objprops.h
Used when saving to get properties from the document.
Returns:
the property as a string. The returned string might be empty.

Reimplemented from gcu::Object.

CrystalView* gcu::CrystalDoc::GetView (  ) 

Returns:
a pointer to the first CrystalView of the document. The view will be created if it does not already exist.

Reimplemented from gcu::GLDocument.

void gcu::CrystalDoc::Init (  )  [protected]

Initialize a new CrystalDoc instance.

bool gcu::CrystalDoc::Loaded (  )  throw (LoaderError) [virtual]

Called by the application whe the document has been loaded to update the title and add some lines.

Reimplemented from gcu::Document.

virtual bool gcu::CrystalDoc::LoadNewView ( xmlNodePtr  node  )  [protected, virtual]

Parameters:
node,: the xmlNode containing the serialized view.
Loads a view from a XML document. This methd must be overrided by applications supporting multiple views.

void gcu::CrystalDoc::ParseXMLTree ( xmlNode *  xml  ) 

Parameters:
xml,: a pointer to the root xmlNode of the xmlDoc containing the definition of the crystal.
Analyses the contents of the XML document and builds the cryatl structure from the data. Typical usage is:
CrystalDoc* crystal = new CrystalDoc();
xmlDocPtr doc = xmlParseFile(filename);
crystal->ParseXMLTree(doc->children);

void gcu::CrystalDoc::Reinit (  ) 

Reinitialize a CrystalDoc instance. Used when loading a file in an already existing document.

bool gcu::CrystalDoc::SetProperty ( unsigned  property,
char const *  value 
) [virtual]

Parameters:
property the property id as defined in objprops.h
value the property value as a string
Used when loading to set properties to the document
Returns:
true if the property could be set, or if the property is not relevant, false otherwise.

Reimplemented from gcu::Object.

void gcu::CrystalDoc::Update (  ) 

This method must be called when a new document is loaded or when the definition of the crystal is changed. It recalculates everything and updates all the views.


Member Data Documentation

List of the atoms in the definition of the crystal

Definition at line 273 of file crystaldoc.h.

List of the atoms displayed.

Definition at line 277 of file crystaldoc.h.

List of the cleavages defined.

Definition at line 289 of file crystaldoc.h.

List of the lines in the definition of the crystal

Definition at line 281 of file crystaldoc.h.

List of the lines displayed.

Definition at line 285 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_a [protected]

The a parameter of the unit cell.

Definition at line 221 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_alpha [protected]

The alpha angle of the unit cell.

Definition at line 233 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_b [protected]

The b parameter of the unit cell.

Definition at line 225 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_beta [protected]

The beta angle of the unit cell.

Definition at line 237 of file crystaldoc.h.

gboolean gcu::CrystalDoc::m_bFixedSize [protected]

true if cleavages must not change positions in the view.

Definition at line 269 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_c [protected]

The c parameter of the unit cell.

Definition at line 229 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_gamma [protected]

The gamma angle of the unit cell.

Definition at line 241 of file crystaldoc.h.

The Bravais lattice of the crystal.

Definition at line 217 of file crystaldoc.h.

std::list<CrystalView *> gcu::CrystalDoc::m_Views [protected]

List of the views of the document.

Definition at line 293 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_xmax [protected]

The maximum x coordinate in the representation of the crystal structure.

Definition at line 257 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_xmin [protected]

The minimum x coordinate in the representation of the crystal structure.

Definition at line 245 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_ymax [protected]

The maximum y coordinate in the representation of the crystal structure.

Definition at line 261 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_ymin [protected]

The minimum y coordinate in the representation of the crystal structure.

Definition at line 249 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_zmax [protected]

The maximum z coordinate in the representation of the crystal structure.

Definition at line 265 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_zmin [protected]

The minimum z coordinate in the representation of the crystal structure.

Definition at line 253 of file crystaldoc.h.


The documentation for this class was generated from the following file:

Generated on Sat Apr 24 09:29:24 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9