00001 // Filename: drawable.h 00002 // Created by: mike (09Jan97) 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 DDRAWABLE_H 00020 #define DDRAWABLE_H 00021 00022 #include "pandabase.h" 00023 00024 #include "boundedObject.h" 00025 #include "writableConfigurable.h" 00026 #include "referenceCount.h" 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Defines 00030 //////////////////////////////////////////////////////////////////// 00031 00032 class GraphicsStateGuardianBase; 00033 class Datagram; 00034 class DatagramIterator; 00035 class BamReader; 00036 class BamWriter; 00037 00038 //////////////////////////////////////////////////////////////////// 00039 // Class : Drawable 00040 // Description : Object that can be drawn (i.e. issues graphics 00041 // commands). 00042 // NOTE: We had to change the name to dDrawable because 00043 // the stupid bastards who wrote X didn't add a prefix 00044 // to their variable names 00045 //////////////////////////////////////////////////////////////////// 00046 class EXPCL_PANDA dDrawable : public ReferenceCount, public WritableConfigurable, 00047 public BoundedObject { 00048 public: 00049 00050 dDrawable(); 00051 virtual ~dDrawable(); 00052 00053 virtual void draw(GraphicsStateGuardianBase *); 00054 virtual bool is_dynamic() const; 00055 00056 protected: 00057 virtual void propagate_stale_bound(); 00058 00059 public: 00060 virtual void write_datagram(BamWriter* manager, Datagram &me); 00061 00062 protected: 00063 void fillin(DatagramIterator& scan, BamReader* manager); 00064 00065 PUBLISHED: 00066 static TypeHandle get_class_type() { 00067 return _type_handle; 00068 } 00069 00070 public: 00071 static void init_type() { 00072 ReferenceCount::init_type(); 00073 WritableConfigurable::init_type(); 00074 BoundedObject::init_type(); 00075 register_type(_type_handle, "dDrawable", 00076 ReferenceCount::get_class_type(), 00077 WritableConfigurable::get_class_type(), 00078 BoundedObject::get_class_type()); 00079 } 00080 virtual TypeHandle get_type() const { 00081 return get_class_type(); 00082 } 00083 00084 public: 00085 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00086 00087 00088 private: 00089 static TypeHandle _type_handle; 00090 }; 00091 00092 #endif 00093