Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GL_VIEW Class Reference

#include <gl_view.H>

Collaboration diagram for GL_VIEW:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GL_VIEW ()
virtual ~GL_VIEW ()
virtual void set_size (int w, int h, int x, int y)
virtual void set_cursor (int i)
virtual int get_cursor ()
virtual void set_stereo (stereo_mode m)
virtual void set_focus ()
virtual int paint ()
virtual void swap_buffers ()
virtual void prepare_buf_read ()
virtual void end_buf_read ()
virtual void read_pixels (uchar *, bool alpha=false)
virtual int stencil_draw (STENCILCB *, GELlist *objs=0)
virtual void draw_bb (mlib::CWpt_list &) const

Static Public Member Functions

static double gl_version ()
static bool poly_ext_available ()
static void init_polygon_offset ()
static void init_polygon_offset (float factor, float units, GLenum mode=GL_POLYGON_OFFSET_FILL)
static void end_polygon_offset ()
static void init_point_smooth (GLfloat size, GLbitfield mask=0, GLfloat *a=0)
static void init_line_smooth (GLfloat width, GLbitfield mask=0, GLfloat *a=0)
static void end_point_smooth ()
static void end_line_smooth ()
static void draw_pts (mlib::CWpt_list &pts, CCOLOR &color, double alpha, double size)
static void draw_wpt_list (mlib::CWpt_list &pts, CCOLOR &color, double alpha, double width, bool do_stipple)
static void draw_lines (CARRAY< mlib::Wline > &lines, CCOLOR &color, double alpha, double width, bool do_stipple)
static int depth_compare (const void *a, const void *b)
static bool print_gl_errors (Cstr_ptr &)

Protected Member Functions

void setup_light (int i)
virtual void setup_lights (CAMdata::eye=CAMdata::MIDDLE)
virtual void sort_blended_objects (CGELlist &)
virtual void clear_draw_buffer ()
virtual void setup_stencil ()
virtual void setup_scissor ()
virtual void draw_setup ()
virtual int draw_frame (CAMdata::eye=CAMdata::MIDDLE)
virtual int draw_objects (CGELlist &, CAMdata::eye=CAMdata::MIDDLE)
virtual void load_proj_mat (CAMdata::eye)
virtual void load_cam_mat (CAMdata::eye)

Static Protected Member Functions

static void check_point_sizes ()
static void check_line_widths ()

Protected Attributes

bool _paintResize
bool _resizePending
bool _focusPending
int _resizeW
int _resizeH
int _resizeX
int _resizeY
GELlist _opaque
GELlist _blended

Static Protected Attributes

static bool _checked_point_sizes = false
static bool _checked_line_widths = false
static GLfloat _min_point_size = 0
static GLfloat _max_point_size = 0
static GLfloat _min_line_width = 0
static GLfloat _max_line_width = 0

Detailed Description

Definition at line 17 of file gl_view.H.


Constructor & Destructor Documentation

GL_VIEW::GL_VIEW  )  [inline]
 

Definition at line 19 of file gl_view.H.

virtual GL_VIEW::~GL_VIEW  )  [inline, virtual]
 

Definition at line 28 of file gl_view.H.


Member Function Documentation

void GL_VIEW::check_line_widths  )  [static, protected]
 

Definition at line 785 of file gl_view.C.

References _checked_line_widths, _max_line_width, _min_line_width, Config::get_var_bool(), GL_LINE_WIDTH_GRANULARITY, GL_LINE_WIDTH_RANGE, and glGetFloatv().

Referenced by init_line_smooth().

void GL_VIEW::check_point_sizes  )  [static, protected]
 

Definition at line 763 of file gl_view.C.

References _checked_point_sizes, _max_point_size, _min_point_size, Config::get_var_bool(), GL_POINT_SIZE_GRANULARITY, GL_POINT_SIZE_RANGE, and glGetFloatv().

Referenced by init_point_smooth().

void GL_VIEW::clear_draw_buffer  )  [protected, virtual]
 

Definition at line 197 of file gl_view.C.

References GL_BACK, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_FRONT, glClear(), glClearColor(), glDrawBuffer(), and RCOLOR_ID.

Referenced by draw_setup(), and set_size().

int GL_VIEW::depth_compare const void *  a,
const void *  b
[static]
 

Definition at line 502 of file gl_view.C.

References is_valid_3D_object(), and VIEW::peek_cam().

Referenced by TexMemRefImage::draw_objects(), and sort_blended_objects().

virtual void GL_VIEW::draw_bb mlib::CWpt_list  )  const [virtual]
 

int GL_VIEW::draw_frame CAMdata::eye  = CAMdata::MIDDLE  )  [protected, virtual]
 

Definition at line 164 of file gl_view.C.

References draw_objects(), and tris.

Referenced by paint(), and read_pixels().

static void GL_VIEW::draw_lines CARRAY< mlib::Wline > &  lines,
CCOLOR color,
double  alpha,
double  width,
bool  do_stipple
[static]
 

int GL_VIEW::draw_objects CGELlist ,
CAMdata::eye  = CAMdata::MIDDLE
[protected, virtual]
 

Definition at line 314 of file gl_view.C.

References _blended, _opaque, check(), DONOT_CLIP_OBJ, GEL_list< T >::draw(), RIC_list< T >::draw_final(), ARRAY< T >::empty(), end_polygon_offset(), hashvar< T >::get(), Config::get_var_dbl(), GL_AMBIENT_AND_DIFFUSE, GL_BLEND, GL_CLIP_PLANE0, GL_COLOR_MATERIAL, GL_CULL_FACE, GL_EMISSION, GL_FRONT_AND_BACK, GL_LIGHTING, GL_MODELVIEW, GL_NORMALIZE, GL_ONE_MINUS_SRC_ALPHA, GL_PROJECTION, GL_SHININESS, GL_SMOOTH, GL_SPECULAR, GL_SRC_ALPHA, glBlendFunc(), glClipPlane(), glColorMaterial(), glDisable(), glEnable(), glLineWidth(), glMaterialf(), glMaterialfv(), glMatrixMode(), glShadeModel(), init_polygon_offset(), load_cam_mat(), load_proj_mat(), ARRAY< T >::num(), RWIRE_FRAME, setup_lights(), sort_blended_objects(), and tris.

Referenced by draw_frame(), and stencil_draw().

static void GL_VIEW::draw_pts mlib::CWpt_list pts,
CCOLOR color,
double  alpha,
double  size
[static]
 

Referenced by ControlFrameTexture::draw_selected_verts().

void GL_VIEW::draw_setup  )  [protected, virtual]
 

Definition at line 136 of file gl_view.C.

References clear_draw_buffer(), GL_DEPTH_TEST, GL_LEQUAL, GL_STENCIL_TEST, GL_TRUE, glDepthFunc(), glDepthMask(), glDisable(), glEnable(), setup_scissor(), and setup_stencil().

Referenced by paint(), and read_pixels().

static void GL_VIEW::draw_wpt_list mlib::CWpt_list pts,
CCOLOR color,
double  alpha,
double  width,
bool  do_stipple
[static]
 

void GL_VIEW::end_buf_read  )  [virtual]
 

Definition at line 624 of file gl_view.C.

References GL_PACK_ALIGNMENT, and glPixelStorei().

void GL_VIEW::end_line_smooth  )  [static]
 

Definition at line 849 of file gl_view.C.

References glPopAttrib().

Referenced by ZcrossTexture::draw(), GestureBoxDrawer::draw(), GestureDrawer::draw(), DEBUG_ELLIPSE::draw(), CreasesTexture::draw(), ControlFrameTexture::draw_level(), SHOW_TRIS::draw_lines(), ControlFrameTexture::draw_selected_edges(), and GtexUtil::draw_strip().

void GL_VIEW::end_point_smooth  )  [static]
 

Definition at line 843 of file gl_view.C.

References glPopAttrib().

Referenced by DEBUG_ELLIPSE::draw().

void GL_VIEW::end_polygon_offset  )  [static]
 

Definition at line 757 of file gl_view.C.

References GL_POLYGON_OFFSET_FILL, and glDisable().

Referenced by GEOM::draw(), SHOW_TRIS::draw_filled(), OGLTexture::draw_id_triangles(), draw_objects(), GEOM::draw_ref_img(), and GEOM::draw_vis_ref().

virtual int GL_VIEW::get_cursor  )  [inline, virtual]
 

Definition at line 32 of file gl_view.H.

double GL_VIEW::gl_version  )  [static]
 

Definition at line 726 of file gl_view.C.

References GL_VERSION, and glGetString().

static void GL_VIEW::init_line_smooth GLfloat  width,
GLbitfield  mask = 0,
GLfloat a = 0
[inline, static]
 

Definition at line 79 of file gl_view.H.

References _max_line_width, _min_line_width, check_line_widths(), GL_BLEND, GL_COLOR_BUFFER_BIT, GL_ENABLE_BIT, GL_HINT_BIT, GL_LINE_BIT, GL_LINE_SMOOTH, GL_LINE_SMOOTH_HINT, GL_NICEST, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, glBlendFunc(), glEnable(), glHint(), glLineWidth(), glPushAttrib(), and max().

Referenced by ZcrossTexture::draw(), WireframeTexture::draw(), SilsTexture::draw(), GestureBoxDrawer::draw(), GestureDrawer::draw(), DEBUG_ELLIPSE::draw(), CreasesTexture::draw(), ControlFrameTexture::draw_level(), SHOW_TRIS::draw_lines(), ControlFrameTexture::draw_selected_edges(), and GtexUtil::draw_strip().

void GL_VIEW::init_point_smooth GLfloat  size,
GLbitfield  mask = 0,
GLfloat a = 0
[static]
 

Definition at line 807 of file gl_view.C.

References _max_point_size, _min_point_size, check_point_sizes(), err_msg(), GL_BLEND, GL_COLOR_BUFFER_BIT, GL_ENABLE_BIT, GL_HINT_BIT, GL_NICEST, GL_ONE_MINUS_SRC_ALPHA, GL_POINT_BIT, GL_POINT_SMOOTH, GL_POINT_SMOOTH_HINT, GL_SRC_ALPHA, glBlendFunc(), glEnable(), glHint(), glPointSize(), glPushAttrib(), and max().

Referenced by DEBUG_ELLIPSE::draw().

void GL_VIEW::init_polygon_offset float  factor,
float  units,
GLenum  mode = GL_POLYGON_OFFSET_FILL
[static]
 

Definition at line 746 of file gl_view.C.

References glEnable(), and glPolygonOffset().

static void GL_VIEW::init_polygon_offset  )  [inline, static]
 

Definition at line 44 of file gl_view.H.

References Config::get_var_dbl(), and GL_POLYGON_OFFSET_FILL.

Referenced by GEOM::draw(), ControlLineTexture::draw(), SHOW_TRIS::draw_filled(), OGLTexture::draw_id_triangles(), draw_objects(), GEOM::draw_ref_img(), and GEOM::draw_vis_ref().

void GL_VIEW::load_cam_mat CAMdata::eye   )  [protected, virtual]
 

Definition at line 33 of file gl_view.C.

References CCAMdataptr, CVIEWptr, and glLoadMatrixd().

Referenced by draw_objects().

void GL_VIEW::load_proj_mat CAMdata::eye   )  [protected, virtual]
 

Definition at line 27 of file gl_view.C.

References glLoadMatrixd().

Referenced by draw_objects().

int GL_VIEW::paint  )  [virtual]
 

Definition at line 59 of file gl_view.C.

References _focusPending, _paintResize, _resizeH, _resizePending, _resizeW, _resizeX, _resizeY, brcase, draw_frame(), draw_setup(), Config::get_var_int(), GL_BACK_LEFT, GL_BACK_RIGHT, GL_DEPTH_BUFFER_BIT, glClear(), glDrawBuffer(), glViewport(), multithread, NONE, ARRAY< T >::num(), Animator::on(), Animator::play_on(), Animator::rend_on(), set_size(), tris, and VIEWS.

bool GL_VIEW::poly_ext_available  )  [static]
 

Definition at line 737 of file gl_view.C.

References GL_EXTENSIONS, and glGetString().

void GL_VIEW::prepare_buf_read  )  [virtual]
 

Definition at line 631 of file gl_view.C.

References GL_BACK, GL_PACK_ALIGNMENT, glPixelStorei(), and glReadBuffer().

bool GL_VIEW::print_gl_errors Cstr_ptr &   )  [static]
 

Definition at line 471 of file gl_view.C.

References err_msg(), GL_INVALID_ENUM, GL_INVALID_OPERATION, GL_INVALID_VALUE, GL_OUT_OF_MEMORY, GL_STACK_OVERFLOW, GL_STACK_UNDERFLOW, and glGetError().

Referenced by GLSLPaperShader::begin_glsl_paper(), PaperEffect::begin_paper_effect(), Perlin::create_perlin_texture3(), XToonTexture::draw(), ToonTexture_1D::draw(), GLSLShader::draw(), FlatShadeTexture::draw(), GLSLPaperShader::end_glsl_paper(), PaperEffect::end_paper_effect(), PaperEffect::end_paper_effect_arb(), PaperEffect::init(), GLSLShader::init(), PaperEffect::init_arb(), PaperEffect::init_ati(), GLSLShader::print_info(), setup_lights(), and swap_buffers().

void GL_VIEW::read_pixels uchar ,
bool  alpha = false
[virtual]
 

Definition at line 638 of file gl_view.C.

References draw_frame(), draw_setup(), GL_RGB, GL_RGBA, GL_UNSIGNED_BYTE, and glReadPixels().

virtual void GL_VIEW::set_cursor int  i  )  [inline, virtual]
 

Definition at line 31 of file gl_view.H.

virtual void GL_VIEW::set_focus  )  [inline, virtual]
 

Definition at line 34 of file gl_view.H.

References _focusPending.

void GL_VIEW::set_size int  w,
int  h,
int  x,
int  y
[virtual]
 

Definition at line 664 of file gl_view.C.

References _paintResize, _resizeH, _resizePending, _resizeW, _resizeX, _resizeY, clear_draw_buffer(), Config::get_var_dbl(), GL_BACK, GL_FRONT, glDrawBuffer(), glViewport(), multithread, ARRAY< T >::num(), and VIEWS.

Referenced by paint().

virtual void GL_VIEW::set_stereo stereo_mode  m  )  [inline, virtual]
 

Definition at line 33 of file gl_view.H.

void GL_VIEW::setup_light int  i  )  [protected]
 

Definition at line 549 of file gl_view.C.

References Light::_ambient_color, Light::_diffuse_color, Light::_is_enabled, Light::_is_in_cam_space, Light::_is_positional, Light::_k0, Light::_k1, Light::_k2, Light::_specular_color, Light::_spot_cutoff, Light::_spot_direction, Light::_spot_exponent, Color::black(), Light::get_direction(), Light::get_position(), GL_AMBIENT, GL_CONSTANT_ATTENUATION, GL_DIFFUSE, GL_LINEAR_ATTENUATION, GL_MODELVIEW, GL_POSITION, GL_QUADRATIC_ATTENUATION, GL_SPECULAR, GL_SPOT_CUTOFF, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, glDisable(), glEnable(), glLightf(), glLightfv(), glLoadIdentity(), glLoadMatrixd(), glMatrixMode(), glPopMatrix(), glPushMatrix(), and light_i().

Referenced by setup_lights().

void GL_VIEW::setup_lights CAMdata::eye  = CAMdata::MIDDLE  )  [protected, virtual]
 

Definition at line 598 of file gl_view.C.

References GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_LOCAL_VIEWER, GL_LIGHT_MODEL_TWO_SIDE, GL_LIGHTING, glDisable(), glEnable(), glLightModelfv(), glLightModeli(), VIEW::max_lights(), print_gl_errors(), and setup_light().

Referenced by draw_objects().

void GL_VIEW::setup_scissor  )  [protected, virtual]
 

Definition at line 280 of file gl_view.C.

References GL_SCISSOR_TEST, glEnable(), and glScissor().

Referenced by draw_setup().

void GL_VIEW::setup_stencil  )  [protected, virtual]
 

Definition at line 232 of file gl_view.C.

References GL_ALWAYS, GL_EQUAL, GL_KEEP, GL_LIGHTING, GL_MODELVIEW, GL_PROJECTION, GL_QUADS, GL_REPLACE, GL_STENCIL_BUFFER_BIT, GL_STENCIL_TEST, glBegin(), glClear(), glClearStencil(), glDisable(), glEnable(), glEnd(), glLoadIdentity(), glLoadMatrixd(), glMatrixMode(), glPopMatrix(), glPushMatrix(), glStencilFunc(), glStencilOp(), glVertex2dv(), and ARRAY< T >::num().

Referenced by draw_setup().

void GL_VIEW::sort_blended_objects CGELlist  )  [protected, virtual]
 

Definition at line 531 of file gl_view.C.

References _blended, _opaque, ARRAY< T >::clear(), depth_compare(), ARRAY< T >::num(), and ARRAY< T >::sort().

Referenced by draw_objects().

int GL_VIEW::stencil_draw STENCILCB ,
GELlist objs = 0
[virtual]
 

Definition at line 454 of file gl_view.C.

References BAD_IND, draw_objects(), GL_EQUAL, GL_KEEP, glStencilFunc(), and glStencilOp().

void GL_VIEW::swap_buffers  )  [virtual]
 

Definition at line 182 of file gl_view.C.

References GL_SCISSOR_TEST, glDisable(), glFlush(), in_swap_buffers(), and print_gl_errors().


Member Data Documentation

GELlist GL_VIEW::_blended [protected]
 

Definition at line 182 of file gl_view.H.

Referenced by draw_objects(), and sort_blended_objects().

bool GL_VIEW::_checked_line_widths = false [static, protected]
 

Definition at line 170 of file gl_view.H.

Referenced by check_line_widths().

bool GL_VIEW::_checked_point_sizes = false [static, protected]
 

Definition at line 169 of file gl_view.H.

Referenced by check_point_sizes().

bool GL_VIEW::_focusPending [protected]
 

Definition at line 178 of file gl_view.H.

Referenced by paint(), and set_focus().

GLfloat GL_VIEW::_max_line_width = 0 [static, protected]
 

Definition at line 174 of file gl_view.H.

Referenced by check_line_widths(), and init_line_smooth().

GLfloat GL_VIEW::_max_point_size = 0 [static, protected]
 

Definition at line 172 of file gl_view.H.

Referenced by check_point_sizes(), and init_point_smooth().

GLfloat GL_VIEW::_min_line_width = 0 [static, protected]
 

Definition at line 173 of file gl_view.H.

Referenced by check_line_widths(), and init_line_smooth().

GLfloat GL_VIEW::_min_point_size = 0 [static, protected]
 

Definition at line 171 of file gl_view.H.

Referenced by check_point_sizes(), and init_point_smooth().

GELlist GL_VIEW::_opaque [protected]
 

Definition at line 181 of file gl_view.H.

Referenced by draw_objects(), and sort_blended_objects().

bool GL_VIEW::_paintResize [protected]
 

Definition at line 176 of file gl_view.H.

Referenced by paint(), and set_size().

int GL_VIEW::_resizeH [protected]
 

Definition at line 179 of file gl_view.H.

Referenced by paint(), and set_size().

bool GL_VIEW::_resizePending [protected]
 

Definition at line 177 of file gl_view.H.

Referenced by paint(), and set_size().

int GL_VIEW::_resizeW [protected]
 

Definition at line 179 of file gl_view.H.

Referenced by paint(), and set_size().

int GL_VIEW::_resizeX [protected]
 

Definition at line 179 of file gl_view.H.

Referenced by paint(), and set_size().

int GL_VIEW::_resizeY [protected]
 

Definition at line 179 of file gl_view.H.

Referenced by paint(), and set_size().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:45:35 2006 for jot by  doxygen 1.4.4