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

- File List

# PointBuilder.h

    00001 /**********************************************************************
    00002  * $Id: PointBuilder.h 2757 2009-12-01 15:39:41Z 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: operation/overlay/PointBuilder.java rev. 1.16 (JTS-1.10)
    00017  *
    00018  **********************************************************************/
    00019
    00020 #ifndef GEOS_OP_OVERLAY_POINTBUILDER_H
    00021 #define GEOS_OP_OVERLAY_POINTBUILDER_H
    00022
    00023 #include <geos/export.h>
    00024
    00025 #include <geos/geom/GeometryFactory.h> // for inlines
    00026 #include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
    00027 #include <geos/util.h>
    00028
    00029 #include <vector>
    00030
    00031 // Forward declarations
    00032 namespace geos {
    00033         namespace geom {
    00034                 class GeometryFactory;
    00035                 class Point;
    00036         }
    00037         namespace geomgraph {
    00038                 class Node;
    00039         }
    00040         namespace algorithm {
    00041                 class PointLocator;
    00042         }
    00043         namespace operation {
    00044                 namespace overlay {
    00045                         class OverlayOp;
    00046                 }
    00047         }
    00048 }
    00049
    00050 namespace geos {
    00051 namespace operation { // geos::operation
    00052 namespace overlay { // geos::operation::overlay
    00053
    00057 class GEOS_DLL PointBuilder {
    00058 private:
    00059
    00060         OverlayOp *op;
    00061         const geom::GeometryFactory *geometryFactory;
    00062         void extractNonCoveredResultNodes(OverlayOp::OpCode opCode);
    00063
    00064         /*
    00065          * Converts non-covered nodes to Point objects and adds them to
    00066          * the result.
    00067          *
    00068          * A node is covered if it is contained in another element Geometry
    00069          * with higher dimension (e.g. a node point might be contained in
    00070          * a polygon, in which case the point can be eliminated from
    00071          * the result).
    00072          *
    00073          * @param n the node to test
    00074          */
    00075         void filterCoveredNodeToPoint(const geomgraph::Node *);
    00076
    00080         std::vector<geom::Point*> *resultPointList;
    00081
    00082 public:
    00083
    00084         PointBuilder(OverlayOp *newOp,
    00085                         const geom::GeometryFactory *newGeometryFactory,
    00086                         algorithm::PointLocator *newPtLocator=NULL)
    00087                 :
    00088                 op(newOp),
    00089                 geometryFactory(newGeometryFactory),
    00090                 resultPointList(new std::vector<geom::Point *>())
    00091         {
    00092         ::geos::ignore_unused_variable_warning(newPtLocator);
    00093     }
    00094
    00099         std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
    00100 };
    00101
    00102
    00103 } // namespace geos::operation::overlay
    00104 } // namespace geos::operation
    00105 } // namespace geos
    00106
    00107 #endif // ndef GEOS_OP_OVERLAY_POINTBUILDER_H
    00108
    00109 /**********************************************************************
    00110  * $Log$
    00111  * Revision 1.2  2006/06/05 15:36:34  strk
    00112  * Given OverlayOp funx code enum a name and renamed values to have a lowercase prefix. Drop all of noding headers from installed header set.
    00113  *
    00114  * Revision 1.1  2006/03/17 13:24:59  strk
    00115  * 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).
    00116  *
    00117  **********************************************************************/
    00118