14 #include "logicOpAttrib.h" 23 int LogicOpAttrib::_attrib_slot;
38 make(LogicOpAttrib::Operation op) {
40 return return_new(attrib);
56 output(std::ostream &out)
const {
75 return (
int)_op - (int)la->_op;
84 size_t LogicOpAttrib::
85 get_hash_impl()
const {
122 attrib->fillin(scan, manager);
133 RenderAttrib::fillin(scan, manager);
142 operator << (std::ostream &out, LogicOpAttrib::Operation op) {
144 case LogicOpAttrib::O_none:
145 return out <<
"none";
147 case LogicOpAttrib::O_clear:
148 return out <<
"clear";
150 case LogicOpAttrib::O_and:
153 case LogicOpAttrib::O_and_reverse:
154 return out <<
"and_reverse";
156 case LogicOpAttrib::O_copy:
157 return out <<
"copy";
159 case LogicOpAttrib::O_and_inverted:
160 return out <<
"and_inverted";
162 case LogicOpAttrib::O_noop:
163 return out <<
"noop";
165 case LogicOpAttrib::O_xor:
168 case LogicOpAttrib::O_or:
171 case LogicOpAttrib::O_nor:
174 case LogicOpAttrib::O_equivalent:
175 return out <<
"equivalent";
177 case LogicOpAttrib::O_invert:
178 return out <<
"invert";
180 case LogicOpAttrib::O_or_reverse:
181 return out <<
"or_reverse";
183 case LogicOpAttrib::O_copy_inverted:
184 return out <<
"copy_inverted";
186 case LogicOpAttrib::O_or_inverted:
187 return out <<
"or_inverted";
189 case LogicOpAttrib::O_nand:
190 return out <<
"nand";
192 case LogicOpAttrib::O_set:
196 return out <<
"**invalid LogicOpAttrib::Operation(" << (int)op <<
")**";
This is the base class for a number of render attributes (other than transform) that may be set on sc...
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
static void register_with_read_factory()
Tells the BamReader how to create objects of type LogicOpAttrib.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
get_operation
Returns the logic operation specified by this attribute.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
const RenderAttrib * get_slot_default(int slot) const
Returns the default RenderAttrib object associated with slot n.
If enabled, specifies that a custom logical operation be performed instead of any color blending.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
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 ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
static RenderAttribRegistry * quick_get_global_ptr()
Returns the global_ptr without first ensuring it has been initialized.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.