70 std::vector<geos::geom::Point *> points;
73 const geos::geom::Envelope *polyBoundBox = multiPoly->getEnvelopeInternal();
86 geos::geom::Point *centroid = multiPoly->getCentroid();
87 double centerX = centroid->getX();
88 double centerY = centroid->getY();
91 int xStepsToCentroid = (int)((centerX - polyBoundBox->getMinX()) /
p_Xspacing + 0.5);
92 int yStepsToCentroid = (int)((centerY - polyBoundBox->getMinY()) /
p_Yspacing + 0.5);
93 double dRealMinX = centerX - (xStepsToCentroid *
p_Xspacing);
94 double dRealMinY = centerY - (yStepsToCentroid *
p_Yspacing);
98 for(
double y = dRealMinY; y <= polyBoundBox->getMaxY(); y +=
p_Yspacing) {
100 for(
double x = dRealMinX; x <= polyBoundBox->getMaxX(); x +=
p_Xspacing) {
101 geos::geom::Coordinate c(x + dDeltaXToReal, y + dDeltaYToReal);
102 geos::geom::Point *p = Isis::globalFactory.createPoint(c);
103 if(p->within(multiPoly)) {
104 points.push_back(Isis::globalFactory.createPoint(c));
107 geos::geom::Coordinate c2(x - dDeltaXToReal, y - dDeltaYToReal);
108 p = Isis::globalFactory.createPoint(c2);
109 if(p->within(multiPoly)) {
110 points.push_back(Isis::globalFactory.createPoint(c2));
144 QString msg =
"PVL for StripSeeder must contain [XSpacing] in [";
157 QString msg =
"PVL for StripSeeder must contain [YSpacing] in [";
163 QString msg =
"Improper format for PolygonSeeder PVL [" + pvl.
fileName() +
"]";
Isis::PolygonSeeder * StripPolygonSeederPlugin(Isis::Pvl &pvl)
Create a StripSeeder object.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
StripPolygonSeeder(Pvl &pvl)
Construct a StripPolygonSeeder algorithm.
Pvl * invalidInput
The Pvl passed in by the constructor minus what was used.
virtual void Parse(Pvl &pvl)
Parse the StripSeeder spicific parameters from the PVL.
This class is used as the base class for all PolygonSeeder objects.
QString fileName() const
Returns the filename used to initialise the Pvl object.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void addKeyword(const PvlKeyword &keyword, const InsertMode mode=Append)
Add a keyword to the container.
Contains multiple PvlContainers.
QString Algorithm() const
The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constr...
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
A single keyword-value pair.
double p_Xspacing
The spacing in the x direction between points.
Seed points using a grid with a staggered pattern.
std::vector< geos::geom::Point * > Seed(const geos::geom::MultiPolygon *mp)
Seed a polygon with points.
virtual void Parse(Pvl &pvl)
Initialize parameters in the PolygonSeeder class using a PVL specification.
Container for cube-like labels.
QString StandardTests(const geos::geom::MultiPolygon *multiPoly, const geos::geom::Envelope *polyBoundBox)
Check the polygon to see if it meets standard criteria.
double p_Yspacing
The spacing in the y direction between points.
double MinimumThickness()
Return the minimum allowed thickness of the polygon.
double MinimumArea()
Return the minimum allowed area of the polygon.
Adds specific functionality to C++ strings.
virtual PvlGroup PluginParameters(QString grpName)
Plugin parameters.
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
void deleteKeyword(const QString &name)
Remove a specified keyword.