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)

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 44 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::Init ( GtkWidget *  widget  ) 

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

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.

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::Update (  ) 

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

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.

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::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.

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.

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.

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.


Member Data Documentation

gdouble gcu::CrystalView::m_fAngle [protected]

he field of view.

Definition at line 139 of file crystalview.h.

gdouble gcu::CrystalView::m_fRadius [protected]

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

Definition at line 143 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 147 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 151 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 155 of file crystalview.h.

gdouble gcu::CrystalView::m_height [protected]

The height of the widget.

Definition at line 159 of file crystalview.h.

gdouble gcu::CrystalView::m_width [protected]

The width of the widget.

Definition at line 163 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 167 of file crystalview.h.

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 175 of file crystalview.h.

unsigned gcu::CrystalView::m_nGLList [protected]

A GLList used when drawing the model.

Definition at line 179 of file crystalview.h.

float gcu::CrystalView::m_fBlue [protected]

The blue component of the background color.

Definition at line 184 of file crystalview.h.

float gcu::CrystalView::m_fRed [protected]

The red component of the background color.

Definition at line 188 of file crystalview.h.

float gcu::CrystalView::m_fGreen [protected]

The green component of the background color.

Definition at line 192 of file crystalview.h.

float gcu::CrystalView::m_fAlpha [protected]

The alpha component of the background color.

Definition at line 196 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 200 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 204 of file crystalview.h.


The documentation for this class was generated from the following file:
Generated on Mon May 7 17:04:16 2007 for The Gnome Chemistry Utils by  doxygen 1.5.1