27class EXPCL_PANDA_PGRAPH ColorAttrib :
public RenderAttrib {
30 T_vertex, T_flat, T_off
34 INLINE ColorAttrib(Type type,
const LColor &color);
38 static CPT(RenderAttrib)
make_flat(
const LColor &color);
50 virtual void output(std::ostream &out)
const;
53 virtual int compare_to_impl(
const RenderAttrib *other)
const;
54 virtual size_t get_hash_impl()
const;
57 void quantize_color();
62 static CPT(RenderAttrib) _off;
63 static CPT(RenderAttrib) _vertex;
66 static int get_class_slot() {
69 virtual int get_slot()
const {
70 return get_class_slot();
72 MAKE_PROPERTY(class_slot, get_class_slot);
75 static void register_with_read_factory();
79 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
80 void fillin(DatagramIterator &scan, BamReader *manager);
83 static TypeHandle get_class_type() {
86 static void init_type() {
87 RenderAttrib::init_type();
89 RenderAttrib::get_class_type());
91 new ColorAttrib(T_vertex, LColor::zero()));
93 virtual TypeHandle get_type()
const {
94 return get_class_type();
96 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
99 static TypeHandle _type_handle;
100 static int _attrib_slot;
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
static ConstPointerTo< RenderAttrib > make_vertex()
Constructs a new ColorAttrib object that indicates geometry should be rendered according to its own v...
static ConstPointerTo< RenderAttrib > make_off()
Constructs a new ColorAttrib object that indicates geometry should be rendered in white.
get_color_type
Returns the type of color specified by this ColorAttrib.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
static ConstPointerTo< RenderAttrib > make_flat(const LColor &color)
Constructs a new ColorAttrib object that indicates geometry should be rendered in the indicated color...
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 ...
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.