Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
RenderEffects Class Reference

This represents a unique collection of RenderEffect objects that correspond to a particular renderable state. More...

Inheritance diagram for RenderEffects:
TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject

List of all members.

Public Member Functions

RenderEffects const addEffect (RenderEffect const effect)
 Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added.
int findEffect (TypeHandle type)
 Searches for an effect with the indicated type in the state, and returns its index if it is found, or.
RenderEffect const getEffect (TypeHandle type)
 Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not.
RenderEffect const getEffect (int n)
 Returns the nth effect in the state.
int getNumEffects ()
 Returns the number of separate effects indicated in the state.
bool isEmpty ()
 Returns true if the state is empty, false otherwise.
bool operator< (RenderEffects const other)
 Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially different ones in a big set and throw away the rest.
 output (ostream out)
RenderEffects const removeEffect (TypeHandle type)
 Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed.
 write (ostream out, int indent_level)

Static Public Member Functions

static TypeHandle getClassType ()
static int getNumStates ()
 Returns the total number of unique RenderEffects objects allocated in the world.
static listStates (ostream out)
 Lists all of the RenderEffects in the cache to the output stream, one per line.
static RenderEffects const make (RenderEffect const effect)
 Returns a RenderEffects with one effect set.
static RenderEffects const make (RenderEffect const effect1, RenderEffect const effect2)
 Returns a RenderEffects with two effects set.
static RenderEffects const make (RenderEffect const effect1, RenderEffect const effect2, RenderEffect const effect3)
 Returns a RenderEffects with three effects set.
static RenderEffects const make (RenderEffect const effect1, RenderEffect const effect2, RenderEffect const effect3, RenderEffect const effect4)
 Returns a RenderEffects with four effects set.
static RenderEffects const makeEmpty ()
 Returns a RenderEffects with no effects set.
static bool validateStates ()
 Ensures that the cache is still stored in sorted order.

Detailed Description

This represents a unique collection of RenderEffect objects that correspond to a particular renderable state.

You should not attempt to create or modify a RenderEffects object directly. Instead, call one of the make() functions to create one for you. And instead of modifying a RenderEffects object, create a new one.


Member Function Documentation

RenderEffects const addEffect ( RenderEffect const  effect)

Returns a new RenderEffects object that represents the same as the source state, with the new RenderEffect added.

If there is already a RenderEffect with the same type, it is replaced.

Searches for an effect with the indicated type in the state, and returns its index if it is found, or.

-1 if it is not.

static TypeHandle getClassType ( ) [static]

Reimplemented from TypedWritableReferenceCount.

Looks for a RenderEffect of the indicated type in the state, and returns it if it is found, or NULL if it is not.

RenderEffect const getEffect ( int  n)

Returns the nth effect in the state.

Returns the number of separate effects indicated in the state.

static int getNumStates ( ) [static]

Returns the total number of unique RenderEffects objects allocated in the world.

This will go up and down during normal operations.

bool isEmpty ( )

Returns true if the state is empty, false otherwise.

static listStates ( ostream  out) [static]

Lists all of the RenderEffects in the cache to the output stream, one per line.

This can be quite a lot of output if the cache is large, so be prepared.

static RenderEffects const make ( RenderEffect const  effect) [static]

Returns a RenderEffects with one effect set.

static RenderEffects const make ( RenderEffect const  effect1,
RenderEffect const  effect2 
) [static]

Returns a RenderEffects with two effects set.

static RenderEffects const make ( RenderEffect const  effect1,
RenderEffect const  effect2,
RenderEffect const  effect3 
) [static]

Returns a RenderEffects with three effects set.

static RenderEffects const make ( RenderEffect const  effect1,
RenderEffect const  effect2,
RenderEffect const  effect3,
RenderEffect const  effect4 
) [static]

Returns a RenderEffects with four effects set.

static RenderEffects const makeEmpty ( ) [static]

Returns a RenderEffects with no effects set.

bool operator< ( RenderEffects const  other)

Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially different ones in a big set and throw away the rest.

This method is not needed outside of the RenderEffects class because all equivalent RenderEffects objects are guaranteed to share the same pointer; thus, a pointer comparison is always sufficient.

output ( ostream  out)

Returns a new RenderEffects object that represents the same as the source state, with the indicated RenderEffect removed.

static bool validateStates ( ) [static]

Ensures that the cache is still stored in sorted order.

Returns true if so, false if there is a problem (which implies someone has modified one of the supposedly-const RenderEffects objects).

write ( ostream  out,
int  indent_level 
)
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties