Panda3D
 All Classes Functions Variables Enumerations
fltLocalVertexPool.h
1 // Filename: fltLocalVertexPool.h
2 // Created by: drose (28Feb01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef FLTLOCALVERTEXPOOL_H
16 #define FLTLOCALVERTEXPOOL_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltRecord.h"
21 #include "fltHeader.h"
22 #include "fltVertex.h"
23 
24 #include "pointerTo.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : FltLocalVertexPool
28 // Description : A local vertex pool, as might appear in the middle of
29 // the hierarchy, for instance for a mesh.
30 ////////////////////////////////////////////////////////////////////
31 class FltLocalVertexPool : public FltRecord {
32 public:
34 
35  // These bits are not stored in the vertex pool, but are read from
36  // the .flt file and used immediately.
37  enum AttributeMask {
38  AM_has_position = 0x80000000,
39  AM_has_color_index = 0x40000000,
40  AM_has_packed_color = 0x20000000,
41  AM_has_normal = 0x10000000,
42  AM_has_base_uv = 0x08000000,
43  AM_has_uv_1 = 0x04000000,
44  AM_has_uv_2 = 0x02000000,
45  AM_has_uv_3 = 0x01000000,
46  AM_has_uv_4 = 0x00800000,
47  AM_has_uv_5 = 0x00400000,
48  AM_has_uv_6 = 0x00200000,
49  AM_has_uv_7 = 0x00100000
50  };
51 
53  Vertices _vertices;
54 
55 public:
56  virtual bool extract_record(FltRecordReader &reader);
57  virtual bool build_record(FltRecordWriter &writer) const;
58 
59 public:
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64  static TypeHandle get_class_type() {
65  return _type_handle;
66  }
67  static void init_type() {
68  FltRecord::init_type();
69  register_type(_type_handle, "FltLocalVertexPool",
70  FltRecord::get_class_type());
71  }
72 
73 private:
74  static TypeHandle _type_handle;
75 };
76 
77 #include "fltLocalVertexPool.I"
78 
79 #endif
80 
81 
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
virtual bool build_record(FltRecordWriter &writer) const
Fills up the current record on the FltRecordWriter with data for this record, but does not advance th...
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
A local vertex pool, as might appear in the middle of the hierarchy, for instance for a mesh...
virtual bool extract_record(FltRecordReader &reader)
Fills in the information in this bead based on the information given in the indicated datagram...
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:40
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85