CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

cstool/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_CSTOOL_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);
00049   virtual const csVector3& GetPosition () const;
00050   virtual void SetSector (iSector *sec);
00051   virtual iSector *GetSector () const;
00052 
00053 private:
00054   iSector *m_pSector;
00055   csVector3 m_Position;
00056 };
00057 
00061 class CS_CSTOOL_EXPORT csNodeIterator
00062 {
00063 public:
00075   csNodeIterator (iSector *pSector, const char *classname = 0);
00076 
00078   ~csNodeIterator ();
00079 
00081   void Reset (iSector *pSector, const char *classname = 0);
00083   iMapNode* Next ();
00085   bool HasNext () const;
00086 
00087 protected:
00089   void SkipWrongClassname ();
00091   void NextNode ();
00092 
00093   csRef<iObjectIterator> Iterator;
00094   const char *Classname;
00095   csRef<iMapNode> CurrentNode;
00096 };
00097 
00098 #endif // __CS_MAPNODE_H__

Generated for Crystal Space by doxygen 1.2.18