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

# PointBuilder.h

    00001 /**********************************************************************
    00002  * $Id: PointBuilder.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_OP_OVERLAY_POINTBUILDER_H
    00017 #define GEOS_OP_OVERLAY_POINTBUILDER_H
    00018
    00019 #include <geos/geom/GeometryFactory.h> // for inlines
    00020 #include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
    00021
    00022 #include <vector>
    00023
    00024 // Forward declarations
    00025 namespace geos {
    00026         namespace geom {
    00027                 class GeometryFactory;
    00028                 class Point;
    00029         }
    00030         namespace geomgraph {
    00031                 class Node;
    00032         }
    00033         namespace algorithm {
    00034                 class PointLocator;
    00035         }
    00036         namespace operation {
    00037                 namespace overlay {
    00038                         class OverlayOp;
    00039                 }
    00040         }
    00041 }
    00042
    00043 namespace geos {
    00044 namespace operation { // geos::operation
    00045 namespace overlay { // geos::operation::overlay
    00046
    00050 class PointBuilder {
    00051 private:
    00052
    00053         OverlayOp *op;
    00054         const geom::GeometryFactory *geometryFactory;
    00055         void extractNonCoveredResultNodes(OverlayOp::OpCode opCode);
    00056
    00057         /*
    00058          * Converts non-covered nodes to Point objects and adds them to
    00059          * the result.
    00060          *
    00061          * A node is covered if it is contained in another element Geometry
    00062          * with higher dimension (e.g. a node point might be contained in
    00063          * a polygon, in which case the point can be eliminated from
    00064          * the result).
    00065          *
    00066          * @param n the node to test
    00067          */
    00068         void filterCoveredNodeToPoint(const geomgraph::Node *);
    00069
    00073         std::vector<geom::Point*> *resultPointList;
    00074
    00075 public:
    00076
    00077         PointBuilder(OverlayOp *newOp,
    00078                         const geom::GeometryFactory *newGeometryFactory,
    00079                         algorithm::PointLocator *newPtLocator=NULL)
    00080                 :
    00081                 op(newOp),
    00082                 geometryFactory(newGeometryFactory),
    00083                 resultPointList(new std::vector<geom::Point *>())
    00084         {}
    00085
    00090         std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
    00091 };
    00092
    00093
    00094 } // namespace geos::operation::overlay
    00095 } // namespace geos::operation
    00096 } // namespace geos
    00097
    00098 #endif // ndef GEOS_OP_OVERLAY_POINTBUILDER_H
    00099
    00100 /**********************************************************************
    00101  * $Log$
    00102  * Revision 1.2  2006/06/05 15:36:34  strk
    00103  * Given OverlayOp funx code enum a name and renamed values to have a lowercase prefix. Drop all of noding headers from installed header set.
    00104  *
    00105  * Revision 1.1  2006/03/17 13:24:59  strk
    00106  * opOverlay.h header splitted. Reduced header inclusions in operation/overlay implementation files. ElevationMatrixFilter code moved from own file to ElevationMatrix.cpp (ideally a class-private).
    00107  *
    00108  **********************************************************************/
    00109