gcu Namespace Reference

The Gnome Chemistry Utils C++ classes. More...


Classes

class  Application
class  Atom
class  AtomPair
class  AtomMatchState
class  Bond
struct  ChainElt
class  Chain
class  Chem3dDoc
class  CrystalAtom
class  CrystalCleavage
class  CrystalDoc
class  CrystalLine
class  CrystalView
class  Cycle
class  DialogOwner
class  Dialog
class  Document
class  Element
 Chemical element. More...
class  FileChooser
class  parse_error
class  FormulaElt
class  FormulaAtom
class  FormulaBlock
class  FormulaResidue
 Residue. More...
class  Formula
class  GLDocument
class  GLView
class  Isotope
class  IsotopicPattern
struct  LoaderStruct
class  Loader
 class used to implement serialization engines. More...
class  Matrix
class  GLMatrix
class  Matrix2D
class  Molecule
class  Object
class  PrintSetupDlg
class  Printable
struct  SymbolResidue
class  Residue
class  SpaceGroup
 Handle crystallographic space group symmetry. More...
struct  JdxVar
class  SpectrumDocument
class  SpectrumView
class  Sphere
class  Transform3d
 Handle 3D transformations, such as space group definitions. More...
class  UIBuilder
 GtkBuilder wrapping. More...
class  Value
class  SimpleValue
class  DimensionalValue
class  StringValue
class  LocalizedStringValue
class  Vector
 3D vector. More...
class  Vector3f
class  Window

Typedefs

typedef std::list< CrystalAtom * > CrystalAtomList
typedef std::list
< CrystalCleavage * > 
CrystalCleavageList
typedef std::list< CrystalLine * > CrystalLineList
typedef unsigned TypeId
typedef bool(* BuildMenuCb )(Object *target, GtkUIManager *UIManager, Object *object, double x, double y)
typedef unsigned SignalId

Enumerations

enum  WindowState { NormalWindowState, MaximizedWindowState, MinimizedWindowState, FullScreenWindowState }
enum  Display3DMode
enum  gcLattices
enum  CrystalLineType
enum  CheckType
enum  FormulaParseMode
enum  MatrixType
enum  GcuTypeId
enum  RuleId
enum  PrintScaleType { GCU_PRINT_SCALE_NONE, GCU_PRINT_SCALE_FIXED, GCU_PRINT_SCALE_AUTO }
enum  SpectrumType {
  GCU_SPECTRUM_INFRARED, GCU_SPECTRUM_RAMAN, GCU_SPECTRUM_INFRARED_PEAK_TABLE, GCU_SPECTRUM_INFRARED_INTERFEROGRAM,
  GCU_SPECTRUM_INFRARED_TRANSFORMED, GCU_SPECTRUM_UV_VISIBLE, GCU_SPECTRUM_NMR, GCU_SPECTRUM_NMR_FID,
  GCU_SPECTRUM_NMR_PEAK_TABLE, GCU_SPECTRUM_NMR_PEAK_ASSIGNMENTS, GCU_SPECTRUM_MASS, GCU_SPECTRUM_MAX
}
enum  SpectrumUnitType {
  GCU_SPECTRUM_UNIT_CM_1, GCU_SPECTRUM_UNIT_TRANSMITTANCE, GCU_SPECTRUM_UNIT_ABSORBANCE, GCU_SPECTRUM_UNIT_PPM,
  GCU_SPECTRUM_UNIT_NANOMETERS, GCU_SPECTRUM_UNIT_MICROMETERS, GCU_SPECTRUM_UNIT_SECONDS, GCU_SPECTRUM_UNIT_HZ,
  GCU_SPECTRUM_UNIT_M_Z, GCU_SPECTRUM_UNIT_REL_ABUNDANCE, GCU_SPECTRUM_UNIT_MAX
}
enum  SpectrumVarType { GCU_SPECTRUM_TYPE_INDEPENDENT, GCU_SPECTRUM_TYPE_DEPENDENT, GCU_SPECTRUM_TYPE_PAGE, GCU_SPECTRUM_TYPE_MAX }
enum  SpectrumFormatType {
  GCU_SPECTRUM_FORMAT_ASDF, GCU_SPECTRUM_FORMAT_AFFN, GCU_SPECTRUM_FORMAT_PAC, GCU_SPECTRUM_FORMAT_SQZ,
  GCU_SPECTRUM_FORMAT_DIF, GCU_SPECTRUM_FORMAT_MAX
}
enum  ContentType {
  ContentTypeUnknown, ContentType3D, ContentType2D, ContentTypeCrystal,
  ContentTypeSpectrum, ContentTypeMisc
}

Functions

GtkUnit gtk_unit_from_string (char const *name)
char const * gtk_unit_to_string (GtkUnit unit)
Vector operator* (double f, Vector const &v)
Vector3f operator* (float f, Vector3f const &v)
xmlNodePtr FindNodeByNameAndId (xmlNodePtr node, const char *name, const char *id=NULL)
bool ReadPosition (xmlNodePtr node, const char *id, double *x, double *y, double *z=NULL)
bool WritePosition (xmlDocPtr xml, xmlNodePtr node, const char *id, double x, double y, double z=0.0)
bool ReadColor (xmlNodePtr node, const char *id, float *red, float *green, float *blue, float *alpha=NULL)
bool WriteColor (xmlDocPtr xml, xmlNodePtr node, const char *id, double red, double green, double blue, double alpha=1.0)
GOColor ReadColor (xmlNodePtr node)
void WriteColor (xmlNodePtr node, GOColor color)
bool ReadRadius (xmlNodePtr node, GcuAtomicRadius &radius)
bool WriteRadius (xmlDocPtr xml, xmlNodePtr node, const GcuAtomicRadius &radius)
char const * GetStaticScale (char *buf)
void WriteFloat (xmlNodePtr node, char const *name, double value)
bool ReadFloat (xmlNodePtr node, char const *name, double &value, double default_value=0.)

Variables

gchar const * LatticeName []
char const * LineTypeName []


Detailed Description

The Gnome Chemistry Utils C++ classes.

The namespace used for all C++ classes provided by the Gnome Chemistry Utils base library.


Typedef Documentation

typedef bool(* gcu::BuildMenuCb)(Object *target, GtkUIManager *UIManager, Object *object, double x, double y)

The type of callbacks for adding new items to the contextual menu of an object.

Parameters:
target the Object whose menu is being built.
UIManager the GtkUIanager to populate.
object the Object on which occured the mouse click.
x x coordinate of the mouse click.
y y coordinate of the mouse click.

Definition at line 107 of file object.h.

typedef std::list<CrystalAtom*> gcu::CrystalAtomList

a list of pointers to CrystalAtom instances derived from std::list.

Definition at line 247 of file crystalatom.h.

a list of pointers to CrystalCleavage instances derived from std::list.

Definition at line 122 of file crystalcleavage.h.

typedef std::list<CrystalLine*> gcu::CrystalLineList

a list of pointers to CrystalLine instances derived from std::list.

Definition at line 348 of file crystalline.h.

typedef unsigned gcu::SignalId

The types of the signals used in Object::EmitSignal() and Object::OnSignal(). Each signal must type be retrieved from a call to Object::CreateNewSignalId().

Definition at line 133 of file object.h.

typedef unsigned gcu::TypeId

The type of an object instance. Either predefined types are defined in the enum above or dynamically defined types by calls to Object::AddType.

Definition at line 95 of file object.h.


Enumeration Type Documentation

CheckType CheckType describes how numbers entered in entries might be checked. Possible values are:

  • NoCheck: no check is performed.
  • Min: value > min.
  • Max: value < max.
  • MinMax: min < value < max.
  • MinEq: value >= min.
  • MaxEq: value <= max.
  • MinEqMax: min <= value < max.
  • MinMaxEq: min < value <= max.
  • MinEqMaxEq: min <= value <= max.

This enumeration is used in Dialog::GetNumber.

Definition at line 49 of file dialog.h.

The list of supported data types.

Enumerator:
ContentTypeUnknown  Unknown content.
ContentType3D  3D molecular structure.
ContentType2D  2D molecular structure.
ContentTypeCrystal  Crystal structure.
ContentTypeSpectrum  Spectral data.
ContentTypeMisc  Miscalleneous contents. Might include anything.

Definition at line 35 of file gcu/structs.h.

crystalviewer/crystalline.h The type of a CrystalLine instance. Possible values are:

  • edges: all the cell edges.
  • diagonals: the lines joining opposite vertices of a cell.
  • medians: the lines joining the centers of opposite faces of a cell.
  • normal: a line with defined ends, repeated in each displayes cell.
  • unique: a line with defined ends, not repeated.

Definition at line 43 of file crystalline.h.

3D display mode. Possible values are:

  • BALL_AND_STICK: use ball and stick representation; atoms are represented by spheres with a radius equal to 20% of their van der Waals radius and bonds are displayed as cylinders Multiple bonds are displayed as multiple cylinders.
  • SPACEFILL: use space filling representation; atoms are represented by spheres with a radius equal their van der Waals radius; bonds are not displayed.
  • CYLINDERS: only bonds are represented as cylinders, atoms just end the cylinders.
  • WIREFRAME: bonds are represented as narrow lines, atoms just end the lines.

Definition at line 46 of file chem3ddoc.h.

gcu/formula.h The way formula should be interpreted when they contain symbols that might represent both an atom or a group of atoms such as Ac and Pr. Possible values are:

  • GCU_FORMULA_PARSE_GUESS: try to determine the most probable interpretation of the symbol,
  • GCU_FORMULA_PARSE_ATOM: always interpret as atoms,
  • GCU_FORMULA_PARSE_RESIDUE: always interpret as groups,
  • GCU_FORMULA_PARSE_ASK: ask the user for each encountered instance,
  • GCU_FORMULA_PARSE_NO_CASE: this one is unrelated and can ba combined with any of the previous values, just make the parsing stricktly case sensitive.

Definition at line 52 of file formula.h.

crystalviewer/crystaldoc.h This enumeration gives sympolic names to the fourteen Bravais lattices.

Possible values are:

  • cubic
  • body_centered_cubic
  • face_centered_cubic
  • hexagonal
  • tetragonal
  • body_centered_tetragonal
  • orthorhombic
  • base_centered_orthorhombic
  • body_centered_orthorhombic
  • face_centered_orthorhombic
  • rhombohedral
  • monoclinic
  • base_centered_monoclinic
  • triclinic

Definition at line 66 of file crystaldoc.h.

This enumeration is used to determine the type of an Object instance. Possible values are:

  • NoType invalid type
  • AtomType an atom
  • FragmentType several atoms linked and represented by a text such as COOH (only in GChemPaint).
  • BondType a bond between two (or more) atoms.
  • MoleculeType a molecule.
  • ChainType a chain of atoms.
  • CycleType a cycle.
  • ReactantType a molecule involved in a reaction (only in GChemPaint).
  • ReactionArrowType a reaction arrow (only in GChemPaint).
  • ReactionOperatorType a + sign in a reaction (only in GChemPaint).
  • ReactionType a reaction.
  • MesomeryType a mesomery representation (only in GChemPaint).
  • MesomeryArrowType a double headed arrow used to represent mesomery (only in GChemPaint).
  • DocumentType a document, generally the top node in the objects tree.
  • TextType some text (only in GChemPaint).
  • OtherType if the type of an object is at least equal to OtherType, then it is a dynamically created type returned by the static Object::AddType method.
Some types are not used in the Gnome Chemistry Utils, but only in GChemPaint and might disappear from this list in future versions and replaced by dynamically created types.

Definition at line 71 of file object.h.

This enumeration is used to determine the type a Matrix. Possible values are:

  • euler: matrix used to find absolute positions from the position inside the solid using Euler's angles.
  • antieuler: the inverse of euler.
  • rotation: matrix representing the rotation to apply to the solid.
This enumeration is used in one of the constructors (Matrix(Psi, Theta, Phi, Type)) of class Matrix.

Definition at line 44 of file matrix.h.

gcu/printable.h Represents how printing is scaled

Enumerator:
GCU_PRINT_SCALE_NONE  No scaling is done.
GCU_PRINT_SCALE_FIXED  Explicit scaling.
GCU_PRINT_SCALE_AUTO  Automatic scaling (will fill the print area).

Definition at line 40 of file printable.h.

This enumeration is used to maintain a set of rules about the possible hierarchical of the document. They are used with two class names or ids. Possible values are:

  • RuleMayContain an instance of the first class may contain an instance of the second. This implies that an instance of the second class may be in an instance of the first (see RuleMayBeIn);
  • RuleMustContain an instance of the first class may contain an instance of the second class (implies RuleMayContain); if no instance of the first class is present, the object is not valid.
  • RuleMayBeIn an instance of the first class may be the child of an instance of the second class (see also RuleMayContain);
  • RuleMustBeIn an instance of the first class must be the child of an instance of the second class, otherwise it is not valid.

Definition at line 121 of file object.h.

gcu/spectrumdoc.h Represents the list of data formats from the JCAMP-DX specification supported by the gcu::SpectrumDocument class. See the JCAMP-DX specification for more information.

Enumerator:
GCU_SPECTRUM_FORMAT_ASDF  ASCII squeezed difference form.
GCU_SPECTRUM_FORMAT_AFFN  ASCII free format numeric.
GCU_SPECTRUM_FORMAT_PAC  Packed form.
GCU_SPECTRUM_FORMAT_SQZ  Squeezed form.
GCU_SPECTRUM_FORMAT_DIF  Difference form.
GCU_SPECTRUM_FORMAT_MAX  Last known value. This value does not represent a valid type, but is equal to the number of supported formats.

Definition at line 173 of file spectrumdoc.h.

gcu/spectrumdoc.h Represents the list of spectrum types supported (or which should be supported) by the gcu::SpectrumDocument class.

Enumerator:
GCU_SPECTRUM_INFRARED  Infrared spectrum.
GCU_SPECTRUM_RAMAN  Raman spectrum.
GCU_SPECTRUM_INFRARED_PEAK_TABLE  Infrared peaks table.
GCU_SPECTRUM_INFRARED_INTERFEROGRAM  Infrared iterferogram.
GCU_SPECTRUM_INFRARED_TRANSFORMED  Transformed infrared spectrum.
GCU_SPECTRUM_UV_VISIBLE  UV-visible spectrum.
GCU_SPECTRUM_NMR  NMR spectrum.
GCU_SPECTRUM_NMR_FID  NMR FID.
GCU_SPECTRUM_NMR_PEAK_TABLE  NMR peaks table.
GCU_SPECTRUM_NMR_PEAK_ASSIGNMENTS  NMR peaks assignments.
GCU_SPECTRUM_MASS  Mass spectrum.
GCU_SPECTRUM_MAX  Last known value. This value does not represent a valid type, but is equal to the number of supported types.

Definition at line 40 of file spectrumdoc.h.

gcu/spectrumdoc.h Represents the list of units supported by the gcu::SpectrumDocument class.

Enumerator:
GCU_SPECTRUM_UNIT_CM_1  Wave number per cm.
GCU_SPECTRUM_UNIT_TRANSMITTANCE  Transmittance
GCU_SPECTRUM_UNIT_ABSORBANCE  Absorbance
GCU_SPECTRUM_UNIT_PPM  Part per million.
GCU_SPECTRUM_UNIT_NANOMETERS  Nanometers
GCU_SPECTRUM_UNIT_MICROMETERS  Micrometers
GCU_SPECTRUM_UNIT_SECONDS  Seconds
GCU_SPECTRUM_UNIT_HZ  Hz.
GCU_SPECTRUM_UNIT_M_Z  M/Z (for mass spectra).
GCU_SPECTRUM_UNIT_REL_ABUNDANCE  Relative abundance.
GCU_SPECTRUM_UNIT_MAX  Last known value. This value does not represent a valid type, but is equal to the number of supported units.

Definition at line 96 of file spectrumdoc.h.

gcu/spectrumdoc.h Represents the list of varialble types supported by the gcu::SpectrumDocument class.

Enumerator:
GCU_SPECTRUM_TYPE_INDEPENDENT  Independent variable.
GCU_SPECTRUM_TYPE_DEPENDENT  Dependent variable.
GCU_SPECTRUM_TYPE_PAGE  Page number.
GCU_SPECTRUM_TYPE_MAX  Last known value. This value does not represent a valid type, but is equal to the number of supported types.

Definition at line 148 of file spectrumdoc.h.

Window states

Enumerator:
NormalWindowState  Normal window.
MaximizedWindowState  Maximized window.
MinimizedWindowState  Minimized window.
FullScreenWindowState  Full screen window.

Definition at line 46 of file gcu/application.h.


Function Documentation

xmlNodePtr gcu::FindNodeByNameAndId ( xmlNodePtr  node,
const char *  name,
const char *  id = NULL 
)

ReadPosition

Parameters:
node,: a pointer to the current parsed XML Node.
name,: the name of the searched node.
id,: the id property of the node or NULL if not significant. This parameter might be omitted in the last case.
Helper method used to search the xmlNode instance of name Name and with id property equal to id in the children of node. When id is NULL, the searched node does not have an id property. When id is not NULL, the searched node should be unique.

Returns:
the matching node or NULL.

char const* gcu::GetStaticScale ( char *  buf  ) 

Parameters:
buf,: a string to convert to a static instance.
This function is used to replace a dynamically allocated string by a static instance. It works managing a set of string instances. It is used for scale names (as for radii and electronegativity), hence its name.

Returns:
a static version of buf or NULL if a new static string could not be created.

GtkUnit gcu::gtk_unit_from_string ( char const *  name  ) 

Parameters:
name a string representing a GtkUnit.
Returns:
the GtkUnit represented by the string.

char const* gcu::gtk_unit_to_string ( GtkUnit  unit  ) 

Parameters:
unit a GtkUnit.
Returns:
the sring representig the GtkUnit.

Vector3f gcu::operator* ( float  f,
Vector3f const &  v 
)

Parameters:
f a multiplication factor
v the vector to multiply
Returns:
the product of f and v.

Vector gcu::operator* ( double  f,
Vector const &  v 
)

Parameters:
f a multiplication factor
v the vector to multiply
Returns:
the product of f and v.

GOColor gcu::ReadColor ( xmlNodePtr  node  ) 

Parameters:
node,: a pointer to the xmlNode from which the color must be retrieved. Builds a GOColor from the node properties.
Returns:
the GOColor found or black (0xff).

bool gcu::ReadColor ( xmlNodePtr  node,
const char *  id,
float *  red,
float *  green,
float *  blue,
float *  alpha = NULL 
)

Parameters:
node,: a pointer to the xmlNode representing an Object instance.
id,: the value of the id property of the color. This is used for Object instances having at least two colors.
red,: a pointer to the red component of the color.
green,: a pointer to the green component of the color.
blue,: a pointer to the blue component of the color.
alpha,: a pointer to the alpha component of the color or NULL if tranparency is not managed.
This method can be used to load a color in an Object instance. It should be used in cunjunction with WriteColor() which executes the inverse operation. If id is NULL, a color with no id property will be search and parsed.

Returns:
true on success and false on failure.

bool gcu::ReadFloat ( xmlNodePtr  node,
char const *  name,
double &  value,
double  default_value = 0. 
)

Parameters:
node a pointer to an XML node.
name the property name.
value the value for the property.
default_value the default value for the property if the property can't be retrieved.
Retrieves value from the node property with name name. Sets the default value if somthing goes wrong.
Returns:
true if the value could be retrieved.

bool gcu::ReadPosition ( xmlNodePtr  node,
const char *  id,
double *  x,
double *  y,
double *  z = NULL 
)

Parameters:
node,: a pointer to the xmlNode representing an Object instance.
id,: the value of the id property of the position. This is used for example for arrows because both the head and the tail of the arrow are positions.
x,: a pointer to the x coordinate of the position.
y,: a pointer to the y coordinate of the position.
z,: a pointer to the z coordinate of the position or NULL for 2D objects.
This method can be used to load the coordinates of a point in an Object instance. It should be used in cunjunction with WritePosition() which executes the inverse operation. If id is NULL, a position with no id property will be search and parsed.

Returns:
true on success and false on failure.

bool gcu::ReadRadius ( xmlNodePtr  node,
GcuAtomicRadius radius 
)

Parameters:
node,: a pointer to the xmlNode representing an Object instance.
radius,: a GcuAtomicRadius structure.
This function parses the XML node representing a radius (written using WriteRadius()) and fills the fields in the GcuAtomicRadius structure with the data parsed.

Returns:
true on success and false on failure.

void gcu::WriteColor ( xmlNodePtr  node,
GOColor  color 
)

Parameters:
node,: a pointer to the xmlNode to which the color must be serialized.
color,: a pointer to the xmlNode from which the color must be retrieved. Serializes color to node.

bool gcu::WriteColor ( xmlDocPtr  xml,
xmlNodePtr  node,
const char *  id,
double  red,
double  green,
double  blue,
double  alpha = 1.0 
)

Parameters:
xml,: a pointer to the xmlDoc used to serialize the document.
node,: a pointer to the xmlNode representing an Object instance.
id,: the value of the id property of the color. This is used for Object instances having at least two colors. of the arrow are positions.
red,: the red component of the color.
green,: the green component of the color.
blue,: the blue component of the color.
alpha,: the alpha component of the color.
Save a color as an XML node added to the children of node. This color can then be parsed using ReadColor().

Returns:
true on success and false on failure.

void gcu::WriteFloat ( xmlNodePtr  node,
char const *  name,
double  value 
)

Parameters:
node a pointer to an XML node.
name the property name.
value the value for the property.
Adds value as a property with name name to node.

bool gcu::WritePosition ( xmlDocPtr  xml,
xmlNodePtr  node,
const char *  id,
double  x,
double  y,
double  z = 0.0 
)

WritePosition

Parameters:
xml,: a pointer to the xmlDoc used to serialize the document.
node,: a pointer to the xmlNode representing an Object instance.
id,: the value of the id property of the position. This is used for example for arrows because both the head and the tail of the arrow are positions.
x,: the x coordinate of the position.
y,: the y coordinate of the position.
z,: the z coordinate of the position.
Save a position as an XML node added to the children of node. This position can then be parsed using ReadPosition().

Returns:
true on success and false on failure.

bool gcu::WriteRadius ( xmlDocPtr  xml,
xmlNodePtr  node,
const GcuAtomicRadius radius 
)

Parameters:
xml,: a pointer to the xmlDoc used to serialize the document.
node,: a pointer to the xmlNode representing an Object instance.
radius,: a GcuAtomicRadius structure.
Save a radius as an XML node added to the children of node. This radius can then be parsed using ReadRadius().

Returns:
true on success and false on failure.


Variable Documentation

gchar const* gcu::LatticeName[]

A table of the Bravais lattices names.

char const* gcu::LineTypeName[]

an array of the line types names used for serialization.


Generated on Fri Sep 24 15:58:46 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9