GEOS  3.3.3
TopologyLocation.h
1 /**********************************************************************
2  * $Id: TopologyLocation.h 3255 2011-03-01 17:56:10Z mloskot $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geomgraph/TopologyLocation.java rev. 1.6 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 
22 #ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
23 #define GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
24 
25 #include <geos/export.h>
26 #include <geos/inline.h>
27 
28 #include <vector>
29 #include <string>
30 
31 #ifdef _MSC_VER
32 #pragma warning(push)
33 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
34 #endif
35 
36 namespace geos {
37 namespace geomgraph { // geos.geomgraph
38 
59 class GEOS_DLL TopologyLocation {
60 
61 public:
62 
63  friend std::ostream& operator<< (std::ostream&, const TopologyLocation&);
64 
66 
68 
69  TopologyLocation(const std::vector<int> &newLocation);
70 
82  TopologyLocation(int on, int left, int right);
83 
84  TopologyLocation(int on);
85 
87 
88  int get(std::size_t posIndex) const;
89 
93  bool isNull() const;
94 
98  bool isAnyNull() const;
99 
100  bool isEqualOnSide(const TopologyLocation &le, int locIndex) const;
101 
102  bool isArea() const;
103 
104  bool isLine() const;
105 
106  void flip();
107 
108  void setAllLocations(int locValue);
109 
110  void setAllLocationsIfNull(int locValue);
111 
112  void setLocation(std::size_t locIndex, int locValue);
113 
114  void setLocation(int locValue);
115 
117  const std::vector<int> &getLocations() const;
118 
119  void setLocations(int on, int left, int right);
120 
121  bool allPositionsEqual(int loc) const;
122 
127  void merge(const TopologyLocation &gl);
128 
129  std::string toString() const;
130 
131 private:
132 
133  std::vector<int> location;
134 };
135 
136 std::ostream& operator<< (std::ostream&, const TopologyLocation&);
137 
138 } // namespace geos.geomgraph
139 } // namespace geos
140 
141 //#ifdef GEOS_INLINE
142 //# include "geos/geomgraph/TopologyLocation.inl"
143 //#endif
144 
145 #ifdef _MSC_VER
146 #pragma warning(pop)
147 #endif
148 
149 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
150 
151 /**********************************************************************
152  * $Log$
153  * Revision 1.4 2006/06/12 11:29:23 strk
154  * unsigned int => size_t
155  *
156  * Revision 1.3 2006/04/06 09:01:11 strk
157  * Doxygen comments, port info, operator<<, assertion checking
158  *
159  * Revision 1.2 2006/03/24 09:52:41 strk
160  * USE_INLINE => GEOS_INLINE
161  *
162  * Revision 1.1 2006/03/09 16:46:49 strk
163  * geos::geom namespace definition, first pass at headers split
164  *
165  **********************************************************************/
166