The Gnome Chemistry Utils  0.13.6
Public Member Functions | Protected Member Functions | Protected Attributes
gcugtk::GLView Class Reference

#include <gcu/glview.h>

Inheritance diagram for gcugtk::GLView:
gcu::GLView gcugtk::Printable gcu::DialogOwner gcr::View gcugtk::Chem3dView

List of all members.

Public Member Functions

 GLView (gcu::GLDocument *pDoc) throw (std::runtime_error)
 Constructor.
virtual ~GLView ()
 Destructor.
GtkWidget * GetWidget ()
GtkWindow * GetGtkWindow ()
void Update ()
void DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const
GdkPixbuf * BuildPixbuf (unsigned width, unsigned height, bool use_bg) const

Protected Member Functions

virtual bool GLBegin ()
virtual void GLEnd ()

Protected Attributes

GtkWidget * m_Widget

Detailed Description

View class based on OpenGL for rendering. Used to display 3d chemical structures such as molecules or crystals cells.

Definition at line 40 of file tk/glview.h.


Constructor & Destructor Documentation

gcugtk::GLView::GLView ( gcu::GLDocument pDoc) throw (std::runtime_error)

Constructor.

Parameters:
pDoc,:a pointer to the GLDocument instance.

Creates a view for the document.

Reimplemented from gcu::GLView.

virtual gcugtk::GLView::~GLView ( ) [virtual]

Destructor.

The destructor of GLView.

Reimplemented from gcu::GLView.


Member Function Documentation

GdkPixbuf* gcugtk::GLView::BuildPixbuf ( unsigned  width,
unsigned  height,
bool  use_bg 
) const [virtual]
Parameters:
widththe width of the generated image.
heightthe height of the generated image.
use_bgwhether to use the window background or a transparent background.

Generates a pixbuf from the current view.

Returns:
the pixbuf containing the generated image

Reimplemented from gcu::GLView.

void gcugtk::GLView::DoPrint ( GtkPrintOperation *  print,
GtkPrintContext *  context,
int  page 
) const [virtual]
Parameters:
printa GtkPrintOperation.
contexta GtkPrintContext.
pagethe page to print.

Prints the current view at 300 dpi.

Implements gcugtk::Printable.

GtkWindow* gcugtk::GLView::GetGtkWindow ( ) [inline, virtual]
Returns:
the top level GtkWindow containing the view.

Implements gcugtk::Printable.

Definition at line 65 of file tk/glview.h.

References m_Widget.

GtkWidget* gcugtk::GLView::GetWidget ( ) [inline]
Returns:
the associated GtkWidget.

Definition at line 60 of file tk/glview.h.

References m_Widget.

virtual bool gcugtk::GLView::GLBegin ( ) [protected, virtual]

Starts an OpenGL drawing operation. Will set the appropriate context. This method is pure virtual and must be implemented in derived classes.

Returns:
true if successful.

Implements gcu::GLView.

virtual void gcugtk::GLView::GLEnd ( ) [protected, virtual]

Ends an OpenGL drawing operation. This method is pure virtual and must be implemented in derived classes.

Implements gcu::GLView.

void gcugtk::GLView::Update ( ) [virtual]

Update the contents of the associated widget. This method must be called each time the document or the view are modified.

Reimplemented from gcu::GLView.


Member Data Documentation

GtkWidget* gcugtk::GLView::m_Widget [protected]

The associated widget.

Definition at line 101 of file tk/glview.h.

Referenced by GetGtkWindow(), and GetWidget().


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