51class EXPCL_PANDA_PGRAPH RenderAttrib :
public TypedWritableReferenceCount {
56 RenderAttrib(
const RenderAttrib ©) =
delete;
57 virtual ~RenderAttrib();
59 RenderAttrib &operator = (
const RenderAttrib ©) =
delete;
62 INLINE CPT(RenderAttrib) compose(
const RenderAttrib *other)
const;
63 INLINE CPT(RenderAttrib) invert_compose(
const RenderAttrib *other)
const;
71 INLINE
int compare_to(
const RenderAttrib &other)
const;
72 INLINE
size_t get_hash()
const;
73 INLINE CPT(RenderAttrib) get_unique()
const;
75 virtual bool unref()
const final;
77 virtual void output(std::ostream &out)
const;
78 virtual void write(std::ostream &out,
int indent_level)
const;
85 virtual int get_slot()
const=0;
86 MAKE_PROPERTY(slot, get_slot);
88 enum PandaCompareFunc {
165 INLINE
void calc_hash();
167 static CPT(RenderAttrib) return_new(RenderAttrib *attrib);
168 static CPT(RenderAttrib) return_unique(RenderAttrib *attrib);
169 virtual int compare_to_impl(
const RenderAttrib *other)
const;
170 virtual size_t get_hash_impl()
const;
171 virtual CPT(RenderAttrib) compose_impl(
const RenderAttrib *other)
const;
172 virtual CPT(RenderAttrib) invert_compose_impl(
const RenderAttrib *other)
const;
173 void output_comparefunc(std::ostream &out, PandaCompareFunc fn)
const;
177 RenderAttrib *default_attrib);
189 static Attribs *_attribs;
196 static size_t _garbage_index;
200 friend class RenderAttribRegistry;
208 static TypedWritable *new_from_bam(RenderAttrib *attrib,
BamReader *manager);
215 static void init_type() {
216 TypedWritableReferenceCount::init_type();
218 TypedWritableReferenceCount::get_class_type());
221 return get_class_type();
223 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
229INLINE std::ostream &operator << (std::ostream &out,
const RenderAttrib &attrib) {
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A lightweight reentrant mutex.
A lightweight class that represents a single element that may be timed and/or counted via stats.
virtual bool unref() const
Explicitly decrements the reference count.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
static void init_attribs()
Make sure the global _attribs map is allocated.
static TypedWritable * change_this(TypedWritable *old_ptr, BamReader *manager)
Called immediately after complete_pointers(), this gives the object a chance to adjust its own pointe...
virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
static int garbage_collect()
Performs a garbage-collection cycle.
static void list_attribs(std::ostream &out)
Lists all of the RenderAttribs in the cache to the output stream, one per line.
virtual bool lower_attrib_can_override() const
Intended to be overridden by derived RenderAttrib types to specify how two consecutive RenderAttrib o...
static bool validate_attribs()
Ensures that the cache is still stored in sorted order.
static int get_num_attribs()
Returns the total number of unique RenderAttrib objects allocated in the world.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
This template class implements an unordered map of keys to data, implemented as a hashtable.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.