File failed to load: https://isis.astrogeology.usgs.gov/3.9.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Developer Reference
Isis::ImagePolygon Class Reference

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

#include <ImagePolygon.h>

Inheritance diagram for Isis::ImagePolygon:
Inheritance graph
Collaboration diagram for Isis::ImagePolygon:
Collaboration graph

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...
 
CamerainitCube (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...
 
PvlObjectLabel ()
 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...
 

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

◆ ImagePolygon()

Isis::ImagePolygon::ImagePolygon ( )

Constructs a Polygon object, setting the polygon name.

◆ ~ImagePolygon()

Isis::ImagePolygon::~ImagePolygon ( )

Destroys the Polygon object.

Member Function Documentation

◆ Create()

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
increasePrecisionIteratively 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.

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.

◆ EllipsoidLimb()

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
ellipTrue to use ellipsoid on limb images

◆ Emission()

void Isis::ImagePolygon::Emission ( double  emission)
inline

Set the maximum emission angle ( light refleted to camera )

Parameters
emissionThe maximum valid emission angle

◆ Find()

void Isis::Blob::Find ( const Pvl pvl)
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.

Parameters
pvlThe Pvl to be searched

References _FILEINFO_, Isis::PvlContainer::isNamed(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::FileName::path().

◆ getLinc()

int Isis::ImagePolygon::getLinc ( ) const
inline

Return the line increment used the create this polygon.

◆ getSinc()

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

Return the sample increment used the create this polygon.

◆ Incidence()

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

Set the maximum incidence angle ( light contacting the planet )

Parameters
incidenceThe maximum valid incidence angle

◆ initCube()

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_, 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().

◆ Label()

PvlObject & Isis::Blob::Label ( )
inherited

Accessor method that returns a PvlObject containing the Blob label.

Returns
PvlObject The label of the blob.

Referenced by Isis::SpiceRotation::CacheLabel(), Isis::SpicePosition::LoadCache(), and Isis::SpiceRotation::LoadCache().

◆ Name()

QString Isis::Blob::Name ( ) const
inherited

Accessor method that returns a string containing the Blob name.

Returns
string The name of the blob.

Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), Isis::SpicePosition::LoadCache(), and Isis::Cube::write().

◆ Polys()

geos::geom::MultiPolygon* Isis::ImagePolygon::Polys ( )
inline

◆ Read() [1/3]

void Isis::Blob::Read ( const QString &  file)
inherited

This method reads Pvl values from a specified file.

Parameters
fileThe filename to read from.
Exceptions
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().

◆ Read() [2/3]

void Isis::Blob::Read ( const QString &  file,
const Pvl pvlLabels 
)
inherited

This method reads the given a file and labels.

Parameters
fileThe filename to read from.
pvlLabelsA Pvl containing the label information.
Exceptions
iException::Io- Unable to open file

References _FILEINFO_, and Isis::Message::FileOpen().

◆ Read() [3/3]

void Isis::Blob::Read ( const Pvl pvl,
std::istream &  istm 
)
virtualinherited

This method reads the Blob data from an open input file stream.

Parameters
pvlA Pvl containing the label information.
istmThe input file stream containing the blob data to be read.
Exceptions
iException::Io- Unable to open file

Reimplemented in Isis::History.

References _FILEINFO_, and Isis::Message::FileOpen().

◆ ReadData()

void Isis::ImagePolygon::ReadData ( std::istream &  is)
protectedvirtual

Reads Multipolygon from cube blob.

Parameters
[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.

◆ ReadInit()

void Isis::Blob::ReadInit ( )
protectedvirtualinherited

This virtual method for classes that inherit Blob.

It is not defined in the Blob class.

Reimplemented in Isis::Table.

◆ Size()

int Isis::Blob::Size ( ) const
inherited

Accessor method that returns the number of bytes in the blob data.

Returns
int Number of bytes in the blob data.

◆ SubpixelAccuracy()

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
divThe subpixel accuracy to use

◆ Type()

QString Isis::Blob::Type ( ) const
inherited

Accessor method that returns a string containing the Blob type.

Returns
string Type of blob.

Referenced by Isis::Shape::isFootprintable(), Isis::Image::isFootprintable(), and Isis::Cube::write().

◆ validLineDim()

double Isis::ImagePolygon::validLineDim ( )

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

◆ validSampleDim()

double Isis::ImagePolygon::validSampleDim ( )

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

◆ Write() [1/2]

void Isis::Blob::Write ( const QString &  file)
inherited

Write the blob data out to a file.

Parameters
fileThe filename to write to.
Exceptions
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().

◆ Write() [2/2]

void Isis::Blob::Write ( Pvl pvl,
std::fstream &  stm,
const QString &  detachedFileName = "" 
)
inherited

Write the blob data out to a Pvl object.

Parameters
pvlThe pvl object to update
stmstream to write data to
detachedFileNameIf 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().

◆ WriteData()

void Isis::ImagePolygon::WriteData ( std::fstream &  os)
protectedvirtual

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

Reimplemented from Isis::Blob.

References Isis::Blob::p_nbytes.

◆ WriteInit()

void Isis::ImagePolygon::WriteInit ( )
protectedvirtual

Initializes for writing polygon to cube blob.

Reimplemented from Isis::Blob.

References _FILEINFO_, Isis::Blob::p_nbytes, and Isis::IException::Programmer.

Member Data Documentation

◆ p_blobName

QString Isis::Blob::p_blobName
protectedinherited

◆ p_blobPvl

◆ p_buffer

◆ p_detached

QString Isis::Blob::p_detached
protectedinherited

Used for reading detached blobs.

Referenced by Isis::Blob::Blob(), and Isis::Blob::operator=().

◆ p_labelFile

QString Isis::Blob::p_labelFile
protectedinherited

The file containing the labels.

Referenced by Isis::Blob::Blob(), and Isis::Blob::operator=().

◆ p_nbytes

◆ p_startByte

BigInt Isis::Blob::p_startByte
protectedinherited

Byte blob data starts at in buffer.

Referenced by Isis::Blob::Blob(), Isis::Blob::operator=(), Isis::Table::ReadData(), and ReadData().

◆ p_type

QString Isis::Blob::p_type
protectedinherited

Type of data stored in the buffer.

Referenced by Isis::Blob::Blob(), Isis::Blob::operator=(), and ReadData().


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

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/12/2023 23:51:52