14#ifndef SCISSORATTRIB_H
15#define SCISSORATTRIB_H
36class EXPCL_PANDA_PGRAPH ScissorAttrib :
public RenderAttrib {
38 ScissorAttrib(
const LVecBase4 &frame);
42 INLINE
static CPT(RenderAttrib) make(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top);
43 static CPT(RenderAttrib) make(
const LVecBase4 &frame);
46 INLINE
bool is_off()
const;
48 INLINE
const LVecBase4 &
get_frame()
const;
54 virtual void output(std::ostream &out)
const;
57 virtual int compare_to_impl(
const RenderAttrib *other)
const;
58 virtual size_t get_hash_impl()
const;
59 virtual CPT(RenderAttrib) compose_impl(
const RenderAttrib *other)
const;
64 static CPT(RenderAttrib) _off_attrib;
67 static int get_class_slot() {
70 virtual int get_slot()
const {
71 return get_class_slot();
73 MAKE_PROPERTY(class_slot, get_class_slot);
76 static void register_with_read_factory();
80 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
81 void fillin(DatagramIterator &scan, BamReader *manager);
84 static TypeHandle get_class_type() {
87 static void init_type() {
88 RenderAttrib::init_type();
90 RenderAttrib::get_class_type());
92 ScissorAttrib *attrib =
new ScissorAttrib(LVecBase4(0, 1, 0, 1));
96 virtual TypeHandle get_type()
const {
97 return get_class_type();
99 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
102 static TypeHandle _type_handle;
103 static int _attrib_slot;
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
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 ...
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
bool is_off() const
Returns true if the ScissorAttrib is an 'off' ScissorAttrib, indicating that scissor testing is disab...
static ConstPointerTo< RenderAttrib > make_off()
Constructs a new ScissorAttrib object that removes the scissor region and fills the DisplayRegion.
get_frame
Returns the left, right, bottom, top coordinates of the scissor frame.
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.