14 #ifndef GEOMVERTEXCOLUMN_H 15 #define GEOMVERTEXCOLUMN_H 42 NumericType numeric_type, Contents contents,
43 int start,
int column_alignment = 0,
44 int num_elements = 0,
int element_stride = 0);
50 INLINE
int get_num_components()
const;
51 INLINE
int get_num_values()
const;
52 INLINE
int get_num_elements()
const;
53 INLINE NumericType get_numeric_type()
const;
54 INLINE Contents get_contents()
const;
55 INLINE
int get_start()
const;
56 INLINE
int get_column_alignment()
const;
57 INLINE
int get_element_stride()
const;
58 INLINE
int get_component_bytes()
const;
59 INLINE
int get_total_bytes()
const;
60 INLINE
bool has_homogeneous_coord()
const;
62 INLINE
bool overlaps_with(
int start_byte,
int num_bytes)
const;
66 void set_num_components(
int num_components);
67 void set_numeric_type(NumericType numeric_type);
68 void set_contents(Contents contents);
69 void set_start(
int start);
70 void set_column_alignment(
int column_alignment);
72 void output(std::ostream &out)
const;
75 INLINE
bool is_packed_argb()
const;
76 INLINE
bool is_uint8_rgba()
const;
87 Packer *make_packer()
const;
99 NumericType _numeric_type;
102 int _column_alignment;
104 int _component_bytes;
116 virtual float get_data1f(
const unsigned char *pointer);
117 virtual const LVecBase2f &get_data2f(
const unsigned char *pointer);
118 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
119 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
121 virtual double get_data1d(
const unsigned char *pointer);
122 virtual const LVecBase2d &get_data2d(
const unsigned char *pointer);
123 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
124 virtual const LVecBase4d &get_data4d(
const unsigned char *pointer);
126 virtual int get_data1i(
const unsigned char *pointer);
127 virtual const LVecBase2i &get_data2i(
const unsigned char *pointer);
128 virtual const LVecBase3i &get_data3i(
const unsigned char *pointer);
129 virtual const LVecBase4i &get_data4i(
const unsigned char *pointer);
131 virtual void set_data1f(
unsigned char *pointer,
float data);
132 virtual void set_data2f(
unsigned char *pointer,
const LVecBase2f &data);
133 virtual void set_data3f(
unsigned char *pointer,
const LVecBase3f &data);
134 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &data);
136 virtual void set_data1d(
unsigned char *pointer,
double data);
137 virtual void set_data2d(
unsigned char *pointer,
const LVecBase2d &data);
138 virtual void set_data3d(
unsigned char *pointer,
const LVecBase3d &data);
139 virtual void set_data4d(
unsigned char *pointer,
const LVecBase4d &data);
141 virtual void set_data1i(
unsigned char *pointer,
int data);
142 virtual void set_data2i(
unsigned char *pointer,
const LVecBase2i &data);
143 virtual void set_data3i(
unsigned char *pointer,
const LVecBase3i &data);
144 virtual void set_data4i(
unsigned char *pointer,
const LVecBase4i &data);
146 virtual const char *get_name()
const {
160 unsigned int _a, _b, _c, _d;
168 class Packer_point :
public Packer {
170 virtual float get_data1f(
const unsigned char *pointer);
171 virtual const LVecBase2f &get_data2f(
const unsigned char *pointer);
172 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
173 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
175 virtual double get_data1d(
const unsigned char *pointer);
176 virtual const LVecBase2d &get_data2d(
const unsigned char *pointer);
177 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
178 virtual const LVecBase4d &get_data4d(
const unsigned char *pointer);
180 virtual void set_data1f(
unsigned char *pointer,
float data);
181 virtual void set_data2f(
unsigned char *pointer,
const LVecBase2f &data);
182 virtual void set_data3f(
unsigned char *pointer,
const LVecBase3f &data);
183 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &data);
185 virtual void set_data1d(
unsigned char *pointer,
double data);
186 virtual void set_data2d(
unsigned char *pointer,
const LVecBase2d &data);
187 virtual void set_data3d(
unsigned char *pointer,
const LVecBase3d &data);
188 virtual void set_data4d(
unsigned char *pointer,
const LVecBase4d &data);
190 virtual const char *get_name()
const {
191 return "Packer_point";
198 class Packer_color :
public Packer {
200 virtual float get_data1f(
const unsigned char *pointer);
201 virtual const LVecBase2f &get_data2f(
const unsigned char *pointer);
202 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
203 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
205 virtual double get_data1d(
const unsigned char *pointer);
206 virtual const LVecBase2d &get_data2d(
const unsigned char *pointer);
207 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
208 virtual const LVecBase4d &get_data4d(
const unsigned char *pointer);
210 virtual void set_data1f(
unsigned char *pointer,
float data);
211 virtual void set_data2f(
unsigned char *pointer,
const LVecBase2f &data);
212 virtual void set_data3f(
unsigned char *pointer,
const LVecBase3f &data);
213 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &data);
215 virtual void set_data1d(
unsigned char *pointer,
double data);
216 virtual void set_data2d(
unsigned char *pointer,
const LVecBase2d &data);
217 virtual void set_data3d(
unsigned char *pointer,
const LVecBase3d &data);
218 virtual void set_data4d(
unsigned char *pointer,
const LVecBase4d &data);
220 virtual const char *get_name()
const {
221 return "Packer_color";
229 class Packer_float32_3 :
public Packer {
231 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
232 virtual void set_data3f(
unsigned char *pointer,
const LVecBase3f &value);
234 virtual const char *get_name()
const {
235 return "Packer_float32_3";
239 class Packer_point_float32_2 :
public Packer_point {
241 virtual const LVecBase2f &get_data2f(
const unsigned char *pointer);
242 virtual void set_data2f(
unsigned char *pointer,
const LVecBase2f &value);
244 virtual const char *get_name()
const {
245 return "Packer_point_float32_2";
249 class Packer_point_float32_3 :
public Packer_point {
251 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
252 virtual void set_data3f(
unsigned char *pointer,
const LVecBase3f &value);
254 virtual const char *get_name()
const {
255 return "Packer_point_float32_3";
259 class Packer_point_float32_4 :
public Packer_point {
261 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
262 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &value);
264 virtual const char *get_name()
const {
265 return "Packer_point_float32_4";
269 class Packer_nativefloat_3 :
public Packer_float32_3 {
271 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
273 virtual const char *get_name()
const {
274 return "Packer_nativefloat_3";
278 class Packer_point_nativefloat_2 :
public Packer_point_float32_2 {
280 virtual const LVecBase2f &get_data2f(
const unsigned char *pointer);
282 virtual const char *get_name()
const {
283 return "Packer_nativefloat_2";
287 class Packer_point_nativefloat_3 :
public Packer_point_float32_3 {
289 virtual const LVecBase3f &get_data3f(
const unsigned char *pointer);
291 virtual const char *get_name()
const {
292 return "Packer_point_nativefloat_3";
296 class Packer_point_nativefloat_4 :
public Packer_point_float32_4 {
298 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
300 virtual const char *get_name()
const {
301 return "Packer_point_nativefloat_4";
305 class Packer_float64_3 :
public Packer {
307 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
308 virtual void set_data3d(
unsigned char *pointer,
const LVecBase3d &value);
310 virtual const char *get_name()
const {
311 return "Packer_float64_3";
315 class Packer_point_float64_2 :
public Packer_point {
317 virtual const LVecBase2d &get_data2d(
const unsigned char *pointer);
318 virtual void set_data2d(
unsigned char *pointer,
const LVecBase2d &value);
320 virtual const char *get_name()
const {
321 return "Packer_point_float64_2";
325 class Packer_point_float64_3 :
public Packer_point {
327 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
328 virtual void set_data3d(
unsigned char *pointer,
const LVecBase3d &value);
330 virtual const char *get_name()
const {
331 return "Packer_point_float64_3";
335 class Packer_point_float64_4 :
public Packer_point {
337 virtual const LVecBase4d &get_data4d(
const unsigned char *pointer);
338 virtual void set_data4d(
unsigned char *pointer,
const LVecBase4d &value);
340 virtual const char *get_name()
const {
341 return "Packer_point_float64_4";
345 class Packer_nativedouble_3 final :
public Packer_float64_3 {
347 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
349 virtual const char *get_name()
const {
350 return "Packer_nativedouble_3";
354 class Packer_point_nativedouble_2 final :
public Packer_point_float64_2 {
356 virtual const LVecBase2d &get_data2d(
const unsigned char *pointer);
358 virtual const char *get_name()
const {
359 return "Packer_nativedouble_2";
363 class Packer_point_nativedouble_3 final :
public Packer_point_float64_3 {
365 virtual const LVecBase3d &get_data3d(
const unsigned char *pointer);
367 virtual const char *get_name()
const {
368 return "Packer_point_nativedouble_3";
372 class Packer_point_nativedouble_4 :
public Packer_point_float64_4 {
374 virtual const LVecBase4d &get_data4d(
const unsigned char *pointer);
376 virtual const char *get_name()
const {
377 return "Packer_point_nativedouble_4";
381 class Packer_argb_packed final :
public Packer_color {
383 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
384 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &value);
386 virtual const char *get_name()
const {
387 return "Packer_argb_packed";
391 class Packer_rgba_uint8_4 final :
public Packer_color {
393 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
394 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &value);
396 virtual const char *get_name()
const {
397 return "Packer_rgba_uint8_4";
401 class Packer_rgba_float32_4 :
public Packer_color {
403 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
404 virtual void set_data4f(
unsigned char *pointer,
const LVecBase4f &value);
406 virtual const char *get_name()
const {
407 return "Packer_rgba_float32_4";
411 class Packer_rgba_nativefloat_4 final :
public Packer_rgba_float32_4 {
413 virtual const LVecBase4f &get_data4f(
const unsigned char *pointer);
415 virtual const char *get_name()
const {
416 return "Packer_rgba_nativefloat_4";
420 class Packer_uint16_1 final :
public Packer {
422 virtual int get_data1i(
const unsigned char *pointer);
423 virtual void set_data1i(
unsigned char *pointer,
int value);
425 virtual const char *get_name()
const {
426 return "Packer_uint16_1";
436 INLINE std::ostream &operator << (std::ostream &out,
const GeomVertexColumn &obj);
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
This is a const pointer to an InternalName, and should be used in lieu of a CPT(InternalName) in func...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
This is our own Panda specialization on the default STL list.
This defines how a single column is interleaved within a vertex array stored within a Geom.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is intended to be the base class of all objects in Panda that might be allocated and delet...
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encodes a string name in a hash table, mapping it to a pointer.
An STL function object class, this is intended to be used on any ordered collection of class objects ...
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
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 ...