Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions

StandardMunger Class Reference

Performs some generic munging that is appropriate for all GSG types; for instance, applies ColorAttrib and ColorScaleAttrib to the vertices, and checks for hardware-accelerated animation capabilities. More...

#include "standardMunger.h"

Inheritance diagram for StandardMunger:
StateMunger GeomMunger TypedReferenceCount GeomEnums TypedObject ReferenceCount MemoryBase MemoryBase DXGeomMunger8 DXGeomMunger9 TinyGeomMunger

List of all members.

Public Member Functions

 StandardMunger (GraphicsStateGuardianBase *gsg, const RenderState *state, int num_components, NumericType numeric_type, Contents contents)
 The StandardMunger constructor accepts additional parameters that specify the GSG's preferred color format (since we might be munging the color anyway, we might as well convert it as we munge).
virtual TypeHandle force_init_type ()
GraphicsStateGuardianget_gsg () const
 Returns a pointer to the GSG that created this munger.
virtual TypeHandle get_type () const

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

virtual int compare_to_impl (const GeomMunger *other) const
 Called to compare two GeomMungers who are known to be of the same type, for an apples-to-apples comparison.
virtual CPT (GeomVertexData) munge_data_impl(const GeomVertexData *data)
virtual CPT (RenderState) munge_state_impl(const RenderState *state)
virtual int geom_compare_to_impl (const GeomMunger *other) const
 Compares two GeomMungers, considering only whether they would produce a different answer to munge_format(), munge_data(), or munge_geom().
virtual void munge_geom_impl (CPT(Geom)&geom, CPT(GeomVertexData)&data, Thread *current_thread)
 Converts a Geom and/or its data as necessary.
virtual void premunge_geom_impl (CPT(Geom)&geom, CPT(GeomVertexData)&data)
 Converts a Geom and/or its data as necessary.

Detailed Description

Performs some generic munging that is appropriate for all GSG types; for instance, applies ColorAttrib and ColorScaleAttrib to the vertices, and checks for hardware-accelerated animation capabilities.

Definition at line 34 of file standardMunger.h.


Constructor & Destructor Documentation

StandardMunger::StandardMunger ( GraphicsStateGuardianBase gsg,
const RenderState state,
int  num_components,
NumericType  numeric_type,
Contents  contents 
)

The StandardMunger constructor accepts additional parameters that specify the GSG's preferred color format (since we might be munging the color anyway, we might as well convert it as we munge).

Definition at line 33 of file standardMunger.cxx.

References GraphicsStateGuardian::get_alpha_scale_via_texture(), RenderState::get_attrib(), GraphicsStateGuardian::get_color_scale_via_lighting(), get_gsg(), and GraphicsStateGuardian::get_runtime_color_scale().


Member Function Documentation

int StandardMunger::compare_to_impl ( const GeomMunger other) const [protected, virtual]

Called to compare two GeomMungers who are known to be of the same type, for an apples-to-apples comparison.

This will never be called on two pointers of a different type.

Reimplemented from GeomMunger.

Reimplemented in DXGeomMunger8, DXGeomMunger9, and TinyGeomMunger.

Definition at line 268 of file standardMunger.cxx.

References LVecBase4f::compare_to().

int StandardMunger::geom_compare_to_impl ( const GeomMunger other) const [protected, virtual]

Compares two GeomMungers, considering only whether they would produce a different answer to munge_format(), munge_data(), or munge_geom().

(They still might be different in other ways, but if they would produce the same answer, this function consider them to be the same.)

Reimplemented from GeomMunger.

Reimplemented in DXGeomMunger8, DXGeomMunger9, and TinyGeomMunger.

Definition at line 308 of file standardMunger.cxx.

References LVecBase4f::compare_to().

GraphicsStateGuardian * StandardMunger::get_gsg ( ) const [inline]

Returns a pointer to the GSG that created this munger.

Reimplemented from GeomMunger.

Definition at line 23 of file standardMunger.I.

Referenced by munge_geom_impl(), premunge_geom_impl(), and StandardMunger().

static void StandardMunger::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from StateMunger.

Reimplemented in DXGeomMunger8, DXGeomMunger9, and TinyGeomMunger.

Definition at line 68 of file standardMunger.h.

References StateMunger::init_type().

Referenced by TinyGeomMunger::init_type(), DXGeomMunger9::init_type(), and DXGeomMunger8::init_type().

void StandardMunger::munge_geom_impl ( CPT(Geom)&  geom,
CPT(GeomVertexData)&  data,
Thread current_thread 
) [protected, virtual]

Converts a Geom and/or its data as necessary.

Reimplemented from GeomMunger.

Definition at line 172 of file standardMunger.cxx.

References Geom::get_geom_rendering(), get_gsg(), GraphicsStateGuardian::get_supported_geom_rendering(), Geom::make_copy(), and Geom::set_vertex_data().

void StandardMunger::premunge_geom_impl ( CPT(Geom)&  geom,
CPT(GeomVertexData)&  data 
) [protected, virtual]

Converts a Geom and/or its data as necessary.

Reimplemented from GeomMunger.

Definition at line 219 of file standardMunger.cxx.

References Geom::get_geom_rendering(), get_gsg(), GraphicsStateGuardian::get_supported_geom_rendering(), Geom::make_copy(), and Geom::set_vertex_data().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations