SineStarFactory.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 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: geom/util/SineStarFactory.java r378 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/util/GeometricShapeFactory.h> // for inheritance
#include <memory>
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
class Envelope;
class Polygon;
class GeometryFactory;
class PrecisionModel;
class LineString;
}
}
namespace geos {
namespace geom { // geos::geom
namespace util { // geos::geom::util
class GEOS_DLL SineStarFactory : public geos::util::GeometricShapeFactory {
protected:
int numArms;
double armLengthRatio;
public:
SineStarFactory(const geom::GeometryFactory* fact)
:
geos::util::GeometricShapeFactory(fact),
numArms(8),
armLengthRatio(0.5)
{}
void
setNumArms(int nArms)
{
numArms = nArms;
}
void
setArmLengthRatio(double armLenRatio)
{
armLengthRatio = armLenRatio;
}
std::unique_ptr<Polygon> createSineStar() const;
};
} // namespace geos::geom::util
} // namespace geos::geom
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::GeometryFactory
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:70
geos::geom::LineString
Definition LineString.h:66
geos::geom::Polygon
Represents a linear polygon, which may include holes.
Definition Polygon.h:61
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
geos::geom::util::SineStarFactory::setArmLengthRatio
void setArmLengthRatio(double armLenRatio)
Definition SineStarFactory.h:100
geos::geom::util::SineStarFactory::setNumArms
void setNumArms(int nArms)
Definition SineStarFactory.h:87
geos::geom::util::SineStarFactory::SineStarFactory
SineStarFactory(const geom::GeometryFactory *fact)
Definition SineStarFactory.h:74
geos::geom::util::SineStarFactory::createSineStar
std::unique_ptr< Polygon > createSineStar() const
geos::util::GeometricShapeFactory
Computes various kinds of common geometric shapes.
Definition GeometricShapeFactory.h:66
geos::util::GeometricShapeFactory::GeometricShapeFactory
GeometricShapeFactory(const geom::GeometryFactory *factory)
Create a shape factory which will create shapes using the given GeometryFactory.
geos::geom::util
Provides classes that parse and modify Geometry objects.
Definition ComponentCoordinateExtracter.h:28
geos::geom
Definition Angle.h:26
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38