00001 // Filename: geomTrifan.h 00002 // Created by: charles (13Jul00) 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 GEOMTRIFAN_H 00020 #define GEOMTRIFAN_H 00021 00022 #include "geom.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : GeomTrifan 00026 // Description : Triangle Fan Primitive 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA GeomTrifan : public Geom 00029 { 00030 public: 00031 GeomTrifan( void ) : Geom() { } 00032 virtual Geom *make_copy() const; 00033 virtual void print_draw_immediate( void ) const; 00034 int get_num_tris( void ) const; 00035 virtual void draw_immediate(GraphicsStateGuardianBase *gsg, GeomContext *gc); 00036 00037 virtual int get_num_vertices_per_prim() const { 00038 return 0; 00039 } 00040 virtual int get_num_more_vertices_than_components() const { 00041 return 2; 00042 } 00043 virtual bool uses_components() const { 00044 return true; 00045 } 00046 00047 virtual int get_length(int prim) const { 00048 return _primlengths[prim]; 00049 } 00050 00051 virtual Geom *explode() const; 00052 virtual PTA_ushort get_tris() const; 00053 00054 public: 00055 static void register_with_read_factory(void); 00056 static TypedWritable *make_GeomTrifan(const FactoryParams ¶ms); 00057 00058 PUBLISHED: 00059 static TypeHandle get_class_type() { 00060 return _type_handle; 00061 } 00062 public: 00063 static void init_type() { 00064 Geom::init_type(); 00065 register_type(_type_handle, "GeomTrifan", 00066 Geom::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 #endif // GEOMTRIFAN_H