00001 // Filename: geomPolygon.cxx 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 #include <datagram.h> 00020 #include <datagramIterator.h> 00021 #include <bamReader.h> 00022 #include <bamWriter.h> 00023 #include <ioPtaDatagramShort.h> 00024 #include <ioPtaDatagramInt.h> 00025 #include <ioPtaDatagramLinMath.h> 00026 #include <graphicsStateGuardianBase.h> 00027 00028 #include "geomPolygon.h" 00029 00030 TypeHandle GeomPolygon::_type_handle; 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: GeomPolygon::make_copy 00034 // Access: Public, Virtual 00035 // Description: Returns a newly-allocated Geom that is a shallow copy 00036 // of this one. It will be a different Geom pointer, 00037 // but its internal data may or may not be shared with 00038 // that of the original Geom. 00039 //////////////////////////////////////////////////////////////////// 00040 Geom *GeomPolygon:: 00041 make_copy() const { 00042 return new GeomPolygon(*this); 00043 } 00044 00045 //////////////////////////////////////////////////////////////////// 00046 // Function: GeomPolygon::print_draw_immediate 00047 // Access: 00048 // Description: 00049 //////////////////////////////////////////////////////////////////// 00050 void GeomPolygon:: 00051 print_draw_immediate(void) const { 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: GeomPolygon::draw_immediate 00056 // Access: 00057 // Description: 00058 //////////////////////////////////////////////////////////////////// 00059 void GeomPolygon:: 00060 draw_immediate(GraphicsStateGuardianBase *gsg, GeomContext *gc) { 00061 gsg->draw_polygon(this, gc); 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: GeomPolygon::make_GeomPolygon 00066 // Access: Protected 00067 // Description: Factory method to generate a GeomPolygon object 00068 //////////////////////////////////////////////////////////////////// 00069 TypedWritable* GeomPolygon:: 00070 make_GeomPolygon(const FactoryParams ¶ms) { 00071 GeomPolygon *me = new GeomPolygon; 00072 DatagramIterator scan; 00073 BamReader *manager; 00074 00075 parse_params(params, scan, manager); 00076 me->fillin(scan, manager); 00077 me->make_dirty(); 00078 me->config(); 00079 return me; 00080 } 00081 00082 //////////////////////////////////////////////////////////////////// 00083 // Function: GeomPolygon::register_with_factory 00084 // Access: Public, Static 00085 // Description: Factory method to generate a GeomPolygon object 00086 //////////////////////////////////////////////////////////////////// 00087 void GeomPolygon:: 00088 register_with_read_factory(void) { 00089 BamReader::get_factory()->register_factory(get_class_type(), make_GeomPolygon); 00090 } 00091