Isis 3 Programmer Reference
Isis::LimitPolygonSeeder Class Reference

Seed points using a grid. More...

#include <LimitPolygonSeeder.h>

Inheritance diagram for Isis::LimitPolygonSeeder:
Inheritance graph
Collaboration diagram for Isis::LimitPolygonSeeder:
Collaboration graph

Public Member Functions

 LimitPolygonSeeder (Pvl &pvl)
 Construct a LimitPolygonSeeder algorithm.
 
virtual ~LimitPolygonSeeder ()
 Destructor.
 
std::vector< geos::geom::Point * > Seed (const geos::geom::MultiPolygon *mp)
 Seed a polygon with points.
 
virtual PvlGroup PluginParameters (QString grpName)
 Plugin parameters.
 
double MinimumThickness ()
 Return the minimum allowed thickness of the polygon.
 
double MinimumArea ()
 Return the minimum allowed area of the polygon.
 
QString Algorithm () const
 The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constructor.
 
Pvl InvalidInput ()
 This method returns a copy of the Pvl passed in by the constructor (from a def file probably) minus what was used.
 

Protected Member Functions

virtual void Parse (Pvl &pvl)
 Parse the LimitPolygonSeeder spicific parameters from the PVL.
 
QString StandardTests (const geos::geom::MultiPolygon *multiPoly, const geos::geom::Envelope *polyBoundBox)
 Check the polygon to see if it meets standard criteria.
 

Protected Attributes

PvlinvalidInput
 The Pvl passed in by the constructor minus what was used.
 

Private Member Functions

geos::geom::Geometry * GetMultiPolygon (double dMinX, double dMinY, double dMaxX, double dMaxY, const geos::geom::MultiPolygon &orig)
 This method returns the overlap between the x/y range specified and the "orig" polygon.
 

Private Attributes

int p_majorAxisPts
 Number of points to place on major axis.
 
int p_minorAxisPts
 Number of points to place on minor axis.
 
QString p_algorithmName
 The value for the 'Name' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
 
double p_minimumThickness
 The value for the 'MinimumThickness' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
 
double p_minimumArea
 The value for the 'MinimumArea' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
 

Detailed Description

Seed points using a grid.

This class seeds the polygons with Control Points by creating a grid centered on the polygon. For each grid square, if it contains any overlap, a box is then created within the grid square, surrounding the valid data. The point checked is the center of this box, and if this point is within the overlap polygon then this point is returned, otherwise the grid square does not have a point.

Author
2008-04-21 Steven Lambright
History

2008-08-18 Christopher Austin - Upgraded to geos3.0.0

2008-11-12 Steven Lambright - Fixed documentation

2008-11-25 Steven Lambright - Added error checking

2008-12-23 Steven Lambright - Fixed problem with finding points in polygons that caused this algorithm to miss some.

2009-08-05 Travis Addair - Encapsulated group creation for seed definition group

2010-04-15 Eric Hyer - Now updates parent's invalidInput variable

2010-04-20 Christopher Austin - adapted for generic/unitless seeding

Definition at line 47 of file LimitPolygonSeeder.h.

Constructor & Destructor Documentation

◆ LimitPolygonSeeder()

Isis::LimitPolygonSeeder::LimitPolygonSeeder ( Pvl & pvl)

Construct a LimitPolygonSeeder algorithm.

Parameters
pvlA Pvl object that contains a valid polygon point seeding definition

Definition at line 30 of file LimitPolygonSeeder.cpp.

References Parse().

◆ ~LimitPolygonSeeder()

virtual Isis::LimitPolygonSeeder::~LimitPolygonSeeder ( )
inlinevirtual

Destructor.

Definition at line 52 of file LimitPolygonSeeder.h.

Member Function Documentation

◆ Algorithm()

QString Isis::PolygonSeeder::Algorithm ( ) const
inherited

The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constructor.

Returns
QString The value of the Name Keyword in the Pvl.

Definition at line 172 of file PolygonSeeder.cpp.

References Isis::PolygonSeeder::p_algorithmName.

Referenced by Isis::GridPolygonSeeder::PluginParameters(), PluginParameters(), and Isis::StripPolygonSeeder::PluginParameters().

◆ GetMultiPolygon()

geos::geom::Geometry * Isis::LimitPolygonSeeder::GetMultiPolygon ( double dMinX,
double dMinY,
double dMaxX,
double dMaxY,
const geos::geom::MultiPolygon & orig )
private

This method returns the overlap between the x/y range specified and the "orig" polygon.

This is used to get polygons that represent the overlap polygons in individual grid squares.

Parameters
dMinXLeft side of rectangle
dMinYBottom side of rectangle
dMaxXRight side of rectangle
dMaxYTop side of the rectangle
origMultiplygon to intersect the square with
Returns
geos::geom::Geometry* The portion of "orig" that intersects the square

Definition at line 121 of file LimitPolygonSeeder.cpp.

Referenced by Seed().

◆ InvalidInput()

Pvl Isis::PolygonSeeder::InvalidInput ( )
inherited

This method returns a copy of the Pvl passed in by the constructor (from a def file probably) minus what was used.

Returns
Pvl A copy of this pvl minus what was used.

Definition at line 231 of file PolygonSeeder.cpp.

References Isis::PolygonSeeder::invalidInput.

◆ MinimumArea()

double Isis::PolygonSeeder::MinimumArea ( )
inherited

Return the minimum allowed area of the polygon.

This value is set from the "MinimumArea" keyword in the PVL. The seeding algorithm will not seed polygons that have an area less than this.

Returns
double The value for the minimum area allowed.

Definition at line 195 of file PolygonSeeder.cpp.

References Isis::PolygonSeeder::p_minimumArea.

Referenced by Isis::GridPolygonSeeder::PluginParameters(), PluginParameters(), Isis::StripPolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::StandardTests().

◆ MinimumThickness()

double Isis::PolygonSeeder::MinimumThickness ( )
inherited

Return the minimum allowed thickness of the polygon.

This value is set from the "MinimumThickness" keyword in the PVL. The seeding algorithm will not seed polygons that have a thickness ratio less than this

Returns
double The value for the minimum thickness allowed.

Definition at line 183 of file PolygonSeeder.cpp.

References Isis::PolygonSeeder::p_minimumThickness.

Referenced by Isis::GridPolygonSeeder::PluginParameters(), PluginParameters(), Isis::StripPolygonSeeder::PluginParameters(), Isis::GridPolygonSeeder::SeedSubGrid(), and Isis::PolygonSeeder::StandardTests().

◆ Parse()

void Isis::LimitPolygonSeeder::Parse ( Pvl & pvl)
protectedvirtual

Parse the LimitPolygonSeeder spicific parameters from the PVL.

Parameters
pvlThe PVL object containing the control parameters for this polygon seeder.

Reimplemented from Isis::PolygonSeeder.

Definition at line 144 of file LimitPolygonSeeder.cpp.

References Isis::PvlObject::findGroup(), Isis::PolygonSeeder::invalidInput, p_majorAxisPts, p_minorAxisPts, Isis::PolygonSeeder::Parse(), Isis::PvlObject::Traverse, and Isis::IException::User.

Referenced by LimitPolygonSeeder().

◆ PluginParameters()

PvlGroup Isis::LimitPolygonSeeder::PluginParameters ( QString grpName)
virtual

Plugin parameters.

This method will add the PvlKeyword values for algorithm name, minimum thickness, and minimum area of this object to a PvlGroup with the name that is passed in.

Parameters
grpNameA string containing the PvlGroup name.
Returns
PvlGroup The PvlGroup with the appropriate parameters added.

Reimplemented from Isis::PolygonSeeder.

Definition at line 198 of file LimitPolygonSeeder.cpp.

References Isis::PolygonSeeder::Algorithm(), Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::MinimumThickness(), p_majorAxisPts, p_minorAxisPts, and Isis::toString().

◆ Seed()

std::vector< geos::geom::Point * > Isis::LimitPolygonSeeder::Seed ( const geos::geom::MultiPolygon * multiPoly)
virtual

Seed a polygon with points.

Seed the supplied polygon with points in a staggered pattern. The spacing is determined by the PVL group "PolygonSeederAlgorithm"

Parameters
lonLatPolygeos::MultiPolygon The polygon to be seeded with points.
Returns
std::vector<geos::Point*> A vector of points which have been seeded into the polygon. The caller assumes responsibility for deleteing these.

Implements Isis::PolygonSeeder.

Definition at line 47 of file LimitPolygonSeeder.cpp.

References GetMultiPolygon(), p_majorAxisPts, p_minorAxisPts, and Isis::PolygonSeeder::StandardTests().

◆ StandardTests()

QString Isis::PolygonSeeder::StandardTests ( const geos::geom::MultiPolygon * xymp,
const geos::geom::Envelope * xyBoundBox )
protectedinherited

Check the polygon to see if it meets standard criteria.

Parameters
xympThe multipoly containing the coordinates in x/y units instead of lon/lat
xyBoundBoxThe bounding box of the multipoly
Returns
QString A string with an appropriate message to throw if a test was unsuccessful or an empty string if all tests passed.

Definition at line 146 of file PolygonSeeder.cpp.

References Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::MinimumThickness(), and Isis::toString().

Referenced by Seed(), Isis::StripPolygonSeeder::Seed(), and Isis::GridPolygonSeeder::SeedSubGrid().

Member Data Documentation

◆ invalidInput

Pvl* Isis::PolygonSeeder::invalidInput
protectedinherited

◆ p_algorithmName

QString Isis::PolygonSeeder::p_algorithmName
privateinherited

The value for the 'Name' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.

Definition at line 82 of file PolygonSeeder.h.

Referenced by Isis::PolygonSeeder::Algorithm(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), Isis::PolygonSeeder::PolygonSeeder(), and Isis::PolygonSeeder::PolygonSeeder().

◆ p_majorAxisPts

int Isis::LimitPolygonSeeder::p_majorAxisPts
private

Number of points to place on major axis.

Definition at line 65 of file LimitPolygonSeeder.h.

Referenced by Parse(), PluginParameters(), and Seed().

◆ p_minimumArea

double Isis::PolygonSeeder::p_minimumArea
privateinherited

The value for the 'MinimumArea' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.

Definition at line 89 of file PolygonSeeder.h.

Referenced by Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::PolygonSeeder().

◆ p_minimumThickness

double Isis::PolygonSeeder::p_minimumThickness
privateinherited

The value for the 'MinimumThickness' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.

Definition at line 85 of file PolygonSeeder.h.

Referenced by Isis::PolygonSeeder::MinimumThickness(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::PolygonSeeder().

◆ p_minorAxisPts

int Isis::LimitPolygonSeeder::p_minorAxisPts
private

Number of points to place on minor axis.

Definition at line 66 of file LimitPolygonSeeder.h.

Referenced by Parse(), PluginParameters(), and Seed().


The documentation for this class was generated from the following files: