![]() |
Isis 3 Developer Reference
|
Create cube polygons, read/write polygons to blobs. More...
#include <ImagePolygon.h>


Public Member Functions | |
| ImagePolygon () | |
| Constructs a Polygon object, setting the polygon name. More... | |
| ~ImagePolygon () | |
| Destroys the Polygon object. More... | |
| 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. More... | |
| Camera * | initCube (Cube &cube, int ss=1, int sl=1, int ns=0, int nl=0, int band=1) |
| Create a Polygon from given cube. More... | |
| void | Emission (double emission) |
| Set the maximum emission angle ( light refleted to camera ) More... | |
| void | Incidence (double incidence) |
| Set the maximum incidence angle ( light contacting the planet ) More... | |
| void | EllipsoidLimb (bool ellip) |
| If a limb is detected, use un ellipsoid shape model if true. More... | |
| void | SubpixelAccuracy (int div) |
| The subpixel accuracy to use. More... | |
| geos::geom::MultiPolygon * | Polys () |
| Return a geos Multipolygon. More... | |
| double | validSampleDim () |
| Retuns the maximum valid sample width of the cube set with either initCube() or Create() More... | |
| double | validLineDim () |
| Retuns the maximum valid line width of the cube set with either initCube() or Create() More... | |
| int | getSinc () const |
| Return the sample increment used the create this polygon. More... | |
| int | getLinc () const |
| Return the line increment used the create this polygon. More... | |
| QString | Type () const |
| Accessor method that returns a string containing the Blob type. More... | |
| QString | Name () const |
| Accessor method that returns a string containing the Blob name. More... | |
| int | Size () const |
| Accessor method that returns the number of bytes in the blob data. More... | |
| PvlObject & | Label () |
| Accessor method that returns a PvlObject containing the Blob label. More... | |
| void | Read (const QString &file) |
| This method reads Pvl values from a specified file. More... | |
| void | Read (const QString &file, const Pvl &pvlLabels) |
| This method reads the given a file and labels. More... | |
| virtual void | Read (const Pvl &pvl, std::istream &is) |
| This method reads the Blob data from an open input file stream. More... | |
| void | Write (const QString &file) |
| Write the blob data out to a file. More... | |
| void | Write (Pvl &pvl, std::fstream &stm, const QString &detachedFileName="") |
| Write the blob data out to a Pvl object. More... | |
Protected Member Functions | |
| void | ReadData (std::istream &is) |
| Reads Multipolygon from cube blob. More... | |
| void | WriteInit () |
| Initializes for writing polygon to cube blob. More... | |
| void | WriteData (std::fstream &os) |
| Writes polygon to cube blob. More... | |
| void | Find (const Pvl &pvl) |
| This method searches the given Pvl for the Blob by the Blob's type and name. More... | |
| virtual void | ReadInit () |
| This virtual method for classes that inherit Blob. More... | |
Protected Attributes | |
| PvlObject | p_blobPvl |
| Pvl Blob object. More... | |
| QString | p_blobName |
| Name of the Blob object. More... | |
| char * | p_buffer |
| Buffer blob data is stored in. More... | |
| BigInt | p_startByte |
| Byte blob data starts at in buffer. More... | |
| int | p_nbytes |
| Size of blob data (in bytes) More... | |
| QString | p_type |
| Type of data stored in the buffer. More... | |
| QString | p_detached |
| Used for reading detached blobs. More... | |
| QString | p_labelFile |
| The file containing the labels. More... | |
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.
| Isis::ImagePolygon::ImagePolygon | ( | ) |
Constructs a Polygon object, setting the polygon name.
| Isis::ImagePolygon::~ImagePolygon | ( | ) |
Destroys the Polygon object.
| 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.
| [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) |
2008-04-28 Tracie Sucharski, When calculating p_pixInc, set to 1 if values calculated is 0.
2008-12-30 Tracie Sucharski - If ground map returns pole make sure it is actually on the image.
2009-05-28 Stuart Sides - Added the quality argument.
References _FILEINFO_, Isis::Camera::BasicMapping(), Isis::UniversalGroundMap::Camera(), Isis::Cube::fileName(), Isis::Sensor::IgnoreElevationModel(), initCube(), Isis::IException::print(), and Isis::IException::User.
|
inline |
If a limb is detected, use un ellipsoid shape model if true.
If false, use the default (spiceinit defined) shape model.
| ellip | True to use ellipsoid on limb images |
|
inline |
Set the maximum emission angle ( light refleted to camera )
| emission | The maximum valid emission angle |
|
protectedinherited |
This method searches the given Pvl for the Blob by the Blob's type and name.
If found, the start byte, number of bytes are read from the Pvl. Also, if a keyword label pointer is found, the filename for the detached blob is stored and the pointer is removed from the blob pvl.
| pvl | The Pvl to be searched |
References _FILEINFO_, Isis::PvlContainer::isNamed(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::FileName::path().
|
inline |
Return the line increment used the create this polygon.
|
inline |
Return the sample increment used the create this polygon.
|
inline |
Set the maximum incidence angle ( light contacting the planet )
| 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.
| [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_, Isis::IException::append(), Isis::UniversalGroundMap::Camera(), Isis::Cube::camera(), Isis::Cube::fileName(), Isis::Camera::HasProjection(), Isis::Sensor::IgnoreElevationModel(), Isis::Cube::lineCount(), Isis::Cube::pixelType(), Isis::Cube::projection(), Isis::Cube::sampleCount(), Isis::UniversalGroundMap::SetBand(), and Isis::IException::User.
Referenced by Create().
|
inherited |
Accessor method that returns a PvlObject containing the Blob label.
Referenced by Isis::SpiceRotation::CacheLabel(), Isis::SpicePosition::LoadCache(), and Isis::SpiceRotation::LoadCache().
|
inherited |
Accessor method that returns a string containing the Blob name.
Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), Isis::SpicePosition::LoadCache(), and Isis::Cube::write().
|
inline |
Return a geos Multipolygon.
Referenced by Isis::ImageOverlapSet::FindImageOverlaps(), and Isis::UniversalGroundMap::GroundRange().
|
inherited |
This method reads Pvl values from a specified file.
| file | The filename to read from. |
| iException::Io | - Unable to open file |
| iException::Pvl | - Invalid label format |
References _FILEINFO_, and Isis::Pvl::read().
Referenced by Isis::History::History(), Isis::OriginalLabel::OriginalLabel(), Isis::OriginalXmlLabel::OriginalXmlLabel(), Isis::History::Read(), Isis::Cube::read(), and Isis::Table::Table().
|
inherited |
This method reads the given a file and labels.
| file | The filename to read from. |
| pvlLabels | A Pvl containing the label information. |
| iException::Io | - Unable to open file |
References _FILEINFO_, and Isis::Message::FileOpen().
|
virtualinherited |
This method reads the Blob data from an open input file stream.
| pvl | A Pvl containing the label information. |
| istm | The input file stream containing the blob data to be read. |
| iException::Io | - Unable to open file |
Reimplemented in Isis::History.
References _FILEINFO_, and Isis::Message::FileOpen().
|
protectedvirtual |
Reads Multipolygon from cube blob.
| [in] | is | (std::fstream) Input stream to read from |
throws Isis::IException::Io - Error reading data from stream
Reimplemented from Isis::Blob.
References _FILEINFO_, Isis::globalFactory, Isis::IException::Io, Isis::PolygonTools::MakeMultiPolygon(), Isis::Blob::p_blobName, Isis::Blob::p_nbytes, Isis::Blob::p_startByte, and Isis::Blob::p_type.
|
protectedvirtualinherited |
This virtual method for classes that inherit Blob.
It is not defined in the Blob class.
Reimplemented in Isis::Table.
|
inherited |
Accessor method that returns the number of bytes in the blob data.
|
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
| div | The subpixel accuracy to use |
|
inherited |
Accessor method that returns a string containing the Blob type.
Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), and Isis::Cube::write().
| 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()
|
inherited |
Write the blob data out to a file.
| file | The filename to write to. |
| IException::Io | - Unable to open file |
| IException::Io | - Error preparing to write data to file |
| IException::Io | - Error creating file |
References _FILEINFO_, Isis::PvlObject::addObject(), Isis::PvlObject::findObject(), Isis::toString(), and Isis::Pvl::write().
Referenced by Isis::Cube::write().
|
inherited |
Write the blob data out to a Pvl object.
| pvl | The pvl object to update |
| stm | stream to write data to |
| detachedFileName | If the stream is detached from the labels give the name of the file |
References Isis::PvlObject::addObject(), Isis::PvlContainer::name(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::toString().
|
protectedvirtual |
Writes polygon to cube blob.
| [in] | os | (std::fstream &) Output steam blob data will be written to |
| Isis::iException::Io | - Error writing data to stream |
Reimplemented from Isis::Blob.
References Isis::Blob::p_nbytes.
|
protectedvirtual |
Initializes for writing polygon to cube blob.
Reimplemented from Isis::Blob.
References _FILEINFO_, Isis::Blob::p_nbytes, and Isis::IException::Programmer.
|
protectedinherited |
Name of the Blob object.
Referenced by Isis::Blob::Blob(), Isis::Table::operator+=(), Isis::Blob::operator=(), Isis::Table::ReadData(), and ReadData().
|
protectedinherited |
|
protectedinherited |
Buffer blob data is stored in.
Referenced by Isis::Blob::Blob(), Isis::GisBlob::GisBlob(), Isis::Blob::operator=(), Isis::OriginalXmlLabel::ReadData(), Isis::History::ReturnHist(), Isis::OriginalLabel::ReturnLabels(), Isis::GisBlob::setPolygon(), Isis::History::WriteInit(), and Isis::OriginalLabel::WriteInit().
|
protectedinherited |
Used for reading detached blobs.
Referenced by Isis::Blob::Blob(), and Isis::Blob::operator=().
|
protectedinherited |
The file containing the labels.
Referenced by Isis::Blob::Blob(), and Isis::Blob::operator=().
|
protectedinherited |
Size of blob data (in bytes)
Referenced by Isis::Blob::Blob(), Isis::GisBlob::GisBlob(), Isis::Blob::operator=(), Isis::OriginalXmlLabel::ReadData(), ReadData(), Isis::History::ReturnHist(), Isis::OriginalLabel::ReturnLabels(), Isis::GisBlob::setPolygon(), WriteData(), Isis::OriginalXmlLabel::WriteInit(), Isis::OriginalLabel::WriteInit(), Isis::History::WriteInit(), Isis::Table::WriteInit(), and WriteInit().
|
protectedinherited |
Byte blob data starts at in buffer.
Referenced by Isis::Blob::Blob(), Isis::Blob::operator=(), Isis::Table::ReadData(), and ReadData().
|
protectedinherited |
Type of data stored in the buffer.
Referenced by Isis::Blob::Blob(), Isis::Blob::operator=(), and ReadData().