gcu::CrystalView Class Reference

#include <gcu/crystalview.h>

List of all members.

Public Member Functions

 CrystalView (CrystalDoc *pDoc)
 Constructor.
virtual ~CrystalView ()
 Destructor.
GtkWidget * CreateNewWidget ()
void Init (GtkWidget *widget)
void Reshape (GtkWidget *widget)
void Draw (GtkWidget *widget)
void Update ()
void Update (GtkWidget *widget)
bool OnPressed (GtkWidget *widget, GdkEventButton *event)
void OnMotion (GtkWidget *widget, GdkEventMotion *event)
void OnDestroyed (GtkWidget *widget)
virtual bool Load (xmlNodePtr node)
virtual xmlNodePtr Save (xmlDocPtr xml)
void SaveAsImage (char const *filename, char const *type, map< string, string > &options)

Protected Attributes

gdouble m_fAngle
gdouble m_fRadius
gdouble m_psi
gdouble m_theta
gdouble m_phi
gdouble m_height
gdouble m_width
gdouble m_near
gdouble m_far
Matrix m_Euler
unsigned m_nGLList
float m_fBlue
float m_fRed
float m_fGreen
float m_fAlpha
CrystalDocm_pDoc
GtkWidget * m_pWidget


Detailed Description

The class representing a view of the model. Each document might have several views. Most methods are automatically called by the framework and should not be explicitely used in programs.

Definition at line 45 of file crystalview.h.


Constructor & Destructor Documentation

gcu::CrystalView::CrystalView ( CrystalDoc pDoc  ) 

Constructor.

Parameters:
pDoc,: a pointer to the CrystalDoc instance.
Creates a new view for the document.

virtual gcu::CrystalView::~CrystalView (  )  [virtual]

Destructor.

The destructor of CrystalView.


Member Function Documentation

GtkWidget* gcu::CrystalView::CreateNewWidget (  ) 

Creates a widget to display the model as defined in the document and with the parameters of the view. Several widgets cn exist for the same view and their contents are identical.

void gcu::CrystalView::Draw ( GtkWidget *  widget  ) 

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
Draws the contents of the widget. Automatically called by the framework.

void gcu::CrystalView::Init ( GtkWidget *  widget  ) 

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
Initialize the widget. Automatically called by the framework.

virtual bool gcu::CrystalView::Load ( xmlNodePtr  node  )  [virtual]

Parameters:
node,: a pointer to the xmlNode containing the serialized view.
Loads the parameters of the view from an xmlNode.

void gcu::CrystalView::OnDestroyed ( GtkWidget *  widget  ) 

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
Automatically called by the framework when the widget is destroyed.

void gcu::CrystalView::OnMotion ( GtkWidget *  widget,
GdkEventMotion *  event 
)

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
event,: a pointer to a GdkEvent.
Automatically called by the framework when the mouse cursor moves over the widget drawing area.

bool gcu::CrystalView::OnPressed ( GtkWidget *  widget,
GdkEventButton *  event 
)

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
event,: a pointer to a GdkEvent.
Automatically called by the framework when a left button click occurs in the widget drawing area.

void gcu::CrystalView::Reshape ( GtkWidget *  widget  ) 

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
Automatically called by the framework when the the widget size changes.

virtual xmlNodePtr gcu::CrystalView::Save ( xmlDocPtr  xml  )  [virtual]

Parameters:
xml,: the xmlDoc used to save the document.
Returns:
a pointer to the xmlNode containig the view parameters or NULL if an error occured.

void gcu::CrystalView::SaveAsImage ( char const *  filename,
char const *  type,
map< string, string > &  options 
)

Parameters:
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.
Export the view contents as an image.

void gcu::CrystalView::Update ( GtkWidget *  widget  ) 

Parameters:
widget,: a pointer to a widget created by CreateNewWidget().
Update the contents of widget. Automatically called by the framework when Update() is executed.

void gcu::CrystalView::Update (  ) 

Updates all widgets of the view. This method must be called each time the document or the view are modified.


Member Data Documentation

Matrix gcu::CrystalView::m_Euler [protected]

The gcu::Matrix used to calculate the absolute coordiantes from the positions relative to the crystal.

Definition at line 184 of file crystalview.h.

float gcu::CrystalView::m_fAlpha [protected]

The alpha component of the background color.

Definition at line 205 of file crystalview.h.

gdouble gcu::CrystalView::m_fAngle [protected]

The field of view.

Definition at line 148 of file crystalview.h.

float gcu::CrystalView::m_fBlue [protected]

The blue component of the background color.

Definition at line 193 of file crystalview.h.

float gcu::CrystalView::m_fGreen [protected]

The green component of the background color.

Definition at line 201 of file crystalview.h.

gdouble gcu::CrystalView::m_fRadius [protected]

The distance of the center of the model from the viewer.

Definition at line 152 of file crystalview.h.

float gcu::CrystalView::m_fRed [protected]

The red component of the background color.

Definition at line 197 of file crystalview.h.

gdouble gcu::CrystalView::m_height [protected]

The height of the widget.

Definition at line 168 of file crystalview.h.

gdouble gcu::CrystalView::m_near [protected]

The distance of the fore plane delimiting the volume active in the OpenGL representation to the viewer.

Definition at line 176 of file crystalview.h.

unsigned gcu::CrystalView::m_nGLList [protected]

A GLList used when drawing the model.

Definition at line 188 of file crystalview.h.

CrystalDoc* gcu::CrystalView::m_pDoc [protected]

A pointer to the CrystalDoc instance containig the definition of the model displayed in the view.

Definition at line 209 of file crystalview.h.

gdouble gcu::CrystalView::m_phi [protected]

Euler's Phi angle giving the orientaion of the crystal in the view.

Definition at line 164 of file crystalview.h.

gdouble gcu::CrystalView::m_psi [protected]

Euler's Psi angle giving the orientaion of the crystal in the view.

Definition at line 156 of file crystalview.h.

GtkWidget* gcu::CrystalView::m_pWidget [protected]

A OpenGL widget where the model is displayed. It is the last one used.

Definition at line 213 of file crystalview.h.

gdouble gcu::CrystalView::m_theta [protected]

Euler's Theta angle giving the orientaion of the crystal in the view.

Definition at line 160 of file crystalview.h.

gdouble gcu::CrystalView::m_width [protected]

The width of the widget.

Definition at line 172 of file crystalview.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 15 10:47:36 2006 for The Gnome Chemistry Utils by  doxygen 1.4.7