15 #include "antialiasAttrib.h"
16 #include "config_pgraph.h"
17 #include "graphicsStateGuardianBase.h"
19 #include "bamReader.h"
20 #include "bamWriter.h"
22 #include "datagramIterator.h"
25 int AntialiasAttrib::_attrib_slot;
64 make(
unsigned short mode) {
66 return return_new(attrib);
78 if (default_antialias_enable) {
90 void AntialiasAttrib::
91 output(ostream &out)
const {
92 out << get_type() <<
":";
100 }
else if (type == M_auto) {
104 if ((_mode & M_point) != 0) {
105 out << sep <<
"point";
108 if ((_mode & M_line) != 0) {
109 out << sep <<
"line";
112 if ((_mode & M_polygon) != 0) {
113 out << sep <<
"polygon";
116 if ((_mode & M_auto) != 0) {
117 out << sep <<
"best";
122 if ((_mode & M_faster) != 0) {
123 out << sep <<
"faster";
126 if ((_mode & M_better) != 0) {
127 out << sep <<
"better";
147 int AntialiasAttrib::
150 DCAST_INTO_R(ta, other, 0);
151 if (_mode != ta->_mode) {
152 return (
int)_mode - (int)ta->_mode;
167 size_t AntialiasAttrib::
168 get_hash_impl()
const {
194 DCAST_INTO_R(ta, other, 0);
196 unsigned short mode_type;
197 unsigned short mode_quality;
200 get_mode_type() == M_auto) {
217 mode_quality = get_mode_quality();
220 return make(mode_type | mode_quality);
261 parse_params(params, scan, manager);
262 attrib->fillin(scan, manager);
274 void AntialiasAttrib::
276 RenderAttrib::fillin(scan, manager);
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Specifies whether or how to enable antialiasing, if supported by the backend renderer.
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PN_uint16 get_uint16()
Extracts an unsigned 16-bit integer.
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 size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
unsigned short get_mode_type() const
Returns the specified antialias mode, with the quality bits masked out.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
void add_uint16(PN_uint16 value)
Adds an unsigned 16-bit integer to the datagram.
static void register_with_read_factory()
Tells the BamReader how to create objects of type AntialiasAttrib.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
unsigned short get_mode_quality() const
Returns the specified antialias mode, with the type bits masked out.