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/export.h>
00026 #include <geos/geomgraph/TopologyLocation.h>
00027
00028 #include <geos/inline.h>
00029
00030 #include <iosfwd>
00031
00032 namespace geos {
00033 namespace geomgraph {
00034
00058 class GEOS_DLL Label {
00059
00060 public:
00061
00062 friend std::ostream& operator<< (std::ostream&, const Label&);
00063
00071 static Label* toLineLabel(const Label& label);
00072
00076 Label(int onLoc);
00077
00085 Label(int geomIndex, int onLoc);
00086
00092 Label(int onLoc, int leftLoc, int rightLoc);
00093
00095 Label(const Label &l);
00096
00100 Label();
00101
00103 virtual ~Label();
00104
00111 Label(int geomIndex, int onLoc, int leftLoc, int rightLoc);
00112
00113 void flip();
00114
00115 int getLocation(int geomIndex, int posIndex) const;
00116
00117 int getLocation(int geomIndex) const;
00118
00119 void setLocation(int geomIndex, int posIndex, int location);
00120
00121 void setLocation(int geomIndex, int location);
00122
00123 void setAllLocations(int geomIndex, int location);
00124
00125 void setAllLocationsIfNull(int geomIndex, int location);
00126
00127 void setAllLocationsIfNull(int location);
00128
00135 void merge(const Label &lbl);
00136
00137 int getGeometryCount() const;
00138
00139 bool isNull(int geomIndex) const;
00140
00141 bool isAnyNull(int geomIndex) const;
00142
00143 bool isArea() const;
00144
00145 bool isArea(int geomIndex) const;
00146
00147 bool isLine(int geomIndex) const;
00148
00149 bool isEqualOnSide(const Label &lbl, int side) const;
00150
00151 bool allPositionsEqual(int geomIndex, int loc) const;
00152
00156 void toLine(int geomIndex);
00157
00158 std::string toString() const;
00159
00160 protected:
00161
00162 TopologyLocation elt[2];
00163 };
00164
00165 std::ostream& operator<< (std::ostream&, const Label&);
00166
00167 }
00168 }
00169
00170
00171
00172
00173
00174
00175 #endif // ifndef GEOS_GEOMGRAPH_LABEL_H
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189