GEOS  3.9.1dev
PointBuilder.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  ***********************************************************************
14  *
15  * Last port: operation/overlay/PointBuilder.java rev. 1.16 (JTS-1.10)
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_OP_OVERLAY_POINTBUILDER_H
20 #define GEOS_OP_OVERLAY_POINTBUILDER_H
21 
22 #include <geos/export.h>
23 
24 #include <geos/geom/GeometryFactory.h> // for inlines
25 #include <geos/operation/overlay/OverlayOp.h> // for OpCode enum
26 #include <geos/util.h>
27 
28 #include <vector>
29 
30 // Forward declarations
31 namespace geos {
32 namespace geom {
33 class GeometryFactory;
34 class Point;
35 }
36 namespace geomgraph {
37 class Node;
38 }
39 namespace algorithm {
40 class PointLocator;
41 }
42 namespace operation {
43 namespace overlay {
44 class OverlayOp;
45 }
46 }
47 }
48 
49 namespace geos {
50 namespace operation { // geos::operation
51 namespace overlay { // geos::operation::overlay
52 
57 private:
58 
61  void extractNonCoveredResultNodes(OverlayOp::OpCode opCode);
62 
63  /*
64  * Converts non-covered nodes to Point objects and adds them to
65  * the result.
66  *
67  * A node is covered if it is contained in another element Geometry
68  * with higher dimension (e.g. a node point might be contained in
69  * a polygon, in which case the point can be eliminated from
70  * the result).
71  *
72  * @param n the node to test
73  */
74  void filterCoveredNodeToPoint(const geomgraph::Node*);
75 
79  std::vector<geom::Point*>* resultPointList;
80 
81  PointBuilder(const PointBuilder&) = delete;
82  PointBuilder& operator=(const PointBuilder&) = delete;
83 
84 public:
85 
87  const geom::GeometryFactory* newGeometryFactory,
88  algorithm::PointLocator* newPtLocator = nullptr)
89  :
90  op(newOp),
91  geometryFactory(newGeometryFactory),
92  resultPointList(new std::vector<geom::Point *>())
93  {
95  }
96 
101  std::vector<geom::Point*>* build(OverlayOp::OpCode opCode);
102 };
103 
104 
105 } // namespace geos::operation::overlay
106 } // namespace geos::operation
107 } // namespace geos
108 
109 #endif // ndef GEOS_OP_OVERLAY_POINTBUILDER_H
PointBuilder(OverlayOp *newOp, const geom::GeometryFactory *newGeometryFactory, algorithm::PointLocator *newPtLocator=nullptr)
Definition: PointBuilder.h:86
const geom::GeometryFactory * geometryFactory
Definition: PointBuilder.h:60
#define GEOS_DLL
Definition: export.h:28
OpCode
The spatial functions supported by this class.
Definition: OverlayOp.h:79
Computes the geometric overlay of two Geometry.
Definition: OverlayOp.h:70
Computes the topological relationship (Location) of a single point to a Geometry. ...
Definition: PointLocator.h:57
Constructs geom::Point s from the nodes of an overlay graph.
Definition: PointBuilder.h:56
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Basic namespace for all GEOS functionalities.
void ignore_unused_variable_warning(T const &)
Definition: util.h:44
The node component of a geometry graph.
std::vector< geom::Point * > * resultPointList
Definition: PointBuilder.h:79