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

SegmentNode.h

00001 /**********************************************************************
00002  * $Id: SegmentNode.h 2778 2009-12-03 19:44:00Z mloskot $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2006      Refractions Research 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: noding/SegmentNode.java rev. 1.6 (JTS-1.9)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_NODING_SEGMENTNODE_H
00021 #define GEOS_NODING_SEGMENTNODE_H
00022 
00023 #include <geos/export.h>
00024 
00025 #include <vector>
00026 #include <iostream>
00027 
00028 #include <geos/inline.h>
00029 
00030 #include <geos/geom/Coordinate.h>
00031 
00032 // Forward declarations
00033 namespace geos {
00034         namespace noding {
00035                 class NodedSegmentString;
00036         }
00037 }
00038 
00039 namespace geos {
00040 namespace noding { // geos.noding
00041 
00043 //
00046 class GEOS_DLL SegmentNode {
00047 private:
00048         const NodedSegmentString& segString;
00049 
00050         int segmentOctant;
00051 
00052         bool isInteriorVar;
00053 
00054     // Declare type as noncopyable
00055     SegmentNode(const SegmentNode& other);
00056     SegmentNode& operator=(const SegmentNode& rhs);
00057 
00058 public:
00059         friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
00060 
00062         geom::Coordinate coord;  
00063 
00065         unsigned int segmentIndex;  
00066 
00068         //
00079         SegmentNode(const NodedSegmentString& ss,
00080                     const geom::Coordinate& nCoord,
00081                         unsigned int nSegmentIndex, int nSegmentOctant);
00082 
00083         ~SegmentNode() {}
00084 
00090         bool isInterior() const { return isInteriorVar; }
00091 
00092         bool isEndPoint(unsigned int maxSegmentIndex) const;
00093 
00101         int compareTo(const SegmentNode& other);
00102 
00103         //string print() const;
00104 };
00105 
00106 std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
00107 
00108 struct GEOS_DLL  SegmentNodeLT {
00109         bool operator()(SegmentNode *s1, SegmentNode *s2) const {
00110                 return s1->compareTo(*s2)<0;
00111         }
00112 };
00113 
00114 
00115 } // namespace geos.noding
00116 } // namespace geos
00117 
00118 //#ifdef GEOS_INLINE
00119 //# include "geos/noding/SegmentNode.inl"
00120 //#endif
00121 
00122 #endif // GEOS_NODING_SEGMENTNODE_H
00123 
00124 /**********************************************************************
00125  * $Log$
00126  * Revision 1.2  2006/03/24 09:52:41  strk
00127  * USE_INLINE => GEOS_INLINE
00128  *
00129  * Revision 1.1  2006/03/09 16:46:49  strk
00130  * geos::geom namespace definition, first pass at headers split
00131  *
00132  **********************************************************************/
00133 

Generated on Thu Jul 22 2010 for GEOS by  doxygen 1.7.1