The Gnome Chemistry Utils  0.12.13
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gcu::CrystalDoc Class Reference

#include <gcu/crystaldoc.h>

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

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)
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 (SpaceGroup const *val)
SpaceGroup const * GetSpaceGroup (void) const
SpaceGroup const *& GetRefSpaceGroup (void)
void SetAutoSpaceGroup (bool val)
bool GetAutoSpaceGroup (void) const
bool & GetRefAutoSpaceGroup (void)
- Public Member Functions inherited from gcu::GLDocument
 GLDocument (Application *App)
virtual ~GLDocument ()
double GetMaxDist (void)
- Public Member Functions inherited from gcu::Document
 Document (Application *App=NULL)
virtual ~Document ()
std::string & GetTranslatedId (const char *id)
void EraseTranslationId (const char *Id)
void EmptyTranslationTable ()
virtual void SetTitle (std::string &title)
virtual void SetTitle (char const *title)
std::string & GetTitle ()
void NotifyDirty (Object *pObject)
virtual void Save () const
virtual ResidueCreateResidue (char const *name, char const *symbol, Molecule *molecule)
virtual Residue const * GetResidue (char const *symbol, bool *ambiguous=NULL)
virtual GtkWindow * GetGtkWindow ()
bool SetTarget (char const *id, Object **target, Object *parent, Object *owner=NULL) throw (std::runtime_error)
std::string Name ()
ApplicationGetApp (void)
bool GetEmpty (void)
void SetScale (double val)
double GetScale (void) const
double & GetRefScale (void)
- Public Member Functions inherited from gcu::Object
 Object (TypeId Id=OtherType)
virtual ~Object ()
TypeId GetType () const
void SetId (gchar const *Id)
gchar const * GetId () const
ObjectGetMolecule () const
ObjectGetReaction () const
ObjectGetGroup () const
DocumentGetDocument () const
ObjectGetParentOfType (TypeId Id) const
ObjectGetChild (const gchar *Id) const
ObjectGetFirstChild (std::map< std::string, Object * >::iterator &i)
ObjectGetNextChild (std::map< std::string, Object * >::iterator &i)
ObjectGetDescendant (const gchar *Id) const
ObjectGetParent () const
void SetParent (Object *Parent)
virtual xmlNodePtr Save (xmlDocPtr xml) const
virtual bool Load (xmlNodePtr node)
virtual void Move (double x, double y, double z=0.)
virtual void Transform2D (Matrix2D &m, double x, double y)
bool SaveChildren (xmlDocPtr xml, xmlNodePtr node) const
void SaveId (xmlNodePtr node) const
xmlNodePtr GetNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNextNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNodeByName (xmlNodePtr node, char const *Name)
xmlNodePtr GetNextNodeByName (xmlNodePtr node, char const *Name)
bool HasChildren () const
unsigned GetChildrenNumber () const
virtual ObjectGetAtomAt (double x, double y, double z=0.)
virtual bool Build (std::list< Object * > &Children) throw (std::invalid_argument)
virtual double GetYAlign ()
virtual bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y)
void EmitSignal (SignalId Signal)
virtual bool OnSignal (SignalId Signal, Object *Child)
void Lock (bool state=true)
bool IsLocked ()
ObjectGetFirstLink (std::set< Object * >::iterator &i)
ObjectGetNextLink (std::set< Object * >::iterator &i)
void Link (Object *object)
void Unlink (Object *object)
virtual void OnUnlink (Object *object)
void GetPossibleAncestorTypes (std::set< TypeId > &types) const
virtual void OnLoaded ()
void SetDirty (bool dirty=true)
virtual void Clear ()
std::string Identity ()
virtual char const * HasPropertiesDialog () const
void ShowPropertiesDialog ()
bool GetDirty (void) const
- Public Member Functions inherited from gcu::DialogOwner
 DialogOwner ()
virtual ~DialogOwner ()
DialogGetDialog (std::string name)
void ClearDialogs ()

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
- Protected Attributes inherited from gcu::GLDocument
double m_MaxDist
GLViewm_View
- Protected Attributes inherited from gcu::Document
std::string m_Title
std::set< Object * > m_DirtyObjects
Applicationm_App
bool m_Empty

Additional Inherited Members

- Static Public Member Functions inherited from gcu::Object
static TypeId AddType (std::string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType)
static void AddAlias (TypeId id, std::string TypeName)
static ObjectCreateObject (const std::string &TypeName, Object *parent=NULL)
static TypeId GetTypeId (const std::string &Name)
static std::string GetTypeName (TypeId Id)
static void AddMenuCallback (TypeId Id, BuildMenuCb cb)
static void AddRule (TypeId type1, RuleId rule, TypeId type2)
static void AddRule (const std::string &type1, RuleId rule, const std::string &type2)
static const std::set< TypeId > & GetRules (TypeId type, RuleId rule)
static const std::set< TypeId > & GetRules (const std::string &type, RuleId rule)
static void SetCreationLabel (TypeId Id, std::string Label)
static const std::string & GetCreationLabel (TypeId Id)
static const std::string & GetCreationLabel (const std::string &TypeName)
static SignalId CreateNewSignalId ()

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
objectthe 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
mthe Matrix giving the current model orientation

Displays the molecule using OpenGL.

Implements gcu::GLDocument.

SpaceGroup const* gcu::CrystalDoc::FindSpaceGroup ( )

Attempts to infer the symmetry space group for the crystal.

Returns
the SpaceGroup found.
gcu::CrystalDoc::GetAutoSpaceGroup ( void  ) const
inline
Returns
whether the space group is automatically evaluated.

Definition at line 337 of file crystaldoc.h.

gcu::CrystalDoc::GetNameCommon ( void  ) const
inline
Returns
the common name or the chemical entity.

Definition at line 301 of file crystaldoc.h.

gcu::CrystalDoc::GetNameMineral ( void  ) const
inline
Returns
the mineral name or the chemical entity.

Definition at line 309 of file crystaldoc.h.

gcu::CrystalDoc::GetNameStructure ( void  ) const
inline
Returns
the structure name or the chemical entity.

Definition at line 313 of file crystaldoc.h.

gcu::CrystalDoc::GetNameSystematic ( void  ) const
inline
Returns
the systematic name or the chemical entity.

Definition at line 305 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
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.

gcu::CrystalDoc::GetRefAutoSpaceGroup ( void  )
inline
Returns
whether the space group is automatically evaluated as a reference.

Definition at line 337 of file crystaldoc.h.

gcu::CrystalDoc::GetRefSpaceGroup ( void  )
inline
Returns
the space group associated with the lattice as a reference.

Definition at line 324 of file crystaldoc.h.

gcu::CrystalDoc::GetSpaceGroup ( void  ) const
inline
Returns
the space group associated with the lattice.

Definition at line 324 of file crystaldoc.h.

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)
protectedvirtual
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.

gcu::CrystalDoc::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 337 of file crystaldoc.h.

bool gcu::CrystalDoc::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.

gcu::CrystalDoc::SetSpaceGroup ( SpaceGroup const *  group)
inline
Parameters
groupa SpaceGroup. Associates a the space group with the lattice.

Definition at line 324 of file crystaldoc.h.

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

CrystalAtomList gcu::CrystalDoc::AtomDef
protected

List of the atoms in the definition of the crystal

Definition at line 276 of file crystaldoc.h.

CrystalAtomList gcu::CrystalDoc::Atoms
protected

List of the atoms displayed.

Definition at line 280 of file crystaldoc.h.

CrystalCleavageList gcu::CrystalDoc::Cleavages
protected

List of the cleavages defined.

Definition at line 292 of file crystaldoc.h.

CrystalLineList gcu::CrystalDoc::LineDef
protected

List of the lines in the definition of the crystal

Definition at line 284 of file crystaldoc.h.

CrystalLineList gcu::CrystalDoc::Lines
protected

List of the lines displayed.

Definition at line 288 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_a
protected

The a parameter of the unit cell.

Definition at line 224 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_alpha
protected

The alpha angle of the unit cell.

Definition at line 236 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_b
protected

The b parameter of the unit cell.

Definition at line 228 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_beta
protected

The beta angle of the unit cell.

Definition at line 240 of file crystaldoc.h.

gboolean gcu::CrystalDoc::m_bFixedSize
protected

true if cleavages must not change positions in the view.

Definition at line 272 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_c
protected

The c parameter of the unit cell.

Definition at line 232 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_gamma
protected

The gamma angle of the unit cell.

Definition at line 244 of file crystaldoc.h.

gcLattices gcu::CrystalDoc::m_lattice
protected

The Bravais lattice of the crystal.

Definition at line 220 of file crystaldoc.h.

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

List of the views of the document.

Definition at line 296 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_xmax
protected

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

Definition at line 260 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_xmin
protected

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

Definition at line 248 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_ymax
protected

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

Definition at line 264 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_ymin
protected

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

Definition at line 252 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_zmax
protected

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

Definition at line 268 of file crystaldoc.h.

gdouble gcu::CrystalDoc::m_zmin
protected

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

Definition at line 256 of file crystaldoc.h.


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