# SegmentNode.h

    00001 /**********************************************************************
    00002  * $Id: SegmentNode.h 1820 2006-09-06 16:54:23Z 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 #ifndef GEOS_NODING_SEGMENTNODE_H
    00017 #define GEOS_NODING_SEGMENTNODE_H
    00018
    00019 #include <vector>
    00020 #include <iostream>
    00021
    00022 #include <geos/inline.h>
    00023
    00024 #include <geos/geom/Coordinate.h>
    00025
    00026 // Forward declarations
    00027 namespace geos {
    00028         namespace noding {
    00029                 class SegmentString;
    00030         }
    00031 }
    00032
    00033 namespace geos {
    00034 namespace noding { // geos.noding
    00035
    00037 //
    00042 class SegmentNode {
    00043 private:
    00044         const SegmentString& segString;
    00045
    00046         int segmentOctant;
    00047
    00048         bool isInteriorVar;
    00049
    00050 public:
    00051         friend std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
    00052
    00054         geom::Coordinate coord;
    00055
    00057         unsigned int segmentIndex;
    00058
    00060         //
    00070         SegmentNode(const SegmentString& ss, const geom::Coordinate& nCoord,
    00071                         unsigned int nSegmentIndex, int nSegmentOctant);
    00072
    00073         ~SegmentNode() {}
    00074
    00080         bool isInterior() const { return isInteriorVar; }
    00081
    00082         bool isEndPoint(unsigned int maxSegmentIndex) const;
    00083
    00091         int compareTo(const SegmentNode& other);
    00092
    00093         //string print() const;
    00094 };
    00095
    00096 std::ostream& operator<< (std::ostream& os, const SegmentNode& n);
    00097
    00098 struct SegmentNodeLT {
    00099         bool operator()(SegmentNode *s1, SegmentNode *s2) const {
    00100                 return s1->compareTo(*s2)<0;
    00101         }
    00102 };
    00103
    00104
    00105 } // namespace geos.noding
    00106 } // namespace geos
    00107
    00108 //#ifdef GEOS_INLINE
    00109 //# include "geos/noding/SegmentNode.inl"
    00110 //#endif
    00111
    00112 #endif // GEOS_NODING_SEGMENTNODE_H
    00113
    00114 /**********************************************************************
    00115  * $Log$
    00116  * Revision 1.2  2006/03/24 09:52:41  strk
    00117  * USE_INLINE => GEOS_INLINE
    00118  *
    00119  * Revision 1.1  2006/03/09 16:46:49  strk
    00120  * geos::geom namespace definition, first pass at headers split
    00121  *
    00122  **********************************************************************/
    00123