![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2004 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: networkEdgeReversePointIter.h,v $ $Revision: 1.5 $ $State: Exp $ 00007 *********************************************************************/ 00008 #ifndef networkEdgeReversePointIter_H_ 00009 #define networkEdgeReversePointIter_H_ 00010 00011 // 00012 // \file networkEdgeReversePointIter.h 00013 // \brief Contains the DtNetworkEdgeReversePointIter class declaration. 00014 // 00015 00016 #include "gdb/gdbDefines.h" 00017 #include "gdb/netwrkEdge.h" 00018 #include "gdb/networkEdgePointIter.h" 00019 00020 class DtPoint; 00021 class DtString; 00022 00023 // DtNetworkEdgeReversePointIter is a bidirectional iterator over the points 00024 // representing a DtNetworkEdge, traversing in the REVERSE direction. 00025 // \invariant At all times, this iterator must point to a valid DtNetworkEdge. 00026 class DT_DLL_gdb DtNetworkEdgeReversePointIter : public DtNetworkEdgePointIter 00027 { 00028 public: 00029 00030 // constructor 00031 // \param edge The DtNetworkEdge to iterate over 00032 DtNetworkEdgeReversePointIter(DtNetworkEdge& edge); 00033 00034 // constructor that allows the user to specify that 00035 // the iterator is initialized to the end of the 00036 // points of the edge. 00037 // \param edge The DtNetworkEdge to iterate over 00038 // \param isEnd Is the iterator at the end or not. 00039 DtNetworkEdgeReversePointIter(DtNetworkEdge& edge, 00040 bool isEnd); 00041 00042 // Constructs a reverse point iterator starting at the specified 00043 // segment along the edge, which means the current point will be the ending point 00044 // of the specified segment. 00045 // \param edge The DtNetworkEdge to iterate over 00046 // \param initialPoint The point in the edge to initialize to. 00047 // \note If the initialPoint is NOT in the edge, then the iterator is 00048 // initialized to the first point as if no point had been specified. 00049 DtNetworkEdgeReversePointIter(DtNetworkEdge& edge, 00050 const DtPoint& initialPoint); 00051 00052 // destructor 00053 virtual ~DtNetworkEdgeReversePointIter(); 00054 00055 // assignment operator 00056 DtNetworkEdgeReversePointIter& operator=(const DtNetworkEdgeReversePointIter& orig); 00057 00058 // copy constructor 00059 DtNetworkEdgeReversePointIter(const DtNetworkEdgeReversePointIter& orig); 00060 00061 void operator++(); 00062 void operator--(); 00063 const DtPoint& operator*() const; 00064 const DtPoint* operator->() const; 00065 00066 bool operator==(const DtNetworkEdgePointIter& other) const; 00067 bool operator!=(const DtNetworkEdgePointIter& other) const; 00068 00069 bool operator==(const DtNetworkEdgeReversePointIter& other) const; 00070 bool operator!=(const DtNetworkEdgeReversePointIter& other) const; 00071 00072 // \return the DtString "DtNetworkEdgeReversePointIter" 00073 virtual const DtString type() const; 00074 00075 protected: 00076 // Used to keep track of where we are in the parent edge since the last segment 00077 // in either direction will have both a starting and ending point. 00078 DtNetworkEdge::DtPointContainer::reverse_iterator myReversePointIter; 00079 00080 private: 00081 // default constructor 00082 DtNetworkEdgeReversePointIter(); 00083 }; 00084 00085 00086 #endif