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

RIBGraphicsStateGuardian Class Reference

#include <ribGraphicsStateGuardian.h>

Inheritance diagram for RIBGraphicsStateGuardian:

GraphicsStateGuardian GraphicsStateGuardianBase TypedReferenceCount TypedObject ReferenceCount List of all members.

Public Member Functions

 RIBGraphicsStateGuardian (GraphicsWindow *win)
virtual void reset ()
void reset_file (ostream &out)
void reset_frame ()
virtual void clear (const RenderBuffer &buffer)
virtual void clear (const RenderBuffer &buffer, const DisplayRegion *region)
virtual void prepare_display_region ()
virtual void render_frame (const AllAttributesWrapper &initial_state)
virtual void render_scene (Node *root, ProjectionNode *projnode, const AllAttributesWrapper &initial_state)
virtual void render_subgraph (RenderTraverser *traverser, Node *subgraph, ProjectionNode *projnode, const AllAttributesWrapper &initial_state, const AllTransitionsWrapper &net_trans)
virtual void render_subgraph (RenderTraverser *traverser, Node *subgraph, const AllAttributesWrapper &initial_state, const AllTransitionsWrapper &net_trans)
virtual bool wants_normals (void) const
virtual bool wants_texcoords (void) const
virtual bool wants_colors (void) const
virtual float compute_distance_to (const LPoint3f &point) const
virtual void draw_point (const GeomPoint *geom)
virtual void draw_line (const GeomLine *geom)
virtual void draw_linestrip (const GeomLinestrip *)
virtual void draw_sprite (const GeomSprite *geom)
virtual void draw_polygon (const GeomPolygon *geom)
virtual void draw_quad (const GeomQuad *geom)
virtual void draw_tri (const GeomTri *geom)
virtual void draw_tristrip (const GeomTristrip *geom)
virtual void draw_trifan (const GeomTrifan *geom)
virtual void draw_sphere (const GeomSphere *geom)
virtual TextureContextprepare_texture (Texture *tex)
virtual void apply_texture (TextureContext *tc)
virtual void release_texture (TextureContext *tc)
virtual void copy_texture (TextureContext *tc, const DisplayRegion *dr)
virtual void copy_texture (TextureContext *tc, const DisplayRegion *dr, const RenderBuffer &rb)
virtual void draw_texture (TextureContext *tc, const DisplayRegion *dr)
virtual void draw_texture (TextureContext *tc, const DisplayRegion *dr, const RenderBuffer &rb)
virtual void texture_to_pixel_buffer (TextureContext *, PixelBuffer *)
virtual void texture_to_pixel_buffer (TextureContext *, PixelBuffer *, const DisplayRegion *)
virtual void copy_pixel_buffer (PixelBuffer *pb, const DisplayRegion *dr)
virtual void copy_pixel_buffer (PixelBuffer *pb, const DisplayRegion *dr, const RenderBuffer &rb)
virtual void draw_pixel_buffer (PixelBuffer *pb, const DisplayRegion *dr, const NodeAttributes &na=NodeAttributes())
virtual void draw_pixel_buffer (PixelBuffer *pb, const DisplayRegion *dr, const RenderBuffer &rb, const NodeAttributes &na=NodeAttributes())
virtual void apply_material (Material *)
virtual void apply_fog (Fog *)
virtual void apply_light (PointLight *)
virtual void apply_light (DirectionalLight *)
virtual void apply_light (Spotlight *)
virtual void apply_light (AmbientLight *)
virtual void issue_transform (const TransformAttribute *attrib)
virtual void issue_color (const ColorAttribute *attrib)
virtual void issue_texture (const TextureAttribute *attrib)
virtual void issue_light (const LightAttribute *attrib)
void set_texture_directory (const string &directory)
string get_texture_directory () const
void set_texture_extension (const string &extension)
string get_texture_extension () const
virtual TypeHandle get_type (void) const
virtual TypeHandle force_init_type ()

Static Public Member Functions

GraphicsStateGuardianmake_RIBGraphicsStateGuardian (const FactoryParams &params)
TypeHandle get_class_type (void)
void init_type (void)

Protected Types

typedef pmap< const Texture *,
Filename > 
TextureNames
typedef pmap< const Light *,
int > 
LightIDs
typedef pvector< bool > EnabledLights

Protected Member Functions

virtual PT (SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer
virtual CPT (DisplayRegion) dr)
virtual void restore_frame_buffer (SavedFrameBuffer *frame_buffer)
void set_color (const RGBColorf &color)
void get_rib_stuff (Node *root, const AllAttributesWrapper &initial_state)
void define_texture (const Texture *tex)
void define_light (const Light *light)
void write_light_color (const Colorf &color) const
void write_light_from (const Node *light) const
void write_light_to (const Node *light) const
ostream & new_line (int extra_indent=0) const
void reset_transform (const LMatrix4f &mat) const
void concat_transform (const LMatrix4f &mat) const
void draw_simple_poly (const Geom *geom)
void write_polygon (int num_verts)

Static Protected Member Functions

void get_color_and_intensity (const RGBColorf &input, RGBColorf &output, float &intensity)

Protected Attributes

RGBColorf _current_color
string _texture_directory
string _texture_extension
ostream * _output
int _indent_level
TextureNames _texture_names
LightIDs _light_ids
EnabledLights _enabled_lights

Static Private Attributes

TypeHandle _type_handle

Friends

class RibStuffTraverser

Member Typedef Documentation

typedef pvector<bool> RIBGraphicsStateGuardian::EnabledLights [protected]
 

Definition at line 162 of file ribGraphicsStateGuardian.h.

typedef pmap<const Light *, int> RIBGraphicsStateGuardian::LightIDs [protected]
 

Definition at line 160 of file ribGraphicsStateGuardian.h.

typedef pmap<const Texture *, Filename> RIBGraphicsStateGuardian::TextureNames [protected]
 

Definition at line 158 of file ribGraphicsStateGuardian.h.


Constructor & Destructor Documentation

RIBGraphicsStateGuardian::RIBGraphicsStateGuardian GraphicsWindow win  ) 
 

Definition at line 101 of file ribGraphicsStateGuardian.cxx.

References _texture_directory, _texture_extension, reset(), and win.

Referenced by make_RIBGraphicsStateGuardian().


Member Function Documentation

virtual void RIBGraphicsStateGuardian::apply_fog Fog  )  [inline, virtual]
 

Definition at line 109 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::apply_light AmbientLight  )  [inline, virtual]
 

Definition at line 114 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::apply_light Spotlight  )  [inline, virtual]
 

Definition at line 113 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::apply_light DirectionalLight  )  [inline, virtual]
 

Definition at line 112 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::apply_light PointLight  )  [inline, virtual]
 

Definition at line 111 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::apply_material Material  )  [inline, virtual]
 

Definition at line 108 of file ribGraphicsStateGuardian.h.

void RIBGraphicsStateGuardian::apply_texture TextureContext tc  )  [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 555 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::clear const RenderBuffer buffer,
const DisplayRegion region
[virtual]
 

Definition at line 182 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::clear const RenderBuffer buffer  )  [virtual]
 

Definition at line 172 of file ribGraphicsStateGuardian.cxx.

float RIBGraphicsStateGuardian::compute_distance_to const LPoint3f &  point  )  const [virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 431 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::concat_transform const LMatrix4f &  mat  )  const [protected]
 

Definition at line 1058 of file ribGraphicsStateGuardian.cxx.

References new_line().

void RIBGraphicsStateGuardian::copy_pixel_buffer PixelBuffer pb,
const DisplayRegion dr,
const RenderBuffer rb
[virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 629 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::copy_pixel_buffer PixelBuffer pb,
const DisplayRegion dr
[virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 620 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::copy_texture TextureContext tc,
const DisplayRegion dr,
const RenderBuffer rb
[virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 593 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::copy_texture TextureContext tc,
const DisplayRegion dr
[virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 584 of file ribGraphicsStateGuardian.cxx.

virtual RIBGraphicsStateGuardian::CPT DisplayRegion   )  [protected, virtual]
 

Implements GraphicsStateGuardian.

void RIBGraphicsStateGuardian::define_light const Light light  )  [protected]
 

Definition at line 926 of file ribGraphicsStateGuardian.cxx.

References _enabled_lights, _light_ids, deg_2_rad(), AmbientLight::get_class_type(), Spotlight::get_class_type(), DirectionalLight::get_class_type(), PointLight::get_class_type(), id, new_line(), write_light_color(), write_light_from(), and write_light_to().

void RIBGraphicsStateGuardian::define_texture const Texture tex  )  [protected]
 

Definition at line 887 of file ribGraphicsStateGuardian.cxx.

References _texture_directory, _texture_extension, _texture_names, Texture::get_wrapu(), Texture::get_wrapv(), new_line(), tex, Texture::WM_clamp, and Texture::write().

void RIBGraphicsStateGuardian::draw_line const GeomLine geom  )  [virtual]
 

Definition at line 454 of file ribGraphicsStateGuardian.cxx.

virtual void RIBGraphicsStateGuardian::draw_linestrip const GeomLinestrip  )  [inline, virtual]
 

Definition at line 75 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::draw_pixel_buffer PixelBuffer pb,
const DisplayRegion dr,
const RenderBuffer rb,
const NodeAttributes &  na = NodeAttributes()
[virtual]
 

virtual void RIBGraphicsStateGuardian::draw_pixel_buffer PixelBuffer pb,
const DisplayRegion dr,
const NodeAttributes &  na = NodeAttributes()
[virtual]
 

void RIBGraphicsStateGuardian::draw_point const GeomPoint geom  )  [virtual]
 

Definition at line 445 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::draw_polygon const GeomPolygon geom  )  [virtual]
 

Definition at line 472 of file ribGraphicsStateGuardian.cxx.

References draw_simple_poly().

void RIBGraphicsStateGuardian::draw_quad const GeomQuad geom  )  [virtual]
 

Definition at line 492 of file ribGraphicsStateGuardian.cxx.

References draw_simple_poly().

void RIBGraphicsStateGuardian::draw_simple_poly const Geom geom  )  [protected]
 

Definition at line 1077 of file ribGraphicsStateGuardian.cxx.

References G_COLOR, G_NORMAL, G_OVERALL, G_PER_PRIM, G_PER_VERTEX, Geom::get_length(), Geom::get_num_prims(), GeomIssuer::issue_color(), issue_color_rib(), GeomIssuer::issue_normal(), issue_normal_rib(), GeomIssuer::issue_texcoord(), issue_texcoord_rib(), GeomIssuer::issue_vertex(), issue_vertex_rib(), Geom::make_color_iterator(), Geom::make_normal_iterator(), Geom::make_texcoord_iterator(), Geom::make_vertex_iterator(), NULL, and write_polygon().

Referenced by draw_polygon(), draw_quad(), draw_tri(), draw_trifan(), and draw_tristrip().

void RIBGraphicsStateGuardian::draw_sphere const GeomSphere geom  )  [virtual]
 

Definition at line 526 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::draw_sprite const GeomSprite geom  )  [virtual]
 

Definition at line 463 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::draw_texture TextureContext tc,
const DisplayRegion dr,
const RenderBuffer rb
[virtual]
 

Definition at line 611 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::draw_texture TextureContext tc,
const DisplayRegion dr
[virtual]
 

Definition at line 602 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::draw_tri const GeomTri geom  )  [virtual]
 

Definition at line 482 of file ribGraphicsStateGuardian.cxx.

References draw_simple_poly().

void RIBGraphicsStateGuardian::draw_trifan const GeomTrifan geom  )  [virtual]
 

Definition at line 514 of file ribGraphicsStateGuardian.cxx.

References draw_simple_poly(), and GeomTrifan::explode().

void RIBGraphicsStateGuardian::draw_tristrip const GeomTristrip geom  )  [virtual]
 

Definition at line 502 of file ribGraphicsStateGuardian.cxx.

References draw_simple_poly(), and GeomTristrip::explode().

virtual TypeHandle RIBGraphicsStateGuardian::force_init_type void   )  [inline, virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 171 of file ribGraphicsStateGuardian.h.

References get_class_type(), and init_type().

TypeHandle RIBGraphicsStateGuardian::get_class_type void   )  [static]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 1234 of file ribGraphicsStateGuardian.cxx.

References _type_handle.

Referenced by ConfigureFn(), force_init_type(), RIBGraphicsWindow::get_gsg_type(), and get_type().

void RIBGraphicsStateGuardian::get_color_and_intensity const RGBColorf input,
RGBColorf output,
float &  intensity
[static, protected]
 

Definition at line 1204 of file ribGraphicsStateGuardian.cxx.

References input.

Referenced by write_light_color().

void RIBGraphicsStateGuardian::get_rib_stuff Node *  root,
const AllAttributesWrapper &  initial_state
[protected]
 

string RIBGraphicsStateGuardian::get_texture_directory  )  const
 

Definition at line 793 of file ribGraphicsStateGuardian.cxx.

References _texture_directory.

string RIBGraphicsStateGuardian::get_texture_extension  )  const
 

Definition at line 819 of file ribGraphicsStateGuardian.cxx.

References _texture_extension.

TypeHandle RIBGraphicsStateGuardian::get_type void   )  const [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 1230 of file ribGraphicsStateGuardian.cxx.

References get_class_type().

void RIBGraphicsStateGuardian::init_type void   )  [static]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 1238 of file ribGraphicsStateGuardian.cxx.

References _type_handle, GraphicsStateGuardian::get_class_type(), GraphicsStateGuardian::init_type(), and register_type().

Referenced by ConfigureFn(), and force_init_type().

virtual void RIBGraphicsStateGuardian::issue_color const ColorAttribute *  attrib  )  [virtual]
 

virtual void RIBGraphicsStateGuardian::issue_light const LightAttribute *  attrib  )  [virtual]
 

virtual void RIBGraphicsStateGuardian::issue_texture const TextureAttribute *  attrib  )  [virtual]
 

virtual void RIBGraphicsStateGuardian::issue_transform const TransformAttribute *  attrib  )  [virtual]
 

GraphicsStateGuardian * RIBGraphicsStateGuardian::make_RIBGraphicsStateGuardian const FactoryParams params  )  [static]
 

Definition at line 1218 of file ribGraphicsStateGuardian.cxx.

References get_param_into(), NULL, params, RIBGraphicsStateGuardian(), and win.

Referenced by ConfigureFn().

ostream & RIBGraphicsStateGuardian::new_line int  extra_indent = 0  )  const [protected]
 

Definition at line 1027 of file ribGraphicsStateGuardian.cxx.

References _indent_level, _output, and indent().

Referenced by concat_transform(), define_light(), define_texture(), reset_transform(), and set_color().

void RIBGraphicsStateGuardian::prepare_display_region  )  [virtual]
 

Implements GraphicsStateGuardian.

Definition at line 192 of file ribGraphicsStateGuardian.cxx.

TextureContext * RIBGraphicsStateGuardian::prepare_texture Texture tex  )  [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 536 of file ribGraphicsStateGuardian.cxx.

References GraphicsStateGuardian::mark_prepared_texture(), tc, and tex.

virtual RIBGraphicsStateGuardian::PT SavedFrameBuffer   )  const [protected, virtual]
 

Reimplemented from GraphicsStateGuardian.

void RIBGraphicsStateGuardian::release_texture TextureContext tc  )  [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 564 of file ribGraphicsStateGuardian.cxx.

References Texture::clear_gsg(), tc, tex, and GraphicsStateGuardian::unmark_prepared_texture().

virtual void RIBGraphicsStateGuardian::render_frame const AllAttributesWrapper &  initial_state  )  [virtual]
 

virtual void RIBGraphicsStateGuardian::render_scene Node *  root,
ProjectionNode *  projnode,
const AllAttributesWrapper &  initial_state
[virtual]
 

virtual void RIBGraphicsStateGuardian::render_subgraph RenderTraverser *  traverser,
Node *  subgraph,
const AllAttributesWrapper &  initial_state,
const AllTransitionsWrapper &  net_trans
[virtual]
 

virtual void RIBGraphicsStateGuardian::render_subgraph RenderTraverser *  traverser,
Node *  subgraph,
ProjectionNode *  projnode,
const AllAttributesWrapper &  initial_state,
const AllTransitionsWrapper &  net_trans
[virtual]
 

void RIBGraphicsStateGuardian::reset  )  [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 119 of file ribGraphicsStateGuardian.cxx.

References GraphicsStateGuardian::_buffer_mask, _indent_level, _output, _texture_names, NULL, GraphicsStateGuardian::reset(), reset_frame(), and RenderBuffer::T_color.

Referenced by RIBGraphicsWindow::end_file(), reset_file(), and RIBGraphicsStateGuardian().

void RIBGraphicsStateGuardian::reset_file ostream &  out  ) 
 

Definition at line 142 of file ribGraphicsStateGuardian.cxx.

References _output, and reset().

Referenced by RIBGraphicsWindow::begin_file().

void RIBGraphicsStateGuardian::reset_frame  ) 
 

Definition at line 154 of file ribGraphicsStateGuardian.cxx.

References _current_color, _enabled_lights, and _light_ids.

Referenced by reset().

void RIBGraphicsStateGuardian::reset_transform const LMatrix4f &  mat  )  const [protected]
 

Definition at line 1039 of file ribGraphicsStateGuardian.cxx.

References new_line().

void RIBGraphicsStateGuardian::restore_frame_buffer SavedFrameBuffer frame_buffer  )  [protected, virtual]
 

Implements GraphicsStateGuardian.

Definition at line 846 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::set_color const RGBColorf color  )  [protected]
 

Definition at line 856 of file ribGraphicsStateGuardian.cxx.

References _current_color, and new_line().

Referenced by write_polygon().

void RIBGraphicsStateGuardian::set_texture_directory const string &  directory  ) 
 

Definition at line 782 of file ribGraphicsStateGuardian.cxx.

References _texture_directory.

void RIBGraphicsStateGuardian::set_texture_extension const string &  extension  ) 
 

Definition at line 807 of file ribGraphicsStateGuardian.cxx.

References _texture_extension.

virtual void RIBGraphicsStateGuardian::texture_to_pixel_buffer TextureContext ,
PixelBuffer ,
const DisplayRegion
[inline, virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 96 of file ribGraphicsStateGuardian.h.

virtual void RIBGraphicsStateGuardian::texture_to_pixel_buffer TextureContext ,
PixelBuffer
[inline, virtual]
 

Implements GraphicsStateGuardianBase.

Definition at line 95 of file ribGraphicsStateGuardian.h.

bool RIBGraphicsStateGuardian::wants_colors void   )  const [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 407 of file ribGraphicsStateGuardian.cxx.

bool RIBGraphicsStateGuardian::wants_normals void   )  const [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 387 of file ribGraphicsStateGuardian.cxx.

bool RIBGraphicsStateGuardian::wants_texcoords void   )  const [virtual]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 397 of file ribGraphicsStateGuardian.cxx.

void RIBGraphicsStateGuardian::write_light_color const Colorf color  )  const [protected]
 

Definition at line 982 of file ribGraphicsStateGuardian.cxx.

References get_color_and_intensity(), and RGBColorf.

Referenced by define_light().

void RIBGraphicsStateGuardian::write_light_from const Node *  light  )  const [protected]
 

Definition at line 998 of file ribGraphicsStateGuardian.cxx.

Referenced by define_light().

void RIBGraphicsStateGuardian::write_light_to const Node *  light  )  const [protected]
 

Definition at line 1011 of file ribGraphicsStateGuardian.cxx.

Referenced by define_light().

void RIBGraphicsStateGuardian::write_polygon int  num_verts  )  [protected]
 

Definition at line 1136 of file ribGraphicsStateGuardian.cxx.

References _indent_level, _output, rib_colors, rib_normals, rib_texcoords, rib_vertices, set_color(), and write_long_list().

Referenced by draw_simple_poly().


Friends And Related Function Documentation

friend class RibStuffTraverser [friend]
 

Definition at line 178 of file ribGraphicsStateGuardian.h.


Member Data Documentation

RGBColorf RIBGraphicsStateGuardian::_current_color [protected]
 

Definition at line 152 of file ribGraphicsStateGuardian.h.

Referenced by reset_frame(), and set_color().

EnabledLights RIBGraphicsStateGuardian::_enabled_lights [protected]
 

Definition at line 163 of file ribGraphicsStateGuardian.h.

Referenced by define_light(), and reset_frame().

int RIBGraphicsStateGuardian::_indent_level [protected]
 

Definition at line 157 of file ribGraphicsStateGuardian.h.

Referenced by new_line(), reset(), and write_polygon().

LightIDs RIBGraphicsStateGuardian::_light_ids [protected]
 

Definition at line 161 of file ribGraphicsStateGuardian.h.

Referenced by define_light(), and reset_frame().

ostream* RIBGraphicsStateGuardian::_output [protected]
 

Definition at line 156 of file ribGraphicsStateGuardian.h.

Referenced by new_line(), reset(), reset_file(), and write_polygon().

string RIBGraphicsStateGuardian::_texture_directory [protected]
 

Definition at line 154 of file ribGraphicsStateGuardian.h.

Referenced by define_texture(), get_texture_directory(), RIBGraphicsStateGuardian(), and set_texture_directory().

string RIBGraphicsStateGuardian::_texture_extension [protected]
 

Definition at line 155 of file ribGraphicsStateGuardian.h.

Referenced by define_texture(), get_texture_extension(), RIBGraphicsStateGuardian(), and set_texture_extension().

TextureNames RIBGraphicsStateGuardian::_texture_names [protected]
 

Definition at line 159 of file ribGraphicsStateGuardian.h.

Referenced by define_texture(), and reset().

TypeHandle RIBGraphicsStateGuardian::_type_handle [static, private]
 

Reimplemented from GraphicsStateGuardian.

Definition at line 57 of file ribGraphicsStateGuardian.cxx.

Referenced by get_class_type(), and init_type().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:13:30 2003 for Panda by doxygen1.3