14#ifndef GEOMVERTEXFORMAT_H
15#define GEOMVERTEXFORMAT_H
55class EXPCL_PANDA_GOBJ GeomVertexFormat final :
public TypedWritableReferenceCount,
public GeomEnums {
59 GeomVertexFormat(
const GeomVertexFormat ©);
60 void operator = (
const GeomVertexFormat ©);
61 virtual ~GeomVertexFormat();
63 virtual bool unref()
const;
66 INLINE
static CPT(GeomVertexFormat) register_format(
const GeomVertexFormat *format);
74 CPT(GeomVertexFormat) get_post_animated_format()
const;
75 CPT(GeomVertexFormat) get_union_format(
const GeomVertexFormat *other)
const;
132 void output(std::ostream &out)
const;
133 void write(std::ostream &out,
int indent_level = 0)
const;
134 void write_with_data(std::ostream &out,
int indent_level,
137 INLINE
static const GeomVertexFormat *
get_empty();
142 INLINE
static const GeomVertexFormat *
get_v3();
143 INLINE
static const GeomVertexFormat *
get_v3n3();
144 INLINE
static const GeomVertexFormat *
get_v3t2();
145 INLINE
static const GeomVertexFormat *
get_v3n3t2();
151 INLINE
static const GeomVertexFormat *
get_v3cp();
152 INLINE
static const GeomVertexFormat *
get_v3cpt2();
153 INLINE
static const GeomVertexFormat *
get_v3n3cp();
161 INLINE
static const GeomVertexFormat *
get_v3c4();
162 INLINE
static const GeomVertexFormat *
get_v3c4t2();
163 INLINE
static const GeomVertexFormat *
get_v3n3c4();
178 int compare_to(
const GeomVertexFormat &other)
const;
182 INLINE
static Registry *get_registry();
183 static void make_registry();
186 void do_unregister();
195 class DataTypeRecord {
201 typedef pmap<const InternalName *, DataTypeRecord> DataTypesByName;
202 DataTypesByName _columns_by_name;
204 int _vertex_array_index;
206 int _normal_array_index;
208 int _color_array_index;
211 typedef pvector<CPT_InternalName> Columns;
222 typedef pvector<MorphRecord> Morphs;
225 const GeomVertexFormat *_post_animated_format;
228 typedef pset<GeomVertexFormat *, IndirectCompareTo<GeomVertexFormat> > Formats;
229 class EXPCL_PANDA_GOBJ Registry {
232 void make_standard_formats();
234 CPT(GeomVertexFormat) register_format(GeomVertexFormat *format);
235 INLINE CPT(GeomVertexFormat) register_format(GeomVertexArrayFormat *format);
236 void unregister_format(GeomVertexFormat *format);
241 CPT(GeomVertexFormat) _empty;
243 CPT(GeomVertexFormat) _v3;
244 CPT(GeomVertexFormat) _v3n3;
245 CPT(GeomVertexFormat) _v3t2;
246 CPT(GeomVertexFormat) _v3n3t2;
248 CPT(GeomVertexFormat) _v3cp;
249 CPT(GeomVertexFormat) _v3n3cp;
250 CPT(GeomVertexFormat) _v3cpt2;
251 CPT(GeomVertexFormat) _v3n3cpt2;
253 CPT(GeomVertexFormat) _v3c4;
254 CPT(GeomVertexFormat) _v3n3c4;
255 CPT(GeomVertexFormat) _v3c4t2;
256 CPT(GeomVertexFormat) _v3n3c4t2;
259 static Registry *_registry;
263 static void register_with_read_factory();
268 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
269 void fillin(DatagramIterator &scan, BamReader *manager);
272 static TypeHandle get_class_type() {
275 static void init_type() {
276 TypedWritableReferenceCount::init_type();
278 TypedWritableReferenceCount::get_class_type());
280 virtual TypeHandle get_type()
const {
281 return get_class_type();
283 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
286 static TypeHandle _type_handle;
288 friend class GeomVertexFormat::Registry;
289 friend class GeomMunger;
292INLINE std::ostream &operator << (std::ostream &out,
const GeomVertexFormat &obj);
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Objects of this class are used to convert vertex data from a Geom into a format suitable for passing ...
This object describes how the vertex animation, if any, represented in a GeomVertexData is encoded.
This defines how a single column is interleaved within a vertex array stored within a Geom.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
Encodes a string name in a hash table, mapping it to a pointer.
virtual bool unref() const
Explicitly decrements the reference count.
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.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
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.
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.
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.