00001 // Filename: geomLinestrip.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 GEOMLINESTRIP_H 00020 #define GEOMLINESTRIP_H 00021 00022 #include "geom.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : GeomLinestrip 00026 // Description : Linestrip Primitive 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDA GeomLinestrip : public Geom 00029 { 00030 public: 00031 GeomLinestrip(void) : Geom() { _width = 1.0f; } 00032 virtual Geom *make_copy() const; 00033 virtual void print_draw_immediate( void ) const { } 00034 virtual void draw_immediate(GraphicsStateGuardianBase *gsg, GeomContext *gc); 00035 00036 // Undefined for this type of primitive 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 1; 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 00053 INLINE void set_width(float width) { _width = width; } 00054 INLINE float get_width(void) const { return _width; } 00055 00056 protected: 00057 float _width; 00058 00059 public: 00060 static void register_with_read_factory(void); 00061 virtual void write_datagram(BamWriter* manager, Datagram &me); 00062 00063 static TypedWritable *make_GeomLinestrip(const FactoryParams ¶ms); 00064 00065 protected: 00066 void fillin(DatagramIterator& scan, BamReader* manager); 00067 00068 PUBLISHED: 00069 static TypeHandle get_class_type() { 00070 return _type_handle; 00071 } 00072 public: 00073 static void init_type() { 00074 Geom::init_type(); 00075 register_type(_type_handle, "GeomLinestrip", 00076 Geom::get_class_type()); 00077 } 00078 virtual TypeHandle get_type() const { 00079 return get_class_type(); 00080 } 00081 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00082 00083 private: 00084 static TypeHandle _type_handle; 00085 }; 00086 00087 #endif // GEOMLINESTRIP_H