The Gnome Chemistry Utils
0.12.11
|
#include <gcu/document.h>
Public Member Functions | |
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 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) throw (std::runtime_error) |
virtual bool | Loaded () throw (LoaderError) |
std::string | Name () |
Application * | GetApp (void) |
bool | GetEmpty (void) |
void | SetScale (double val) |
double | GetScale (void) const |
double & | GetRefScale (void) |
![]() | |
Object (TypeId Id=OtherType) | |
virtual | ~Object () |
TypeId | GetType () const |
void | SetId (gchar const *Id) |
gchar const * | GetId () const |
virtual void | AddChild (Object *object) |
Object * | GetMolecule () const |
Object * | GetReaction () const |
Object * | GetGroup () const |
Document * | GetDocument () 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 gchar *Id) const |
Object * | GetParent () 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 Object * | GetAtomAt (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 () |
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 bool | SetProperty (unsigned property, char const *value) |
virtual std::string | GetProperty (unsigned property) 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 |
![]() | |
DialogOwner () | |
virtual | ~DialogOwner () |
Dialog * | GetDialog (std::string name) |
void | ClearDialogs () |
Protected Attributes | |
std::string | m_Title |
std::set< Object * > | m_DirtyObjects |
Application * | m_App |
bool | m_Empty |
Additional Inherited Members | |
![]() | |
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 () |
![]() | |
virtual Dialog * | BuildPropertiesDialog () |
This class is the base document class.
Definition at line 56 of file gcu/document.h.
gcu::Document::Document | ( | Application * | App = NULL | ) |
App | the Appllcation which owns the new document. |
The default constructor. Creates an empty document.
|
virtual |
The destructor of Document.
Reimplemented in gcp::Document.
|
virtual |
name | the name of the new residue. |
symbol | the symbol of the new residue. |
molecule | a molecule with a pseudo atom which describes the structure of the residue. |
This methodshould be overloaded by derived classes necessitating it. Default implementation just returns NULL.
Reimplemented in gcp::Document.
|
inline |
When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. The EmptyTranslationTable method should be called after pasting to reinitialize the table to avoid errors on the next paste event.
Definition at line 96 of file gcu/document.h.
|
inline |
Id | the entry to remove |
When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. The EraseTranslationTable method removes thenentry correspondig to id.
Definition at line 89 of file gcu/document.h.
|
inline |
Definition at line 210 of file gcu/document.h.
|
inline |
Definition at line 217 of file gcu/document.h.
|
inlinevirtual |
This method is used to get the active window of the document. Derived classes should, override it to return a consistent value. Default implementation returns NULL.
Reimplemented in gcp::Document.
Definition at line 149 of file gcu/document.h.
|
inline |
Definition at line 229 of file gcu/document.h.
|
virtual |
symbol | the symbol for which a Residue* is searched. |
ambiguous | where to store the boolean telling if the symbol is ambiguous or NULL. |
Documents might own not global residues with the same symbol or name but a different meaning from the standard residue.
Reimplemented in gcp::Document.
|
inline |
Definition at line 229 of file gcu/document.h.
|
inline |
Definition at line 109 of file gcu/document.h.
References m_Title.
|
inline |
id | the original id to tranlate |
When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. GetTranslatedId returns the translated id corresponding to the parameter id.
Definition at line 81 of file gcu/document.h.
|
virtual |
Processes pending references resulting from failed calls to SetTarget().
Reimplemented in gcu::CrystalDoc.
|
virtual |
Reimplemented from gcu::Object.
|
inline |
pObject | an object needing some update. |
The gcu::Document class just stores dirty objects, but don't do anything with them. Derived classes need to implement that, if meaningful.
Definition at line 117 of file gcu/document.h.
References m_DirtyObjects.
|
inlinevirtual |
Saves the document. Need to be overloaded by derived class if meaningful. Default implementation doesn't do anything.
Reimplemented in gcp::Document.
Definition at line 122 of file gcu/document.h.
|
inline |
scale | the new scale factor. |
Sets the new scale factor.
Definition at line 229 of file gcu/document.h.
bool gcu::Document::SetTarget | ( | char const * | id, |
Object ** | target, | ||
Object * | parent, | ||
Object * | owner = NULL |
||
) | throw (std::runtime_error) |
id | the id of the target Object. |
target | where to store the found object. |
parent | the ancestor of the search object or NULL. |
owner | the owner of the reference to the search object. |
Search the descendant of parent, or of the whole document if parent is not set whose Id is id. I not found, the parameters are stored for post loading processing using gcu::Document::Loaded(), and target is set to NULL. if owner is not NULL, post processing will call its OnLoaded() method.
|
inlinevirtual |
title | the new document title. |
Definition at line 101 of file gcu/document.h.
References m_Title.
|
inlinevirtual |
title | the new document title. |
Definition at line 105 of file gcu/document.h.
References m_Title.
|
protected |
The Application instance owning the document.
Definition at line 210 of file gcu/document.h.
|
protected |
The set of dirty objects, see gcu::Document::NotifyDirty.
Definition at line 201 of file gcu/document.h.
Referenced by NotifyDirty().
|
protected |
Tells if the document is empty or not.
Definition at line 217 of file gcu/document.h.
|
protected |
The document title.
Definition at line 196 of file gcu/document.h.
Referenced by GetTitle(), and SetTitle().