## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# cstool/mapnode.h

Go to the documentation of this file.

    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
    00027 #include "csextern.h"
    00028
    00029 #include "csgeom/vector3.h"
    00030 #include "csutil/csobject.h"
    00031 #include "csutil/scf_implementation.h"
    00032 #include "ivaria/mapnode.h"
    00033
    00038 class CS_CRYSTALSPACE_EXPORT csMapNode :
    00039   public scfImplementationExt1<csMapNode, csObject, iMapNode>
    00040 {
    00041 public:
    00043   csMapNode (const char *Name);
    00045   virtual ~csMapNode ();
    00046
    00048   static iMapNode *GetNode (iSector *pSector, const char *name,
    00049     const char *classname = 0);
    00050
    00051   //----------------------- iMapNode --------------------------
    00052   virtual iObject *QueryObject() { return (csObject*)this; }
    00053   virtual void SetPosition (const csVector3& pos) { position = pos; }
    00054   virtual const csVector3& GetPosition () const { return position; }
    00055   virtual void SetXVector (const csVector3& vec) { xvector = vec; }
    00056   virtual const csVector3& GetXVector () const { return xvector; }
    00057   virtual void SetYVector (const csVector3& vec) { yvector = vec; }
    00058   virtual const csVector3& GetYVector () const { return yvector; }
    00059   virtual void SetZVector (const csVector3& vec) { zvector = vec; }
    00060   virtual const csVector3& GetZVector () const { return zvector; }
    00061
    00062   virtual void SetSector (iSector *sec);
    00063   virtual iSector *GetSector () const { return sector; }
    00064
    00065 private:
    00066   iSector *sector;
    00067   csVector3 position;
    00068   csVector3 xvector;
    00069   csVector3 yvector;
    00070   csVector3 zvector;
    00071 };
    00072
    00076 class CS_CRYSTALSPACE_EXPORT csNodeIterator
    00077 {
    00078 public:
    00090   csNodeIterator (iSector *pSector, const char *classname = 0);
    00091
    00093   ~csNodeIterator ();
    00094
    00096   void Reset (iSector *pSector, const char *classname = 0);
    00098   iMapNode* Next ();
    00100   bool HasNext () const;
    00101
    00102 protected:
    00104   void SkipWrongClassname ();
    00106   void NextNode ();
    00107
    00108   csRef<iObjectIterator> Iterator;
    00109   const char *Classname;
    00110   csRef<iMapNode> CurrentNode;
    00111 };
    00112
    00113 #endif // __CS_MAPNODE_H__