00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FLTMESHPRIMITIVE_H
00016 #define FLTMESHPRIMITIVE_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include "fltBead.h"
00021 #include "fltHeader.h"
00022
00023 #include "luse.h"
00024 #include "vector_int.h"
00025
00026
00027
00028
00029
00030
00031 class FltMeshPrimitive : public FltBead {
00032 public:
00033 FltMeshPrimitive(FltHeader *header);
00034
00035 enum PrimitiveType {
00036 PT_tristrip = 1,
00037 PT_trifan = 2,
00038 PT_quadstrip = 3,
00039 PT_polygon = 4,
00040 };
00041
00042 typedef vector_int Vertices;
00043
00044 PrimitiveType _primitive_type;
00045 Vertices _vertices;
00046
00047
00048 protected:
00049 virtual bool extract_record(FltRecordReader &reader);
00050 virtual bool build_record(FltRecordWriter &writer) const;
00051
00052 public:
00053 virtual TypeHandle get_type() const {
00054 return get_class_type();
00055 }
00056 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00057 static TypeHandle get_class_type() {
00058 return _type_handle;
00059 }
00060 static void init_type() {
00061 FltBead::init_type();
00062 register_type(_type_handle, "FltMeshPrimitive",
00063 FltBead::get_class_type());
00064 }
00065
00066 private:
00067 static TypeHandle _type_handle;
00068 };
00069
00070 #include "fltMeshPrimitive.I"
00071
00072 #endif
00073
00074