Panda3D
|
Specifies whether or how to enable antialiasing, if supported by the backend renderer. More...
#include "antialiasAttrib.h"
Public Types | |
enum | Mode { M_none = 0x0000, M_point = 0x0001, M_line = 0x0002, M_polygon = 0x0004, M_multisample = 0x0008, M_auto = 0x001f, M_type_mask = 0x001f, M_faster = 0x0020, M_better = 0x0040, M_dont_care = 0x0060 } |
Public Member Functions | |
virtual TypeHandle | force_init_type () |
unsigned short | get_mode () const |
Returns the specified antialias mode. | |
unsigned short | get_mode_quality () const |
Returns the specified antialias mode, with the type bits masked out. | |
unsigned short | get_mode_type () const |
Returns the specified antialias mode, with the quality bits masked out. | |
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(unsigned short 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 AntialiasAttrib. | |
Protected Member Functions | |
virtual int | compare_to_impl (const RenderAttrib *other) const |
Intended to be overridden by derived AntialiasAttrib types to return a unique number indicating whether this AntialiasAttrib is equivalent to the other one. | |
virtual | CPT (RenderAttrib) compose_impl(const RenderAttrib *other) 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 AntialiasAttrib. | |
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 TypedWritable * | make_from_bam (const FactoryParams ¶ms) |
This function is called by the BamReader's factory when a new object of type AntialiasAttrib is encountered in the Bam file. |
Specifies whether or how to enable antialiasing, if supported by the backend renderer.
Definition at line 29 of file antialiasAttrib.h.
int AntialiasAttrib::compare_to_impl | ( | const RenderAttrib * | other | ) | const [protected, virtual] |
Intended to be overridden by derived AntialiasAttrib types to return a unique number indicating whether this AntialiasAttrib is equivalent to the other one.
This should return 0 if the two AntialiasAttrib 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 AntialiasAttrib objects whose get_type() functions return the same.
Reimplemented from RenderAttrib.
Definition at line 147 of file antialiasAttrib.cxx.
void AntialiasAttrib::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 AntialiasAttrib.
Reimplemented from RenderAttrib.
Definition at line 274 of file antialiasAttrib.cxx.
References DatagramIterator::get_uint16().
Referenced by make_from_bam().
size_t AntialiasAttrib::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 167 of file antialiasAttrib.cxx.
References integer_hash< Key, Compare >::add_hash().
unsigned short AntialiasAttrib::get_mode | ( | ) | const [inline] |
Returns the specified antialias mode.
Definition at line 34 of file antialiasAttrib.I.
Referenced by NodePath::get_antialias().
unsigned short AntialiasAttrib::get_mode_quality | ( | ) | const [inline] |
Returns the specified antialias mode, with the type bits masked out.
This therefore indicates only the requested quality settings: one of M_faster, M_better, M_dont_care, or zero (unspecified).
Definition at line 60 of file antialiasAttrib.I.
unsigned short AntialiasAttrib::get_mode_type | ( | ) | const [inline] |
Returns the specified antialias mode, with the quality bits masked out.
This therefore indicates only the requested type of antialiasing: M_none, M_auto, or some specific combination.
Definition at line 47 of file antialiasAttrib.I.
TypedWritable * AntialiasAttrib::make_from_bam | ( | const FactoryParams & | params | ) | [static, protected] |
This function is called by the BamReader's factory when a new object of type AntialiasAttrib is encountered in the Bam file.
It should create the AntialiasAttrib and extract its information from the file.
Definition at line 255 of file antialiasAttrib.cxx.
References fillin().
Referenced by register_with_read_factory().
void AntialiasAttrib::register_with_read_factory | ( | ) | [static] |
Tells the BamReader how to create objects of type AntialiasAttrib.
Definition at line 229 of file antialiasAttrib.cxx.
References BamReader::get_factory(), make_from_bam(), and Factory< Type >::register_factory().
void AntialiasAttrib::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 240 of file antialiasAttrib.cxx.
References Datagram::add_uint16().