BasicSegmentString.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
*
* 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: noding/BasicSegmentString.java rev. 1.1 (JTS-1.9)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/noding/BasicSegmentString.h>
#include <geos/noding/Octant.h>
#include <geos/noding/SegmentString.h> // for inheritance
#include <geos/geom/CoordinateSequence.h> // for inlines (size())
#include <vector>
// Forward declarations
namespace geos {
namespace noding { // geos.noding
class GEOS_DLL BasicSegmentString : public SegmentString {
public:
BasicSegmentString(geom::CoordinateSequence* newPts,
const void* newContext)
:
SegmentString(newContext, newPts)
{}
~BasicSegmentString() override
{}
// see dox in SegmentString.h
std::ostream& print(std::ostream& os) const override;
int getSegmentOctant(std::size_t index) const
{
if(index >= size() - 1) {
return -1;
}
return Octant::octant(getCoordinate(index), getCoordinate(index + 1));
};
private:
// Declare type as noncopyable
BasicSegmentString(const BasicSegmentString& other) = delete;
BasicSegmentString& operator=(const BasicSegmentString& rhs) = delete;
};
} // namespace geos.noding
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::noding::BasicSegmentString
Represents a list of contiguous line segments, and supports noding the segments.
Definition BasicSegmentString.h:44
geos::noding::BasicSegmentString::getSegmentOctant
int getSegmentOctant(std::size_t index) const
Gets the octant of the segment starting at vertex index.
Definition BasicSegmentString.h:72
geos::noding::BasicSegmentString::BasicSegmentString
BasicSegmentString(geom::CoordinateSequence *newPts, const void *newContext)
Construct a BasicSegmentString.
Definition BasicSegmentString.h:53
geos::noding::Octant::octant
static int octant(double dx, double dy)
geos::noding::SegmentString::SegmentString
SegmentString(const void *newContext, geom::CoordinateSequence *newSeq)
Construct a SegmentString.
Definition SegmentString.h:60
geos::index
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38