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

AlphaTestAttrib Class Reference

Enables or disables writing of pixel to framebuffer based on its alpha value relative to a reference alpha value. More...

#include "alphaTestAttrib.h"

Inheritance diagram for AlphaTestAttrib:
RenderAttrib TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

virtual TypeHandle force_init_type ()
PandaCompareFunc get_mode () const
 Returns the alpha write mode.
PN_stdfloat get_reference_alpha () const
 Returns the alpha reference value.
virtual int get_slot () const
virtual TypeHandle get_type () const
virtual void output (ostream &out) const
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static CPT (RenderAttrib) make(PandaCompareFunc mode
static CPT (RenderAttrib) make_default()
static int get_class_slot ()
static TypeHandle get_class_type ()
static void init_type ()
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type AlphaTestAttrib.

Public Attributes

static PN_stdfloat reference_alpha

Protected Member Functions

virtual int compare_to_impl (const RenderAttrib *other) const
 Intended to be overridden by derived AlphaTestAttrib types to return a unique number indicating whether this AlphaTestAttrib is equivalent to the other one.
virtual CPT (RenderAttrib) get_auto_shader_attrib_impl(const RenderState *state) const
void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new AlphaTestAttrib.
virtual size_t get_hash_impl () const
 Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type AlphaTestAttrib is encountered in the Bam file.

Detailed Description

Enables or disables writing of pixel to framebuffer based on its alpha value relative to a reference alpha value.

Definition at line 28 of file alphaTestAttrib.h.


Member Function Documentation

int AlphaTestAttrib::compare_to_impl ( const RenderAttrib other) const [protected, virtual]

Intended to be overridden by derived AlphaTestAttrib types to return a unique number indicating whether this AlphaTestAttrib is equivalent to the other one.

This should return 0 if the two AlphaTestAttrib objects are equivalent, a number less than zero if this one should be sorted before the other one, and a number greater than zero otherwise.

This will only be called with two AlphaTestAttrib objects whose get_type() functions return the same.

Reimplemented from RenderAttrib.

Definition at line 78 of file alphaTestAttrib.cxx.

void AlphaTestAttrib::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new AlphaTestAttrib.

Reimplemented from RenderAttrib.

Definition at line 174 of file alphaTestAttrib.cxx.

References DatagramIterator::get_int8(), and DatagramIterator::get_stdfloat().

Referenced by make_from_bam().

size_t AlphaTestAttrib::get_hash_impl ( ) const [protected, virtual]

Intended to be overridden by derived RenderAttrib types to return a unique hash for these particular properties.

RenderAttribs that compare the same with compare_to_impl(), above, should return the same hash; RenderAttribs that compare differently should return a different hash.

Reimplemented from RenderAttrib.

Definition at line 104 of file alphaTestAttrib.cxx.

References floating_point_hash< Key >::add_hash(), and integer_hash< Key, Compare >::add_hash().

AlphaTestAttrib::PandaCompareFunc AlphaTestAttrib::get_mode ( ) const [inline]

Returns the alpha write mode.

Definition at line 35 of file alphaTestAttrib.I.

Referenced by ShaderGenerator::analyze_renderstate(), and TinyGraphicsStateGuardian::begin_draw_primitives().

PN_stdfloat AlphaTestAttrib::get_reference_alpha ( ) const [inline]

Returns the alpha reference value.

Definition at line 45 of file alphaTestAttrib.I.

Referenced by TinyGraphicsStateGuardian::begin_draw_primitives().

TypedWritable * AlphaTestAttrib::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type AlphaTestAttrib is encountered in the Bam file.

It should create the AlphaTestAttrib and extract its information from the file.

Definition at line 155 of file alphaTestAttrib.cxx.

References fillin().

Referenced by register_with_read_factory().

void AlphaTestAttrib::register_with_read_factory ( ) [static]

Tells the BamReader how to create objects of type AlphaTestAttrib.

Definition at line 128 of file alphaTestAttrib.cxx.

References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().

void AlphaTestAttrib::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from RenderAttrib.

Definition at line 139 of file alphaTestAttrib.cxx.

References Datagram::add_int8(), and Datagram::add_stdfloat().


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