#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) |
Protected Attributes | |
std::string | m_Title |
std::set< Object * > | m_DirtyObjects |
Application * | m_App |
bool | m_Empty |
Definition at line 56 of file gcu/document.h.
gcu::Document::Document | ( | Application * | App = NULL |
) |
App | the Appllcation which owns the new document. |
virtual gcu::Document::~Document | ( | ) | [virtual] |
The destructor of Document.
Reimplemented in gcp::Document.
virtual Residue* gcu::Document::CreateResidue | ( | char const * | name, | |
char const * | symbol, | |||
Molecule * | molecule | |||
) | [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. |
Reimplemented in gcp::Document.
void gcu::Document::EmptyTranslationTable | ( | ) | [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.
void gcu::Document::EraseTranslationId | ( | const char * | Id | ) | [inline] |
Id | the entry to remove |
Definition at line 89 of file gcu/document.h.
gcu::Document::GetApp | ( | void | ) | [inline] |
Definition at line 210 of file gcu/document.h.
gcu::Document::GetEmpty | ( | void | ) | [inline] |
Definition at line 217 of file gcu/document.h.
virtual GtkWindow* gcu::Document::GetGtkWindow | ( | ) | [inline, virtual] |
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.
gcu::Document::GetRefScale | ( | void | ) | [inline] |
virtual Residue const* gcu::Document::GetResidue | ( | char const * | symbol, | |
bool * | ambiguous = NULL | |||
) | [virtual] |
symbol | the symbol for which a Residue* is searched. | |
ambiguous | where to store the boolean telling if the symbol is ambiguous or NULL. |
Reimplemented in gcp::Document.
gcu::Document::GetScale | ( | void | ) | const [inline] |
std::string& gcu::Document::GetTitle | ( | ) | [inline] |
Definition at line 109 of file gcu/document.h.
References m_Title.
std::string& gcu::Document::GetTranslatedId | ( | const char * | id | ) | [inline] |
id | the original id to tranlate |
Definition at line 81 of file gcu/document.h.
virtual bool gcu::Document::Loaded | ( | ) | throw (LoaderError) [virtual] |
Processes pending references resulting from failed calls to SetTarget().
Reimplemented in gcu::CrystalDoc.
std::string gcu::Document::Name | ( | ) | [virtual] |
void gcu::Document::NotifyDirty | ( | Object * | pObject | ) | [inline] |
pObject | an object needing some update. |
Definition at line 117 of file gcu/document.h.
References m_DirtyObjects.
virtual void gcu::Document::Save | ( | ) | const [inline, virtual] |
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.
gcu::Document::SetScale | ( | double | scale | ) | [inline] |
scale | 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. |
virtual void gcu::Document::SetTitle | ( | char const * | title | ) | [inline, virtual] |
title | the new document title. |
Definition at line 105 of file gcu/document.h.
References m_Title.
virtual void gcu::Document::SetTitle | ( | std::string & | title | ) | [inline, virtual] |
title | the new document title. |
Definition at line 101 of file gcu/document.h.
References m_Title.
gcu::Document::m_App [protected] |
The Application instance owning the document.
Definition at line 210 of file gcu/document.h.
std::set<Object*> gcu::Document::m_DirtyObjects [protected] |
The set of dirty objects, see gcu::Document::NotifyDirty.
Definition at line 201 of file gcu/document.h.
Referenced by NotifyDirty().
gcu::Document::m_Empty [protected] |
Tells if the document is empty or not.
Definition at line 217 of file gcu/document.h.
std::string gcu::Document::m_Title [protected] |
The document title.
Definition at line 196 of file gcu/document.h.
Referenced by GetTitle(), and SetTitle().