|
The Gnome Chemistry Utils 0.12.8
|
#include <gcu/glview.h>
Public Member Functions | |
| GLView (GLDocument *pDoc) throw (std::runtime_error) | |
| Constructor. | |
| virtual | ~GLView () |
| Destructor. | |
| GtkWidget * | GetWidget () |
| void | Init () |
| void | Reshape (int width, int height) |
| void | Draw () |
| bool | OnPressed (GdkEventButton *event) |
| bool | OnMotion (GdkEventMotion *event) |
| void | Update () |
| void | SetRotation (double psi, double theta, double phi) |
| void | SaveAsImage (std::string const &filename, char const *type, std::map< std::string, std::string > &options, unsigned width, unsigned height) const |
| GdkPixbuf * | BuildPixbuf (unsigned width, unsigned height) const |
| void | DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const |
| GtkWindow * | GetGtkWindow () |
| void | RenderToCairo (cairo_t *cr, unsigned width, unsigned height) const |
| void | SetAngle (double val) |
| double | GetAngle (void) const |
| double & | GetRefAngle (void) |
| void | SetPsi (double val) |
| double | GetPsi (void) const |
| double & | GetRefPsi (void) |
| void | SetPhi (double val) |
| double | GetPhi (void) const |
| double & | GetRefPhi (void) |
| void | SetTheta (double val) |
| double | GetTheta (void) const |
| double & | GetRefTheta (void) |
| void | SetRed (float val) |
| float | GetRed (void) const |
| float & | GetRefRed (void) |
| void | SetGreen (float val) |
| float | GetGreen (void) const |
| float & | GetRefGreen (void) |
| void | SetBlue (float val) |
| float | GetBlue (void) const |
| float & | GetRefBlue (void) |
| void | SetAlpha (float val) |
| float | GetAlpha (void) const |
| float & | GetRefAlpha (void) |
| GLDocument * | GetDoc (void) |
| double | GetRadius (void) |
Protected Attributes | |
| GtkWidget * | m_pWidget |
| double | m_Radius |
View class based on OpenGL for rendering. Used to display 3d chemical structures such as molecules or crystals cells.
| gcu::GLView::GLView | ( | GLDocument * | pDoc | ) | throw (std::runtime_error) |
Constructor.
| pDoc,: | a pointer to the GLDocument instance. |
Creates a view for the document.
| virtual gcu::GLView::~GLView | ( | ) | [virtual] |
Destructor.
The destructor of GLView.
| GdkPixbuf* gcu::GLView::BuildPixbuf | ( | unsigned | width, |
| unsigned | height | ||
| ) | const |
| width | the width of the generated image. |
| height | the height of the generated image. |
Generates a pixbuf from the current view.
| void gcu::GLView::DoPrint | ( | GtkPrintOperation * | print, |
| GtkPrintContext * | context, | ||
| int | page | ||
| ) | const [virtual] |
| a GtkPrintOperation. | |
| context | a GtkPrintContext. |
| page | the page to print. |
Prints the current view at 300 dpi.
Implements gcu::Printable.
| void gcu::GLView::Draw | ( | ) |
Draws the contents of the associated widget. Automatically called by the framework.
| gcu::GLView::GetAlpha | ( | void | ) | const [inline] |
| gcu::GLView::GetAngle | ( | void | ) | const [inline] |
| gcu::GLView::GetBlue | ( | void | ) | const [inline] |
| gcu::GLView::GetDoc | ( | void | ) | [inline] |
| gcu::GLView::GetGreen | ( | void | ) | const [inline] |
| GtkWindow* gcu::GLView::GetGtkWindow | ( | ) | [inline, virtual] |
Implements gcu::Printable.
Definition at line 141 of file glview.h.
References m_pWidget.
| gcu::GLView::GetPhi | ( | void | ) | const [inline] |
| gcu::GLView::GetPsi | ( | void | ) | const [inline] |
| gcu::GLView::GetRadius | ( | void | ) | [inline] |
| gcu::GLView::GetRed | ( | void | ) | const [inline] |
| gcu::GLView::GetRefAlpha | ( | void | ) | [inline] |
| gcu::GLView::GetRefAngle | ( | void | ) | [inline] |
| gcu::GLView::GetRefBlue | ( | void | ) | [inline] |
| gcu::GLView::GetRefGreen | ( | void | ) | [inline] |
| gcu::GLView::GetRefPhi | ( | void | ) | [inline] |
| gcu::GLView::GetRefPsi | ( | void | ) | [inline] |
| gcu::GLView::GetRefRed | ( | void | ) | [inline] |
| gcu::GLView::GetRefTheta | ( | void | ) | [inline] |
| gcu::GLView::GetTheta | ( | void | ) | const [inline] |
| GtkWidget* gcu::GLView::GetWidget | ( | ) | [inline] |
| void gcu::GLView::Init | ( | ) |
Initialize the associated widget. Automatically called by the framework.
| bool gcu::GLView::OnMotion | ( | GdkEventMotion * | event | ) |
| event,: | a pointer to a GdkEvent. |
Automatically called by the framework when the mouse cursor moves over the associated widget drawing area.
| bool gcu::GLView::OnPressed | ( | GdkEventButton * | event | ) |
| event,: | a pointer to a GdkEvent. |
Automatically called by the framework when a left button click occurs in the associated widget drawing area.
| void gcu::GLView::RenderToCairo | ( | cairo_t * | cr, |
| unsigned | width, | ||
| unsigned | height | ||
| ) | const |
| cr | a cairo_t. |
| width | the width used for rendering. |
| height | the height used for rendering. |
Outputs a bitmap to cairo. Used internally for printing and various image formats exports.
| void gcu::GLView::Reshape | ( | int | width, |
| int | height | ||
| ) |
Automatically called by the framework when the associated widget size changes.
| void gcu::GLView::SaveAsImage | ( | std::string const & | filename, |
| char const * | type, | ||
| std::map< std::string, std::string > & | options, | ||
| unsigned | width, | ||
| unsigned | height | ||
| ) | const |
| filename | the name of the file. |
| type | the type as supported by GdkPixbuf (e.g. "png" or "jpeg"). |
| options | the pairs of keys/values to pass GdkPixbuf. |
| width | the width of the generated image. |
| height | the height of the generated image. |
Export the view contents as an image. The size of the new image is defined by the width and height parameters.
| gcu::GLView::SetAlpha | ( | float | alpha | ) | [inline] |
| gcu::GLView::SetAngle | ( | double | angle | ) | [inline] |
| gcu::GLView::SetBlue | ( | float | blue | ) | [inline] |
| gcu::GLView::SetGreen | ( | float | green | ) | [inline] |
| gcu::GLView::SetPhi | ( | double | phi | ) | [inline] |
| gcu::GLView::SetPsi | ( | double | psi | ) | [inline] |
| gcu::GLView::SetRed | ( | float | red | ) | [inline] |
| void gcu::GLView::SetRotation | ( | double | psi, |
| double | theta, | ||
| double | phi | ||
| ) |
| psi | the first Euler's angle. |
| theta | the second Euler's angle. |
| phi | the third Euler's angle. |
Sets the orientation of the model, using the Euler's angles.
| gcu::GLView::SetTheta | ( | double | theta | ) | [inline] |
| void gcu::GLView::Update | ( | ) |
Update the contents of the associated widget. This method must be called each time the document or the view are modified.
GtkWidget* gcu::GLView::m_pWidget [protected] |
The associated widget.
Definition at line 164 of file glview.h.
Referenced by GetGtkWindow(), and GetWidget().
gcu::GLView::m_Radius [protected] |
1.7.4