From: Chad G. <ex...@us...> - 2005-07-14 02:32:00
|
Update of /cvsroot/openrpg-gde/Source/Source3D/DataStructure/Headers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21078/Source3D/DataStructure/Headers Added Files: Chain.h Log Message: Renamed 3d because java cannot reference apackage that starts with a digit --- NEW FILE: Chain.h --- /*************************************************************************** * Chain.h * * Wed Jun 29 20:07:55 2005 * Copyright 2005 User * Email ****************************************************************************/ #ifndef CHAIN_H #define CHAIN_H #include <list> #include "../../Simple/Headers/Vertex.h" #include "../../Simple/Headers/Surface.h" namespace OpenRPGGDE { /* [API] Public #Exodist - 7/10/05# [Class] [Description] A chain of nodes each containing a vertex, each virtex is linked to the next and previous. An unending loop of vertices Is a sorted loop */ class Chain { public: /* [API] Public #Exodist - 7/10/05# [int] Size of chain (how many links) [Description] Basic constructor generates an empty chain of specified size */ Chain(int); /* [API] Public #Exodist - 7/10/05# [int] Size of chain (how many links) [Vertex**] should be an array of pointer sot vertices of the size specified or larger [Description] Generate a chain of given length from the given array */ Chain(int, Vertex**); /* [API] Public #Exodist - 7/10/05# [std::list<Vertex *>] List of verticies [Description] Construct a chain from the given list of vertices */ Chain(std::list<Vertex *>); /* [API] Public #Exodist - 7/10/05# [return] First vertex in chain [Description] Sets the current link in the chain to the begginging, also returns the first vertex in the chain */ Vertex* start(); /* [API] Public #Exodist - 7/10/05# [return] First vertex in chain [Description] returns the first vertex in the chain */ Vertex* first(); /* [API] Public #Exodist - 7/10/05# [return] Last vertex in chain [Description] returns the last vertex in the chain */ Vertex* last(); /* [API] Public #Exodist - 7/10/05# [return] Last vertex in chain [int] Link number [Description] returns the vertex at the given position of the chain */ Vertex* at(int); /* [API] Public #Exodist - 7/10/05# [return] current vertex in chain [Description] returns the vertex at the current position of the chain */ Vertex* current(); /* [API] Public #Exodist - 7/10/05# [return] next vertex in chain [Description] returns the vertex at the next position of the chain */ Vertex* next(); /* [API] Public #Exodist - 7/10/05# [return] previous vertex in chain [Description] returns the vertex at the previous position of the chain */ Vertex* previous(); /* [API] Public #Exodist - 7/10/05# [return] Current link in chain after incriment [Description] Incriments to the next link in the chain and returns it */ Vertex* operator ++(); /* [API] Public #Exodist - 7/10/05# [return] Current link in chain before incriment [Description] returns current and incriments to next */ Vertex* operator ++(int); /* [API] Public #Exodist - 7/10/05# [return] Current link in chain after decriment [Description] decrements to the previous chain element and returns it */ Vertex* operator --(); /* [API] Public #Exodist - 7/10/05# [return] Current link in chain before decriment [Description] returns current and decriments to next */ Vertex* operator --(int); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to place in the given position [Description] Set the first link to the given vertex */ void first(Vertex *); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to place in the given position [Description] set the last link to the given vertex */ void last(Vertex*); /* [API] Public #Exodist - 7/10/05# [int] Position in chain [Vertex*] Vertex to place in the given position [Description] set the link at the given position to the given vertex */ void at(int, Vertex*); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to place in the given position [Description] set the current link to the given vertex */ void current(Vertex*); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to place in the given position [Description] set the next link to the given vertex */ void next(Vertex*); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to place in the given position [Description] set the previous link to the given vertex */ void previous(Vertex*); /* [API] Public #Exodist - 7/10/05# [int] Position in chain [Description] set the chain's current position to the given one */ void setCurrentIndex(int); /* [API] Public #Exodist - 7/10/05# [return] current position in chain [Description] get the current index position in the chain */ int getCurrentIndex(); /* [API] Public #Exodist - 7/10/05# [return] Ammount of links in the chain [Description] get the ammount of links in the chain */ int getCount(); /* [API] Public #Exodist - 7/10/05# [Description] Sort the chain */ void sort(); /* [API] Public #Exodist - 7/10/05# [Vertex*] Vertex to reference [Description] Set the vertex closest to the given one as current. */ void setClosestCurrent(Vertex*); private: Vertex** theChain; //Internal array int count; //Element count int currentIndex; //Current index position }; } #endif |