00001 // Filename: geomTri.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 GEOMTRI_H 00020 #define GEOMTRI_H 00021 00022 #include "geom.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : GeomTri 00026 // Description : Triangle Primitive 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA GeomTri : public Geom { 00029 public: 00030 GeomTri() { } 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 3; 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) const { 00046 return 3; 00047 } 00048 00049 virtual PTA_ushort get_tris() const; 00050 00051 public: 00052 static void register_with_read_factory(void); 00053 static TypedWritable *make_GeomTri(const FactoryParams ¶ms); 00054 00055 PUBLISHED: 00056 static TypeHandle get_class_type() { 00057 return _type_handle; 00058 } 00059 public: 00060 static void init_type() { 00061 Geom::init_type(); 00062 register_type(_type_handle, "GeomTri", 00063 Geom::get_class_type()); 00064 } 00065 virtual TypeHandle get_type() const { 00066 return get_class_type(); 00067 } 00068 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00069 00070 private: 00071 static TypeHandle _type_handle; 00072 }; 00073 00074 #endif // GEOMTRI_H