14#ifndef SCISSOREFFECT_H
15#define SCISSOREFFECT_H
31class EXPCL_PANDA_PGRAPH ScissorEffect :
public RenderEffect {
39 ScissorEffect(
bool screen,
const LVecBase4 &frame,
40 const PointDef *points,
int num_points,
bool clip);
41 ScissorEffect(
const ScissorEffect ©);
44 static CPT(RenderEffect)
make_screen(
const LVecBase4 &frame,
bool clip =
true);
45 static CPT(RenderEffect)
make_node(
bool clip =
true);
47 static CPT(RenderEffect)
make_node(
const LPoint3 &a,
const LPoint3 &b,
const LPoint3 &c,
const LPoint3 &d,
const NodePath &node =
NodePath());
51 INLINE
const LVecBase4 &
get_frame()
const;
54 INLINE
const LPoint3 &
get_point(
int n)
const;
62 virtual CPT(RenderEffect)
xform(
const LMatrix4 &mat)
const;
63 virtual void output(std::ostream &out)
const;
71 virtual int compare_to_impl(
const RenderEffect *other)
const;
79 typedef pvector<PointDef> Points;
88 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
95 static void init_type() {
96 RenderEffect::init_type();
98 RenderEffect::get_class_type());
100 virtual TypeHandle get_type()
const {
101 return get_class_type();
103 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
106 static TypeHandle _type_handle;
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 ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
A base class for any number of different kinds of lenses, linear and otherwise.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
virtual ConstPointerTo< RenderEffect > xform(const LMatrix4 &mat) const
Returns a new RenderEffect transformed by the indicated matrix.
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined.
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 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...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
get_node
Returns the node to which the nth point is relative, or empty NodePath to indicate the current node.
const LVecBase4 & get_frame() const
If is_screen() returns true, this method may be called to query the screen- based scissor frame.
static ConstPointerTo< RenderEffect > make_screen(const LVecBase4 &frame, bool clip=true)
Constructs a new screen-relative ScissorEffect.
bool is_screen() const
Returns true if the ScissorEffect is a screen-based effect, meaning get_frame() has a meaningful valu...
ConstPointerTo< RenderEffect > add_point(const LPoint3 &point, const NodePath &node=NodePath()) const
Returns a new ScissorEffect with the indicated point added.
get_point
If is_screen() returns false, then get_num_points() and get_point() may be called to query the node-b...
bool get_clip() const
Returns true if this ScissorEffect actually enables scissoring, or false if it culls only.
static ConstPointerTo< RenderEffect > make_node(bool clip=true)
Constructs a new node-relative ScissorEffect, with no points.
static void register_with_read_factory()
Tells the BamReader how to create objects of type ScissorEffect.
get_num_points
Returns the number of node-based scissor points.
TypeHandle is the identifier used to differentiate C++ class types.
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.