Skip to content

Commit

Permalink
reorganize headers
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Nov 1, 2024
1 parent c972dd8 commit 7fc5059
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
5 changes: 0 additions & 5 deletions include/geos/operation/overlayng/EdgeMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@

#pragma once

#include <geos/operation/overlayng/OverlayLabel.h>
#include <geos/operation/overlayng/EdgeKey.h>
#include <geos/operation/overlayng/Edge.h>
#include <geos/export.h>

#include <vector>
#include <map>

Expand All @@ -31,7 +27,6 @@ class Coordinate;
namespace operation {
namespace overlayng {
class Edge;
class EdgeKey;
}
}
}
Expand Down
32 changes: 15 additions & 17 deletions include/geos/operation/overlayng/EdgeNodingBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#include <memory>
#include <deque>

using namespace geos::geom;
using namespace geos::noding;


namespace geos { // geos.
Expand All @@ -57,7 +55,7 @@ namespace overlayng { // geos.operation.overlayng
* - Extracts input edges, and attaches topological information
* - if clipping is enabled, handles clipping or limiting input geometry
* - chooses a {@link noding::Noder} based on provided precision model, unless a custom one is supplied
* - calls the chosen Noder, with precision model
* - calls the chosen noding::Noder, with precision model
* - removes any fully collapsed noded edges
* - builds {@link Edge}s and merges them
*
Expand All @@ -73,18 +71,18 @@ class GEOS_DLL EdgeNodingBuilder {

// Members
const PrecisionModel* pm;
std::unique_ptr<std::vector<SegmentString*>> inputEdges;
Noder* customNoder;
std::unique_ptr<std::vector<noding::SegmentString*>> inputEdges;
noding::Noder* customNoder;
std::array<bool, 2> hasEdges;
const Envelope* clipEnv;
std::unique_ptr<RingClipper> clipper;
std::unique_ptr<LineLimiter> limiter;

// For use in createFloatingPrecisionNoder()
algorithm::LineIntersector lineInt;
IntersectionAdder intAdder;
std::unique_ptr<Noder> internalNoder;
std::unique_ptr<Noder> spareInternalNoder;
noding::IntersectionAdder intAdder;
std::unique_ptr<noding::Noder> internalNoder;
std::unique_ptr<noding::Noder> spareInternalNoder;
// EdgeSourceInfo*, Edge* owned by EdgeNodingBuilder, stored in deque
std::deque<EdgeSourceInfo> edgeSourceInfoQue;
std::deque<Edge> edgeQue;
Expand All @@ -99,9 +97,9 @@ class GEOS_DLL EdgeNodingBuilder {
* - Floating precision: a conventional model (which may be non-robust).
* In this case, a validation step is applied to the output from the noder.
*/
Noder* getNoder();
static std::unique_ptr<Noder> createFixedPrecisionNoder(const PrecisionModel* pm);
std::unique_ptr<Noder> createFloatingPrecisionNoder(bool doValidation);
noding::Noder* getNoder();
static std::unique_ptr<noding::Noder> createFixedPrecisionNoder(const PrecisionModel* pm);
std::unique_ptr<noding::Noder> createFloatingPrecisionNoder(bool doValidation);


void addCollection(const GeometryCollection* gc, uint8_t geomIndex);
Expand Down Expand Up @@ -171,8 +169,8 @@ class GEOS_DLL EdgeNodingBuilder {
* which is used to provide source topology info to the constructed Edges
* (and is then discarded).
*/
std::vector<Edge*> node(std::vector<SegmentString*>* segStrings);
std::vector<Edge*> createEdges(std::vector<SegmentString*>* segStrings);
std::vector<Edge*> node(std::vector<noding::SegmentString*>* segStrings);
std::vector<Edge*> createEdges(std::vector<noding::SegmentString*>* segStrings);


public:
Expand All @@ -182,9 +180,9 @@ class GEOS_DLL EdgeNodingBuilder {
* If the noder is not provided, a suitable one will
* be used based on the supplied precision model.
*/
EdgeNodingBuilder(const PrecisionModel* p_pm, Noder* p_customNoder)
EdgeNodingBuilder(const PrecisionModel* p_pm, noding::Noder* p_customNoder)
: pm(p_pm)
, inputEdges(new std::vector<SegmentString*>)
, inputEdges(new std::vector<noding::SegmentString*>)
, customNoder(p_customNoder)
, hasEdges{{false,false}}
, clipEnv(nullptr)
Expand All @@ -195,15 +193,15 @@ class GEOS_DLL EdgeNodingBuilder {

~EdgeNodingBuilder()
{
for (SegmentString* ss: *inputEdges) {
for (noding::SegmentString* ss: *inputEdges) {
delete ss;
}
}

void setClipEnvelope(const Envelope* clipEnv);

// returns newly allocated vector and segmentstrings
// std::vector<SegmentString*>* node();
// std::vector<noding::SegmentString*>* node();

/**
* Reports whether there are noded edges
Expand Down
4 changes: 3 additions & 1 deletion src/operation/overlayng/EdgeMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include <geos/geom/Coordinate.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/util/Assert.h>

#include <geos/operation/overlayng/EdgeKey.h>
#include <geos/operation/overlayng/Edge.h>
#include <geos/operation/overlayng/OverlayLabel.h>

namespace geos { // geos
namespace operation { // geos.operation
Expand Down
12 changes: 9 additions & 3 deletions src/operation/overlayng/EdgeNodingBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <geos/noding/ValidatingNoder.h>
#include <geos/noding/NodedSegmentString.h>
#include <geos/noding/MCIndexNoder.h>
#include <geos/geom/Coordinate.h>
#include <geos/algorithm/Orientation.h>
#include <geos/noding/snapround/SnapRoundingNoder.h>
#include <geos/operation/overlayng/EdgeNodingBuilder.h>
Expand All @@ -28,13 +27,20 @@
#include <geos/operation/overlayng/OverlayUtil.h>
#include <geos/util.h>

using geos::operation::valid::RepeatedPointRemover;
using geos::noding::snapround::SnapRoundingNoder;

namespace geos { // geos
namespace operation { // geos.operation
namespace overlayng { // geos.operation.overlayng

using geos::operation::valid::RepeatedPointRemover;
using geos::noding::snapround::SnapRoundingNoder;
using geos::noding::Noder;
using geos::noding::MCIndexNoder;
using geos::noding::ValidatingNoder;
using geos::noding::SegmentString;
using geos::noding::NodedSegmentString;


/*private*/
Noder*
EdgeNodingBuilder::getNoder()
Expand Down

0 comments on commit 7fc5059

Please sign in to comment.