GEOS: MCPointInRing.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# MCPointInRing.h

    00001 /**********************************************************************
    00002  * $Id: MCPointInRing.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) 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 #ifndef GEOS_ALGORITHM_MCPOINTINRING_H
    00018 #define GEOS_ALGORITHM_MCPOINTINRING_H
    00019
    00020 #include <geos/export.h>
    00021 #include <geos/index/chain/MonotoneChainSelectAction.h> // for inheritance
    00022 #include <geos/algorithm/PointInRing.h> // for inheritance
    00023 #include <geos/geom/Coordinate.h> // for composition
    00024 #include <geos/index/bintree/Interval.h> // for composition
    00025
    00026 #include <vector>
    00027
    00028 // Forward declarations
    00029 namespace geos {
    00030         namespace geom {
    00031                 class Coordinate;
    00032                 class LineSegment;
    00033                 class LinearRing;
    00034                 class CoordinateSequence;
    00035                 class CoordinateSequence;
    00036         }
    00037         namespace index {
    00038                 namespace bintree {
    00039                         class Bintree;
    00040                         class Interval;
    00041                 }
    00042                 namespace chain {
    00043                         class MonotoneChain;
    00044                 }
    00045         }
    00046 }
    00047
    00048 namespace geos {
    00049 namespace algorithm { // geos::algorithm
    00050
    00051 class GEOS_DLL MCPointInRing: public PointInRing {
    00052 public:
    00053         MCPointInRing(const geom::LinearRing *newRing);
    00054         ~MCPointInRing();
    00055         bool isInside(const geom::Coordinate& pt);
    00056
    00057         void testLineSegment(const geom::Coordinate& p,
    00058                                 const geom::LineSegment& seg);
    00059
    00060         class MCSelecter: public index::chain::MonotoneChainSelectAction {
    00061         using MonotoneChainSelectAction::select;
    00062         private:
    00063                 geom::Coordinate p;
    00064                 MCPointInRing *parent;
    00065         public:
    00066                 MCSelecter(const geom::Coordinate& newP, MCPointInRing *prt);
    00067                 void select(const geom::LineSegment& ls);
    00068         };
    00069
    00070 private:
    00071         const geom::LinearRing *ring;
    00072         index::bintree::Interval interval;
    00073         geom::CoordinateSequence *pts;
    00074         index::bintree::Bintree *tree;
    00075         int crossings;  // number of segment/ray crossings
    00076         void buildIndex();
    00077         void testMonotoneChain(geom::Envelope *rayEnv,
    00078                         MCSelecter *mcSelecter,
    00079                         index::chain::MonotoneChain *mc);
    00080 };
    00081
    00082 } // namespace geos::algorithm
    00083 } // namespace geos
    00084
    00085 #endif // GEOS_ALGORITHM_MCPOINTINRING_H
    00086
    00087 /**********************************************************************
    00088  * $Log$
    00089  * Revision 1.4  2006/03/29 11:52:00  strk
    00090  * const correctness, useless heap allocations removal
    00091  *
    00092  * Revision 1.3  2006/03/22 18:12:31  strk
    00093  * indexChain.h header split.
    00094  *
    00095  * Revision 1.2  2006/03/22 16:01:33  strk
    00096  * indexBintree.h header split, classes renamed to match JTS
    00097  *
    00098  * Revision 1.1  2006/03/09 16:46:48  strk
    00099  * geos::geom namespace definition, first pass at headers split
    00100  *
    00101  **********************************************************************/
    00102