|
The Gnome Chemistry Utils
0.14.15
|
#include <gcr/document.h>
Public Member Functions | |
| Document (gcu::Application *App) | |
| virtual | ~Document () |
| void | ParseXMLTree (xmlNode *xml) |
| void | Update () |
| View * | GetView () |
| void | Draw (gcu::Matrix const &m) const |
| virtual View * | CreateNewView () |
| virtual Atom * | CreateNewAtom () |
| virtual Line * | CreateNewLine () |
| virtual Cleavage * | CreateNewCleavage () |
| 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 () |
| AtomList * | GetAtomList () |
| CleavageList * | GetCleavageList () |
| LineList * | GetLineList () |
| void | GetCell (Lattice *lattice, double *a, double *b, double *c, double *alpha, double *beta, double *gamma) |
| void | SetCell (Lattice lattice, double a, double b, double c, double alpha, double beta, double gamma) |
| void | GetSize (double *xmin, double *xmax, double *ymin, double *ymax, double *zmin, double *zmax) |
| void | SetSize (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) |
| void | CheckAtoms () |
| void | CheckCleavages () |
| void | CheckLines () |
| void | Define (unsigned nPage=0) |
| void | AddView (View *pView) |
| bool | RemoveView (View *pView) |
| void | RemoveAllViews () |
| View * | GetActiveView () |
| std::list< gcr::View * > * | GetViews () |
| void | RenameViews () |
| bool | VerifySaved () |
| void | SetWidget (GtkWidget *widget) |
| const gchar * | GetFileName () |
| void | SetActiveView (View *pView) |
| void | SaveAsImage (const std::string &filename, char const *type, std::map< std::string, std::string > &options) |
| void | SetFileName (const std::string &filename) |
| void | SetTitle (char const *title) |
| void | SetTitle (std::string &title) |
| char const * | GetTitle () |
| void | SetAuthor (char const *author) |
| void | SetMail (char const *mail) |
| void | SetComment (char const *comment) |
| void | SetLabel (char const *label) |
| GDate * | GetCreationDate () |
| GDate * | GetRevisionDate () |
| char const * | GetLabel () |
| void | OnExportVRML (const std::string &FileName) const |
| void | Save () const |
| 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) |
| void | SetFixedSize (bool val) |
| bool | GetFixedSize (void) const |
| bool & | GetRefFixedSize (void) |
| void | SetReadOnly (bool val) |
| bool | GetReadOnly (void) const |
| bool & | GetRefReadOnly (void) |
| char * | GetMail (void) |
| char * | GetComment (void) |
Public Member Functions inherited from gcu::GLDocument | |
| GLDocument (Application *App) | |
| virtual | ~GLDocument () |
| double | GetMaxDist (void) |
| GLView * | GetView (void) |
Public Member Functions inherited from gcu::Document | |
| Document (Application *App=NULL) | |
| std::string & | GetTranslatedId (const char *id) |
| void | EraseTranslationId (const char *Id) |
| void | EmptyTranslationTable () |
| std::string & | GetTitle () |
| void | NotifyDirty (Object *pObject) |
| virtual Residue * | CreateResidue (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, Action action=ActionException) throw (std::runtime_error) |
| std::string | Name () |
| void | ObjectLoaded (Object *obj) |
| std::set< Object *> | GetNewObjects () |
| virtual Window * | GetWindow () |
| Application * | GetApp (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) |
| char const * | GetId () const |
| virtual void | AddChild (Object *object) |
| Object * | GetMolecule () const |
| Object * | GetReaction () const |
| Object * | GetGroup () const |
| Document * | GetDocument () const |
| Application * | GetApplication () const |
| Object * | GetParentOfType (TypeId Id) const |
| Object * | GetChild (const gchar *Id) const |
| Object * | GetFirstChild (std::map< std::string, Object *>::iterator &i) |
| Object * | GetNextChild (std::map< std::string, Object *>::iterator &i) |
| Object * | GetDescendant (const char *Id) const |
| Object * | GetParent () const |
| void | SetParent (Object *Parent) |
| virtual xmlNodePtr | Save (xmlDocPtr xml) const |
| virtual bool | Load (xmlNodePtr node) |
| virtual bool | GetCoords (double *x, double *y, double *z=NULL) const |
| 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 Object * | GetAtomAt (double x, double y, double z=0.) |
| virtual bool | Build (std::set< Object * > const &Children) throw (std::invalid_argument) |
| virtual double | GetYAlign () |
| virtual bool | BuildContextualMenu (UIManager *uim, Object *object, double x, double y) |
| void | EmitSignal (SignalId Signal) |
| virtual bool | OnSignal (SignalId Signal, Object *Child) |
| void | Lock (bool state=true) |
| bool | IsLocked () |
| Object * | GetFirstLink (std::set< Object *>::iterator &i) |
| Object * | GetNextLink (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 |
| virtual bool | CanSelect () const |
| virtual void | NotifyEmpty () |
| void | ShowPropertiesDialog () |
| bool | GetDirty (void) const |
Public Member Functions inherited from gcu::DialogOwner | |
| DialogOwner () | |
| virtual | ~DialogOwner () |
| Dialog * | GetDialog (std::string name) const |
| void | ClearDialogs () |
Protected Member Functions | |
| void | Init () |
| virtual bool | LoadNewView (xmlNodePtr node) |
Protected Member Functions inherited from gcu::Object | |
| virtual Dialog * | BuildPropertiesDialog () |
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 |
| GDate | m_CreationDate |
| GDate | m_RevisionDate |
| char * | m_Author |
| char * | m_Mail |
| char * | m_Comment |
Protected Attributes inherited from gcu::GLDocument | |
| double | m_MaxDist |
| GLView * | m_View |
Protected Attributes inherited from gcu::Document | |
| std::string | m_Title |
| std::set< Object * > | m_DirtyObjects |
| Application * | m_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 Object * | CreateObject (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 () |
The document containing the crystal structure.
Definition at line 88 of file gcr/document.h.
| gcr::Document::Document | ( | gcu::Application * | App | ) |
The constructor of Document
|
virtual |
The destructor of Document
Reimplemented from gcu::Document.
| void gcr::Document::AddChild | ( | Object * | object | ) |
| object | the Object instance to add as a child. |
| void gcr::Document::AddView | ( | View * | pView | ) |
| pView | a new view. |
Adds a new view to the document.
| xmlDocPtr gcr::Document::BuildXMLTree | ( | ) | const |
Builds the xmlDoc corresponding to the crystal structure.
| void gcr::Document::CheckAtoms | ( | ) |
Checks the atoms list and remove duplicates if needed.
| void gcr::Document::CheckCleavages | ( | ) |
Checks the cleavages list and remove duplicates if needed.
| void gcr::Document::CheckLines | ( | ) |
Checks the lines list and remove duplicates if needed.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
| void gcr::Document::Define | ( | unsigned | nPage = 0 | ) |
| nPage | the dialog id. |
Shows the dialog corresponding to nPage: 0: cell and lattice dialog, 1: atoms dialog, 2: lines dialog, 3: size dialog, 4: cleavages dialog.
|
virtual |
| m | the 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.
|
inline |
Definition at line 324 of file gcr/document.h.
|
inline |
Definition at line 211 of file gcr/document.h.
|
inline |
Definition at line 600 of file gcr/document.h.
| void gcr::Document::GetCell | ( | Lattice * | lattice, |
| double * | a, | ||
| double * | b, | ||
| double * | c, | ||
| double * | alpha, | ||
| double * | beta, | ||
| double * | gamma | ||
| ) |
| lattice | where to store the lattice. |
| a | where to store the a cell parameter. |
| b | where to store the b cell parameter. |
| c | where to store the c cell parameter. |
| alpha | where to store the alpha cell parameter. |
| beta | where to store the beta cell parameter. |
| gamma | where to store the gamma cell parameter. |
Retrieves the cell parameters.
|
inline |
Definition at line 216 of file gcr/document.h.
|
inline |
Definition at line 651 of file gcr/document.h.
|
inline |
Definition at line 424 of file gcr/document.h.
|
inline |
Definition at line 354 of file gcr/document.h.
|
inline |
Definition at line 614 of file gcr/document.h.
|
inline |
Definition at line 434 of file gcr/document.h.
|
inline |
Definition at line 221 of file gcr/document.h.
|
inline |
Definition at line 643 of file gcr/document.h.
|
inline |
Definition at line 564 of file gcr/document.h.
|
inline |
Definition at line 572 of file gcr/document.h.
|
inline |
Definition at line 576 of file gcr/document.h.
|
inline |
Definition at line 568 of file gcr/document.h.
|
virtual |
|
virtual |
| property | the property id as defined in objprops.h |
Used when saving to get properties from the document.
Reimplemented from gcu::Object.
|
inline |
Definition at line 627 of file gcr/document.h.
|
inline |
Definition at line 600 of file gcr/document.h.
|
inline |
Definition at line 614 of file gcr/document.h.
|
inline |
Definition at line 627 of file gcr/document.h.
|
inline |
Definition at line 587 of file gcr/document.h.
|
inline |
Definition at line 429 of file gcr/document.h.
| void gcr::Document::GetSize | ( | double * | xmin, |
| double * | xmax, | ||
| double * | ymin, | ||
| double * | ymax, | ||
| double * | zmin, | ||
| double * | zmax | ||
| ) |
| xmin | where to store the minimum x. |
| xmax | where to store the maximum x. |
| ymin | where to store the minimum y. |
| ymax | where to store the maximum y. |
| zmin | where to store the minimum z. |
| zmax | where to store the maximum z. |
Retrieves the visible volume in cell coordinates.
|
inline |
Definition at line 587 of file gcr/document.h.
|
inline |
Definition at line 390 of file gcr/document.h.
| View* gcr::Document::GetView | ( | ) |
|
inline |
Definition at line 329 of file gcr/document.h.
|
protected |
Initialize a new Document instance.
|
virtual | |||||||||||||
Called by the application when the document has been loaded to update the title and add some lines.
Reimplemented from gcu::Document.
|
protectedvirtual |
| 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::OnExportVRML | ( | const std::string & | FileName | ) | const |
| FileName | a file name. |
Saves the scene as a VRML file.
| void gcr::Document::ParseXMLTree | ( | xmlNode * | xml | ) |
| 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 crystal structure from the data. Typical usage is:
| void gcr::Document::Reinit | ( | ) |
Reinitialize a Document instance. Used when loading a file in an already existing document.
| void gcr::Document::RemoveAllViews | ( | ) |
Removes all views from the document. This should be done only when destroying the document.
| bool gcr::Document::RemoveView | ( | View * | pView | ) |
| pView | the view to remove. Removes a view from the document when possible. |
| void gcr::Document::RenameViews | ( | ) |
Updates the views window titles.
|
virtual |
Saves the document.
Reimplemented from gcu::Document.
| void gcr::Document::SaveAsImage | ( | const std::string & | filename, |
| char const * | type, | ||
| std::map< std::string, std::string > & | options | ||
| ) |
| filename | a file name |
| type | an image type such as "png" or "jpeg". |
| options | the options to use if any. |
Saves the scene as a bitmap.
|
inline |
| pView | the new active view. |
Sets the new active view.
Definition at line 361 of file gcr/document.h.
| void gcr::Document::SetAuthor | ( | char const * | author | ) |
| author | the file author's name |
Sets the author's name.
|
inline |
| val | whether 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 600 of file gcr/document.h.
| void gcr::Document::SetCell | ( | Lattice | lattice, |
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | alpha, | ||
| double | beta, | ||
| double | gamma | ||
| ) |
| lattice | the new lattice. |
| a | the new a value. |
| b | the new b value. |
| c | the new c value. |
| alpha | the new alpha value. |
| beta | the new beta value. |
| gamma | the new gamma value. |
Sets the cell parameters.
| void gcr::Document::SetComment | ( | char const * | comment | ) |
| comment | a comment |
Adds a comment to the document. Currently only one comment is allowed per document.
| void gcr::Document::SetFileName | ( | const std::string & | filename | ) |
| filename | a new file name |
Changes the file name.
|
inline |
| val | whether cleavages should not change positions in the view. |
If true, adding cleavages will not change atoms positions, otherwise, the scene will be made as large as possible.
Definition at line 614 of file gcr/document.h.
| void gcr::Document::SetLabel | ( | char const * | label | ) |
| label | the new window title. |
Sets the label to use as window title for views.
| void gcr::Document::SetMail | ( | char const * | ) |
| the file author's mail address |
Sets the author's mail address.
|
virtual |
| 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
Reimplemented from gcu::Object.
|
inline |
| val | whether the file can be modified. |
If true, the document can't be saved using the original file name.
Definition at line 627 of file gcr/document.h.
| void gcr::Document::SetSize | ( | double | xmin, |
| double | xmax, | ||
| double | ymin, | ||
| double | ymax, | ||
| double | zmin, | ||
| double | zmax | ||
| ) |
| xmin | the new minimum x. |
| xmax | the new maximum x. |
| ymin | the new minimum y. |
| ymax | the new maximum y. |
| zmin | the new minimum z. |
| zmax | the new maximum z. |
Sets the visible volume in cell coordinates.
|
inline |
| val | a SpaceGroup. Associates a the space group with the lattice. |
Definition at line 587 of file gcr/document.h.
|
virtual |
|
virtual |
| title | the new document title. |
Reimplemented from gcu::Document.
|
inline |
| widget | the new current widget. |
Sets the currently active widget.
Definition at line 349 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.
| bool gcr::Document::VerifySaved | ( | ) |
Checks if the document needs to be saved and ask the user about what to do when needed.
|
protected |
List of the atoms in the definition of the crystal
Definition at line 521 of file gcr/document.h.
|
protected |
List of the atoms displayed.
Definition at line 525 of file gcr/document.h.
|
protected |
List of the cleavages defined.
Definition at line 537 of file gcr/document.h.
|
protected |
List of the lines in the definition of the crystal
Definition at line 529 of file gcr/document.h.
|
protected |
List of the lines displayed.
Definition at line 533 of file gcr/document.h.
|
protected |
The a parameter of the unit cell.
Definition at line 473 of file gcr/document.h.
|
protected |
The alpha angle of the unit cell.
Definition at line 485 of file gcr/document.h.
|
protected |
The document author's name.
Definition at line 635 of file gcr/document.h.
|
protected |
The b parameter of the unit cell.
Definition at line 477 of file gcr/document.h.
|
protected |
The beta angle of the unit cell.
Definition at line 489 of file gcr/document.h.
|
protected |
The c parameter of the unit cell.
Definition at line 481 of file gcr/document.h.
|
protected |
The document comment.
Definition at line 651 of file gcr/document.h.
|
protected |
The document creation date.
Definition at line 546 of file gcr/document.h.
|
protected |
The gamma angle of the unit cell.
Definition at line 493 of file gcr/document.h.
|
protected |
The Bravais lattice of the crystal.
Definition at line 469 of file gcr/document.h.
|
protected |
The document author's mail address.
Definition at line 643 of file gcr/document.h.
|
protected |
The document last revision date.
Definition at line 551 of file gcr/document.h.
|
protected |
List of the views of the document.
Definition at line 541 of file gcr/document.h.
|
protected |
The maximum x coordinate in the representation of the crystal structure.
Definition at line 509 of file gcr/document.h.
|
protected |
The minimum x coordinate in the representation of the crystal structure.
Definition at line 497 of file gcr/document.h.
|
protected |
The maximum y coordinate in the representation of the crystal structure.
Definition at line 513 of file gcr/document.h.
|
protected |
The minimum y coordinate in the representation of the crystal structure.
Definition at line 501 of file gcr/document.h.
|
protected |
The maximum z coordinate in the representation of the crystal structure.
Definition at line 517 of file gcr/document.h.
|
protected |
The minimum z coordinate in the representation of the crystal structure.
Definition at line 505 of file gcr/document.h.
1.8.12