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