Go to the documentation of this file.
27 if (_effects ==
nullptr) {
33 _effects =
new Effects;
35 _saved_entry = _effects->end();
44 if (_saved_entry != _effects->end()) {
58 _effects->erase(_saved_entry);
59 _saved_entry = _effects->end();
78 prepare_flatten_transform(
const TransformState *net_transform)
const {
88 safe_to_combine()
const {
96 xform(
const LMatrix4 &)
const {
106 has_cull_callback()
const {
133 has_adjust_transform()
const {
154 output(std::ostream &out)
const {
162 write(std::ostream &out,
int indent_level)
const {
163 indent(out, indent_level) << *
this <<
"\n";
172 if (_effects ==
nullptr) {
175 return _effects->size();
185 out << _effects->size() <<
" effects:\n";
186 Effects::const_iterator si;
187 for (si = _effects->begin(); si != _effects->end(); ++si) {
189 effect->write(out, 2);
200 if (_effects->empty()) {
204 Effects::const_iterator si = _effects->begin();
205 Effects::const_iterator snext = si;
207 while (snext != _effects->end()) {
208 if ((*si)->compare_to(*(*snext)) >= 0) {
210 <<
"RenderEffects out of order!\n";
211 (*si)->write(pgraph_cat.error(
false), 2);
212 (*snext)->write(pgraph_cat.error(
false), 2);
234 nassertr(effect !=
nullptr, effect);
238 nassertr(effect->_saved_entry == _effects->end(), effect);
241 if (paranoid_const) {
250 std::pair<Effects::iterator, bool> result = _effects->insert(effect);
253 effect->_saved_entry = result.first;
259 return *(result.first);
305 if (pointer == effect) {
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
static bool validate_effects()
Ensures that the cache is still stored in sorted order.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
A class to retrieve the individual data elements previously stored in a Datagram.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of RenderEffect by calling the...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
TypeHandle is the identifier used to differentiate C++ class types.
void register_finalize(TypedWritable *whom)
Should be called by an object reading itself from the Bam file to indicate that this particular objec...
CPT(TransformState) RenderEffect
Preprocesses the accumulated transform that is about to be applied to (or through) this node due to a...
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...
static void list_effects(std::ostream &out)
Lists all of the RenderEffects in the cache to the output stream, one per line.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual bool unref() const
Explicitly decrements the reference count.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...
A basic node of the scene graph or data graph.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
get_ref_count
Returns the current reference count.
This is our own Panda specialization on the default STL set.
virtual ~RenderEffect()
The destructor is responsible for removing the RenderEffect from the global set if it is there.