00001 /* 00002 * $Id: lightnode.h 672 2009-01-16 08:34:17Z misek $ 00003 * 00004 * Description : One line description of file. 00005 * Author : Vaclav Kyba <mail/Jabber: vaseo1@gmail.com> <ICQ: 98576293> 00006 * 00007 * Purpose : 00008 * Long description of what the file is for. 00009 */ 00010 00011 00012 #ifndef __LIGHTNODE__H__ 00013 #define __LIGHTNODE__H__ 00014 00015 #include "scenenode.h" 00016 #include "light.h" 00017 00018 00019 namespace VRUT 00020 { 00022 class LightNode : public SceneNode 00023 { 00024 protected: 00026 Light * light; 00027 00028 public: 00030 LightNode(const wxString & _uid, const wxString & _name) 00031 : SceneNode(_uid, _name, SceneNode::LIGHT), light((Light *)NULL) 00032 { 00033 } 00034 00036 LightNode(const LightNode & l) : SceneNode(l) 00037 { 00038 light = ( l.light ? l.light->Clone() : (Light *)NULL ); 00039 } 00040 00042 virtual ~LightNode() 00043 { 00044 SAFE_DELETE(light); 00045 } 00046 00048 const Light * GetLight() const 00049 { 00050 return light; 00051 } 00052 00054 virtual wxString ToString() const 00055 { 00056 return wxString::Format(wxT("%s\n%s\n"), SceneNode::ToString().c_str(), light->ToString().c_str()); 00057 } 00058 00060 virtual SceneNode * Clone() const 00061 { 00062 return new LightNode(*this); 00063 } 00064 00065 friend class Scene; 00066 }; 00067 }; 00068 00069 #endif
1.5.5