gcp::Fragment Class Reference

Inheritance diagram for gcp::Fragment:

gcp::TextObject gcu::Object

List of all members.

Public Member Functions

void SetSelected (GtkWidget *w, int state)
void Add (GtkWidget *w) const
void Update (GtkWidget *w) const
xmlNodePtr Save (xmlDocPtr xml) const
bool Load (xmlNodePtr)
bool OnChanged (bool save)
Object * GetAtomAt (double x, double y, double z=0.)
void Move (double x, double y, double z=0)
void Transform2D (gcu::Matrix2D &m, double x, double y)
double GetYAlign ()
bool SetProperty (unsigned property, char const *value)


Detailed Description

Definition at line 39 of file fragment.h.


Member Function Documentation

void gcp::Fragment::SetSelected ( GtkWidget *  w,
int  state 
) [virtual]

Parameters:
w the GtkWidget inside which the Object is displayed.
state the selection state of the Object.
Used to set the selection state of the Object inside the widget. The values of state are application dependant and have no default value.

Reimplemented from gcu::Object.

void gcp::Fragment::Add ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object will be displayed.
Used to add a representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

void gcp::Fragment::Update ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object is displayed.
Used to update the representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

xmlNodePtr gcp::Fragment::Save ( xmlDocPtr  xml  )  const [virtual]

Parameters:
xml the xmlDoc used to save the document.
Used to save the Object to the xmlDoc. Each serializable Object should implement this virtual method.
Returns:
the xmlNode containing the serialized object. The name of the node should be the name of the corresponding type used as first parameter to the Object::AddType method. The default method just saves the id and children.

Reimplemented from gcu::Object.

bool gcp::Fragment::Load ( xmlNodePtr  node  )  [virtual]

Parameters:
node the xml node representing the text.
Loads the position and Id.

Reimplemented from gcp::TextObject.

bool gcp::Fragment::OnChanged ( bool  save  )  [virtual]

Parameters:
save whether the text should be saved for undo/redo operations.
Must be called after any change in the text. This method is pure virtual and must be overloaded in derived classes.

Implements gcp::TextObject.

Object* gcp::Fragment::GetAtomAt ( double  x,
double  y,
double  z = 0. 
) [virtual]

Parameters:
x the x coordinate
y the y coordinate
z the z coordinate
Returns:
a pointer to a child of type Atomtype at or near position defined by the coordinates passed as parameters. Default implementation returns NULL.

Reimplemented from gcu::Object.

void gcp::Fragment::Move ( double  x,
double  y,
double  z = 0 
) [virtual]

Parameters:
x the horizontal translation.
y the vertical translation.
z the depth translation.
The z variable is not useful.

Reimplemented from gcp::TextObject.

void gcp::Fragment::Transform2D ( gcu::Matrix2D m,
double  x,
double  y 
) [virtual]

Parameters:
m the Matrix2D of the transformation.
x the x component of the center of the transformation.
y the y component of the center of the transformation.
Used to move and/or transform an object. This virtual method must be overrided by Object derived classes for which it makes sense. The base Object class has no coordinates and the default method calls the corresponding method for every child.

Reimplemented from gcu::Object.

double gcp::Fragment::GetYAlign (  )  [virtual]

Used to retrieve the y coordinate for alignment. The default implementation returns 0.0 and every derived class for which alignment has a meaning should implement this method.

Returns:
y coordinate used for objects alignment.

Reimplemented from gcu::Object.

bool gcp::Fragment::SetProperty ( unsigned  property,
char const *  value 
) [virtual]

Parameters:
property the property id as defined in objprops.h
value the property value as a string
Used when loading to set properties to various objects. If the method returns false, the property should be set again later. This might happen if an atom does not exists when one of its bonds is loaded. All classes supporting the mechanism must overload this method.
Returns:
true if the property could be set, or if the property is not relevant, false otherwise.

Reimplemented from gcu::Object.


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

Generated on Mon Aug 25 17:46:35 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6