The Gnome Chemistry Utils
0.14.0
|
#include <gcu/glview.h>
Public Member Functions | |
GLView (GLDocument *pDoc) throw (std::runtime_error) | |
Constructor. | |
virtual | ~GLView () |
Destructor. | |
virtual void | Update () |
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 |
virtual GdkPixbuf * | BuildPixbuf (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) |
GLDocument * | GetDoc (void) |
double | GetRadius (void) |
Protected Member Functions | |
void | Rotate (gdouble x, gdouble y) |
virtual bool | GLBegin ()=0 |
virtual void | GLEnd ()=0 |
Protected Attributes | |
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 |
View class based on OpenGL for rendering. Used to display 3d chemical structures such as molecules or crystals cells.
gcu::GLView::GLView | ( | GLDocument * | pDoc | ) | throw (std::runtime_error) |
Constructor.
pDoc,: | a pointer to the GLDocument instance. |
Creates a view for the document.
Reimplemented in gcugtk::GLView.
|
virtual |
|
virtual |
width | the width of the generated image. |
height | the height of the generated image. |
use_bg | whether to use the window background or a transparent background. |
Generates a pixbuf from the current view.
Reimplemented in gcugtk::GLView.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 177 of file glview.h.
Referenced by gcr::View::GetFoV().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedpure virtual |
Starts an OpenGL drawing operation. Will set the appropriate context. This method is pure virtual and must be implemented in derived classes.
Implemented in gcugtk::GLView.
|
protectedpure virtual |
Ends an OpenGL drawing operation. This method is pure virtual and must be implemented in derived classes.
Implemented in gcugtk::GLView.
void gcu::GLView::RenderToCairo | ( | cairo_t * | cr, |
unsigned | width, | ||
unsigned | height, | ||
bool | use_bg | ||
) | const |
cr | a cairo_t. |
width | the width used for rendering. |
height | the height used for rendering. |
use_bg | whether to use the window background or a transparent background. |
Outputs a bitmap to cairo. Used internally for printing and various image formats exports.
|
protected |
x | the x component of the rotation. |
y | the y component of the rotation. std:: Called by OnMotion(). x and y are the displacement coordinates of the mouse. |
void gcu::GLView::SaveAsImage | ( | std::string const & | filename, |
char const * | type, | ||
std::map< std::string, std::string > & | options, | ||
unsigned | width, | ||
unsigned | height, | ||
bool | use_bg | ||
) | const |
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. |
width | the width of the generated image. |
height | the height of the generated image. |
use_bg | whether to use the window background or a transparent background. |
Export the view contents as an image. The size of the new image is defined by the width and height parameters.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void gcu::GLView::SetRotation | ( | double | psi, |
double | theta, | ||
double | phi | ||
) |
psi | the first Euler's angle. |
theta | the second Euler's angle. |
phi | the third Euler's angle. |
Sets the orientation of the model, using the Euler's angles.
|
inline |
|
virtual |
Update the contents of the associated widget if any. This method must be called each time the document or the view are modified. Default implementation doesn't do anything.
Reimplemented in gcugtk::GLView.
|
protected |
|
protected |
|
protected |
|
protected |
The distance between the center of the model and the point of view.
Definition at line 265 of file glview.h.
Referenced by gcr::View::GetPos().