The Gnome Chemistry Utils 0.13.3
Public Member Functions | Protected Member Functions | Protected Attributes
gcr::Document Class Reference

#include <gcr/document.h>

Inheritance diagram for gcr::Document:
gcu::GLDocument gcu::Document gcu::Object gcu::DialogOwner

List of all members.

Public Member Functions

 Document (gcu::Application *App)
virtual ~Document ()
void ParseXMLTree (xmlNode *xml)
void Update ()
ViewGetView ()
void Draw (gcu::Matrix const &m) const
virtual ViewCreateNewView ()
virtual AtomCreateNewAtom ()
virtual LineCreateNewLine ()
virtual CleavageCreateNewCleavage ()
xmlDocPtr BuildXMLTree () const
virtual const char * GetProgramId () const
bool SetProperty (unsigned property, char const *value)
std::string GetProperty (unsigned property) const
bool Loaded () throw (gcu::LoaderError)
void AddChild (Object *object)
gcu::SpaceGroup const * FindSpaceGroup ()
void Reinit ()
std::string GetNameCommon (void) const
std::string GetNameSystematic (void) const
std::string GetNameMineral (void) const
std::string GetNameStructure (void) const
void SetSpaceGroup (gcu::SpaceGroup const *val)
gcu::SpaceGroup const * GetSpaceGroup (void) const
gcu::SpaceGroup const *& GetRefSpaceGroup (void)
void SetAutoSpaceGroup (bool val)
bool GetAutoSpaceGroup (void) const
bool & GetRefAutoSpaceGroup (void)

Protected Member Functions

void Init ()
virtual bool LoadNewView (xmlNodePtr node)

Protected Attributes

Lattice 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
AtomList AtomDef
AtomList Atoms
LineList LineDef
LineList Lines
CleavageList Cleavages
std::list< View * > m_Views

Detailed Description

The document containing the crystal structure.

Definition at line 88 of file gcr/document.h.


Constructor & Destructor Documentation

gcr::Document::Document ( gcu::Application App)

The constructor of Document

Reimplemented from gcu::Document.

virtual gcr::Document::~Document ( ) [virtual]

The destructor of Document

Reimplemented from gcu::Document.


Member Function Documentation

void gcr::Document::AddChild ( Object *  object)
Parameters:
objectthe Object instance to add as a child.
xmlDocPtr gcr::Document::BuildXMLTree ( ) const

Builds the xmlDoc corresponding to the crystal structure.

Returns:
a pointer to the XML document.
virtual Atom* gcr::Document::CreateNewAtom ( ) [virtual]

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

Returns:
a pointer to the new Atom instance.
virtual Cleavage* gcr::Document::CreateNewCleavage ( ) [virtual]

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

Returns:
a pointer to the new Cleavage instance.
virtual Line* gcr::Document::CreateNewLine ( ) [virtual]

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

Returns:
a pointer to the new Line instance.
virtual View* gcr::Document::CreateNewView ( ) [virtual]

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

Returns:
a pointer to the new View instance.
void gcr::Document::Draw ( gcu::Matrix const &  m) const [virtual]
Parameters:
mthe Matrix giving the current model orientation

Displays the molecule using OpenGL.

Implements gcu::GLDocument.

gcu::SpaceGroup const* gcr::Document::FindSpaceGroup ( )

Attempts to infer the symmetry space group for the crystal.

Returns:
the SpaceGroup found.
gcr::Document::GetAutoSpaceGroup ( void  ) const [inline]
Returns:
whether the space group is automatically evaluated.

Definition at line 343 of file gcr/document.h.

gcr::Document::GetNameCommon ( void  ) const [inline]
Returns:
the common name or the chemical entity.

Definition at line 307 of file gcr/document.h.

gcr::Document::GetNameMineral ( void  ) const [inline]
Returns:
the mineral name or the chemical entity.

Definition at line 315 of file gcr/document.h.

gcr::Document::GetNameStructure ( void  ) const [inline]
Returns:
the structure name or the chemical entity.

Definition at line 319 of file gcr/document.h.

gcr::Document::GetNameSystematic ( void  ) const [inline]
Returns:
the systematic name or the chemical entity.

Definition at line 311 of file gcr/document.h.

virtual const char* gcr::Document::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 gcr::Document::GetProperty ( unsigned  property) const [virtual]
Parameters:
propertythe 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.

gcr::Document::GetRefAutoSpaceGroup ( void  ) [inline]
Returns:
whether the space group is automatically evaluated as a reference.

Definition at line 343 of file gcr/document.h.

gcr::Document::GetRefSpaceGroup ( void  ) [inline]
Returns:
the space group associated with the lattice as a reference.

Definition at line 330 of file gcr/document.h.

gcr::Document::GetSpaceGroup ( void  ) const [inline]
Returns:
the space group associated with the lattice.

Definition at line 330 of file gcr/document.h.

View* gcr::Document::GetView ( )
Returns:
a pointer to the first View of the document. The view will be created if it does not already exist.

Reimplemented from gcu::GLDocument.

void gcr::Document::Init ( ) [protected]

Initialize a new Document instance.

bool gcr::Document::Loaded ( ) throw (gcu::LoaderError) [virtual]

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

Reimplemented from gcu::Document.

virtual bool gcr::Document::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 gcr::Document::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:

Document *crystal = new Document();
xmlDocPtr doc = xmlParseFile (filename);
crystal->ParseXMLTree (doc->children);
void gcr::Document::Reinit ( )

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

gcr::Document::SetAutoSpaceGroup ( bool  auto) [inline]
Parameters:
autowheteher the lattice SpaceGroup should be automatically searched for.

If true, after each change, the framework will reevaluate the space group according to the Bravais lattice and the defines atoms.

Definition at line 343 of file gcr/document.h.

bool gcr::Document::SetProperty ( unsigned  property,
char const *  value 
) [virtual]
Parameters:
propertythe property id as defined in objprops.h
valuethe 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.

gcr::Document::SetSpaceGroup ( gcu::SpaceGroup const *  val) [inline]
Parameters:
groupa SpaceGroup. Associates a the space group with the lattice.

Definition at line 330 of file gcr/document.h.

void gcr::Document::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

AtomList gcr::Document::AtomDef [protected]

List of the atoms in the definition of the crystal

Definition at line 282 of file gcr/document.h.

AtomList gcr::Document::Atoms [protected]

List of the atoms displayed.

Definition at line 286 of file gcr/document.h.

CleavageList gcr::Document::Cleavages [protected]

List of the cleavages defined.

Definition at line 298 of file gcr/document.h.

LineList gcr::Document::LineDef [protected]

List of the lines in the definition of the crystal

Definition at line 290 of file gcr/document.h.

LineList gcr::Document::Lines [protected]

List of the lines displayed.

Definition at line 294 of file gcr/document.h.

gdouble gcr::Document::m_a [protected]

The a parameter of the unit cell.

Definition at line 234 of file gcr/document.h.

gdouble gcr::Document::m_alpha [protected]

The alpha angle of the unit cell.

Definition at line 246 of file gcr/document.h.

gdouble gcr::Document::m_b [protected]

The b parameter of the unit cell.

Definition at line 238 of file gcr/document.h.

gdouble gcr::Document::m_beta [protected]

The beta angle of the unit cell.

Definition at line 250 of file gcr/document.h.

gdouble gcr::Document::m_c [protected]

The c parameter of the unit cell.

Definition at line 242 of file gcr/document.h.

gdouble gcr::Document::m_gamma [protected]

The gamma angle of the unit cell.

Definition at line 254 of file gcr/document.h.

Lattice gcr::Document::m_lattice [protected]

The Bravais lattice of the crystal.

Definition at line 230 of file gcr/document.h.

std::list<View *> gcr::Document::m_Views [protected]

List of the views of the document.

Definition at line 302 of file gcr/document.h.

gdouble gcr::Document::m_xmax [protected]

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

Definition at line 270 of file gcr/document.h.

gdouble gcr::Document::m_xmin [protected]

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

Definition at line 258 of file gcr/document.h.

gdouble gcr::Document::m_ymax [protected]

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

Definition at line 274 of file gcr/document.h.

gdouble gcr::Document::m_ymin [protected]

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

Definition at line 262 of file gcr/document.h.

gdouble gcr::Document::m_zmax [protected]

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

Definition at line 278 of file gcr/document.h.

gdouble gcr::Document::m_zmin [protected]

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

Definition at line 266 of file gcr/document.h.


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