Panda3D
|
00001 // Filename: lightNode.h 00002 // Created by: drose (26Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef LIGHTNODE_H 00016 #define LIGHTNODE_H 00017 00018 #include "pandabase.h" 00019 00020 #include "light.h" 00021 #include "pandaNode.h" 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : LightNode 00025 // Description : A derivative of Light and of PandaNode. All kinds of 00026 // Light except Spotlight (which must inherit from 00027 // LensNode instead) inherit from this class. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_PANDA_PGRAPHNODES LightNode : public Light, public PandaNode { 00030 PUBLISHED: 00031 LightNode(const string &name); 00032 00033 protected: 00034 LightNode(const LightNode ©); 00035 00036 public: 00037 virtual PandaNode *as_node(); 00038 virtual Light *as_light(); 00039 00040 PUBLISHED: 00041 // We have to explicitly publish these because they resolve the 00042 // multiple inheritance. 00043 virtual void output(ostream &out) const; 00044 virtual void write(ostream &out, int indent_level = 0) const; 00045 00046 public: 00047 virtual void write_datagram(BamWriter *manager, Datagram &dg); 00048 00049 protected: 00050 void fillin(DatagramIterator &scan, BamReader *manager); 00051 00052 public: 00053 static TypeHandle get_class_type() { 00054 return _type_handle; 00055 } 00056 static void init_type() { 00057 Light::init_type(); 00058 PandaNode::init_type(); 00059 register_type(_type_handle, "LightNode", 00060 Light::get_class_type(), 00061 PandaNode::get_class_type()); 00062 } 00063 virtual TypeHandle get_type() const { 00064 return get_class_type(); 00065 } 00066 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00067 00068 private: 00069 static TypeHandle _type_handle; 00070 }; 00071 00072 INLINE ostream &operator << (ostream &out, const LightNode &light) { 00073 light.output(out); 00074 return out; 00075 } 00076 00077 #include "lightNode.I" 00078 00079 #endif