The Gnome Chemistry Utils  0.13.7
Public Member Functions | Static Public Member Functions
gcu::Chem3dDoc Class Reference

#include <gcu/chem3ddoc.h>

Inheritance diagram for gcu::Chem3dDoc:
gcu::GLDocument gcu::Document gcu::Object gcu::DialogOwner gcugtk::Chem3dDoc

List of all members.

Public Member Functions

 Chem3dDoc ()
 Chem3dDoc (Application *App, GLView *View)
virtual ~Chem3dDoc ()
void Draw (Matrix const &m) const
bool IsEmpty ()
void Load (char const *uri, char const *mime_type)
ContentType LoadData (char const *data, char const *mime_type, size_t size=0)
void OnExportVRML (std::string const &filename)
void Clear ()
virtual GLViewCreateView ()=0
void SetDisplay3D (Display3DMode val)
Display3DMode GetDisplay3D (void) const
MoleculeGetMol (void) const

Static Public Member Functions

static Display3DMode Display3DModeFromString (char const *name)
static char const * Display3DModeAsString (Display3DMode mode)

Detailed Description

Document base class for a molecule.

Definition at line 61 of file chem3ddoc.h.


Constructor & Destructor Documentation

Default constructor

Reimplemented in gcugtk::Chem3dDoc.

gcu::Chem3dDoc::Chem3dDoc ( Application App,
GLView View 
)
Parameters:
Appthe application.
View,:an optional already existing GLView instance.
virtual gcu::Chem3dDoc::~Chem3dDoc ( ) [virtual]

Default destructor

Reimplemented in gcugtk::Chem3dDoc.


Member Function Documentation

void gcu::Chem3dDoc::Clear ( ) [virtual]

Clears the document.

Reimplemented from gcu::Object.

virtual GLView* gcu::Chem3dDoc::CreateView ( ) [pure virtual]

Pure virtual method used to create a view. Must be overriden in derived classes.

Returns:
the newly created view.

Implemented in gcugtk::Chem3dDoc.

static char const* gcu::Chem3dDoc::Display3DModeAsString ( Display3DMode  mode) [static]
Parameters:
modea display mode.
Returns:
a string representation of the display mode.
static Display3DMode gcu::Chem3dDoc::Display3DModeFromString ( char const *  name) [static]
Parameters:
namethe name of the display mode.

Converts a string to an actual display mode. Supported names are: "ball&stick", "spacefill", "cylinders", and "wireframe".

Returns:
the display mode or BALL_AND_STICK on error.
void gcu::Chem3dDoc::Draw ( Matrix const &  m) const [virtual]
Parameters:
mthe Matrix giving the current model orientation

Displays the molecule using OpenGL.

Implements gcu::GLDocument.

gcu::Chem3dDoc::GetDisplay3D ( void  ) const [inline]
Returns:
the current mode.

Definition at line 152 of file chem3ddoc.h.

gcu::Chem3dDoc::GetMol ( void  ) const [inline]
Returns:
the molecule dispayed inside the document.

Definition at line 156 of file chem3ddoc.h.

bool gcu::Chem3dDoc::IsEmpty ( ) [inline]
Returns:
true if the molecule have no atom, false otherwise.

Definition at line 88 of file chem3ddoc.h.

References gcu::Molecule::GetAtomsNumber().

void gcu::Chem3dDoc::Load ( char const *  uri,
char const *  mime_type 
)
Parameters:
urithe uri of the molecule file.
mime_typethe mime type of the molecule file.

Loads a molecule from the provided uri.

ContentType gcu::Chem3dDoc::LoadData ( char const *  data,
char const *  mime_type,
size_t  size = 0 
)
Parameters:
datathe inline data.
mime_typethe mime type of the data.
sizethe size of the data. If nul, the size will be evaluated from the string length.

Loads a molecule from the provided data.

void gcu::Chem3dDoc::OnExportVRML ( std::string const &  filename)
Parameters:
filenamethe name of the vrml file to which the data should be written.

Exports the embedded molecule as a vrml scene.

Parameters:
mode,:the new mode.

Sets the display mode to one of the available Display3DMode values.

Definition at line 152 of file chem3ddoc.h.


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