Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages
mapnode.h
00001 /* 00002 Copyright (C) 2001 by Jorrit Tyberghein 00003 Copyright (C) 2000 by Thomas Hieber 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_MAPNODE_H__ 00021 #define __CS_MAPNODE_H__ 00022 00023 #include "csextern.h" 00024 00025 #include "csgeom/vector3.h" 00026 #include "csutil/csobject.h" 00027 #include "ivaria/mapnode.h" 00028 00033 class CS_CRYSTALSPACE_EXPORT csMapNode : public csObject, public iMapNode 00034 { 00035 public: 00037 csMapNode (const char *Name); 00039 virtual ~csMapNode (); 00040 00042 static iMapNode *GetNode (iSector *pSector, const char *name, 00043 const char *classname = 0); 00044 00045 SCF_DECLARE_IBASE_EXT (csObject); 00046 //----------------------- iMapNode -------------------------- 00047 virtual iObject *QueryObject() { return (csObject*)this; } 00048 virtual void SetPosition (const csVector3& pos) { position = pos; } 00049 virtual const csVector3& GetPosition () const { return position; } 00050 virtual void SetXVector (const csVector3& vec) { xvector = vec; } 00051 virtual const csVector3& GetXVector () const { return xvector; } 00052 virtual void SetYVector (const csVector3& vec) { yvector = vec; } 00053 virtual const csVector3& GetYVector () const { return yvector; } 00054 virtual void SetZVector (const csVector3& vec) { zvector = vec; } 00055 virtual const csVector3& GetZVector () const { return zvector; } 00056 00057 virtual void SetSector (iSector *sec); 00058 virtual iSector *GetSector () const { return sector; } 00059 00060 private: 00061 iSector *sector; 00062 csVector3 position; 00063 csVector3 xvector; 00064 csVector3 yvector; 00065 csVector3 zvector; 00066 }; 00067 00071 class CS_CRYSTALSPACE_EXPORT csNodeIterator 00072 { 00073 public: 00085 csNodeIterator (iSector *pSector, const char *classname = 0); 00086 00088 ~csNodeIterator (); 00089 00091 void Reset (iSector *pSector, const char *classname = 0); 00093 iMapNode* Next (); 00095 bool HasNext () const; 00096 00097 protected: 00099 void SkipWrongClassname (); 00101 void NextNode (); 00102 00103 csRef<iObjectIterator> Iterator; 00104 const char *Classname; 00105 csRef<iMapNode> CurrentNode; 00106 }; 00107 00108 #endif // __CS_MAPNODE_H__
Generated for Crystal Space by doxygen 1.4.4