Label.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: geomgraph/Label.java r428 (JTS-1.12+)
00017  *
00018  **********************************************************************/
00019 
00020 
00021 #ifndef GEOS_GEOMGRAPH_LABEL_H
00022 #define GEOS_GEOMGRAPH_LABEL_H
00023 
00024 #include <geos/export.h>
00025 #include <geos/geomgraph/TopologyLocation.h> 
00026 
00027 #include <geos/inline.h>
00028 
00029 #include <iosfwd> // for operator<<
00030 
00031 namespace geos {
00032 namespace geomgraph { // geos.geomgraph
00033 
00057 class GEOS_DLL Label {
00058 
00059 public:
00060 
00061         friend std::ostream& operator<< (std::ostream&, const Label&);
00062 
00068         static Label toLineLabel(const Label& label);
00069 
00073         Label(int onLoc);
00074 
00082         Label(int geomIndex, int onLoc);
00083 
00089         Label(int onLoc, int leftLoc, int rightLoc);
00090 
00092         Label(const Label &l);
00093 
00094         Label& operator= (const Label& l);
00095 
00101         Label();
00102 
00109         Label(int geomIndex, int onLoc, int leftLoc, int rightLoc);
00110 
00111         void flip();
00112 
00113         int getLocation(int geomIndex, int posIndex) const;
00114 
00115         int getLocation(int geomIndex) const;
00116 
00117         void setLocation(int geomIndex, int posIndex, int location);
00118 
00119         void setLocation(int geomIndex, int location);
00120 
00121         void setAllLocations(int geomIndex, int location);
00122 
00123         void setAllLocationsIfNull(int geomIndex, int location);
00124 
00125         void setAllLocationsIfNull(int location);
00126 
00133         void merge(const Label &lbl);
00134 
00135         int getGeometryCount() const;
00136 
00137         bool isNull() 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 private:
00161 
00162         TopologyLocation elt[2];
00163 };
00164 
00165 std::ostream& operator<< (std::ostream&, const Label&);
00166 
00167 } // namespace geos.geomgraph
00168 } // namespace geos
00169 
00170 
00171 //#ifdef GEOS_INLINE
00172 //# include "geos/geomgraph/Label.inl"
00173 //#endif
00174 
00175 #endif // ifndef GEOS_GEOMGRAPH_LABEL_H
00176 

Generated on 30 Dec 2015 for GEOS by  doxygen 1.4.7