USGS

Isis 3.0 Developer's Reference (API)

Home

Isis::ImagePolygon Class Reference

Create cube polygons, read/write polygons to blobs. More...

#include <ImagePolygon.h>

Inherits Isis::Blob.

List of all members.

Public Member Functions

 ImagePolygon ()
 Constructs a Polygon object, setting the polygon name.
 ~ImagePolygon ()
 Destroys the Polygon object.
void Create (Cube &cube, int sinc=1, int linc=1, int ss=1, int sl=1, int ns=0, int nl=0, int band=1, bool increasePrecision=false)
 Create a Polygon from given cube.
CamerainitCube (Cube &cube, int ss=1, int sl=1, int ns=0, int nl=0, int band=1)
 Create a Polygon from given cube.
void Emission (double emission)
 Set the maximum emission angle ( light refleted to camera ).
void Incidence (double incidence)
 Set the maximum incidence angle ( light contacting the planet ).
void EllipsoidLimb (bool ellip)
 If a limb is detected, use un ellipsoid shape model if true.
void SubpixelAccuracy (int div)
 The subpixel accuracy to use.
geos::geom::MultiPolygon * Polys ()
 Return a geos Multipolygon.
double validSampleDim ()
 Retuns the maximum valid sample width of the cube set with either initCube() or Create().
double validLineDim ()
 Retuns the maximum valid line width of the cube set with either initCube() or Create().
int getSinc () const
 Return the sample increment used the create this polygon.
int getLinc () const
 Return the line increment used the create this polygon.

Protected Member Functions

void ReadData (std::istream &is)
 Reads Multipolygon from cube blob.
void WriteInit ()
 Initializes for writing polygon to cube blob.
void WriteData (std::fstream &os)
 Writes polygon to cube blob.

Detailed Description

Create cube polygons, read/write polygons to blobs.

This class creates polygons defining an image boundary, reads the polygon from a cube blob, and writes a polygon to a cube blob. The GEOS (Geometry Engine Open Source) package is used to create and manipulate the polygons. See http://geos.refractions.net for information about this package.

Author:
2005-11-22 Tracie Sucharski

Constructor & Destructor Documentation

Isis::ImagePolygon::ImagePolygon (  ) 

Constructs a Polygon object, setting the polygon name.

Isis::ImagePolygon::~ImagePolygon (  ) 

Destroys the Polygon object.


Member Function Documentation

void Isis::ImagePolygon::Create ( Cube cube,
int  sinc = 1,
int  linc = 1,
int  ss = 1,
int  sl = 1,
int  ns = 0,
int  nl = 0,
int  band = 1,
bool  increasePrecision = false 
)

Create a Polygon from given cube.

Parameters:
[in] cube (Cube &) Cube used to create polygon
[in] sinc (Default=1) (in) Pixel increment to define the granularity of the resulting polygon in the sample direction
[in] linc (Default=1) (in) Pixel increment to define the granularity of the resulting polygon in the line direction
[in] ss (Default=1) (in) Starting sample number
[in] sl (Default=1) (in) Starting Line number
[in] ns (Default=0) (in) Number of samples used to create the polygon. Default of 0 will cause ns to be set to the number of samples in the cube.
[in] nl (Default=0) (in) Number of lines used to create the polygon. Default of 0 will cause nl to be set to the number of lines in the cube.
[in] band (Default=1) (in) Image band number
increasePrecision Iteratively refine sinc and linc (defaults to false)
History:
2008-04-28 Tracie Sucharski, When calculating p_pixInc, set to 1 if values calculated is 0.
History:
2008-12-30 Tracie Sucharski - If ground map returns pole make sure it is actually on the image.
History:
2009-05-28 Stuart Sides - Added the quality argument.

References _FILEINFO_, Isis::Camera::BasicMapping(), cam, Isis::UniversalGroundMap::Camera(), Isis::iException::Clear(), Isis::Cube::getFilename(), Isis::Sensor::IgnoreElevationModel(), initCube(), Isis::iException::Message(), Isis::iException::Report(), and Isis::iException::User.

void Isis::ImagePolygon::EllipsoidLimb ( bool  ellip  )  [inline]

If a limb is detected, use un ellipsoid shape model if true.

If false, use the default (spiceinit defined) shape model.

Parameters:
ellip True to use ellipsoid on limb images
void Isis::ImagePolygon::Emission ( double  emission  )  [inline]

Set the maximum emission angle ( light refleted to camera ).

Parameters:
emission The maximum valid emission angle
int Isis::ImagePolygon::getLinc (  )  const [inline]

Return the line increment used the create this polygon.

int Isis::ImagePolygon::getSinc (  )  const [inline]

Return the sample increment used the create this polygon.

void Isis::ImagePolygon::Incidence ( double  incidence  )  [inline]

Set the maximum incidence angle ( light contacting the planet ).

Parameters:
incidence The maximum valid incidence angle
Camera * Isis::ImagePolygon::initCube ( Cube cube,
int  ss = 1,
int  sl = 1,
int  ns = 0,
int  nl = 0,
int  band = 1 
)

Create a Polygon from given cube.

Parameters:
[in] cube (Cube &) Cube used to create polygon
[in] ss (Default=1) (in) Starting sample number
[in] sl (Default=1) (in) Starting Line number
[in] ns (Default=0) (in) Number of samples used to create the polygon. Default of 0 will cause ns to be set to the number of samples in the cube.
[in] nl (Default=0) (in) Number of lines used to create the polygon. Default of 0 will cause nl to be set to the number of lines in the cube.
[in] band (Default=1) (in) Image band number

References _FILEINFO_, cam, Isis::UniversalGroundMap::Camera(), Isis::iException::Clear(), Isis::Cube::getCamera(), Isis::Cube::getFilename(), Isis::Cube::getLineCount(), Isis::Cube::getPixelType(), Isis::Cube::getProjection(), Isis::Cube::getSampleCount(), Isis::Camera::HasProjection(), Isis::Sensor::IgnoreElevationModel(), Isis::iException::Message(), proj, Isis::UniversalGroundMap::SetBand(), and Isis::iException::User.

Referenced by Create().

geos::geom::MultiPolygon* Isis::ImagePolygon::Polys (  )  [inline]
void Isis::ImagePolygon::ReadData ( std::istream &  is  )  [protected]

Reads Multipolygon from cube blob.

Parameters:
[in] is (std::fstream) Input stream to read from

throws Isis::iException::Io - Error reading data from stream

References _FILEINFO_, Isis::globalFactory, Isis::iException::Io, and Isis::iException::Message().

void Isis::ImagePolygon::SubpixelAccuracy ( int  div  )  [inline]

The subpixel accuracy to use.

This accuracy is the number of binary steps to take to find the subpixel accuracy. A higher number provided gives more accurate results at the cost of runtime.

ImagePolygon's constructor sets a default value of 50

Parameters:
div The subpixel accuracy to use
double Isis::ImagePolygon::validLineDim (  ) 

Retuns the maximum valid line width of the cube set with either initCube() or Create().

double Isis::ImagePolygon::validSampleDim (  ) 

Retuns the maximum valid sample width of the cube set with either initCube() or Create().

void Isis::ImagePolygon::WriteData ( std::fstream &  os  )  [protected]

Writes polygon to cube blob.

Parameters:
[in] os (std::fstream &) Output steam blob data will be written to
Exceptions:
Isis::iException::Io - Error writing data to stream
void Isis::ImagePolygon::WriteInit (  )  [protected]

Initializes for writing polygon to cube blob.

References _FILEINFO_, Isis::iException::Message(), and Isis::iException::Programmer.


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