Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/flt/fltGeometry.h

Go to the documentation of this file.
00001 // Filename: fltGeometry.h
00002 // Created by:  drose (28Feb01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef FLTGEOMETRY_H
00020 #define FLTGEOMETRY_H
00021 
00022 #include <pandatoolbase.h>
00023 
00024 #include "fltBeadID.h"
00025 #include "fltPackedColor.h"
00026 #include "fltHeader.h"
00027 
00028 #include <luse.h>
00029 
00030 class FltTexture;
00031 class FltMaterial;
00032 
00033 ////////////////////////////////////////////////////////////////////
00034 //       Class : FltGeometry
00035 // Description : This is a base class for both FltFace and FltMesh,
00036 //               which are two different kinds of geometric primitives
00037 //               that might be encountered in a MultiGen file.  They
00038 //               have similar properties.
00039 ////////////////////////////////////////////////////////////////////
00040 class FltGeometry : public FltBeadID {
00041 public:
00042   FltGeometry(FltHeader *header);
00043 
00044   enum DrawType {
00045     DT_solid_backface      = 0,
00046     DT_solid_no_backface   = 1,
00047     DT_wireframe           = 2,
00048     DT_wireframe_close     = 3,
00049     DT_wireframe_highlight = 4,
00050     DT_omni_light          = 5,
00051     DT_uni_light           = 6,
00052     DT_bi_light            = 7
00053   };
00054 
00055   enum BillboardType {
00056     BT_none                = 0,
00057     BT_fixed               = 1,
00058     BT_axial               = 2,
00059     BT_point               = 4
00060   };
00061 
00062   enum Flags {
00063     F_terrain              = 0x80000000,
00064     F_no_color             = 0x40000000,
00065     F_no_alt_color         = 0x20000000,
00066     F_packed_color         = 0x10000000,
00067     F_terrain_footprint    = 0x08000000,
00068     F_hidden               = 0x04000000
00069   };
00070 
00071   enum LightMode {
00072     LM_face_no_normal      = 0,
00073     LM_vertex_no_normal    = 1,
00074     LM_face_with_normal    = 2,
00075     LM_vertex_with_normal  = 3
00076   };
00077 
00078   int _ir_color;
00079   int _relative_priority;
00080   DrawType _draw_type;
00081   bool _texwhite;
00082   int _color_name_index;
00083   int _alt_color_name_index;
00084   BillboardType _billboard_type;
00085   int _detail_texture_index;
00086   int _texture_index;
00087   int _material_index;
00088   int _dfad_material_code;
00089   int _dfad_feature_id;
00090   int _ir_material_code;
00091   int _transparency;
00092   int _lod_generation_control;
00093   int _line_style_index;
00094   unsigned int _flags;
00095   LightMode _light_mode;
00096   FltPackedColor _packed_color;
00097   FltPackedColor _alt_packed_color;
00098   int _texture_mapping_index;
00099   int _color_index;
00100   int _alt_color_index;
00101 
00102 public:
00103   INLINE bool has_texture() const;
00104   INLINE FltTexture *get_texture() const;
00105 
00106   INLINE bool has_material() const;
00107   INLINE FltMaterial *get_material() const;
00108 
00109   INLINE bool has_color() const;
00110   Colorf get_color() const;
00111   RGBColorf get_rgb() const;
00112 
00113   bool has_alt_color() const;
00114   Colorf get_alt_color() const;
00115   RGBColorf get_alt_rgb() const;
00116 
00117 
00118 protected:
00119   virtual bool extract_record(FltRecordReader &reader);
00120   virtual bool build_record(FltRecordWriter &writer) const;
00121 
00122 public:
00123   virtual TypeHandle get_type() const {
00124     return get_class_type();
00125   }
00126   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00127   static TypeHandle get_class_type() {
00128     return _type_handle;
00129   }
00130   static void init_type() {
00131     FltBeadID::init_type();
00132     register_type(_type_handle, "FltGeometry",
00133                   FltBeadID::get_class_type());
00134   }
00135 
00136 private:
00137   static TypeHandle _type_handle;
00138 };
00139 
00140 #include "fltGeometry.I"
00141 
00142 #endif
00143 
00144 

Generated on Fri May 2 03:19:11 2003 for Panda-Tool by doxygen1.3