Panda3D
 All Classes Functions Variables Enumerations
fltLocalVertexPool.h
00001 // Filename: fltLocalVertexPool.h
00002 // Created by:  drose (28Feb01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef FLTLOCALVERTEXPOOL_H
00016 #define FLTLOCALVERTEXPOOL_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "fltRecord.h"
00021 #include "fltHeader.h"
00022 #include "fltVertex.h"
00023 
00024 #include "pointerTo.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : FltLocalVertexPool
00028 // Description : A local vertex pool, as might appear in the middle of
00029 //               the hierarchy, for instance for a mesh.
00030 ////////////////////////////////////////////////////////////////////
00031 class FltLocalVertexPool : public FltRecord {
00032 public:
00033   FltLocalVertexPool(FltHeader *header);
00034 
00035   // These bits are not stored in the vertex pool, but are read from
00036   // the .flt file and used immediately.
00037   enum AttributeMask {
00038     AM_has_position      = 0x80000000,
00039     AM_has_color_index   = 0x40000000,
00040     AM_has_packed_color  = 0x20000000,
00041     AM_has_normal        = 0x10000000,
00042     AM_has_base_uv       = 0x08000000,
00043     AM_has_uv_1          = 0x04000000,
00044     AM_has_uv_2          = 0x02000000,
00045     AM_has_uv_3          = 0x01000000,
00046     AM_has_uv_4          = 0x00800000,
00047     AM_has_uv_5          = 0x00400000,
00048     AM_has_uv_6          = 0x00200000,
00049     AM_has_uv_7          = 0x00100000
00050   };
00051 
00052   typedef pvector<PT(FltVertex)> Vertices;
00053   Vertices _vertices;
00054 
00055 public:
00056   virtual bool extract_record(FltRecordReader &reader);
00057   virtual bool build_record(FltRecordWriter &writer) const;
00058 
00059 public:
00060   virtual TypeHandle get_type() const {
00061     return get_class_type();
00062   }
00063   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00064   static TypeHandle get_class_type() {
00065     return _type_handle;
00066   }
00067   static void init_type() {
00068     FltRecord::init_type();
00069     register_type(_type_handle, "FltLocalVertexPool",
00070                   FltRecord::get_class_type());
00071   }
00072 
00073 private:
00074   static TypeHandle _type_handle;
00075 };
00076 
00077 #include "fltLocalVertexPool.I"
00078 
00079 #endif
00080 
00081 
 All Classes Functions Variables Enumerations