[geos-commits] [SCM] GEOS branch master updated. d111e8505e37839f95e3303ee7728a3236f72e07

git at osgeo.org git at osgeo.org
Sat Dec 19 13:55:08 PST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  d111e8505e37839f95e3303ee7728a3236f72e07 (commit)
       via  7bc3541b4a066696ff307d76dad769da1d6c93a6 (commit)
       via  e31f09d67c6cbe4c8917cdd804080f0c7e4840cd (commit)
       via  90b6216e39df69167f6d93d28bec4d9ccc423abe (commit)
       via  4b4c87298fc8570a400df0d3e6e249514a3f5ce0 (commit)
       via  2844fd1e4ead7f7149c09723553a72e88ce99868 (commit)
       via  7b15bbfb511a3adc47584b673b70ecdd61c06506 (commit)
       via  0b599622e2035f8c2cdef156ed81f202f0ca0894 (commit)
       via  1cfbdbcf73950fec6a21bb28e21e25fe87d9e478 (commit)
       via  04e98db3da4f89fb5380cb4541961a817c055a5c (commit)
      from  142466d2244614884386b1c49a23f8849857585c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d111e8505e37839f95e3303ee7728a3236f72e07
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 16:19:02 2020 -0500

    Another autotools fix

diff --git a/include/geos/noding/Makefile.am b/include/geos/noding/Makefile.am
index 467b52e..bd32ea2 100644
--- a/include/geos/noding/Makefile.am
+++ b/include/geos/noding/Makefile.am
@@ -41,4 +41,5 @@ geos_HEADERS = \
 	SimpleNoder.h \
 	SinglePassNoder.h \
 	NodingIntersectionFinder.h \
+	NodingIntersectionFinder.inl \
 	ValidatingNoder.h

commit 7bc3541b4a066696ff307d76dad769da1d6c93a6
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 15:27:53 2020 -0500

    Fix autotools build

diff --git a/include/geos/operation/overlayng/Makefile.am b/include/geos/operation/overlayng/Makefile.am
index 9c2f2b0..1e56fe2 100644
--- a/include/geos/operation/overlayng/Makefile.am
+++ b/include/geos/operation/overlayng/Makefile.am
@@ -23,6 +23,7 @@ geos_HEADERS = \
     LineLimiter.h \
     MaximalEdgeRing.h \
     OverlayEdge.h \
+    OverlayEdge.inl \
     OverlayEdgeRing.h \
     OverlayGraph.h \
     OverlayLabel.h \

commit e31f09d67c6cbe4c8917cdd804080f0c7e4840cd
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 15:08:35 2020 -0500

    Inline some methods of NodedSegmentString

diff --git a/include/geos/noding/Makefile.am b/include/geos/noding/Makefile.am
index c4cc74b..467b52e 100644
--- a/include/geos/noding/Makefile.am
+++ b/include/geos/noding/Makefile.am
@@ -23,6 +23,7 @@ geos_HEADERS = \
 	MCIndexSegmentSetMutualIntersector.h \
 	NodableSegmentString.h \
 	NodedSegmentString.h \
+	NodedSegmentString.inl \
 	Noder.h \
 	NodingValidator.h \
 	Octant.h \
diff --git a/include/geos/noding/NodedSegmentString.h b/include/geos/noding/NodedSegmentString.h
index bc28cbf..6f7578c 100644
--- a/include/geos/noding/NodedSegmentString.h
+++ b/include/geos/noding/NodedSegmentString.h
@@ -23,6 +23,7 @@
 #ifndef GEOS_NODING_NODEDSEGMENTSTRING_H
 #define GEOS_NODING_NODEDSEGMENTSTRING_H
 
+#include <geos/inline.h>
 #include <geos/export.h>
 #include <geos/noding/NodableSegmentString.h> // for inheritance
 #include <geos/geom/CoordinateSequence.h> // for inlines
@@ -187,4 +188,8 @@ private:
 #pragma warning(pop)
 #endif
 
+#ifdef GEOS_INLINE
+#include "geos/noding/NodedSegmentString.inl"
+#endif
+
 #endif // GEOS_NODING_NODEDSEGMENTSTRING_H
diff --git a/src/noding/NodedSegmentString.cpp b/include/geos/noding/NodedSegmentString.inl
similarity index 53%
copy from src/noding/NodedSegmentString.cpp
copy to include/geos/noding/NodedSegmentString.inl
index 771ea65..bf72c8e 100644
--- a/src/noding/NodedSegmentString.cpp
+++ b/include/geos/noding/NodedSegmentString.inl
@@ -3,6 +3,7 @@
  * GEOS - Geometry Engine Open Source
  * http://geos.osgeo.org
  *
+ * Copyright (C) 2020 Paul Ramsey <pramsey at cleverelephant.ca>
  * Copyright (C) 2011 Sandro Santilli <strk at kbt.io>
  * Copyright (C) 2006 Refractions Research Inc.
  * Copyright (C) 2001-2002 Vivid Solutions Inc.
@@ -12,38 +13,30 @@
  * by the Free Software Foundation.
  * See the COPYING file for more information.
  *
+ *
  **********************************************************************
  *
  * Last port: noding/NodedSegmentString.java r320 (JTS-1.12)
  *
  **********************************************************************/
 
+#ifndef GEOS_NODING_NODEDSEGMENTSTRING_INL
+#define GEOS_NODING_NODEDSEGMENTSTRING_INL
 
 #include <geos/noding/NodedSegmentString.h>
-#include <geos/noding/Octant.h>
 #include <geos/algorithm/LineIntersector.h>
+#include <geos/noding/Octant.h>
 
-using namespace geos::algorithm;
-using namespace geos::geom;
-
-namespace geos {
-namespace noding { // geos::noding
+#include <geos/util/IllegalArgumentException.h>
+#include <geos/util.h>
 
-const SegmentNodeList&
-NodedSegmentString::getNodeList() const
-{
-    return nodeList;
-}
 
-SegmentNodeList&
-NodedSegmentString::getNodeList()
-{
-    return nodeList;
-}
+namespace geos {
+namespace noding {
 
 /*static private*/
-int
-NodedSegmentString::safeOctant(const Coordinate& p0, const Coordinate& p1)
+INLINE int
+NodedSegmentString::safeOctant(const geom::Coordinate& p0, const geom::Coordinate& p1)
 {
     if(p0.equals2D(p1)) {
         return 0;
@@ -53,7 +46,7 @@ NodedSegmentString::safeOctant(const Coordinate& p0, const Coordinate& p1)
 
 
 /*public*/
-int
+INLINE int
 NodedSegmentString::getSegmentOctant(std::size_t index) const
 {
     if(index >= size() - 1) {
@@ -63,9 +56,10 @@ NodedSegmentString::getSegmentOctant(std::size_t index) const
     //return Octant::octant(getCoordinate(index), getCoordinate(index+1));
 }
 
+
 /*public*/
-void
-NodedSegmentString::addIntersections(LineIntersector* li,
+INLINE void
+NodedSegmentString::addIntersections(algorithm::LineIntersector* li,
                                      std::size_t segmentIndex, std::size_t geomIndex)
 {
     for(std::size_t i = 0, n = li->getIntersectionNum(); i < n; ++i) {
@@ -74,20 +68,20 @@ NodedSegmentString::addIntersections(LineIntersector* li,
 }
 
 /*public*/
-void
-NodedSegmentString::addIntersection(LineIntersector* li,
+INLINE void
+NodedSegmentString::addIntersection(algorithm::LineIntersector* li,
                                     std::size_t segmentIndex,
                                     std::size_t geomIndex, std::size_t intIndex)
 {
     ::geos::ignore_unused_variable_warning(geomIndex);
 
-    const Coordinate& intPt = li->getIntersection(intIndex);
+    const geom::Coordinate& intPt = li->getIntersection(intIndex);
     addIntersection(intPt, segmentIndex);
 }
 
 /*public*/
-void
-NodedSegmentString::addIntersection(const Coordinate& intPt,
+INLINE void
+NodedSegmentString::addIntersection(const geom::Coordinate& intPt,
                                     std::size_t segmentIndex)
 {
     std::size_t normalizedSegmentIndex = segmentIndex;
@@ -99,7 +93,7 @@ NodedSegmentString::addIntersection(const Coordinate& intPt,
     // normalize the intersection point location
     auto nextSegIndex = normalizedSegmentIndex + 1;
     if(nextSegIndex < size()) {
-        const Coordinate& nextPt = pts->getAt(nextSegIndex);
+        const geom::Coordinate& nextPt = pts->getAt(nextSegIndex);
 
         // Normalize segment index if intPt falls on vertex
         // The check for point equality is 2D only -
@@ -116,72 +110,7 @@ NodedSegmentString::addIntersection(const Coordinate& intPt,
     nodeList.add(intPt, normalizedSegmentIndex);
 }
 
-/* public static */
-void
-NodedSegmentString::getNodedSubstrings(
-    const SegmentString::NonConstVect& segStrings,
-    SegmentString::NonConstVect* resultEdgeList)
-{
-    assert(resultEdgeList);
-    for(SegmentString::NonConstVect::const_iterator
-            i = segStrings.begin(), iEnd = segStrings.end();
-            i != iEnd; ++i) {
-        NodedSegmentString* ss = dynamic_cast<NodedSegmentString*>(*i);
-        assert(ss);
-        ss->getNodeList().addSplitEdges(resultEdgeList);
-    }
-}
-
-/* public */
-std::vector<Coordinate>
-NodedSegmentString::getNodedCoordinates() {
-    return nodeList.getSplitCoordinates();
-}
-
-
-/* public static */
-SegmentString::NonConstVect*
-NodedSegmentString::getNodedSubstrings(
-    const SegmentString::NonConstVect& segStrings)
-{
-    SegmentString::NonConstVect* resultEdgelist = \
-            new SegmentString::NonConstVect();
-    getNodedSubstrings(segStrings, resultEdgelist);
-    return resultEdgelist;
-}
-
-/* virtual public */
-const geom::Coordinate&
-NodedSegmentString::getCoordinate(std::size_t i) const
-{
-    return pts->getAt(i);
-}
-
-/* virtual public */
-geom::CoordinateSequence*
-NodedSegmentString::getCoordinates() const
-{
-    return pts.get();
-}
-
-/* virtual public */
-bool
-NodedSegmentString::isClosed() const
-{
-    return pts->getAt(0) == pts->getAt(size() - 1);
 }
-
-/* public virtual */
-std::ostream&
-NodedSegmentString::print(std::ostream& os) const
-{
-    os << "NodedSegmentString: " << std::endl;
-    os << " LINESTRING" << *(pts) << ";" << std::endl;
-    os << " Nodes: " << nodeList.size() << std::endl;
-
-    return os;
 }
 
-
-} // geos::noding
-} // geos
+#endif
diff --git a/src/noding/NodedSegmentString.cpp b/src/noding/NodedSegmentString.cpp
index 771ea65..93c0756 100644
--- a/src/noding/NodedSegmentString.cpp
+++ b/src/noding/NodedSegmentString.cpp
@@ -20,7 +20,6 @@
 
 
 #include <geos/noding/NodedSegmentString.h>
-#include <geos/noding/Octant.h>
 #include <geos/algorithm/LineIntersector.h>
 
 using namespace geos::algorithm;
@@ -41,81 +40,6 @@ NodedSegmentString::getNodeList()
     return nodeList;
 }
 
-/*static private*/
-int
-NodedSegmentString::safeOctant(const Coordinate& p0, const Coordinate& p1)
-{
-    if(p0.equals2D(p1)) {
-        return 0;
-    }
-    return Octant::octant(p0, p1);
-}
-
-
-/*public*/
-int
-NodedSegmentString::getSegmentOctant(std::size_t index) const
-{
-    if(index >= size() - 1) {
-        return -1;
-    }
-    return safeOctant(getCoordinate(index), getCoordinate(index + 1));
-    //return Octant::octant(getCoordinate(index), getCoordinate(index+1));
-}
-
-/*public*/
-void
-NodedSegmentString::addIntersections(LineIntersector* li,
-                                     std::size_t segmentIndex, std::size_t geomIndex)
-{
-    for(std::size_t i = 0, n = li->getIntersectionNum(); i < n; ++i) {
-        addIntersection(li, segmentIndex, geomIndex, i);
-    }
-}
-
-/*public*/
-void
-NodedSegmentString::addIntersection(LineIntersector* li,
-                                    std::size_t segmentIndex,
-                                    std::size_t geomIndex, std::size_t intIndex)
-{
-    ::geos::ignore_unused_variable_warning(geomIndex);
-
-    const Coordinate& intPt = li->getIntersection(intIndex);
-    addIntersection(intPt, segmentIndex);
-}
-
-/*public*/
-void
-NodedSegmentString::addIntersection(const Coordinate& intPt,
-                                    std::size_t segmentIndex)
-{
-    std::size_t normalizedSegmentIndex = segmentIndex;
-
-    if(segmentIndex > size() - 2) {
-        throw util::IllegalArgumentException("SegmentString::addIntersection: SegmentIndex out of range");
-    }
-
-    // normalize the intersection point location
-    auto nextSegIndex = normalizedSegmentIndex + 1;
-    if(nextSegIndex < size()) {
-        const Coordinate& nextPt = pts->getAt(nextSegIndex);
-
-        // Normalize segment index if intPt falls on vertex
-        // The check for point equality is 2D only -
-        // Z values are ignored
-        if(intPt.equals2D(nextPt)) {
-            normalizedSegmentIndex = nextSegIndex;
-        }
-    }
-
-    /*
-     * Add the intersection point to edge intersection list
-     * (unless the node is already known)
-     */
-    nodeList.add(intPt, normalizedSegmentIndex);
-}
-
 /* public static */
 void
 NodedSegmentString::getNodedSubstrings(
@@ -185,3 +109,7 @@ NodedSegmentString::print(std::ostream& os) const
 
 } // geos::noding
 } // geos
+
+#ifndef GEOS_INLINE
+#include "geos/noding/NodedSegmentString.inl"
+#endif

commit 90b6216e39df69167f6d93d28bec4d9ccc423abe
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 14:58:22 2020 -0500

    Inline short methods of overlayng::OverlayEdge

diff --git a/include/geos/operation/overlayng/OverlayEdge.h b/include/geos/operation/overlayng/OverlayEdge.h
index b1126fb..02b8515 100644
--- a/include/geos/operation/overlayng/OverlayEdge.h
+++ b/include/geos/operation/overlayng/OverlayEdge.h
@@ -18,6 +18,7 @@
 #include <geos/geom/Location.h>
 
 #include <geos/export.h>
+#include <geos/inline.h>
 
 #include <memory>
 
@@ -171,3 +172,6 @@ public:
 } // namespace geos.operation
 } // namespace geos
 
+#ifdef GEOS_INLINE
+#include "geos/operation/overlayng/OverlayEdge.inl"
+#endif
diff --git a/src/operation/overlayng/OverlayEdge.cpp b/include/geos/operation/overlayng/OverlayEdge.inl
similarity index 57%
copy from src/operation/overlayng/OverlayEdge.cpp
copy to include/geos/operation/overlayng/OverlayEdge.inl
index 3566bf7..0c70a98 100644
--- a/src/operation/overlayng/OverlayEdge.cpp
+++ b/include/geos/operation/overlayng/OverlayEdge.inl
@@ -12,65 +12,60 @@
  *
  **********************************************************************/
 
-#include <geos/operation/overlayng/MaximalEdgeRing.h>
+#pragma once
+
 #include <geos/operation/overlayng/OverlayEdge.h>
-#include <geos/operation/overlayng/OverlayLabel.h>
-#include <geos/operation/overlayng/OverlayEdgeRing.h>
-#include <geos/geom/Location.h>
-#include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
-#include <geos/geom/CoordinateArraySequence.h>
-
-namespace geos {      // geos
-namespace operation { // geos.operation
-namespace overlayng { // geos.operation.overlayng
+#include <geos/operation/overlayng/OverlayLabel.h>
 
-using namespace geos::geom;
+namespace geos {
+namespace operation {
+namespace overlayng {
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isForward() const
 {
     return direction;
 }
 
 /*public*/
-const Coordinate&
+INLINE const Coordinate&
 OverlayEdge::directionPt() const
 {
     return dirPt;
 }
 
 /*public*/
-OverlayLabel*
+INLINE OverlayLabel*
 OverlayEdge::getLabel() const
 {
     return label;
 }
 
 /*public*/
-Location
+INLINE Location
 OverlayEdge::getLocation(int index, int position) const
 {
     return label->getLocation(index, position, direction);
 }
 
 /*public*/
-const Coordinate&
+INLINE const Coordinate&
 OverlayEdge::getCoordinate() const
 {
     return orig();
 }
 
 /*public*/
-const CoordinateSequence*
+INLINE const CoordinateSequence*
 OverlayEdge::getCoordinatesRO() const
 {
     return pts;
 }
 
 /*public*/
-std::unique_ptr<CoordinateSequence>
+INLINE std::unique_ptr<CoordinateSequence>
 OverlayEdge::OverlayEdge::getCoordinates()
 {
     // return a copy of pts
@@ -78,88 +73,42 @@ OverlayEdge::OverlayEdge::getCoordinates()
 }
 
 /*public*/
-std::unique_ptr<CoordinateSequence>
-OverlayEdge::getCoordinatesOriented()
-{
-    if (direction) {
-        return pts->clone();
-    }
-    std::unique_ptr<CoordinateSequence> ptsCopy = pts->clone();
-    CoordinateSequence::reverse(ptsCopy.get());
-    return ptsCopy;
-}
-
-/**
-* Adds the coordinates of this edge to the given list,
-* in the direction of the edge.
-* Duplicate coordinates are removed
-* (which means that this is safe to use for a path
-* of connected edges in the topology graph).
-*
-* @param coords the coordinate list to add to
-*/
-/*public*/
-void
-OverlayEdge::addCoordinates(CoordinateArraySequence* coords)
-{
-    bool isFirstEdge = coords->size() > 0;
-    if (direction) {
-        int startIndex = 1;
-        if (isFirstEdge) {
-            startIndex = 0;
-        }
-        for (std::size_t i = startIndex, sz = pts->size(); i < sz; i++) {
-            coords->add(pts->getAt(i), false);
-        }
-    }
-    else { // is backward
-        int startIndex = (int)(pts->size()) - 2;
-        if (isFirstEdge) {
-            startIndex = (int)(pts->size()) - 1;
-        }
-        for (int i = startIndex; i >= 0; i--) {
-            coords->add(pts->getAt(i), false);
-        }
-    }
-}
-
-/*public*/
-OverlayEdge*
+INLINE OverlayEdge*
 OverlayEdge::symOE() const
 {
     return static_cast<OverlayEdge*>(sym());
 }
 
 /*public*/
-OverlayEdge*
+INLINE OverlayEdge*
 OverlayEdge::oNextOE() const
 {
     return static_cast<OverlayEdge*>(oNext());
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isInResultArea() const
 {
     return m_isInResultArea;
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isInResultAreaBoth() const
 {
     return m_isInResultArea && symOE()->m_isInResultArea;
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isInResultEither() const
 {
     return isInResult() || symOE()->isInResult();
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::unmarkFromResultAreaBoth()
 {
     m_isInResultArea = false;
@@ -167,14 +116,14 @@ OverlayEdge::unmarkFromResultAreaBoth()
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::markInResultArea()
 {
     m_isInResultArea  = true;
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::markInResultAreaBoth()
 {
     m_isInResultArea  = true;
@@ -182,14 +131,14 @@ OverlayEdge::markInResultAreaBoth()
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isInResultLine() const
 {
     return m_isInResultLine;
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::markInResultLine()
 {
     m_isInResultLine  = true;
@@ -197,13 +146,13 @@ OverlayEdge::markInResultLine()
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isInResult() const
 {
     return m_isInResultArea || m_isInResultLine;
 }
 
-void
+INLINE void
 OverlayEdge::setNextResult(OverlayEdge* e)
 {
     // Assert: e.orig() == this.dest();
@@ -211,20 +160,20 @@ OverlayEdge::setNextResult(OverlayEdge* e)
 }
 
 /*public*/
-OverlayEdge*
+INLINE OverlayEdge*
 OverlayEdge::nextResult() const
 {
     return nextResultEdge;
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isResultLinked() const
 {
     return nextResultEdge != nullptr;
 }
 
-void
+INLINE void
 OverlayEdge::setNextResultMax(OverlayEdge* e)
 {
     // Assert: e.orig() == this.dest();
@@ -232,35 +181,35 @@ OverlayEdge::setNextResultMax(OverlayEdge* e)
 }
 
 /*public*/
-OverlayEdge*
+INLINE OverlayEdge*
 OverlayEdge::nextResultMax() const
 {
     return nextResultMaxEdge;
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isResultMaxLinked() const
 {
     return nextResultMaxEdge != nullptr;
 }
 
 /*public*/
-bool
+INLINE bool
 OverlayEdge::isVisited() const
 {
     return m_isVisited;
 }
 
 /*private*/
-void
+INLINE void
 OverlayEdge::markVisited()
 {
     m_isVisited = true;
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::markVisitedBoth()
 {
     markVisited();
@@ -268,61 +217,34 @@ OverlayEdge::markVisitedBoth()
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::setEdgeRing(const OverlayEdgeRing* p_edgeRing)
 {
     edgeRing = p_edgeRing;
 }
 
 /*public*/
-const OverlayEdgeRing*
+INLINE const OverlayEdgeRing*
 OverlayEdge::getEdgeRing() const
 {
     return edgeRing;
 }
 
 /*public*/
-const MaximalEdgeRing*
+INLINE const MaximalEdgeRing*
 OverlayEdge::getEdgeRingMax() const
 {
     return maxEdgeRing;
 }
 
 /*public*/
-void
+INLINE void
 OverlayEdge::setEdgeRingMax(const MaximalEdgeRing* p_maximalEdgeRing)
 {
     maxEdgeRing = p_maximalEdgeRing;
 }
 
-/*public friend*/
-std::ostream&
-operator<<(std::ostream& os, const OverlayEdge& oe)
-{
-    os << "OE( " << oe.orig();
-    if (oe.pts->size() > 2) {
-        os << ", " << oe.directionPt();
-    }
-    os << " .. " << oe.dest() << " ) ";
-    oe.label->toString(oe.direction, os);
-    os << oe.resultSymbol();
-    os << " / Sym: ";
-    oe.symOE()->getLabel()->toString(oe.symOE()->direction, os);
-    os << oe.symOE()->resultSymbol();
-    return os;
-}
 
-/*public*/
-std::string
-OverlayEdge::resultSymbol() const
-{
-    if (isInResultArea()) return std::string(" resA");
-    if (isInResultLine()) return std::string(" resL");
-    return std::string("");
 }
-
-
-
-} // namespace geos.operation.overlayng
-} // namespace geos.operation
-} // namespace geos
+}
+}
diff --git a/src/operation/overlayng/OverlayEdge.cpp b/src/operation/overlayng/OverlayEdge.cpp
index 3566bf7..025bc10 100644
--- a/src/operation/overlayng/OverlayEdge.cpp
+++ b/src/operation/overlayng/OverlayEdge.cpp
@@ -18,7 +18,6 @@
 #include <geos/operation/overlayng/OverlayEdgeRing.h>
 #include <geos/geom/Location.h>
 #include <geos/geom/Coordinate.h>
-#include <geos/geom/CoordinateSequence.h>
 #include <geos/geom/CoordinateArraySequence.h>
 
 namespace geos {      // geos
@@ -28,56 +27,6 @@ namespace overlayng { // geos.operation.overlayng
 using namespace geos::geom;
 
 /*public*/
-bool
-OverlayEdge::isForward() const
-{
-    return direction;
-}
-
-/*public*/
-const Coordinate&
-OverlayEdge::directionPt() const
-{
-    return dirPt;
-}
-
-/*public*/
-OverlayLabel*
-OverlayEdge::getLabel() const
-{
-    return label;
-}
-
-/*public*/
-Location
-OverlayEdge::getLocation(int index, int position) const
-{
-    return label->getLocation(index, position, direction);
-}
-
-/*public*/
-const Coordinate&
-OverlayEdge::getCoordinate() const
-{
-    return orig();
-}
-
-/*public*/
-const CoordinateSequence*
-OverlayEdge::getCoordinatesRO() const
-{
-    return pts;
-}
-
-/*public*/
-std::unique_ptr<CoordinateSequence>
-OverlayEdge::OverlayEdge::getCoordinates()
-{
-    // return a copy of pts
-    return pts->clone();
-}
-
-/*public*/
 std::unique_ptr<CoordinateSequence>
 OverlayEdge::getCoordinatesOriented()
 {
@@ -122,179 +71,6 @@ OverlayEdge::addCoordinates(CoordinateArraySequence* coords)
         }
     }
 }
-
-/*public*/
-OverlayEdge*
-OverlayEdge::symOE() const
-{
-    return static_cast<OverlayEdge*>(sym());
-}
-
-/*public*/
-OverlayEdge*
-OverlayEdge::oNextOE() const
-{
-    return static_cast<OverlayEdge*>(oNext());
-}
-
-/*public*/
-bool
-OverlayEdge::isInResultArea() const
-{
-    return m_isInResultArea;
-}
-
-/*public*/
-bool
-OverlayEdge::isInResultAreaBoth() const
-{
-    return m_isInResultArea && symOE()->m_isInResultArea;
-}
-
-/*public*/
-bool
-OverlayEdge::isInResultEither() const
-{
-    return isInResult() || symOE()->isInResult();
-}
-
-/*public*/
-void
-OverlayEdge::unmarkFromResultAreaBoth()
-{
-    m_isInResultArea = false;
-    symOE()->m_isInResultArea = false;
-}
-
-/*public*/
-void
-OverlayEdge::markInResultArea()
-{
-    m_isInResultArea  = true;
-}
-
-/*public*/
-void
-OverlayEdge::markInResultAreaBoth()
-{
-    m_isInResultArea  = true;
-    symOE()->m_isInResultArea = true;
-}
-
-/*public*/
-bool
-OverlayEdge::isInResultLine() const
-{
-    return m_isInResultLine;
-}
-
-/*public*/
-void
-OverlayEdge::markInResultLine()
-{
-    m_isInResultLine  = true;
-    symOE()->m_isInResultLine = true;
-}
-
-/*public*/
-bool
-OverlayEdge::isInResult() const
-{
-    return m_isInResultArea || m_isInResultLine;
-}
-
-void
-OverlayEdge::setNextResult(OverlayEdge* e)
-{
-    // Assert: e.orig() == this.dest();
-    nextResultEdge = e;
-}
-
-/*public*/
-OverlayEdge*
-OverlayEdge::nextResult() const
-{
-    return nextResultEdge;
-}
-
-/*public*/
-bool
-OverlayEdge::isResultLinked() const
-{
-    return nextResultEdge != nullptr;
-}
-
-void
-OverlayEdge::setNextResultMax(OverlayEdge* e)
-{
-    // Assert: e.orig() == this.dest();
-    nextResultMaxEdge = e;
-}
-
-/*public*/
-OverlayEdge*
-OverlayEdge::nextResultMax() const
-{
-    return nextResultMaxEdge;
-}
-
-/*public*/
-bool
-OverlayEdge::isResultMaxLinked() const
-{
-    return nextResultMaxEdge != nullptr;
-}
-
-/*public*/
-bool
-OverlayEdge::isVisited() const
-{
-    return m_isVisited;
-}
-
-/*private*/
-void
-OverlayEdge::markVisited()
-{
-    m_isVisited = true;
-}
-
-/*public*/
-void
-OverlayEdge::markVisitedBoth()
-{
-    markVisited();
-    symOE()->markVisited();
-}
-
-/*public*/
-void
-OverlayEdge::setEdgeRing(const OverlayEdgeRing* p_edgeRing)
-{
-    edgeRing = p_edgeRing;
-}
-
-/*public*/
-const OverlayEdgeRing*
-OverlayEdge::getEdgeRing() const
-{
-    return edgeRing;
-}
-
-/*public*/
-const MaximalEdgeRing*
-OverlayEdge::getEdgeRingMax() const
-{
-    return maxEdgeRing;
-}
-
-/*public*/
-void
-OverlayEdge::setEdgeRingMax(const MaximalEdgeRing* p_maximalEdgeRing)
-{
-    maxEdgeRing = p_maximalEdgeRing;
-}
-
 /*public friend*/
 std::ostream&
 operator<<(std::ostream& os, const OverlayEdge& oe)
@@ -326,3 +102,7 @@ OverlayEdge::resultSymbol() const
 } // namespace geos.operation.overlayng
 } // namespace geos.operation
 } // namespace geos
+
+#ifndef GEOS_INLINE
+#include "geos/operation/overlayng/OverlayEdge.inl"
+#endif

commit 4b4c87298fc8570a400df0d3e6e249514a3f5ce0
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 14:43:09 2020 -0500

    Inline small methods of overlayng::Edge

diff --git a/include/geos/operation/overlayng/Edge.h b/include/geos/operation/overlayng/Edge.h
index a2a2deb..d5cc3e7 100644
--- a/include/geos/operation/overlayng/Edge.h
+++ b/include/geos/operation/overlayng/Edge.h
@@ -14,6 +14,7 @@
 
 #pragma once
 
+#include <geos/inline.h>
 #include <geos/operation/overlayng/OverlayLabel.h>
 #include <geos/geom/Coordinate.h>
 #include <geos/export.h>
@@ -91,7 +92,7 @@ private:
     */
     void initLabel(OverlayLabel& lbl, int geomIndex, int dim, int depthDelta, bool isHole) const;
 
-    int labelDim(int dim, int depthDelta) const;
+    static int labelDim(int dim, int depthDelta);
     bool isHole(int index) const;
     bool isBoundary(int geomIndex) const;
 
@@ -101,12 +102,12 @@ private:
     */
     bool isShell(int geomIndex) const;
 
-    geom::Location locationRight(int depthDelta) const;
-    geom::Location locationLeft(int depthDelta) const;
+    static geom::Location locationRight(int depthDelta);
+    static geom::Location locationLeft(int depthDelta);
 
-    int delSign(int depthDel) const;
+    static int delSign(int depthDel);
     void copyInfo(const EdgeSourceInfo* info);
-    bool isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2) const;
+    static bool isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2);
 
 
 public:
@@ -153,7 +154,7 @@ public:
     */
     void merge(const Edge* edge);
 
-    void populateLabel(OverlayLabel &ovl) const;
+    void populateLabel(OverlayLabel &lbl) const;
 
     /*public*/
     bool compareTo(const Edge& e) const
@@ -191,3 +192,6 @@ bool EdgeComparator(const Edge* a, const Edge* b);
 } // namespace geos.operation
 } // namespace geos
 
+#ifdef GEOS_INLINE
+#include "geos/operation/overlayng/Edge.inl"
+#endif
diff --git a/src/operation/overlayng/Edge.cpp b/include/geos/operation/overlayng/Edge.inl
similarity index 56%
copy from src/operation/overlayng/Edge.cpp
copy to include/geos/operation/overlayng/Edge.inl
index f85b3ba..c680ea2 100644
--- a/src/operation/overlayng/Edge.cpp
+++ b/include/geos/operation/overlayng/Edge.inl
@@ -12,145 +12,108 @@
  *
  **********************************************************************/
 
+#pragma once
+
 #include <geos/operation/overlayng/Edge.h>
+#include <geos/geom/CoordinateSequence.h>
 #include <geos/operation/overlayng/EdgeSourceInfo.h>
+#include <geos/util/GEOSException.h>
+#include <geos/geom/Coordinate.h>
 #include <geos/geom/Dimension.h>
 #include <geos/geom/Location.h>
-#include <geos/geom/Coordinate.h>
-#include <geos/geom/GeometryFactory.h>
-#include <geos/geom/LineString.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/util/GEOSException.h>
-#include <geos/io/WKBWriter.h>
 
-
-namespace geos {      // geos
-namespace operation { // geos.operation
-namespace overlayng { // geos.operation.overlayng
-
-using namespace geos::geom;
-using geos::util::GEOSException;
+namespace geos {
+namespace operation {
+namespace overlayng {
 
 /*public*/
-Edge::Edge(CoordinateSequence* p_pts, const EdgeSourceInfo* info)
-    : aDim(OverlayLabel::DIM_UNKNOWN)
-    , aDepthDelta(0)
-    , aIsHole(false)
-    , bDim(OverlayLabel::DIM_UNKNOWN)
-    , bDepthDelta(0)
-    , bIsHole(false)
-    , pts(p_pts)
+INLINE bool
+Edge::direction() const
 {
-    copyInfo(info);
-}
+    if (pts->size() < 2) {
+        throw util::GEOSException("Edge must have >= 2 points");
+    }
+
+    const geom::Coordinate& p0 = pts->getAt(0);
+    const geom::Coordinate& p1 = pts->getAt(1);
+    const geom::Coordinate& pn0 = pts->getAt(pts->size() - 1);
+    const geom::Coordinate& pn1 = pts->getAt(pts->size() - 2);
+
+    int cmp = 0;
+    int cmp0 = p0.compareTo(pn0);
+    if (cmp0 != 0) cmp = cmp0;
+
+    if (cmp == 0) {
+        int cmp1 = p1.compareTo(pn1);
+        if (cmp1 != 0) cmp = cmp1;
+    }
 
-/*public static*/
-bool
-Edge::isCollapsed(const CoordinateSequence* pts) {
-    std::size_t sz = pts->size();
-    if (sz < 2)
-        return true;
-    // zero-length line
-    if (pts->getAt(0).equals2D(pts->getAt(1)))
-        return true;
-    // TODO: is pts > 2 with equal points ever expected?
-    if (sz > 2) {
-        if (pts->getAt(sz-1).equals2D(pts->getAt(sz - 2)))
-            return true;
+    if (cmp == 0) {
+        throw util::GEOSException("Edge direction cannot be determined because endpoints are equal");
     }
-    return false;
+
+    return cmp == -1;
 }
 
+
 /*public*/
-const CoordinateSequence*
+INLINE const geom::CoordinateSequence*
 Edge::getCoordinatesRO() const
 {
     return pts.get();
 }
 
 /*public*/
-std::unique_ptr<CoordinateSequence>
+INLINE std::unique_ptr<geom::CoordinateSequence>
 Edge::getCoordinates()
 {
-    // std::unique_ptr<CoordinateSequence> tmp = std::move(pts);
-    // pts.reset(nullptr);
     return pts->clone();
 }
 
 /*public*/
-geom::CoordinateSequence*
+INLINE geom::CoordinateSequence*
 Edge::releaseCoordinates()
 {
-    CoordinateSequence* cs = pts.release();
+    geom::CoordinateSequence* cs = pts.release();
     pts.reset(nullptr);
     return cs;
 }
 
 
 /*public*/
-const Coordinate&
+INLINE const geom::Coordinate&
 Edge::getCoordinate(std::size_t index)  const
 {
     return pts->getAt(index);
 }
 
 /*public*/
-std::size_t
+INLINE std::size_t
 Edge::size() const
 {
     return pts->size();
 }
 
-/*public*/
-bool
-Edge::direction() const
-{
-    if (pts->size() < 2) {
-        throw GEOSException("Edge must have >= 2 points");
-    }
-
-    const Coordinate& p0 = pts->getAt(0);
-    const Coordinate& p1 = pts->getAt(1);
-    const Coordinate& pn0 = pts->getAt(pts->size() - 1);
-    const Coordinate& pn1 = pts->getAt(pts->size() - 2);
-
-    int cmp = 0;
-    int cmp0 = p0.compareTo(pn0);
-    if (cmp0 != 0) cmp = cmp0;
-
-    if (cmp == 0) {
-        int cmp1 = p1.compareTo(pn1);
-        if (cmp1 != 0) cmp = cmp1;
-    }
-
-    if (cmp == 0) {
-        throw GEOSException("Edge direction cannot be determined because endpoints are equal");
-    }
-
-    return cmp == -1 ? true : false;
-}
-
 /**
 * Compares two coincident edges to determine
 * whether they have the same or opposite direction.
 */
 /*public*/
-bool
+INLINE bool
 Edge::relativeDirection(const Edge* edge2) const
 {
     // assert: the edges match (have the same coordinates up to direction)
     if (!getCoordinate(0).equals2D(edge2->getCoordinate(0))) {
-      return false;
+        return false;
     }
     if (!getCoordinate(1).equals2D(edge2->getCoordinate(1))) {
-      return false;
+        return false;
     }
     return true;
 }
 
 /*public*/
-int
+INLINE int
 Edge::dimension(int geomIndex) const
 {
     if (geomIndex == 0) return aDim;
@@ -158,55 +121,14 @@ Edge::dimension(int geomIndex) const
 }
 
 
-/**
-* Populates the label for an edge resulting from an input geometry.
-*  - If the edge is not part of the input, the label is left as NOT_PART
-*  - If input is an Area and the edge is on the boundary
-* (which may include some collapses),
-* edge is marked as an AREA edge and side locations are assigned
-*  - If input is an Area and the edge is collapsed
-* (depth delta = 0),
-* the label is set to COLLAPSE.
-* The location will be determined later
-* by evaluating the final graph topology.
-*  - If input is a Line edge is set to a LINE edge.
-* For line edges the line location is not significant
-* (since there is no parent area for which to determine location).
-*/
-/*private*/
-void
-Edge::initLabel(OverlayLabel& lbl, int geomIndex, int dim, int depthDelta, bool p_isHole) const
-{
-    int dimLabel = labelDim(dim, depthDelta);
-
-    switch (dimLabel) {
-        case OverlayLabel::DIM_NOT_PART: {
-            lbl.initNotPart(geomIndex);
-            break;
-        }
-        case OverlayLabel::DIM_BOUNDARY: {
-            lbl.initBoundary(geomIndex, locationLeft(depthDelta), locationRight(depthDelta), p_isHole);
-            break;
-        }
-        case OverlayLabel::DIM_COLLAPSE: {
-            lbl.initCollapse(geomIndex, p_isHole);
-            break;
-        }
-        case OverlayLabel::DIM_LINE: {
-            lbl.initLine(geomIndex);
-            break;
-        }
-    }
-}
-
 /*private*/
-int
-Edge::labelDim(int dim, int depthDelta) const
+INLINE int
+Edge::labelDim(int dim, int depthDelta)
 {
-    if (dim == Dimension::False)
+    if (dim == geom::Dimension::False)
         return OverlayLabel::DIM_NOT_PART;
 
-    if (dim == Dimension::L)
+    if (dim == geom::Dimension::L)
         return OverlayLabel::DIM_LINE;
 
     // assert: dim is A
@@ -218,7 +140,7 @@ Edge::labelDim(int dim, int depthDelta) const
 }
 
 /*private*/
-bool
+INLINE bool
 Edge::isHole(int index) const
 {
     if (index == 0)
@@ -228,7 +150,7 @@ Edge::isHole(int index) const
 
 
 /*private*/
-bool
+INLINE bool
 Edge::isBoundary(int geomIndex) const
 {
     if (geomIndex == 0)
@@ -241,7 +163,7 @@ Edge::isBoundary(int geomIndex) const
 * This is only the case if the edge is a boundary.
 */
 /*private*/
-bool
+INLINE bool
 Edge::isShell(int geomIndex) const
 {
     if (geomIndex == 0) {
@@ -251,8 +173,8 @@ Edge::isShell(int geomIndex) const
 }
 
 /*private*/
-Location
-Edge::locationRight(int depthDelta) const
+INLINE Location
+Edge::locationRight(int depthDelta)
 {
     int sgn = delSign(depthDelta);
     switch (sgn) {
@@ -264,8 +186,8 @@ Edge::locationRight(int depthDelta) const
 }
 
 /*private*/
-Location
-Edge::locationLeft(int depthDelta) const
+INLINE Location
+Edge::locationLeft(int depthDelta)
 {
     // TODO: is it always safe to ignore larger depth deltas?
     int sgn = delSign(depthDelta);
@@ -278,8 +200,8 @@ Edge::locationLeft(int depthDelta) const
 }
 
 /*private*/
-int
-Edge::delSign(int depthDel) const
+INLINE int
+Edge::delSign(int depthDel)
 {
     if (depthDel > 0) return 1;
     if (depthDel < 0) return -1;
@@ -287,7 +209,7 @@ Edge::delSign(int depthDel) const
 }
 
 /*private*/
-void
+INLINE void
 Edge::copyInfo(const EdgeSourceInfo* info)
 {
     if (info->getIndex() == 0) {
@@ -307,7 +229,7 @@ Edge::copyInfo(const EdgeSourceInfo* info)
 * updating the topology info accordingly.
 */
 /*public*/
-void
+INLINE void
 Edge::merge(const Edge* edge)
 {
     /**
@@ -328,8 +250,8 @@ Edge::merge(const Edge* edge)
 }
 
 /*private*/
-bool
-Edge::isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2) const
+INLINE bool
+Edge::isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2)
 {
     // TOD: this might be clearer with tri-state logic for isHole?
     bool isShell1 = edge1->isShell(geomIndex);
@@ -340,34 +262,13 @@ Edge::isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2) const
 }
 
 /*public*/
-void
+INLINE void
 Edge::populateLabel(OverlayLabel &lbl) const
 {
     initLabel(lbl, 0, aDim, aDepthDelta, aIsHole);
     initLabel(lbl, 1, bDim, bDepthDelta, bIsHole);
-    return;
 }
 
-
-/*public friend*/
-std::ostream&
-operator<<(std::ostream& os, const Edge& e)
-{
-    auto gf = GeometryFactory::create();
-    auto cs = e.getCoordinatesRO();
-    auto line = gf->createLineString(cs->clone());
-    io::WKBWriter w;
-    w.writeHEX(*line, os);
-    return os;
 }
-
-
-bool EdgeComparator(const Edge* a, const Edge* b)
-{
-    return a->compareTo(*b);
 }
-
-
-} // namespace geos.operation.overlayng
-} // namespace geos.operation
-} // namespace geos
+}
diff --git a/include/geos/operation/overlayng/Makefile.am b/include/geos/operation/overlayng/Makefile.am
index d49484d..9c2f2b0 100644
--- a/include/geos/operation/overlayng/Makefile.am
+++ b/include/geos/operation/overlayng/Makefile.am
@@ -9,7 +9,9 @@ geosdir = $(includedir)/geos/operation/overlayng
 
 geos_HEADERS = \
     Edge.h \
+    Edge.inl \
     EdgeKey.h \
+    EdgeKey.inl \
     EdgeMerger.h \
     EdgeNodingBuilder.h \
     EdgeSourceInfo.h \
diff --git a/src/operation/overlayng/Edge.cpp b/src/operation/overlayng/Edge.cpp
index f85b3ba..6d6066a 100644
--- a/src/operation/overlayng/Edge.cpp
+++ b/src/operation/overlayng/Edge.cpp
@@ -14,14 +14,8 @@
 
 #include <geos/operation/overlayng/Edge.h>
 #include <geos/operation/overlayng/EdgeSourceInfo.h>
-#include <geos/geom/Dimension.h>
-#include <geos/geom/Location.h>
-#include <geos/geom/Coordinate.h>
 #include <geos/geom/GeometryFactory.h>
 #include <geos/geom/LineString.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/geom/CoordinateSequence.h>
-#include <geos/util/GEOSException.h>
 #include <geos/io/WKBWriter.h>
 
 
@@ -62,102 +56,6 @@ Edge::isCollapsed(const CoordinateSequence* pts) {
     return false;
 }
 
-/*public*/
-const CoordinateSequence*
-Edge::getCoordinatesRO() const
-{
-    return pts.get();
-}
-
-/*public*/
-std::unique_ptr<CoordinateSequence>
-Edge::getCoordinates()
-{
-    // std::unique_ptr<CoordinateSequence> tmp = std::move(pts);
-    // pts.reset(nullptr);
-    return pts->clone();
-}
-
-/*public*/
-geom::CoordinateSequence*
-Edge::releaseCoordinates()
-{
-    CoordinateSequence* cs = pts.release();
-    pts.reset(nullptr);
-    return cs;
-}
-
-
-/*public*/
-const Coordinate&
-Edge::getCoordinate(std::size_t index)  const
-{
-    return pts->getAt(index);
-}
-
-/*public*/
-std::size_t
-Edge::size() const
-{
-    return pts->size();
-}
-
-/*public*/
-bool
-Edge::direction() const
-{
-    if (pts->size() < 2) {
-        throw GEOSException("Edge must have >= 2 points");
-    }
-
-    const Coordinate& p0 = pts->getAt(0);
-    const Coordinate& p1 = pts->getAt(1);
-    const Coordinate& pn0 = pts->getAt(pts->size() - 1);
-    const Coordinate& pn1 = pts->getAt(pts->size() - 2);
-
-    int cmp = 0;
-    int cmp0 = p0.compareTo(pn0);
-    if (cmp0 != 0) cmp = cmp0;
-
-    if (cmp == 0) {
-        int cmp1 = p1.compareTo(pn1);
-        if (cmp1 != 0) cmp = cmp1;
-    }
-
-    if (cmp == 0) {
-        throw GEOSException("Edge direction cannot be determined because endpoints are equal");
-    }
-
-    return cmp == -1 ? true : false;
-}
-
-/**
-* Compares two coincident edges to determine
-* whether they have the same or opposite direction.
-*/
-/*public*/
-bool
-Edge::relativeDirection(const Edge* edge2) const
-{
-    // assert: the edges match (have the same coordinates up to direction)
-    if (!getCoordinate(0).equals2D(edge2->getCoordinate(0))) {
-      return false;
-    }
-    if (!getCoordinate(1).equals2D(edge2->getCoordinate(1))) {
-      return false;
-    }
-    return true;
-}
-
-/*public*/
-int
-Edge::dimension(int geomIndex) const
-{
-    if (geomIndex == 0) return aDim;
-    return bDim;
-}
-
-
 /**
 * Populates the label for an edge resulting from an input geometry.
 *  - If the edge is not part of the input, the label is left as NOT_PART
@@ -199,156 +97,6 @@ Edge::initLabel(OverlayLabel& lbl, int geomIndex, int dim, int depthDelta, bool
     }
 }
 
-/*private*/
-int
-Edge::labelDim(int dim, int depthDelta) const
-{
-    if (dim == Dimension::False)
-        return OverlayLabel::DIM_NOT_PART;
-
-    if (dim == Dimension::L)
-        return OverlayLabel::DIM_LINE;
-
-    // assert: dim is A
-    bool isCollapse = (depthDelta == 0);
-    if (isCollapse)
-        return OverlayLabel::DIM_COLLAPSE;
-
-    return OverlayLabel::DIM_BOUNDARY;
-}
-
-/*private*/
-bool
-Edge::isHole(int index) const
-{
-    if (index == 0)
-        return aIsHole;
-    return bIsHole;
-}
-
-
-/*private*/
-bool
-Edge::isBoundary(int geomIndex) const
-{
-    if (geomIndex == 0)
-        return aDim == OverlayLabel::DIM_BOUNDARY;
-    return bDim == OverlayLabel::DIM_BOUNDARY;
-}
-
-/**
-* Tests whether the edge is part of a shell in the given geometry.
-* This is only the case if the edge is a boundary.
-*/
-/*private*/
-bool
-Edge::isShell(int geomIndex) const
-{
-    if (geomIndex == 0) {
-        return (aDim == OverlayLabel::DIM_BOUNDARY && ! aIsHole);
-    }
-    return (bDim == OverlayLabel::DIM_BOUNDARY && ! bIsHole);
-}
-
-/*private*/
-Location
-Edge::locationRight(int depthDelta) const
-{
-    int sgn = delSign(depthDelta);
-    switch (sgn) {
-        case 0: return Location::NONE;
-        case 1: return Location::INTERIOR;
-        case -1: return Location::EXTERIOR;
-    }
-    return Location::NONE;
-}
-
-/*private*/
-Location
-Edge::locationLeft(int depthDelta) const
-{
-    // TODO: is it always safe to ignore larger depth deltas?
-    int sgn = delSign(depthDelta);
-    switch (sgn) {
-        case 0: return Location::NONE;
-        case 1: return Location::EXTERIOR;
-        case -1: return Location::INTERIOR;
-    }
-    return Location::NONE;
-}
-
-/*private*/
-int
-Edge::delSign(int depthDel) const
-{
-    if (depthDel > 0) return 1;
-    if (depthDel < 0) return -1;
-    return 0;
-}
-
-/*private*/
-void
-Edge::copyInfo(const EdgeSourceInfo* info)
-{
-    if (info->getIndex() == 0) {
-        aDim = info->getDimension();
-        aIsHole = info->isHole();
-        aDepthDelta = info->getDepthDelta();
-    }
-    else {
-        bDim = info->getDimension();
-        bIsHole = info->isHole();
-        bDepthDelta = info->getDepthDelta();
-    }
-}
-
-/**
-* Merges an edge into this edge,
-* updating the topology info accordingly.
-*/
-/*public*/
-void
-Edge::merge(const Edge* edge)
-{
-    /**
-     * Marks this
-     * as a shell edge if any contributing edge is a shell.
-     * Update hole status first, since it depends on edge dim
-     */
-    aIsHole = isHoleMerged(0, this, edge);
-    bIsHole = isHoleMerged(1, this, edge);
-
-    if (edge->aDim > aDim) aDim = edge->aDim;
-    if (edge->bDim > bDim) bDim = edge->bDim;
-
-    bool relDir = relativeDirection(edge);
-    int flipFactor = relDir ? 1 : -1;
-    aDepthDelta += flipFactor * edge->aDepthDelta;
-    bDepthDelta += flipFactor * edge->bDepthDelta;
-}
-
-/*private*/
-bool
-Edge::isHoleMerged(int geomIndex, const Edge* edge1, const Edge* edge2) const
-{
-    // TOD: this might be clearer with tri-state logic for isHole?
-    bool isShell1 = edge1->isShell(geomIndex);
-    bool isShell2 = edge2->isShell(geomIndex);
-    bool isShellMerged = isShell1 || isShell2;
-    // flip since isHole is stored
-    return !isShellMerged;
-}
-
-/*public*/
-void
-Edge::populateLabel(OverlayLabel &lbl) const
-{
-    initLabel(lbl, 0, aDim, aDepthDelta, aIsHole);
-    initLabel(lbl, 1, bDim, bDepthDelta, bIsHole);
-    return;
-}
-
-
 /*public friend*/
 std::ostream&
 operator<<(std::ostream& os, const Edge& e)
@@ -361,7 +109,6 @@ operator<<(std::ostream& os, const Edge& e)
     return os;
 }
 
-
 bool EdgeComparator(const Edge* a, const Edge* b)
 {
     return a->compareTo(*b);
@@ -371,3 +118,7 @@ bool EdgeComparator(const Edge* a, const Edge* b)
 } // namespace geos.operation.overlayng
 } // namespace geos.operation
 } // namespace geos
+
+#ifndef GEOS_INLINE
+#include "geos/operation/overlayng/Edge.inl"
+#endif

commit 2844fd1e4ead7f7149c09723553a72e88ce99868
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 14:20:06 2020 -0500

    Inline short methods of NodingIntersectionFinder

diff --git a/include/geos/noding/NodingIntersectionFinder.h b/include/geos/noding/NodingIntersectionFinder.h
index 96a39cf..f279a4f 100644
--- a/include/geos/noding/NodingIntersectionFinder.h
+++ b/include/geos/noding/NodingIntersectionFinder.h
@@ -15,6 +15,7 @@
 #ifndef GEOS_NODING_NODINGINTERSECTIONFINDER_H
 #define GEOS_NODING_NODINGINTERSECTIONFINDER_H
 
+#include <geos/inline.h>
 #include <geos/noding/SegmentIntersector.h> // for inheritance
 #include <geos/geom/Coordinate.h> // for composition
 
@@ -183,7 +184,7 @@ private:
      * @param isEnd1 true if vertex is a segmentString endpoint
      * @return true if an intersection is found
     */
-    bool isInteriorVertexIntersection(
+    static bool isInteriorVertexIntersection(
         const geom::Coordinate& p0, const geom::Coordinate& p1,
         bool isEnd0, bool isEnd1);
 
@@ -203,7 +204,7 @@ private:
      * @param isEnd11 true if vertex is a segmentString endpoint
      * @return true if an intersection is found
      */
-    bool isInteriorVertexIntersection(
+    static bool isInteriorVertexIntersection(
         const geom::Coordinate& p00, const geom::Coordinate& p01,
         const geom::Coordinate& p10, const geom::Coordinate& p11,
         bool isEnd00, bool isEnd01, bool isEnd10, bool isEnd11);
@@ -216,7 +217,7 @@ private:
      * @param index the index of a segment in the segment string
      * @return true if the segment is an end segment
      */
-    bool isEndSegment(const SegmentString* segStr, std::size_t index);
+    static bool isEndSegment(const SegmentString* segStr, std::size_t index);
 
 
 };
@@ -224,4 +225,8 @@ private:
 } // namespace geos.noding
 } // namespace geos
 
+#ifdef GEOS_INLINE
+#include "geos/noding/NodingIntersectionFinder.inl"
+#endif
+
 #endif // GEOS_NODING_NODINGINTERSECTIONFINDER_H
diff --git a/include/geos/noding/NodingIntersectionFinder.inl b/include/geos/noding/NodingIntersectionFinder.inl
new file mode 100644
index 0000000..0d24d01
--- /dev/null
+++ b/include/geos/noding/NodingIntersectionFinder.inl
@@ -0,0 +1,80 @@
+/**********************************************************************
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.osgeo.org
+ *
+ * Copyright (C) 2006      Refractions Research Inc.
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************/
+
+#ifndef GEOS_NODING_NODINGINTERSECTIONFINDER_INL
+#define GEOS_NODING_NODINGINTERSECTIONFINDER_INL
+
+#include <geos/geom/Coordinate.h>
+#include <geos/noding/SegmentString.h>
+
+namespace geos {
+namespace noding {
+
+/* private */
+INLINE bool
+NodingIntersectionFinder::isEndSegment(const SegmentString* segStr, std::size_t index)
+{
+    if(index == 0) {
+        return true;
+    }
+    if(index >= segStr->size() - 2) {
+        return true;
+    }
+    return false;
+}
+
+/* private */
+INLINE bool
+NodingIntersectionFinder::isInteriorVertexIntersection(
+        const geom::Coordinate& p0, const geom::Coordinate& p1,
+        bool isEnd0, bool isEnd1)
+{
+    // Intersections between endpoints are valid nodes, so not reported
+    if(isEnd0 && isEnd1) {
+        return false;
+    }
+
+    if(p0.equals2D(p1)) {
+        return true;
+    }
+
+    return false;
+}
+
+/* private */
+INLINE bool
+NodingIntersectionFinder::isInteriorVertexIntersection(
+        const geom::Coordinate& p00, const geom::Coordinate& p01,
+        const geom::Coordinate& p10, const geom::Coordinate& p11,
+        bool isEnd00, bool isEnd01, bool isEnd10, bool isEnd11)
+{
+    if(isInteriorVertexIntersection(p00, p10, isEnd00, isEnd10)) {
+        return true;
+    }
+    if(isInteriorVertexIntersection(p00, p11, isEnd00, isEnd11)) {
+        return true;
+    }
+    if(isInteriorVertexIntersection(p01, p10, isEnd01, isEnd10)) {
+        return true;
+    }
+    if(isInteriorVertexIntersection(p01, p11, isEnd01, isEnd11)) {
+        return true;
+    }
+    return false;
+}
+
+}
+}
+
+#endif
diff --git a/src/noding/NodingIntersectionFinder.cpp b/src/noding/NodingIntersectionFinder.cpp
index d50c7bd..ffa55ff 100644
--- a/src/noding/NodingIntersectionFinder.cpp
+++ b/src/noding/NodingIntersectionFinder.cpp
@@ -28,59 +28,6 @@ using namespace geos::geom;
 namespace geos {
 namespace noding { // geos.noding
 
-/* private */
-bool
-NodingIntersectionFinder::isEndSegment(const SegmentString* segStr, std::size_t index)
-{
-    if(index == 0) {
-        return true;
-    }
-    if(index >= segStr->size() - 2) {
-        return true;
-    }
-    return false;
-}
-
-/* private */
-bool
-NodingIntersectionFinder::isInteriorVertexIntersection(
-    const Coordinate& p0, const Coordinate& p1,
-    bool isEnd0, bool isEnd1)
-{
-    // Intersections between endpoints are valid nodes, so not reported
-    if(isEnd0 && isEnd1) {
-        return false;
-    }
-
-    if(p0.equals2D(p1)) {
-        return true;
-    }
-
-    return false;
-}
-
-
-/* private */
-bool
-NodingIntersectionFinder::isInteriorVertexIntersection(
-    const Coordinate& p00, const Coordinate& p01, const Coordinate& p10, const Coordinate& p11,
-    bool isEnd00, bool isEnd01, bool isEnd10, bool isEnd11)
-{
-    if(isInteriorVertexIntersection(p00, p10, isEnd00, isEnd10)) {
-        return true;
-    }
-    if(isInteriorVertexIntersection(p00, p11, isEnd00, isEnd11)) {
-        return true;
-    }
-    if(isInteriorVertexIntersection(p01, p10, isEnd01, isEnd10)) {
-        return true;
-    }
-    if(isInteriorVertexIntersection(p01, p11, isEnd01, isEnd11)) {
-        return true;
-    }
-    return false;
-}
-
 
 /* public (override) */
 void
@@ -151,6 +98,9 @@ NodingIntersectionFinder::processIntersections(
     }
 }
 
+#ifndef GEOS_INLINE
+#include "geos/noding/NodingIntersectionFinder.inl"
+#endif
 
 } // namespace geos.noding
 } // namespace geos

commit 7b15bbfb511a3adc47584b673b70ecdd61c06506
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 14:12:31 2020 -0500

    Inline short methods of EdgeKey

diff --git a/include/geos/operation/overlayng/EdgeKey.h b/include/geos/operation/overlayng/EdgeKey.h
index b063e9b..2db040e 100644
--- a/include/geos/operation/overlayng/EdgeKey.h
+++ b/include/geos/operation/overlayng/EdgeKey.h
@@ -80,3 +80,7 @@ public:
 } // namespace geos.operation
 } // namespace geos
 
+#ifdef GEOS_INLINE
+#include "geos/operation/overlayng/EdgeKey.inl"
+#endif
+
diff --git a/src/operation/overlayng/EdgeKey.cpp b/include/geos/operation/overlayng/EdgeKey.inl
similarity index 75%
copy from src/operation/overlayng/EdgeKey.cpp
copy to include/geos/operation/overlayng/EdgeKey.inl
index d5d13e0..11a3010 100644
--- a/src/operation/overlayng/EdgeKey.cpp
+++ b/include/geos/operation/overlayng/EdgeKey.inl
@@ -12,26 +12,18 @@
  *
  **********************************************************************/
 
+#pragma once
+
 #include <geos/operation/overlayng/EdgeKey.h>
 #include <geos/operation/overlayng/Edge.h>
-#include <geos/geom/Dimension.h>
 #include <geos/geom/Coordinate.h>
-#include <geos/geom/CoordinateSequence.h>
-
-
-namespace geos {      // geos
-namespace operation { // geos.operation
-namespace overlayng { // geos.operation.overlayng
 
-using geos::geom::Coordinate;
-
-EdgeKey::EdgeKey(const Edge* edge)
-{
-    initPoints(edge);
-}
+namespace geos {
+namespace operation {
+namespace overlayng {
 
 /*private*/
-void
+INLINE void
 EdgeKey::initPoints(const Edge* edge)
 {
     bool direction = edge->direction();
@@ -47,8 +39,8 @@ EdgeKey::initPoints(const Edge* edge)
 }
 
 /*private*/
-void
-EdgeKey::init(const Coordinate& p0, const Coordinate& p1)
+INLINE void
+EdgeKey::init(const geom::Coordinate& p0, const geom::Coordinate& p1)
 {
     p0x = p0.x;
     p0y = p0.y;
@@ -57,7 +49,7 @@ EdgeKey::init(const Coordinate& p0, const Coordinate& p1)
 }
 
 /*public*/
-int
+INLINE int
 EdgeKey::compareTo(const EdgeKey* ek) const
 {
     if (p0x < ek->p0x) return -1;
@@ -73,30 +65,27 @@ EdgeKey::compareTo(const EdgeKey* ek) const
 }
 
 /*public*/
-bool
+INLINE bool
 EdgeKey::equals(const EdgeKey* ek) const
 {
     return p0x == ek->p0x
-        && p0y == ek->p0y
-        && p1x == ek->p1x
-        && p1y == ek->p1y;
+           && p0y == ek->p0y
+           && p1x == ek->p1x
+           && p1y == ek->p1y;
 }
 
-bool
+INLINE bool
 operator<(const EdgeKey& ek1, const EdgeKey& ek2)
 {
     return ek1.compareTo(&ek2) < 0;
 }
 
-bool
+INLINE bool
 operator==(const EdgeKey& ek1, const EdgeKey& ek2)
 {
     return ek1.equals(&ek2);
 }
 
-
-
-
-} // namespace geos.operation.overlayng
-} // namespace geos.operation
-} // namespace geos
+}
+}
+}
diff --git a/include/geos/operation/overlayng/Makefile.am b/include/geos/operation/overlayng/Makefile.am
index 8efcceb..d49484d 100644
--- a/include/geos/operation/overlayng/Makefile.am
+++ b/include/geos/operation/overlayng/Makefile.am
@@ -24,6 +24,7 @@ geos_HEADERS = \
     OverlayEdgeRing.h \
     OverlayGraph.h \
     OverlayLabel.h \
+    OverlayLabel.inl \
     OverlayLabeller.h \
     OverlayMixedPoints.h \
     OverlayPoints.h \
diff --git a/src/operation/overlayng/EdgeKey.cpp b/src/operation/overlayng/EdgeKey.cpp
index d5d13e0..537a86f 100644
--- a/src/operation/overlayng/EdgeKey.cpp
+++ b/src/operation/overlayng/EdgeKey.cpp
@@ -13,9 +13,7 @@
  **********************************************************************/
 
 #include <geos/operation/overlayng/EdgeKey.h>
-#include <geos/operation/overlayng/Edge.h>
 #include <geos/geom/Dimension.h>
-#include <geos/geom/Coordinate.h>
 #include <geos/geom/CoordinateSequence.h>
 
 
@@ -23,80 +21,16 @@ namespace geos {      // geos
 namespace operation { // geos.operation
 namespace overlayng { // geos.operation.overlayng
 
-using geos::geom::Coordinate;
-
 EdgeKey::EdgeKey(const Edge* edge)
 {
     initPoints(edge);
 }
 
-/*private*/
-void
-EdgeKey::initPoints(const Edge* edge)
-{
-    bool direction = edge->direction();
-    if (direction) {
-        init(edge->getCoordinate(0),
-             edge->getCoordinate(1));
-    }
-    else {
-        std::size_t len = edge->size();
-        init(edge->getCoordinate(len - 1),
-             edge->getCoordinate(len - 2));
-    }
-}
-
-/*private*/
-void
-EdgeKey::init(const Coordinate& p0, const Coordinate& p1)
-{
-    p0x = p0.x;
-    p0y = p0.y;
-    p1x = p1.x;
-    p1y = p1.y;
-}
-
-/*public*/
-int
-EdgeKey::compareTo(const EdgeKey* ek) const
-{
-    if (p0x < ek->p0x) return -1;
-    if (p0x > ek->p0x) return 1;
-    if (p0y < ek->p0y) return -1;
-    if (p0y > ek->p0y) return 1;
-    // first points are equal, compare second
-    if (p1x < ek->p1x) return -1;
-    if (p1x > ek->p1x) return 1;
-    if (p1y < ek->p1y) return -1;
-    if (p1y > ek->p1y) return 1;
-    return 0;
-}
-
-/*public*/
-bool
-EdgeKey::equals(const EdgeKey* ek) const
-{
-    return p0x == ek->p0x
-        && p0y == ek->p0y
-        && p1x == ek->p1x
-        && p1y == ek->p1y;
-}
-
-bool
-operator<(const EdgeKey& ek1, const EdgeKey& ek2)
-{
-    return ek1.compareTo(&ek2) < 0;
-}
-
-bool
-operator==(const EdgeKey& ek1, const EdgeKey& ek2)
-{
-    return ek1.equals(&ek2);
-}
-
-
-
-
 } // namespace geos.operation.overlayng
 } // namespace geos.operation
 } // namespace geos
+
+#ifndef GEOS_INLINE
+#include "geos/operation/overlayng/EdgeKey.inl"
+#endif
+

commit 0b599622e2035f8c2cdef156ed81f202f0ca0894
Merge: 1cfbdbc 04e98db
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 13:39:50 2020 -0500

    Merge branch 'inline' into line-intersector


commit 1cfbdbcf73950fec6a21bb28e21e25fe87d9e478
Author: Daniel Baston <dbaston at gmail.com>
Date:   Sat Dec 19 11:16:57 2020 -0500

    Inline simple methods of LineIntersector

diff --git a/include/geos/algorithm/LineIntersector.h b/include/geos/algorithm/LineIntersector.h
index ddec20d..9507bd7 100644
--- a/include/geos/algorithm/LineIntersector.h
+++ b/include/geos/algorithm/LineIntersector.h
@@ -20,6 +20,7 @@
 #ifndef GEOS_ALGORITHM_LINEINTERSECTOR_H
 #define GEOS_ALGORITHM_LINEINTERSECTOR_H
 
+#include <geos/inline.h>
 #include <geos/export.h>
 #include <string>
 
@@ -78,14 +79,14 @@ public:
     static double nonRobustComputeEdgeDistance(const geom::Coordinate& p, const geom::Coordinate& p1,
             const geom::Coordinate& p2);
 
-    LineIntersector(const geom::PrecisionModel* initialPrecisionModel = nullptr)
+    explicit LineIntersector(const geom::PrecisionModel* initialPrecisionModel = nullptr)
         :
         precisionModel(initialPrecisionModel),
         result(0),
         isProperVar(false)
     {}
 
-    ~LineIntersector() {}
+    ~LineIntersector() = default;
 
     /** \brief
      * Tests whether either intersection point is an interior point of
@@ -396,6 +397,9 @@ private:
 } // namespace geos::algorithm
 } // namespace geos
 
+#ifdef GEOS_INLINE
+# include "geos/algorithm/LineIntersector.inl"
+#endif
 
 #endif // GEOS_ALGORITHM_LINEINTERSECTOR_H
 
diff --git a/include/geos/algorithm/LineIntersector.inl b/include/geos/algorithm/LineIntersector.inl
new file mode 100644
index 0000000..56777fb
--- /dev/null
+++ b/include/geos/algorithm/LineIntersector.inl
@@ -0,0 +1,102 @@
+/**********************************************************************
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.osgeo.org
+ *
+ * Copyright (C) 2005-2006 Refractions Research Inc.
+ * Copyright (C) 2001-2002 Vivid Solutions Inc.
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************
+ *
+ * Last port: algorithm/RobustLineIntersector.java r785 (JTS-1.13+)
+ *
+ **********************************************************************/
+
+#ifndef GEOS_ALGORITHM_LINEINTERSECTOR_INL
+#define GEOS_ALGORITHM_LINEINTERSECTOR_INL
+
+#include <geos/algorithm/LineIntersector.h>
+#include <geos/geom/Coordinate.h>
+
+namespace geos {
+namespace algorithm {
+
+/*public*/
+INLINE bool
+LineIntersector::isInteriorIntersection()
+{
+    if(isInteriorIntersection(0)) {
+        return true;
+    }
+    if(isInteriorIntersection(1)) {
+        return true;
+    }
+    return false;
+}
+
+/*public*/
+INLINE bool
+LineIntersector::isInteriorIntersection(std::size_t inputLineIndex)
+{
+    for(std::size_t i = 0; i < result; ++i) {
+        if(!(intPt[i].equals2D(*inputLines[inputLineIndex][0])
+             || intPt[i].equals2D(*inputLines[inputLineIndex][1]))) {
+            return true;
+        }
+    }
+    return false;
+}
+
+/*public*/
+INLINE bool
+LineIntersector::isIntersection(const geom::Coordinate& pt) const
+{
+    for(std::size_t i = 0; i < result; ++i) {
+        if(intPt[i].equals2D(pt)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+/* private static */
+INLINE double
+LineIntersector::zGet(const geom::Coordinate& p, const geom::Coordinate& q)
+{
+    double z = p.z;
+    if ( std::isnan(z) ) {
+        z = q.z; // may be NaN
+    }
+    return z;
+}
+/* private static */
+INLINE double
+LineIntersector::zGetOrInterpolate(const geom::Coordinate& p, const geom::Coordinate& p1, const geom::Coordinate& p2)
+{
+    double z = p.z;
+    if (! std::isnan(z) ) return z;
+    return zInterpolate(p, p1, p2); // may be NaN
+}
+
+/* private static */
+INLINE geom::Coordinate
+LineIntersector::zGetOrInterpolateCopy(
+        const geom::Coordinate& p,
+        const geom::Coordinate& p1,
+        const geom::Coordinate& p2)
+{
+    geom::Coordinate pCopy = p;
+    double z = zGetOrInterpolate(p, p1, p2);
+    pCopy.z = z;
+    return pCopy;
+}
+
+}
+}
+
+#endif
diff --git a/include/geos/algorithm/Makefile.am b/include/geos/algorithm/Makefile.am
index 67fc727..ccebd53 100644
--- a/include/geos/algorithm/Makefile.am
+++ b/include/geos/algorithm/Makefile.am
@@ -27,6 +27,7 @@ geos_HEADERS = \
 	Intersection.h \
 	Length.h \
 	LineIntersector.h \
+	LineIntersector.inl \
 	MinimumBoundingCircle.h \
 	MinimumDiameter.h \
 	NotRepresentableException.h \
diff --git a/src/algorithm/LineIntersector.cpp b/src/algorithm/LineIntersector.cpp
index 3f17b6b..2448a52 100644
--- a/src/algorithm/LineIntersector.cpp
+++ b/src/algorithm/LineIntersector.cpp
@@ -134,17 +134,6 @@ LineIntersector::computeIntLineIndex()
     computeIntLineIndex(1);
 }
 
-/*public*/
-bool
-LineIntersector::isIntersection(const Coordinate& pt) const
-{
-    for(std::size_t i = 0; i < result; ++i) {
-        if(intPt[i].equals2D(pt)) {
-            return true;
-        }
-    }
-    return false;
-}
 
 /*public*/
 const Coordinate&
@@ -189,32 +178,6 @@ LineIntersector::getEdgeDistance(std::size_t segmentIndex, std::size_t intIndex)
     return dist;
 }
 
-/*public*/
-bool
-LineIntersector::isInteriorIntersection()
-{
-    if(isInteriorIntersection(0)) {
-        return true;
-    }
-    if(isInteriorIntersection(1)) {
-        return true;
-    }
-    return false;
-}
-
-/*public*/
-bool
-LineIntersector::isInteriorIntersection(std::size_t inputLineIndex)
-{
-    for(std::size_t i = 0; i < result; ++i) {
-        if(!(intPt[i].equals2D(*inputLines[inputLineIndex][0])
-                || intPt[i].equals2D(*inputLines[inputLineIndex][1]))) {
-            return true;
-        }
-    }
-    return false;
-}
-
 /*public static*/
 double
 LineIntersector::interpolateZ(const Coordinate& p,
@@ -624,17 +587,6 @@ LineIntersector::intersectionSafe(const Coordinate& p1, const Coordinate& p2,
 
 /* private static */
 double
-LineIntersector::zGet(const Coordinate& p, const Coordinate& q)
-{
-    double z = p.z;
-    if ( std::isnan(z) ) {
-        z = q.z; // may be NaN
-    }
-    return z;
-}
-
-/* private static */
-double
 LineIntersector::zInterpolate(const Coordinate& p, const Coordinate& p1, const Coordinate& p2)
 {
 #if GEOS_DEBUG
@@ -679,28 +631,6 @@ LineIntersector::zInterpolate(const Coordinate& p, const Coordinate& p1, const C
 }
 
 
-/* private static */
-double
-LineIntersector::zGetOrInterpolate(const Coordinate& p, const Coordinate& p1, const Coordinate& p2)
-{
-    double z = p.z;
-    if (! std::isnan(z) ) return z;
-    return zInterpolate(p, p1, p2); // may be NaN
-}
-
-/* private static */
-Coordinate
-LineIntersector::zGetOrInterpolateCopy(
-    const Coordinate& p,
-    const Coordinate& p1,
-    const Coordinate& p2)
-{
-    Coordinate pCopy = p;
-    double z = zGetOrInterpolate(p, p1, p2);
-    pCopy.z = z;
-    return pCopy;
-}
-
 
 double
 LineIntersector::zInterpolate(const Coordinate& p,
@@ -761,3 +691,7 @@ LineIntersector::nearestEndpoint(const Coordinate& p1, const Coordinate& p2,
 
 } // namespace geos.algorithm
 } // namespace geos
+
+#ifndef GEOS_INLINE
+# include "geos/algorithm/LineIntersector.inl"
+#endif

commit 04e98db3da4f89fb5380cb4541961a817c055a5c
Author: Daniel Baston <dbaston at gmail.com>
Date:   Wed Nov 25 23:11:21 2020 -0500

    Inline many methods of OverlayLabel

diff --git a/include/geos/operation/overlayng/OverlayLabel.h b/include/geos/operation/overlayng/OverlayLabel.h
index 6b7db1d..869682f 100644
--- a/include/geos/operation/overlayng/OverlayLabel.h
+++ b/include/geos/operation/overlayng/OverlayLabel.h
@@ -17,7 +17,7 @@
 #include <geos/geom/Location.h>
 #include <geos/geom/Position.h>
 #include <geos/export.h>
-
+#include <geos/inline.h>
 
 namespace geos {      // geos.
 namespace operation { // geos.operation
@@ -266,3 +266,7 @@ public:
 } // namespace geos.operation
 } // namespace geos
 
+#ifdef GEOS_INLINE
+#include "geos/operation/overlayng/OverlayLabel.inl"
+#endif
+
diff --git a/include/geos/operation/overlayng/OverlayLabel.inl b/include/geos/operation/overlayng/OverlayLabel.inl
new file mode 100644
index 0000000..9c8bb9e
--- /dev/null
+++ b/include/geos/operation/overlayng/OverlayLabel.inl
@@ -0,0 +1,237 @@
+/**********************************************************************
+ *
+ * GEOS - Geometry Engine Open Source
+ * http://geos.osgeo.org
+ *
+ * Copyright (C) 2020 Paul Ramsey <pramsey at cleverelephant.ca>
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Public Licence as published
+ * by the Free Software Foundation.
+ * See the COPYING file for more information.
+ *
+ **********************************************************************/
+
+#include <geos/operation/overlayng/OverlayLabel.h>
+
+namespace geos {
+namespace operation {
+namespace overlayng {
+
+/*public*/
+INLINE bool
+OverlayLabel::isLine() const
+{
+    return aDim == DIM_LINE || bDim == DIM_LINE;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isLine(int index) const
+{
+    return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isLinear(int index) const
+{
+    if (index == 0) {
+        return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
+    }
+    return bDim == DIM_LINE || bDim == DIM_COLLAPSE;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isKnown(int index) const
+{
+    if (index == 0) {
+        return aDim != DIM_UNKNOWN;
+    }
+    return bDim != DIM_UNKNOWN;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isNotPart(int index) const
+{
+    if (index == 0) {
+        return aDim == DIM_NOT_PART;
+    }
+    return bDim == DIM_NOT_PART;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isBoundaryEither() const
+{
+    return aDim == DIM_BOUNDARY || bDim == DIM_BOUNDARY;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isBoundaryBoth() const
+{
+    return aDim == DIM_BOUNDARY && bDim == DIM_BOUNDARY;
+}
+/*public*/
+INLINE bool
+OverlayLabel::isBoundaryCollapse() const
+{
+    if (isLine()) return false;
+    return ! isBoundaryBoth();
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isBoundary(int index) const
+{
+    if (index == 0) {
+        return aDim == DIM_BOUNDARY;
+    }
+    return bDim == DIM_BOUNDARY;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isBoundarySingleton() const
+{
+    if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
+        return true;
+    }
+
+    if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
+        return true;
+    }
+
+    return false;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isLineLocationUnknown(int index) const
+{
+    if (index == 0) {
+        return aLocLine == LOC_UNKNOWN;
+    }
+    else {
+        return bLocLine == LOC_UNKNOWN;
+    }
+}
+
+
+/*public*/
+INLINE bool
+OverlayLabel::isLineInArea(int index) const
+{
+    if (index == 0) {
+        return aLocLine == Location::INTERIOR;
+    }
+    return bLocLine == Location::INTERIOR;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isHole(int index) const
+{
+    if (index == 0) {
+        return aIsHole;
+    }
+    else {
+        return bIsHole;
+    }
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isCollapse(int index) const
+{
+    return dimension(index) == DIM_COLLAPSE;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isInteriorCollapse() const
+{
+    if (aDim == DIM_COLLAPSE && aLocLine == Location::INTERIOR)
+        return true;
+    if (bDim == DIM_COLLAPSE && bLocLine == Location::INTERIOR)
+        return true;
+
+    return false;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isBoundaryTouch() const
+{
+    return isBoundaryBoth() &&
+           getLocation(0, Position::RIGHT, true) != getLocation(1, Position::RIGHT, true);
+}
+
+/*public*/
+INLINE Location
+OverlayLabel::getLineLocation(int index) const
+{
+    if (index == 0) {
+        return aLocLine;
+    }
+    else {
+        return bLocLine;
+    }
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::isLineInterior(int index) const
+{
+    if (index == 0) {
+        return aLocLine == Location::INTERIOR;
+    }
+    return bLocLine == Location::INTERIOR;
+}
+/*public*/
+INLINE Location
+OverlayLabel::getLocationBoundaryOrLine(int index, int pos, bool isForward) const
+{
+    if (isBoundary(index)) {
+        return getLocation(index, pos, isForward);
+    }
+    return getLineLocation(index);
+}
+
+
+/*public*/
+INLINE Location
+OverlayLabel::getLocation(int index) const {
+    if (index == 0) {
+        return aLocLine;
+    }
+    return bLocLine;
+}
+
+/*public*/
+INLINE bool
+OverlayLabel::hasSides(int index) const {
+    if (index == 0) {
+        return aLocLeft != LOC_UNKNOWN
+               || aLocRight != LOC_UNKNOWN;
+    }
+    return bLocLeft != LOC_UNKNOWN
+           || bLocRight != LOC_UNKNOWN;
+}
+
+/*public*/
+INLINE OverlayLabel
+OverlayLabel::copy() const
+{
+    OverlayLabel lbl = *this;
+    return lbl;
+}
+
+
+}
+}
+}
+
diff --git a/src/operation/overlayng/OverlayLabel.cpp b/src/operation/overlayng/OverlayLabel.cpp
index bd2a83a..cb9167a 100644
--- a/src/operation/overlayng/OverlayLabel.cpp
+++ b/src/operation/overlayng/OverlayLabel.cpp
@@ -18,6 +18,10 @@ namespace geos {      // geos
 namespace operation { // geos.operation
 namespace overlayng { // geos.operation.overlayng
 
+#ifndef GEOS_INLINE
+#include "geos/operation/overlayng/OverlayLabel.inl"
+#endif
+
 /*public*/
 void
 OverlayLabel::initBoundary(int index, Location locLeft, Location locRight, bool p_isHole)
@@ -120,157 +124,6 @@ OverlayLabel::setLocationCollapse(int index)
     }
 }
 
-/*public*/
-bool
-OverlayLabel::isLine() const
-{
-    return aDim == DIM_LINE || bDim == DIM_LINE;
-}
-
-/*public*/
-bool
-OverlayLabel::isLine(int index) const
-{
-    return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
-}
-
-/*public*/
-bool
-OverlayLabel::isLinear(int index) const
-{
-    if (index == 0) {
-        return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
-    }
-    return bDim == DIM_LINE || bDim == DIM_COLLAPSE;
-}
-
-/*public*/
-bool
-OverlayLabel::isKnown(int index) const
-{
-    if (index == 0) {
-        return aDim != DIM_UNKNOWN;
-    }
-    return bDim != DIM_UNKNOWN;
-}
-
-/*public*/
-bool
-OverlayLabel::isNotPart(int index) const
-{
-    if (index == 0) {
-        return aDim == DIM_NOT_PART;
-    }
-    return bDim == DIM_NOT_PART;
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundaryEither() const
-{
-    return aDim == DIM_BOUNDARY || bDim == DIM_BOUNDARY;
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundaryBoth() const
-{
-    return aDim == DIM_BOUNDARY && bDim == DIM_BOUNDARY;
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundaryCollapse() const
-{
-    if (isLine()) return false;
-    return ! isBoundaryBoth();
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundaryTouch() const
-{
-    return isBoundaryBoth() &&
-        getLocation(0, Position::RIGHT, true) != getLocation(1, Position::RIGHT, true);
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundary(int index) const
-{
-    if (index == 0) {
-        return aDim == DIM_BOUNDARY;
-    }
-    return bDim == DIM_BOUNDARY;
-}
-
-/*public*/
-bool
-OverlayLabel::isBoundarySingleton() const
-{
-    if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
-        return true;
-    }
-
-    if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
-        return true;
-    }
-
-    return false;
-}
-
-/*public*/
-bool
-OverlayLabel::isLineLocationUnknown(int index) const
-{
-    if (index == 0) {
-        return aLocLine == LOC_UNKNOWN;
-    }
-    else {
-        return bLocLine == LOC_UNKNOWN;
-    }
-}
-
-/*public*/
-bool
-OverlayLabel::isLineInArea(int index) const
-{
-    if (index == 0) {
-        return aLocLine == Location::INTERIOR;
-    }
-    return bLocLine == Location::INTERIOR;
-}
-
-/*public*/
-bool
-OverlayLabel::isHole(int index) const
-{
-    if (index == 0) {
-        return aIsHole;
-    }
-    else {
-        return bIsHole;
-    }
-}
-
-/*public*/
-bool
-OverlayLabel::isCollapse(int index) const
-{
-    return dimension(index) == DIM_COLLAPSE;
-}
-
-/*public*/
-bool
-OverlayLabel::isInteriorCollapse() const
-{
-    if (aDim == DIM_COLLAPSE && aLocLine == Location::INTERIOR)
-        return true;
-    if (bDim == DIM_COLLAPSE && bLocLine == Location::INTERIOR)
-        return true;
-
-    return false;
-}
 
 /*public*/
 bool
@@ -291,28 +144,6 @@ OverlayLabel::isCollapseAndNotPartInterior() const
 
 /*public*/
 Location
-OverlayLabel::getLineLocation(int index) const
-{
-    if (index == 0) {
-        return aLocLine;
-    }
-    else {
-        return bLocLine;
-    }
-}
-
-/*public*/
-bool
-OverlayLabel::isLineInterior(int index) const
-{
-    if (index == 0) {
-        return aLocLine == Location::INTERIOR;
-    }
-    return bLocLine == Location::INTERIOR;
-}
-
-/*public*/
-Location
 OverlayLabel::getLocation(int index, int position, bool isForward) const
 {
     if (index == 0) {
@@ -338,47 +169,6 @@ OverlayLabel::getLocation(int index, int position, bool isForward) const
     return LOC_UNKNOWN;
 }
 
-
-/*public*/
-Location
-OverlayLabel::getLocationBoundaryOrLine(int index, int pos, bool isForward) const
-{
-    if (isBoundary(index)) {
-        return getLocation(index, pos, isForward);
-    }
-    return getLineLocation(index);
-}
-
-
-/*public*/
-Location
-OverlayLabel::getLocation(int index) const {
-    if (index == 0) {
-        return aLocLine;
-    }
-    return bLocLine;
-}
-
-/*public*/
-bool
-OverlayLabel::hasSides(int index) const {
-    if (index == 0) {
-        return aLocLeft != LOC_UNKNOWN
-            || aLocRight != LOC_UNKNOWN;
-    }
-    return bLocLeft != LOC_UNKNOWN
-        || bLocRight != LOC_UNKNOWN;
-}
-
-/*public*/
-OverlayLabel
-OverlayLabel::copy() const
-{
-    OverlayLabel lbl = *this;
-    return lbl;
-}
-
-
 /*private*/
 std::string
 OverlayLabel::dimensionSymbol(int dim) const

-----------------------------------------------------------------------

Summary of changes:
 include/geos/algorithm/LineIntersector.h           |   8 +-
 include/geos/algorithm/LineIntersector.inl         | 102 ++++++++
 include/geos/algorithm/Makefile.am                 |   1 +
 include/geos/noding/Makefile.am                    |   2 +
 include/geos/noding/NodedSegmentString.h           |   5 +
 .../geos/noding/NodedSegmentString.inl             | 115 ++-------
 include/geos/noding/NodingIntersectionFinder.h     |  11 +-
 include/geos/noding/NodingIntersectionFinder.inl   |  80 +++++++
 include/geos/operation/overlayng/Edge.h            |  16 +-
 .../geos/operation/overlayng/Edge.inl              | 221 +++++-------------
 include/geos/operation/overlayng/EdgeKey.h         |   4 +
 .../geos/operation/overlayng/EdgeKey.inl           |  47 ++--
 include/geos/operation/overlayng/Makefile.am       |   4 +
 include/geos/operation/overlayng/OverlayEdge.h     |   4 +
 .../geos/operation/overlayng/OverlayEdge.inl       | 156 ++++---------
 include/geos/operation/overlayng/OverlayLabel.h    |   6 +-
 include/geos/operation/overlayng/OverlayLabel.inl  | 237 +++++++++++++++++++
 src/algorithm/LineIntersector.cpp                  |  74 +-----
 src/noding/NodedSegmentString.cpp                  |  80 +------
 src/noding/NodingIntersectionFinder.cpp            |  56 +----
 src/operation/overlayng/Edge.cpp                   | 257 +--------------------
 src/operation/overlayng/EdgeKey.cpp                |  76 +-----
 src/operation/overlayng/OverlayEdge.cpp            | 228 +-----------------
 src/operation/overlayng/OverlayLabel.cpp           | 218 +----------------
 24 files changed, 636 insertions(+), 1372 deletions(-)
 create mode 100644 include/geos/algorithm/LineIntersector.inl
 copy src/noding/NodedSegmentString.cpp => include/geos/noding/NodedSegmentString.inl (53%)
 create mode 100644 include/geos/noding/NodingIntersectionFinder.inl
 copy src/operation/overlayng/Edge.cpp => include/geos/operation/overlayng/Edge.inl (56%)
 copy src/operation/overlayng/EdgeKey.cpp => include/geos/operation/overlayng/EdgeKey.inl (75%)
 copy src/operation/overlayng/OverlayEdge.cpp => include/geos/operation/overlayng/OverlayEdge.inl (57%)
 create mode 100644 include/geos/operation/overlayng/OverlayLabel.inl


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list