The Gnome Chemistry Utils  0.14.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gcugtk::GLView Class Reference

#include <gcu/glview.h>

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

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
- Public Member Functions inherited from gcu::GLView
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, bool use_bg) const
void RenderToCairo (cairo_t *cr, unsigned width, unsigned height, bool use_bg) 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)
GLDocumentGetDoc (void)
double GetRadius (void)
- Public Member Functions inherited from gcugtk::Printable
 Printable ()
virtual ~Printable ()
virtual bool SupportsHeaders ()
virtual bool SupportMultiplePages ()
virtual int GetPagesNumber ()
void Print (bool preview)
void SetPageSetup (GtkPageSetup *PageSetup)
GtkPrintSettings * GetPrintSettings (void) const
void SetUnit (GtkUnit val)
GtkUnit GetUnit (void) const
GtkUnit & GetRefUnit (void)
void SetHeaderHeight (double val)
double GetHeaderHeight (void) const
double & GetRefHeaderHeight (void)
void SetFooterHeight (double val)
double GetFooterHeight (void) const
double & GetRefFooterHeight (void)
void SetHorizCentered (bool val)
bool GetHorizCentered (void) const
bool & GetRefHorizCentered (void)
void SetVertCentered (bool val)
bool GetVertCentered (void) const
bool & GetRefVertCentered (void)
void SetScaleType (PrintScaleType val)
PrintScaleType GetScaleType (void) const
PrintScaleTypeGetRefScaleType (void)
void SetScale (double val)
double GetScale (void) const
double & GetRefScale (void)
void SetHorizFit (bool val)
bool GetHorizFit (void) const
bool & GetRefHorizFit (void)
void SetVertFit (bool val)
bool GetVertFit (void) const
bool & GetRefVertFit (void)
void SetHPages (int val)
int GetHPages (void) const
int & GetRefHPages (void)
void SetVPages (int val)
int GetVPages (void) const
int & GetRefVPages (void)
void SetHasBackground (bool val)
bool GetHasBackground (void) const
bool & GetRefHasBackground (void)
void SetPrintBackground (bool val)
bool GetPrintBackground (void) const
bool & GetRefPrintBackground (void)
- Public Member Functions inherited from gcu::DialogOwner
 DialogOwner ()
virtual ~DialogOwner ()
DialogGetDialog (std::string name) const
void ClearDialogs ()

Protected Member Functions

virtual bool GLBegin ()
virtual void GLEnd ()
- Protected Member Functions inherited from gcu::GLView
void Rotate (gdouble x, gdouble y)

Protected Attributes

GtkWidget * m_Widget
- Protected Attributes inherited from gcu::GLView
Matrix m_Euler
double m_Lastx
double m_Lasty
int m_WindowHeight
int m_WindowWidth
double m_Height
double m_Width
double m_Near
double m_Far
double m_Radius

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 ( )
inlinevirtual
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 ( )
protectedvirtual

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 ( )
protectedvirtual

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: