#include <gcu/crystalview.h>
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 |
CrystalDoc * | m_pDoc |
GtkWidget * | m_pWidget |
Definition at line 45 of file crystalview.h.
gcu::CrystalView::CrystalView | ( | CrystalDoc * | pDoc | ) |
Constructor.
pDoc,: | a pointer to the CrystalDoc instance. |
virtual gcu::CrystalView::~CrystalView | ( | ) | [virtual] |
Destructor.
The destructor of CrystalView.
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 | ) |
widget,: | a pointer to a widget created by CreateNewWidget(). |
void gcu::CrystalView::Init | ( | GtkWidget * | widget | ) |
widget,: | a pointer to a widget created by CreateNewWidget(). |
virtual bool gcu::CrystalView::Load | ( | xmlNodePtr | node | ) | [virtual] |
node,: | a pointer to the xmlNode containing the serialized view. |
void gcu::CrystalView::OnDestroyed | ( | GtkWidget * | widget | ) |
widget,: | a pointer to a widget created by CreateNewWidget(). |
void gcu::CrystalView::OnMotion | ( | GtkWidget * | widget, | |
GdkEventMotion * | event | |||
) |
widget,: | a pointer to a widget created by CreateNewWidget(). | |
event,: | a pointer to a GdkEvent. |
bool gcu::CrystalView::OnPressed | ( | GtkWidget * | widget, | |
GdkEventButton * | event | |||
) |
widget,: | a pointer to a widget created by CreateNewWidget(). | |
event,: | a pointer to a GdkEvent. |
void gcu::CrystalView::Reshape | ( | GtkWidget * | widget | ) |
widget,: | a pointer to a widget created by CreateNewWidget(). |
virtual xmlNodePtr gcu::CrystalView::Save | ( | xmlDocPtr | xml | ) | [virtual] |
xml,: | the xmlDoc used to save the document. |
void gcu::CrystalView::SaveAsImage | ( | char const * | filename, | |
char const * | type, | |||
map< string, string > & | options | |||
) |
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. |
void gcu::CrystalView::Update | ( | GtkWidget * | widget | ) |
widget,: | a pointer to a widget created by CreateNewWidget(). |
void gcu::CrystalView::Update | ( | ) |
Updates all widgets of the view. This method must be called each time the document or the view are modified.
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.