![]() |
Public API Reference |
00001 /* 00002 Copyright (C) 2000 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_REGION_H__ 00020 #define __CS_REGION_H__ 00021 00022 #include "csutil/csobject.h" 00023 #include "csutil/nobjvec.h" 00024 #include "iengine/region.h" 00025 00026 class csEngine; 00027 00032 class csRegion : public csObject 00033 { 00034 private: 00035 csEngine* engine; 00036 00037 public: 00041 csRegion (csEngine*); 00042 00047 virtual ~csRegion (); 00048 00052 virtual void Add(iObject *obj) 00053 { ObjAdd (obj); } 00054 00060 virtual bool IsInRegion (iObject* obj); 00061 00065 virtual void DeleteAll (); 00066 00070 virtual bool PrepareTextures (); 00071 00075 virtual bool ShineLights (); 00076 00083 virtual bool Prepare (); 00084 00085 SCF_DECLARE_IBASE_EXT (csObject); 00086 00087 //--------------------- iRegion implementation --------------------- 00088 struct Region : public iRegion 00089 { 00090 SCF_DECLARE_EMBEDDED_IBASE (csRegion); 00091 00093 virtual iObject *QueryObject(); 00094 00095 virtual void Add(iObject *obj) 00096 { scfParent->Add(obj); } 00097 00102 virtual void Clear (); 00103 00107 virtual void DeleteAll (); 00108 00112 virtual bool PrepareTextures (); 00113 00117 virtual bool ShineLights (); 00118 00125 virtual bool Prepare (); 00126 00128 virtual iSector *FindSector (const char *iName); 00130 virtual iMeshWrapper *FindMeshObject (const char *iName); 00132 virtual iMeshFactoryWrapper *FindMeshFactory (const char *iName); 00134 virtual iTextureWrapper *FindTexture (const char *iName); 00136 virtual iMaterialWrapper *FindMaterial (const char *iName); 00138 virtual iCameraPosition *FindCameraPosition (const char *iName); 00140 virtual iCollection *FindCollection (const char *iName); 00141 00147 virtual bool IsInRegion (iObject* obj); 00148 } scfiRegion; 00149 friend struct Region; 00150 }; 00151 00152 00154 class csRegionList : public csRefArrayObject<iRegion> 00155 { 00156 public: 00157 SCF_DECLARE_IBASE; 00158 00160 csRegionList (); 00161 virtual ~csRegionList () { } 00162 00163 class RegionList : public iRegionList 00164 { 00165 public: 00166 SCF_DECLARE_EMBEDDED_IBASE (csRegionList); 00167 00168 virtual int GetCount () const; 00169 virtual iRegion *Get (int n) const; 00170 virtual int Add (iRegion *obj); 00171 virtual bool Remove (iRegion *obj); 00172 virtual bool Remove (int n); 00173 virtual void RemoveAll (); 00174 virtual int Find (iRegion *obj) const; 00175 virtual iRegion *FindByName (const char *Name) const; 00176 } scfiRegionList; 00177 }; 00178 00179 #endif // __CS_REGION_H__