CEL: Crystal Entity Layer: propclass/navgraph.h Source File (CEL: Crystal Entity Layer Public API Reference)

| ## Public API Reference

- Main Page
- Classes
- Files

# propclass/navgraph.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2003 by Steve Cook
    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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018 */
    00019
    00020 #ifndef __CEL_PF_NAVGRAPH__
    00021 #define __CEL_PF_NAVGRAPH__
    00022
    00023 // CS Stuff
    00024 #include "cstypes.h"
    00025 #include "csutil/scf.h"
    00026
    00027 struct iPcNavGraph;
    00028 struct iPcNavLink;
    00029 struct iPcNavNode;
    00030 struct iPcNavGraphRules;
    00031 struct iSector;
    00032
    00033 SCF_VERSION (iPcNavGraphRules, 0, 0, 1);
    00034
    00038 struct iPcNavGraphRules : public iBase
    00039 {
    00044   virtual int TraverseLink (iPcNavGraph* graph, iSector* sector,
    00045         iPcNavLink* plink, iCelEntity* ent ) = 0;
    00046
    00051   virtual void OptimiseGraph (iPcNavGraph* graph) = 0;
    00052
    00057   virtual size_t FindShortestPath (iPcNavGraph* graph, size_t iNodeStart,
    00058         size_t iNodeEnd, size_t* &ipath) = 0;
    00059
    00064   virtual size_t FindNearestNode (iPcNavGraph* graph, csVector3* point,
    00065         iSector* sector, iCelEntity* ent) = 0;
    00066 };
    00067
    00068 SCF_VERSION (iPcNavLink, 0, 0, 1);
    00069
    00071 struct iPcNavLink : public iBase
    00072 {
    00073   virtual void SetSource (iPcNavNode* newsource) = 0;
    00074   virtual csRef<iPcNavNode> GetSource () = 0;
    00075   virtual void SetDest (iPcNavNode* newdest) = 0;
    00076   virtual csRef<iPcNavNode> GetDest () = 0;
    00077   virtual int GetLinkInfo () = 0;
    00078   virtual void SetLinkInfo (int idata) = 0;
    00079   virtual float GetLength () = 0;
    00080 };
    00081
    00082 SCF_VERSION (iPcNavNode, 0, 0, 1);
    00083
    00085 struct iPcNavNode : public iBase
    00086 {
    00087   virtual void SetPos ( csVector3 newpos ) = 0;
    00088   virtual csVector3 GetPos() = 0;
    00089
    00090   virtual size_t AddLink (iPcNavLink* link) = 0;
    00091   virtual bool RemoveLink (size_t i) = 0;
    00092   virtual iPcNavLink* GetLink (size_t i) = 0;
    00093   virtual size_t GetLinkCount () const = 0;
    00094   virtual size_t FindLink (iPcNavLink* link) = 0;
    00095 };
    00096
    00097 SCF_VERSION (iPcNavGraph, 0, 0, 1);
    00098
    00100 struct iPcNavGraph : public iBase
    00101 {
    00102   // UGLY @@@
    00103   virtual void* GetPrivateObject () = 0;
    00104   virtual int Dump () = 0;
    00105   virtual int BuildNodeGraph (iSector* sector, iCelEntity* defaultent) = 0;
    00106   virtual void SetRegion (iPcRegion* newregion) = 0;
    00107   virtual csRef<iPcRegion> GetRegion() = 0;
    00108
    00109   virtual size_t AddNode (iPcNavNode* node) = 0;
    00110   virtual bool RemoveNode (size_t i) = 0;
    00111   virtual iPcNavNode* GetNode (size_t i) = 0;
    00112   virtual size_t GetNodeCount () const = 0;
    00113   virtual size_t FindNode (iPcNavNode* Node) = 0;
    00114
    00115   virtual size_t AddLink (iPcNavLink* link) = 0;
    00116   virtual bool RemoveLink (size_t i) = 0;
    00117   virtual iPcNavLink* GetLink (size_t i) = 0;
    00118   virtual size_t GetLinkCount () const = 0;
    00119   virtual size_t FindLink (iPcNavLink* link) = 0;
    00120
    00121   virtual void SetRules (iPcNavGraphRules* newrules) =0;
    00122
    00123   virtual size_t FindNearestNode (csVector3* point, iSector* sector,
    00124         iCelEntity* ent) = 0;
    00125   virtual size_t FindShortestPath (size_t iNodeStart, size_t iNodeEnd, size_t*& ipath) = 0;
    00126 };
    00127
    00128 #endif