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

ShaderTransition Class Reference

A ShaderTransition holds the set of shaders that might be in effect to render a particular part of the subgraph. More...

#include <shaderTransition.h>

List of all members.

Public Types

typedef Shaders::const_iterator iterator
typedef Shaders::const_iterator const_iterator

Public Member Functions

 ShaderTransition ()
void clear ()
bool is_empty () const
void insert (Shader *shader)
 Inserts the shader into the list, based on the set order of the list.

bool set_shader (Shader *shader, int override=-1)
 Adds the shader to the transition, if it is not already there.

bool clear_shader (Shader *shader)
 Removes the first occurrence of the indicated shader from the list, and returns true if anything was removed, false if there were no occurrences.

bool has_shader (Shader *shader) const
 Returns true if the indicated shader appears on the list, false otherwise.

const_iterator begin () const
const_iterator end () const
virtual NodeTransition * make_copy () const
 Returns a newly allocated ShaderTransition just like this one.

virtual bool sub_render (NodeRelation *arc, const AllTransitionsWrapper &input_trans, AllTransitionsWrapper &modify_trans, RenderTraverser *trav)
virtual bool has_sub_render () const
 Should be redefined to return true if the function sub_render(), above, expects to be called during traversal.

virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

void set_shader_order (TypeHandle shader, int order)
 Stores the order "priority" of a shader.

void set_shader_always_blend (TypeHandle shader)
 Some shaders (i.e.

TypeHandle get_class_type ()
void init_type ()

Private Types

typedef plist< PointerTo<
Shader > > 
Shaders
typedef pmap< TypeHandle,
int > 
ShaderOrder
typedef pmap< PointerTo< Shader >,
int > 
ShaderOverride
typedef pset< TypeHandleShaderBlend

Private Member Functions

bool must_blend ()
 Checks to see if one of the shaders on the shaderTransition is a kind that requires blending.


Private Attributes

Shaders _shaders
ShaderOverride _overrides

Static Private Attributes

ShaderOrder_shader_order = (ShaderTransition::ShaderOrder *)NULL
ShaderBlend_shader_always_blend = (ShaderTransition::ShaderBlend *)NULL
TypeHandle _type_handle

Friends

class ShaderAttribute


Detailed Description

A ShaderTransition holds the set of shaders that might be in effect to render a particular part of the subgraph.

These shaders can range from lightweight rendering effects to full-blown multipass renderings; use with caution.

Definition at line 52 of file shaderTransition.h.


Member Typedef Documentation

typedef Shaders::const_iterator ShaderTransition::const_iterator
 

Definition at line 66 of file shaderTransition.h.

Referenced by clear_shader(), and end().

typedef Shaders::const_iterator ShaderTransition::iterator
 

Definition at line 65 of file shaderTransition.h.

typedef pset<TypeHandle> ShaderTransition::ShaderBlend [private]
 

Definition at line 58 of file shaderTransition.h.

typedef pmap<TypeHandle, int> ShaderTransition::ShaderOrder [private]
 

Definition at line 56 of file shaderTransition.h.

typedef pmap<PointerTo< Shader >, int> ShaderTransition::ShaderOverride [private]
 

Definition at line 57 of file shaderTransition.h.

typedef plist< PointerTo< Shader > > ShaderTransition::Shaders [private]
 

Definition at line 55 of file shaderTransition.h.


Constructor & Destructor Documentation

ShaderTransition::ShaderTransition  )  [inline]
 

Definition at line 32 of file shaderTransition.I.

References INLINE, and set_shader().


Member Function Documentation

ShaderTransition::const_iterator ShaderTransition::begin  )  const
 

Definition at line 264 of file shaderTransition.cxx.

void ShaderTransition::clear void   ) 
 

Definition at line 107 of file shaderTransition.cxx.

References _overrides, _shader_order, _shaders, NULL, and PT.

bool ShaderTransition::clear_shader Shader shader  ) 
 

Removes the first occurrence of the indicated shader from the list, and returns true if anything was removed, false if there were no occurrences.

Definition at line 227 of file shaderTransition.cxx.

References _shaders, and const_iterator.

Referenced by set_shader().

ShaderTransition::const_iterator ShaderTransition::end  )  const
 

Definition at line 276 of file shaderTransition.cxx.

References const_iterator.

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

Definition at line 109 of file shaderTransition.h.

TypeHandle ShaderTransition::get_class_type void   )  [inline, static]
 

Definition at line 110 of file shaderTransition.h.

virtual TypeHandle ShaderTransition::get_type void   )  const [inline, virtual]
 

Definition at line 106 of file shaderTransition.h.

bool ShaderTransition::has_shader Shader shader  )  const
 

Returns true if the indicated shader appears on the list, false otherwise.

Definition at line 249 of file shaderTransition.cxx.

Referenced by clear_shader().

bool ShaderTransition::has_sub_render  )  const [virtual]
 

Should be redefined to return true if the function sub_render(), above, expects to be called during traversal.

Definition at line 379 of file shaderTransition.cxx.

void ShaderTransition::init_type void   )  [inline, static]
 

Definition at line 113 of file shaderTransition.h.

References INLINE.

void ShaderTransition::insert Shader shader  ) 
 

Inserts the shader into the list, based on the set order of the list.

If there is no order set for the shader, it is put at the end of the list.

Definition at line 136 of file shaderTransition.cxx.

References _overrides.

bool ShaderTransition::is_empty  )  const
 

Definition at line 119 of file shaderTransition.cxx.

References _overrides.

NodeTransition * ShaderTransition::make_copy void   )  const [virtual]
 

Returns a newly allocated ShaderTransition just like this one.

Definition at line 48 of file shaderTransition.cxx.

References _shader_order, and NULL.

bool ShaderTransition::must_blend  )  [private]
 

Checks to see if one of the shaders on the shaderTransition is a kind that requires blending.

Definition at line 291 of file shaderTransition.cxx.

bool ShaderTransition::set_shader Shader shader,
int  override = -1
 

Adds the shader to the transition, if it is not already there.

Returns true if the shader was added, false if it was there already. If the shader *was* already on the list, it is moved to the end of the list.

Definition at line 196 of file shaderTransition.cxx.

Referenced by ShaderTransition().

void ShaderTransition::set_shader_always_blend TypeHandle  shader  )  [static]
 

Some shaders (i.e.

spotlight and highlight) need to blend with the scene no matter what.

Definition at line 90 of file shaderTransition.cxx.

References _shaders.

void ShaderTransition::set_shader_order TypeHandle  shader,
int  order
[static]
 

Stores the order "priority" of a shader.

(Note, there is nothing to prevent you from adding a none shader handle type, but it won't really do you any good). This order value is used to make sure that multiple shaders are ordered in a defined, hopefully intelligent order.

Definition at line 71 of file shaderTransition.cxx.

References _shader_always_blend, and NULL.

virtual bool ShaderTransition::sub_render NodeRelation *  arc,
const AllTransitionsWrapper &  input_trans,
AllTransitionsWrapper &  modify_trans,
RenderTraverser *  trav
[virtual]
 


Friends And Related Function Documentation

friend class ShaderAttribute [friend]
 

Definition at line 121 of file shaderTransition.h.


Member Data Documentation

ShaderOverride ShaderTransition::_overrides [private]
 

Definition at line 103 of file shaderTransition.h.

Referenced by clear(), insert(), and is_empty().

ShaderTransition::ShaderBlend * ShaderTransition::_shader_always_blend = (ShaderTransition::ShaderBlend *)NULL [static, private]
 

Definition at line 35 of file shaderTransition.cxx.

Referenced by set_shader_order().

ShaderTransition::ShaderOrder * ShaderTransition::_shader_order = (ShaderTransition::ShaderOrder *)NULL [static, private]
 

Definition at line 34 of file shaderTransition.cxx.

Referenced by clear(), and make_copy().

Shaders ShaderTransition::_shaders [private]
 

Definition at line 100 of file shaderTransition.h.

Referenced by clear(), clear_shader(), and set_shader_always_blend().

TypeHandle ShaderTransition::_type_handle [static, private]
 

Definition at line 33 of file shaderTransition.cxx.


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:55:04 2003 for Panda by doxygen1.3