48class EXPCL_PANDA_PGRAPH RenderEffect :
public TypedWritableReferenceCount {
53 RenderEffect(
const RenderEffect ©) =
delete;
54 virtual ~RenderEffect();
56 RenderEffect &operator = (
const RenderEffect ©) =
delete;
61 virtual CPT(RenderEffect)
xform(
const LMatrix4 &mat)
const;
74 INLINE
int compare_to(
const RenderEffect &other)
const;
76 virtual void output(std::ostream &out)
const;
77 virtual void write(std::ostream &out,
int indent_level)
const;
84 static CPT(RenderEffect) return_new(RenderEffect *effect);
86 virtual int compare_to_impl(
const RenderEffect *other)
const;
89 typedef pset<const RenderEffect *, indirect_compare_to<const RenderEffect *> > Effects;
90 static Effects *_effects;
92 Effects::iterator _saved_entry;
100 static TypedWritable *new_from_bam(RenderEffect *effect,
BamReader *manager);
107 static void init_type() {
108 TypedWritableReferenceCount::init_type();
110 TypedWritableReferenceCount::get_class_type());
113 return get_class_type();
115 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
121INLINE std::ostream &operator << (std::ostream &out,
const RenderEffect &effect) {
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 ...
A basic node of the scene graph or data graph.
This is the base class for a number of special render effects that may be set on scene graph nodes to...
virtual bool safe_to_combine() const
Returns true if this kind of effect can safely be combined with sibling nodes that share the exact sa...
static void list_effects(std::ostream &out)
Lists all of the RenderEffects in the cache to the output stream, one per line.
static int get_num_effects()
Returns the total number of unique RenderEffect objects allocated in the world.
virtual ConstPointerTo< RenderEffect > xform(const LMatrix4 &mat) const
Returns a new RenderEffect transformed by the indicated matrix.
virtual bool has_adjust_transform() const
Should be overridden by derived classes to return true if adjust_transform() has been defined,...
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of RenderEffect by calling the...
virtual void adjust_transform(ConstPointerTo< TransformState > &net_transform, ConstPointerTo< TransformState > &node_transform, const PandaNode *node) const
Performs some operation on the node's apparent net and/or local transforms.
virtual ConstPointerTo< TransformState > prepare_flatten_transform(const TransformState *net_transform) const
Preprocesses the accumulated transform that is about to be applied to (or through) this node due to a...
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
virtual void cull_callback(CullTraverser *trav, CullTraverserData &data, ConstPointerTo< TransformState > &node_transform, ConstPointerTo< RenderState > &node_state) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
int compare_to(const RenderEffect &other) const
Provides an arbitrary ordering among all unique RenderEffects, so we can store the essentially differ...
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 bool validate_effects()
Ensures that the cache is still stored in sorted order.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
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.