00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_GEOMGRAPH_LABEL_H
00023 #define GEOS_GEOMGRAPH_LABEL_H
00024
00025 #include <geos/geomgraph/TopologyLocation.h>
00026
00027 #include <geos/inline.h>
00028
00029 #include <iosfwd>
00030
00031 namespace geos {
00032 namespace geomgraph {
00033
00057 class Label {
00058
00059 public:
00060
00061 friend std::ostream& operator<< (std::ostream&, const Label&);
00062
00070 static Label* toLineLabel(const Label& label);
00071
00075 Label(int onLoc);
00076
00084 Label(int geomIndex, int onLoc);
00085
00091 Label(int onLoc, int leftLoc, int rightLoc);
00092
00094 Label(const Label &l);
00095
00099 Label();
00100
00102 virtual ~Label();
00103
00110 Label(int geomIndex, int onLoc, int leftLoc, int rightLoc);
00111
00112 void flip();
00113
00114 int getLocation(int geomIndex, int posIndex) const;
00115
00116 int getLocation(int geomIndex) const;
00117
00118 void setLocation(int geomIndex, int posIndex, int location);
00119
00120 void setLocation(int geomIndex, int location);
00121
00122 void setAllLocations(int geomIndex, int location);
00123
00124 void setAllLocationsIfNull(int geomIndex, int location);
00125
00126 void setAllLocationsIfNull(int location);
00127
00134 void merge(const Label &lbl);
00135
00136 int getGeometryCount() const;
00137
00138 bool isNull(int geomIndex) const;
00139
00140 bool isAnyNull(int geomIndex) const;
00141
00142 bool isArea() const;
00143
00144 bool isArea(int geomIndex) const;
00145
00146 bool isLine(int geomIndex) const;
00147
00148 bool isEqualOnSide(const Label &lbl, int side) const;
00149
00150 bool allPositionsEqual(int geomIndex, int loc) const;
00151
00155 void toLine(int geomIndex);
00156
00157 std::string toString() const;
00158
00159 protected:
00160
00161 TopologyLocation elt[2];
00162 };
00163
00164 std::ostream& operator<< (std::ostream&, const Label&);
00165
00166 }
00167 }
00168
00169
00170
00171
00172
00173
00174 #endif // ifndef GEOS_GEOMGRAPH_LABEL_H
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188