Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

SegmentNode.h

00001 /**********************************************************************
00002  * $Id: SegmentNode.h 2556 2009-06-06 22:22:28Z strk $
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 public:
00055         friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
00056 
00058         geom::Coordinate coord;  
00059 
00061         unsigned int segmentIndex;  
00062 
00064         //
00075         SegmentNode(const NodedSegmentString& ss,
00076                     const geom::Coordinate& nCoord,
00077                         unsigned int nSegmentIndex, int nSegmentOctant);
00078 
00079         ~SegmentNode() {}
00080 
00086         bool isInterior() const { return isInteriorVar; }
00087 
00088         bool isEndPoint(unsigned int maxSegmentIndex) const;
00089 
00097         int compareTo(const SegmentNode& other);
00098 
00099         //string print() const;
00100 };
00101 
00102 std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
00103 
00104 struct GEOS_DLL  SegmentNodeLT {
00105         bool operator()(SegmentNode *s1, SegmentNode *s2) const {
00106                 return s1->compareTo(*s2)<0;
00107         }
00108 };
00109 
00110 
00111 } // namespace geos.noding
00112 } // namespace geos
00113 
00114 //#ifdef GEOS_INLINE
00115 //# include "geos/noding/SegmentNode.inl"
00116 //#endif
00117 
00118 #endif // GEOS_NODING_SEGMENTNODE_H
00119 
00120 /**********************************************************************
00121  * $Log$
00122  * Revision 1.2  2006/03/24 09:52:41  strk
00123  * USE_INLINE => GEOS_INLINE
00124  *
00125  * Revision 1.1  2006/03/09 16:46:49  strk
00126  * geos::geom namespace definition, first pass at headers split
00127  *
00128  **********************************************************************/
00129 

Generated on Thu Jun 11 06:17:01 2009 for GEOS by  doxygen 1.4.4