Panda3D

fltMeshPrimitive.h
Go to the documentation of this file.
1 /**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file fltMeshPrimitive.h
10 * @author drose
11 * @date 2001-02-28
12 */
13
14 #ifndef FLTMESHPRIMITIVE_H
15 #define FLTMESHPRIMITIVE_H
16
17 #include "pandatoolbase.h"
18
19 #include "fltBead.h"
20 #include "fltHeader.h"
21
22 #include "luse.h"
23 #include "vector_int.h"
24
25 /**
26 * A single primitive of a mesh, like a triangle strip or fan.
27 */
28 class FltMeshPrimitive : public FltBead {
29 public:
30 FltMeshPrimitive(FltHeader *header);
31
32 enum PrimitiveType {
33 PT_tristrip = 1,
34 PT_trifan = 2,
35 PT_quadstrip = 3,
36 PT_polygon = 4,
37 };
38
39 typedef vector_int Vertices;
40
41 PrimitiveType _primitive_type;
42 Vertices _vertices;
43
44
45 protected:
46 virtual bool extract_record(FltRecordReader &reader);
47 virtual bool build_record(FltRecordWriter &writer) const;
48
49 public:
50 virtual TypeHandle get_type() const {
51 return get_class_type();
52 }
53 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
54 static TypeHandle get_class_type() {
55 return _type_handle;
56 }
57 static void init_type() {
58 FltBead::init_type();
59 register_type(_type_handle, "FltMeshPrimitive",
60 FltBead::get_class_type());
61 }
62
63 private:
64 static TypeHandle _type_handle;
65 };
66
67 #include "fltMeshPrimitive.I"
68
69 #endif
FltBead
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h:29
FltHeader
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
FltMeshPrimitive
A single primitive of a mesh, like a triangle strip or fan.
Definition: fltMeshPrimitive.h:28
FltRecordReader
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
Definition: fltRecordReader.h:30
FltRecordWriter
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
Definition: fltRecordWriter.h:31
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
fltBead.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
fltHeader.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
fltMeshPrimitive.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
luse.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
vector_int.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.