Skip to content

Commit

Permalink
remove using declarations and using explicit namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kikitte committed Oct 30, 2024
1 parent 936b730 commit 0a6fec7
Showing 1 changed file with 30 additions and 38 deletions.
68 changes: 30 additions & 38 deletions include/geos/operation/buffer/OffsetCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ namespace geos {
namespace operation {
namespace buffer {

using geos::geom::Coordinate;
using geos::geom::CoordinateSequence;
using geos::geom::Geometry;
using geos::geom::GeometryFactory;
using geos::geom::LineString;
using geos::geom::Polygon;


/**
* Computes an offset curve from a geometry.
* An offset curve is a linear geometry which is offset a given distance
Expand Down Expand Up @@ -94,27 +86,27 @@ class GEOS_DLL OffsetCurve {
private:

// Members
const Geometry& inputGeom;
const geom::Geometry& inputGeom;
double distance;
bool isJoined = false;

BufferParameters bufferParams;
double matchDistance;
const GeometryFactory* geomFactory;
const geom::GeometryFactory* geomFactory;

// Methods

std::unique_ptr<Geometry> computeCurve(
const LineString& lineGeom, double distance);
std::unique_ptr<geom::Geometry> computeCurve(
const geom::LineString& lineGeom, double distance);

std::vector<std::unique_ptr<OffsetCurveSection>> computeSections(
const LineString& lineGeom, double distance);
const geom::LineString& lineGeom, double distance);

std::unique_ptr<LineString> offsetSegment(
const CoordinateSequence* pts, double distance);
std::unique_ptr<geom::LineString> offsetSegment(
const geom::CoordinateSequence* pts, double distance);

static std::unique_ptr<Polygon> getBufferOriented(
const LineString& geom, double distance,
static std::unique_ptr<geom::Polygon> getBufferOriented(
const geom::LineString& geom, double distance,
BufferParameters& bufParams);

/**
Expand All @@ -125,11 +117,11 @@ class GEOS_DLL OffsetCurve {
* @param geom a geometry
* @return the polygon element of largest area
*/
static const Polygon* extractMaxAreaPolygon(const Geometry* geom);
static const geom::Polygon* extractMaxAreaPolygon(const geom::Geometry* geom);

void computeCurveSections(
const CoordinateSequence* bufferRingPts,
const CoordinateSequence& rawCurve,
const geom::CoordinateSequence* bufferRingPts,
const geom::CoordinateSequence& rawCurve,
std::vector<std::unique_ptr<OffsetCurveSection>>& sections);

/**
Expand All @@ -145,15 +137,15 @@ class GEOS_DLL OffsetCurve {
* @return the index of the minimum matched buffer segment
*/
std::size_t matchSegments(
const Coordinate& raw0, const Coordinate& raw1,
const geom::Coordinate& raw0, const geom::Coordinate& raw1,
std::size_t rawCurveIndex,
SegmentMCIndex& bufferSegIndex,
const CoordinateSequence* bufferPts,
const geom::CoordinateSequence* bufferPts,
std::vector<double>& rawCurvePos);

static double segmentMatchFrac(
const Coordinate& p0, const Coordinate& p1,
const Coordinate& seg0, const Coordinate& seg1,
const geom::Coordinate& p0, const geom::Coordinate& p1,
const geom::Coordinate& seg0, const geom::Coordinate& seg1,
double matchDistance);

/**
Expand All @@ -168,7 +160,7 @@ class GEOS_DLL OffsetCurve {
* @param sections the list of extracted offset curve sections
*/
void extractSections(
const CoordinateSequence* ringPts,
const geom::CoordinateSequence* ringPts,
std::vector<double>& rawCurveLoc,
std::size_t startIndex,
std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
Expand Down Expand Up @@ -207,7 +199,7 @@ class GEOS_DLL OffsetCurve {
*
* @see BufferParameters
*/
OffsetCurve(const Geometry& geom, double dist)
OffsetCurve(const geom::Geometry& geom, double dist)
: inputGeom(geom)
, distance(dist)
, matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
Expand All @@ -227,7 +219,7 @@ class GEOS_DLL OffsetCurve {
* @param dist the offset distance (positive for left, negative for right)
* @param bp the buffer parameters to use
*/
OffsetCurve(const Geometry& geom, double dist, BufferParameters& bp)
OffsetCurve(const geom::Geometry& geom, double dist, BufferParameters& bp)
: inputGeom(geom)
, distance(dist)
, matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
Expand Down Expand Up @@ -261,15 +253,15 @@ class GEOS_DLL OffsetCurve {
*/
void setJoined(bool pIsJoined);

static std::unique_ptr<Geometry> getCurve(
const Geometry& geom,
static std::unique_ptr<geom::Geometry> getCurve(
const geom::Geometry& geom,
double dist,
int quadSegs,
BufferParameters::JoinStyle joinStyle,
double mitreLimit);

static std::unique_ptr<Geometry> getCurve(
const Geometry& geom, double dist);
static std::unique_ptr<geom::Geometry> getCurve(
const geom::Geometry& geom, double dist);

/**
* Computes the offset curve of a geometry at a given distance,
Expand All @@ -279,15 +271,15 @@ class GEOS_DLL OffsetCurve {
* @param dist the offset distance (positive for left, negative for right)
* @return the joined offset curve
*/
static std::unique_ptr<Geometry> getCurveJoined(
const Geometry& geom, double dist);
static std::unique_ptr<geom::Geometry> getCurveJoined(
const geom::Geometry& geom, double dist);

/**
* Gets the computed offset curve lines.
*
* @return the offset curve geometry
*/
std::unique_ptr<Geometry> getCurve();
std::unique_ptr<geom::Geometry> getCurve();

/**
* Gets the raw offset curve for a line at a given distance.
Expand All @@ -302,8 +294,8 @@ class GEOS_DLL OffsetCurve {
* @param bufParams the buffer parameters to use
* @return the raw offset curve points
*/
static std::unique_ptr<CoordinateSequence> rawOffsetCurve(
const LineString& line,
static std::unique_ptr<geom::CoordinateSequence> rawOffsetCurve(
const geom::LineString& line,
double distance,
BufferParameters& bufParams);

Expand All @@ -315,8 +307,8 @@ class GEOS_DLL OffsetCurve {
* @param distance the offset distance (positive for left, negative for right)
* @return the raw offset curve points
*/
static std::unique_ptr<CoordinateSequence> rawOffset(
const LineString& line,
static std::unique_ptr<geom::CoordinateSequence> rawOffset(
const geom::LineString& line,
double distance);

};
Expand Down

0 comments on commit 0a6fec7

Please sign in to comment.