Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OpenGLRenderer.C File Reference

Rendering-only DisplayDevice subclass that performs core OpenGL rendering operations to generate molecular graphics from VMDDisplayList tokens. More...

#include "OpenGLRenderer.h"
#include "DispCmds.h"
#include "Inform.h"
#include "utilities.h"
#include "VMDDisplayList.h"
#include "Hershey.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "OpenGLStipples.h"

Go to the source code of this file.

Defines

#define VMDWIREGL   1
#define VMDINTELSWR   1
#define OGLERR
#define MIN_SPHERE_RES   4
#define MAX_SPHERE_RES   30
#define SWAP_ROWS_DOUBLE(a, b)   { double *_tmp = a; (a)=(b); (b)=_tmp; }
#define SWAP_ROWS_FLOAT(a, b)   { float *_tmp = a; (a)=(b); (b)=_tmp; }
#define SWAP_ROWS   SWAP_ROWS_DOUBLE
#define MAT(m, r, c)   (m)[(c)*4+(r)]
#define SPHEREMAXRES   30

Functions

void vmd_matmult_4x4d (GLdouble *r, const GLdouble *m1, const GLdouble *m2)
void vmd_matmultvec_4x4d (GLdouble *npoint, const GLdouble *opoint, const GLdouble *mat)
int vmd_invert_mat_4x4d (const GLdouble *m, GLdouble *out)
GLdouble * vmd_vec_normalize_3d (GLdouble *vect)
GLdouble * vmd_cross_3d (GLdouble *x1, const GLdouble *x2, const GLdouble *x3)
void vmd_mattrans_d (GLdouble *m, GLdouble x, GLdouble y, GLdouble z)
void vmd_mat_identity_4x4d (GLdouble *m)
void vmd_DrawSphere (float rad, int res, int solid)
void vmd_DrawConic (float *base, float *apex, float radius, float radius2, int numsides)
GLint vmd_Project (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *winX, GLdouble *winY, GLdouble *winZ)
GLint vmd_UnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble *objX, GLdouble *objY, GLdouble *objZ)
void vmd_LookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ)
void cylinder_full (int num, float *edges, int filled)
 glPopMatrix ()


Detailed Description

Rendering-only DisplayDevice subclass that performs core OpenGL rendering operations to generate molecular graphics from VMDDisplayList tokens.

OpenGLDisplayDevice is not a complete DisplayDevice subclass definition. Another subclass must provide routines to open windows, reshape, clear, set perspective, etc. This object only contains the low-level OpenGL code to render VMDDisplayList DispCmd tokens to create molecular graphics. OpenGLRenderer renders drawing commands into a framebuffer and (possibly in an on-screen window) managed by one of the other DisplayDevice subclasses, e.g., OpenGLDisplayDevice, FltkDisplayDevice, OpenGLPbufferDisplayDevice, etc.

Definition in file OpenGLRenderer.C.


Define Documentation

#define MAT m,
r,
     (m)[(c)*4+(r)]
 

Definition at line 115 of file OpenGLRenderer.C.

Referenced by vmd_invert_mat_4x4d.

#define MAX_SPHERE_RES   30
 

Definition at line 71 of file OpenGLRenderer.C.

Referenced by OpenGLRenderer::free_opengl_ctx, and OpenGLRenderer::setup_initial_opengl_state.

#define MIN_SPHERE_RES   4
 

Definition at line 70 of file OpenGLRenderer.C.

Referenced by OpenGLRenderer::free_opengl_ctx, OpenGLRenderer::setup_initial_opengl_state, and OpenGLRenderer::update_lists.

#define OGLERR
 

Definition at line 67 of file OpenGLRenderer.C.

Referenced by OpenGLRenderer::setup_initial_opengl_state.

#define SPHEREMAXRES   30
 

Definition at line 328 of file OpenGLRenderer.C.

Referenced by vmd_DrawSphere.

#define SWAP_ROWS   SWAP_ROWS_DOUBLE
 

Definition at line 114 of file OpenGLRenderer.C.

Referenced by vmd_invert_mat_4x4d.

#define SWAP_ROWS_DOUBLE a,
     { double *_tmp = a; (a)=(b); (b)=_tmp; }
 

Definition at line 112 of file OpenGLRenderer.C.

#define SWAP_ROWS_FLOAT a,
     { float *_tmp = a; (a)=(b); (b)=_tmp; }
 

Definition at line 113 of file OpenGLRenderer.C.

#define VMDINTELSWR   1
 

Definition at line 53 of file OpenGLRenderer.C.

#define VMDWIREGL   1
 

Definition at line 50 of file OpenGLRenderer.C.


Function Documentation

void cylinder_full int    num,
float *    edges,
int    filled
[static]
 

Definition at line 1609 of file OpenGLRenderer.C.

References CYLINDER_LEADINGCAP, CYLINDER_TRAILINGCAP, n, num, and vec_normalize.

glPopMatrix  
 

Referenced by OpenGLRenderer::cylinder, OpenGLRenderer::draw_background_gradient, OpenGLDisplayDevice::drawpixels_rgba4u, OpenGLRenderer::enable_stencil_stereo, VRJugglerDisplayDevice::render, FreeVRDisplayDevice::render, CaveDisplayDevice::render, and OpenGLRenderer::render_done.

GLdouble* vmd_cross_3d GLdouble *    x1,
const GLdouble *    x2,
const GLdouble *    x3
[static]
 

Definition at line 301 of file OpenGLRenderer.C.

Referenced by vmd_LookAt.

void vmd_DrawConic float *    base,
float *    apex,
float    radius,
float    radius2,
int    numsides
[static]
 

Definition at line 447 of file OpenGLRenderer.C.

References cross_prod, CYLINDER_LEADINGCAP, CYLINDER_TRAILINGCAP, vec_add, vec_copy, vec_negate, vec_normalize, and VMD_TWOPI.

Referenced by OpenGLRenderer::cylinder.

void vmd_DrawSphere float    rad,
int    res,
int    solid
[static]
 

Definition at line 329 of file OpenGLRenderer.C.

References SPHEREMAXRES, VMD_PIF, and VMD_TWOPIF.

Referenced by OpenGLRenderer::setup_initial_opengl_state.

int vmd_invert_mat_4x4d const GLdouble *    m,
GLdouble *    out
[static]
 

Definition at line 118 of file OpenGLRenderer.C.

References MAT, and SWAP_ROWS.

Referenced by vmd_UnProject.

void vmd_LookAt GLdouble    eyeX,
GLdouble    eyeY,
GLdouble    eyeZ,
GLdouble    centerX,
GLdouble    centerY,
GLdouble    centerZ,
GLdouble    upX,
GLdouble    upY,
GLdouble    upZ
[static]
 

Definition at line 702 of file OpenGLRenderer.C.

References vmd_cross_3d, vmd_mat_identity_4x4d, vmd_matmult_4x4d, vmd_mattrans_d, and vmd_vec_normalize_3d.

Referenced by OpenGLRenderer::set_persp.

void vmd_mat_identity_4x4d GLdouble *    m [static]
 

Definition at line 319 of file OpenGLRenderer.C.

Referenced by vmd_LookAt.

void vmd_matmult_4x4d GLdouble *    r,
const GLdouble *    m1,
const GLdouble *    m2
[static]
 

Definition at line 80 of file OpenGLRenderer.C.

Referenced by vmd_LookAt, and vmd_UnProject.

void vmd_matmultvec_4x4d GLdouble *    npoint,
const GLdouble *    opoint,
const GLdouble *    mat
[static]
 

Definition at line 104 of file OpenGLRenderer.C.

References mat.

Referenced by vmd_Project, and vmd_UnProject.

void vmd_mattrans_d GLdouble *    m,
GLdouble    x,
GLdouble    y,
GLdouble    z
[static]
 

Definition at line 311 of file OpenGLRenderer.C.

References z.

Referenced by vmd_LookAt.

GLint vmd_Project GLdouble    objX,
GLdouble    objY,
GLdouble    objZ,
const GLdouble *    model,
const GLdouble *    proj,
const GLint *    view,
GLdouble *    winX,
GLdouble *    winY,
GLdouble *    winZ
[static]
 

Definition at line 623 of file OpenGLRenderer.C.

References vmd_matmultvec_4x4d.

Referenced by OpenGLRenderer::abs_screen_loc_3D.

GLint vmd_UnProject GLdouble    winX,
GLdouble    winY,
GLdouble    winZ,
const GLdouble *    model,
const GLdouble *    proj,
const GLint *    view,
GLdouble *    objX,
GLdouble *    objY,
GLdouble *    objZ
[static]
 

Definition at line 661 of file OpenGLRenderer.C.

References vmd_invert_mat_4x4d, vmd_matmult_4x4d, and vmd_matmultvec_4x4d.

Referenced by OpenGLRenderer::find_3D_from_2D.

GLdouble* vmd_vec_normalize_3d GLdouble *    vect [static]
 

Definition at line 286 of file OpenGLRenderer.C.

Referenced by vmd_LookAt.


Generated on Sun Oct 6 02:43:44 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002