VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkEdgeSegmentIter.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2004 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: networkEdgeSegmentIter.h,v $ $Revision: 1.5 $ $State: Exp $
7 *********************************************************************/
8 #ifndef networkEdgeSegmentIter_H_
9 #define networkEdgeSegmentIter_H_
10 
11 //
12 // \file networkEdgeSegmentIter.h
13 // \brief Contains the DtNetworkEdgeSegmentIter class declaration.
14 //
15 
16 #include "gdb/gdbDefines.h"
17 #include "gdb/networkEdge.h"
18 
19 class DtSegment;
20 class DtString;
21 
22 
23 //
24 // DtNetworkEdgeSegmentIter is an ABC representing
25 // an iterator over the segments of a DtNetworkEdge.
26 // \invariant At all times, this iterator must point to a valid DtNetworkEdge.
28 {
29 public:
30  // \param an edge to iterate over.
32 
33  // copy constructor
35 
36  // destructor
37  virtual ~DtNetworkEdgeSegmentIter();
38 
39  // \return A DtPoint representing the starting or ending point of
40  // the segment as defined in the direction of iteration.
41  virtual DtPoint startPoint() const = 0;
42  virtual DtPoint endPoint() const = 0;
43 
44  virtual const DtNetworkEdge& edge() const;
45 
46  // Increments/Decrements to the next/previous segment in the edge as defined
47  // by the direction of iteration.
48  virtual void operator++() = 0;
49  virtual void operator--() = 0;
50  virtual DtNetworkSegment& operator*() const = 0;
51  virtual DtNetworkSegment& operator->() const = 0;
52 
53  virtual bool operator==(const DtNetworkEdgeSegmentIter& other) const;
54  virtual bool operator!=(const DtNetworkEdgeSegmentIter& other) const;
55 
56  // \return The DtString "DtNetworkEdgeSegmentIter"
57  virtual const DtString type() const;
58 
59 protected:
60  // Tests the invariant of the iterator as defined above.
61  // \return a boolean signifying true if the invariant is valid
62  // and false otherwise.
63  bool testInvariant() const;
64 
65  // default constructor
67 
69 };
70 
71 
73 myEdge(&edge)
74 {
75  assert(testInvariant());
76 }
77 
79 {
80 }
81 
83 {
84  assert(testInvariant());
85 
86  myEdge = orig.myEdge;
87 
88  assert(testInvariant());
89 }
90 
91 
93 {
94  assert(testInvariant());
95 
96  return "DtNetworkEdgeSegmentIter";
97 }
98 
99 
100 #endif

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)