Panda3D
fltVertexList.h
1 // Filename: fltVertexList.h
2 // Created by: drose (25Aug00)
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 FLTVERTEXLIST_H
16 #define FLTVERTEXLIST_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltRecord.h"
21 #include "fltPackedColor.h"
22 #include "fltVertex.h"
23 
24 #include "pointerTo.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : FltVertexList
28 // Description : A list of vertices, typically added as a child of a
29 // face bead.
30 ////////////////////////////////////////////////////////////////////
31 class FltVertexList : public FltRecord {
32 public:
33  FltVertexList(FltHeader *header);
34 
35  int get_num_vertices() const;
36  FltVertex *get_vertex(int n) const;
37  void clear_vertices();
38  void add_vertex(FltVertex *vertex);
39 
40  virtual void output(ostream &out) const;
41 
42 protected:
43  virtual bool extract_record(FltRecordReader &reader);
44  virtual bool build_record(FltRecordWriter &writer) const;
45 
46 private:
48  Vertices _vertices;
49 
50 public:
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55  static TypeHandle get_class_type() {
56  return _type_handle;
57  }
58  static void init_type() {
59  FltRecord::init_type();
60  register_type(_type_handle, "FltVertexList",
61  FltRecord::get_class_type());
62  }
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
68 #endif
69 
70 
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 void output(ostream &out) const
Writes a quick one-line description of the record, but not its children.
int get_num_vertices() const
Returns the number of vertices in this vertex list.
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
void add_vertex(FltVertex *vertex)
Adds a new vertex to the end of the vertex list.
A list of vertices, typically added as a child of a face bead.
Definition: fltVertexList.h:31
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:40
Represents a single vertex in the vertex palette.
Definition: fltVertex.h:35
void clear_vertices()
Removes all vertices from this vertex list.
FltVertex * get_vertex(int n) const
Returns the nth vertex of this vertex list.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85