• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

Label.h

00001 /**********************************************************************
00002  * $Id: Label.h 2557 2009-06-08 09:30:55Z strk $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2005-2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************
00016  *
00017  * Last port: geomgraph/Label.java rev. 1.8 (JTS-1.10)
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> // for operator<<
00031 
00032 namespace geos {
00033 namespace geomgraph { // geos.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 } // 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 
00177 /**********************************************************************
00178  * $Log$
00179  * Revision 1.3  2006/04/06 09:01:37  strk
00180  * Doxygen comments, port info, operator<<, assertion checking
00181  *
00182  * Revision 1.2  2006/03/24 09:52:41  strk
00183  * USE_INLINE => GEOS_INLINE
00184  *
00185  * Revision 1.1  2006/03/09 16:46:49  strk
00186  * geos::geom namespace definition, first pass at headers split
00187  *
00188  **********************************************************************/
00189 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1