14#ifndef RENDERMODEATTRIB_H
15#define RENDERMODEATTRIB_H
27class EXPCL_PANDA_PGRAPH RenderModeAttrib :
public RenderAttrib {
53 INLINE RenderModeAttrib(Mode mode, PN_stdfloat thickness,
bool perspective,
54 const LColor &wireframe_color = LColor::zero());
57 static CPT(RenderAttrib)
make(Mode mode, PN_stdfloat thickness = 1.0f,
58 bool perspective =
false,
59 const LColor &wireframe_color = LColor::zero());
75 virtual void output(std::ostream &out)
const;
78 virtual int compare_to_impl(
const RenderAttrib *other)
const;
79 virtual size_t get_hash_impl()
const;
80 virtual CPT(RenderAttrib) compose_impl(
const RenderAttrib *other)
const;
84 PN_stdfloat _thickness;
86 LColor _wireframe_color;
89 static int get_class_slot() {
92 virtual int get_slot()
const {
93 return get_class_slot();
95 MAKE_PROPERTY(class_slot, get_class_slot);
98 static void register_with_read_factory();
102 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
103 void fillin(DatagramIterator &scan, BamReader *manager);
106 static TypeHandle get_class_type() {
109 static void init_type() {
110 RenderAttrib::init_type();
112 RenderAttrib::get_class_type());
114 new RenderModeAttrib(M_filled, 1,
false));
116 virtual TypeHandle get_type()
const {
117 return get_class_type();
119 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
122 static TypeHandle _type_handle;
123 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(Mode mode, PN_stdfloat thickness=1.0f, bool perspective=false, const LColor &wireframe_color=LColor::zero())
Constructs a new RenderModeAttrib object that specifies whether to draw polygons in the normal,...
get_perspective
Returns the perspective flag.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
get_thickness
Returns the line width or point thickness.
int get_geom_rendering(int geom_rendering) const
Returns the union of the Geom::GeomRendering bits that will be required once this RenderModeAttrib is...
get_wireframe_color
Returns the color that is used in M_filled_wireframe mode to distinguish the wireframe from the rest ...
get_mode
Returns the render mode.
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.