/home/tetron/hack/vos/libs/vos/csplugin/csvosa3dl.hh
Go to the documentation of this file.00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 $Id: csvosa3dl.h,v 1.23 2006/05/07 23:01:24 reed Exp $ 00003 00004 This file is part of Crystal Space Virtual Object System Abstract 00005 3D Layer plugin (csvosa3dl). 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 Lesser 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 library 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 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser 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 _CSA3DL_H_ 00025 #define _CSA3DL_H_ 00026 00027 // Hack: Work around problems caused by #defining 'new'. 00028 #if defined(CS_EXTENSIVE_MEMDEBUG) || defined(CS_MEMORY_TRACKER) 00029 # undef new 00030 #endif 00031 #include <new> 00032 00033 #include <vos/vos/site.hh> 00034 #include <vos/vutil/taskqueue.hh> 00035 #include "ivosa3dl.hh" 00036 00037 #ifndef M_PI 00038 # ifdef PI 00039 # define M_PI PI 00040 # else 00041 # define M_PI 3.141592 00042 # endif 00043 #endif 00044 00045 class csVosA3DL : public virtual iComponent, 00046 public virtual iEventHandler, 00047 public virtual iVosA3DL, 00048 public virtual iVosApi 00049 { 00050 private: 00051 csRef<iEventQueue> eventq; 00052 csRef<iProgressMeter> progress; 00053 csRef<iVirtualClock> clock; 00054 csRef<iDynamics> dynamics; 00055 00056 iObjectRegistry *objreg; 00057 00058 VUtil::vRef<VOS::Site> localsite; 00059 00060 int relightCounter; 00061 boost::mutex relightCounterMutex; 00062 float remaining_delta; 00063 00064 csEventID Process; 00065 00066 public: 00067 SCF_DECLARE_IBASE; 00068 00069 VUtil::SynchronizedQueue<VUtil::Task*> mainThreadTasks; 00070 00071 csVosA3DL (iBase *); 00072 virtual ~csVosA3DL(); 00073 00074 virtual csRef<iVosSector> GetSector(const char* s); 00075 virtual csRef<iVosObject3D> FindVosObject3D(const char* s); 00076 virtual bool Initialize (iObjectRegistry *objreg); 00077 virtual bool HandleEvent (iEvent &ev); 00078 00079 CS_EVENTHANDLER_NAMES("crystalspace.network.vos.a3dl") 00080 CS_EVENTHANDLER_NIL_CONSTRAINTS 00081 00082 iObjectRegistry* GetObjectRegistry() 00083 { 00084 return objreg; 00085 } 00086 00087 csRef<iDynamics> GetDynamics () 00088 { 00089 return dynamics; 00090 } 00091 00092 virtual VUtil::vRef<VOS::Vobject> GetVobject(); 00093 00094 void setProgressMeter(iProgressMeter* meter); 00095 iProgressMeter* getProgressMeter(); 00096 00097 void incrementRelightCounter(); 00098 void decrementRelightCounter(); 00099 00100 }; 00101 00102 #endif