interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

/home/tetron/hack/vos/libs/vos/csplugin/voslight.hh

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002    $Id: voslight.h,v 1.5 2006/05/07 23:01:24 reed Exp $
00003 
00004     This file is part of the VOS plugin for Crystal Space.
00005     For more information about VOS, go to http://interreality.org.
00006 
00007     Copyright (C) 2004 Peter Amstutz
00008 
00009     This program is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 #ifndef _VOSLIGHT_H_
00025 #define _VOSLIGHT_H_
00026 
00027 #include <vos/metaobjects/a3dl/a3dl.hh>
00028 
00029 #include "ivosa3dl.hh"
00030 #include "csvosa3dl.hh"
00031 #include "vossector.hh"
00032 
00033 class csMetaLight : public A3DL::Light, public VOS::PropertyListener
00034 {
00035 protected:
00036   iObjectRegistry *object_reg;
00037   csRef<iSector> sector;
00038   csRef<iLight> light;
00039 
00040   // light already created & listening to property updates
00041   bool alreadyLoaded;
00042   // True if a static light. Updates to subproperties will have no effect.
00043   bool isStatic;
00044 public:
00045   csMetaLight(VOS::VobjectBase* superobject);
00046   virtual ~csMetaLight();
00047   virtual csRef<iLight> GetCSLight() { return light; }
00048 
00049   virtual void Setup(csVosA3DL* vosa3dl, csVosSector* sect);
00050 
00051   virtual void notifyPropertyChange(const VOS::PropertyEvent& event);
00052   virtual void doExcise();
00053 
00054   static VOS::MetaObject* new_csMetaLight(VOS::VobjectBase* superobject,
00055     const std::string& type);
00056 
00057   friend class ConstructLightTask;
00058 };
00059 
00060 #endif