Isis 3 Programmer Reference
Isis::GisBlob Class Reference

This class creates a polygon-type Isis Blob named "Footprint". More...

#include <GisBlob.h>

Inheritance diagram for Isis::GisBlob:
Inheritance graph
Collaboration diagram for Isis::GisBlob:
Collaboration graph

Public Member Functions

 GisBlob ()
 Constructs an Isis polygon-type Blob named "Footprint.". More...
 
 GisBlob (Cube &cube)
 Constructs an Isis polygon-type Blob named "Footprint" and sets the well-known text string that defines the polygon by reading the given cube. More...
 
 ~GisBlob ()
 Destroys the GisBlob object. More...
 
QString polygon () const
 Accesses the well-known text string that defines the polygon. More...
 
void setPolygon (const QString &wkt)
 Sets the polygon using the given well-known text string. 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 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...
 
virtual void ReadData (std::istream &is)
 Read binary data from an input stream into the Blob object. More...
 
virtual void WriteInit ()
 This virtual method for classes that inherit Blob. More...
 
virtual void WriteData (std::fstream &os)
 Writes blob data to a stream. 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...
 

Private Member Functions

QString scrub (const char *rawbuf, int rbytes) const
 This method will scrub all zeros that prefix the given buffer and convert it to a string using the number of allocated bytes given. More...
 

Private Attributes

QString m_wkt
 Well-known text string containing the polygon defintion for this GIS blob. More...
 

Detailed Description

This class creates a polygon-type Isis Blob named "Footprint".

It inherits from the Isis Blob class. This Blob may be read from a given cube or the polygon maybe set using a wkt polygon string.

Author
2012-07-15 Kris Becker
History:

2012-07-15 Kris Becker - Original version.

2015-03-18 Jeannie Backer - Brought class files closer to ISIS coding standards.

2015-03-31 Jeannie Backer - Updated documentation.

2016-03-02 Ian Humphrey - Updated for coding standards compliance in preparation for adding this class to ISIS. Fixes #2398.

Definition at line 48 of file GisBlob.h.

Constructor & Destructor Documentation

◆ GisBlob() [1/2]

Isis::GisBlob::GisBlob ( )

Constructs an Isis polygon-type Blob named "Footprint.".

Definition at line 38 of file GisBlob.cpp.

◆ GisBlob() [2/2]

Isis::GisBlob::GisBlob ( Cube cube)

Constructs an Isis polygon-type Blob named "Footprint" and sets the well-known text string that defines the polygon by reading the given cube.

Parameters
cube

Definition at line 48 of file GisBlob.cpp.

References m_wkt, Isis::Blob::p_buffer, Isis::Blob::p_nbytes, Isis::Cube::read(), and scrub().

◆ ~GisBlob()

Isis::GisBlob::~GisBlob ( )

Destroys the GisBlob object.

Definition at line 57 of file GisBlob.cpp.

Member Function Documentation

◆ 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

Definition at line 179 of file Blob.cpp.

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

◆ Label()

◆ Name()

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

Accessor method that returns a string containing the Blob name.

Returns
string The name of the blob.

Definition at line 149 of file Blob.cpp.

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

◆ polygon()

QString Isis::GisBlob::polygon ( ) const

Accesses the well-known text string that defines the polygon.

Returns
QString A well-known text string containing the polygon definition.

Definition at line 66 of file GisBlob.cpp.

References m_wkt.

Referenced by Isis::GisGeometry::fromCube().

◆ 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

Definition at line 243 of file Blob.cpp.

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

Definition at line 268 of file Blob.cpp.

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.

Definition at line 303 of file Blob.cpp.

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

◆ ReadData()

void Isis::Blob::ReadData ( std::istream &  stream)
protectedvirtualinherited

Read binary data from an input stream into the Blob object.

Parameters
streamThe input stream to read from.
Exceptions
IException::Io- Error reading data from stream

Reimplemented in Isis::ImagePolygon, Isis::Table, and Isis::OriginalXmlLabel.

Definition at line 340 of file Blob.cpp.

References _FILEINFO_.

Referenced by Isis::OriginalXmlLabel::ReadData().

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

Definition at line 330 of file Blob.cpp.

◆ scrub()

QString Isis::GisBlob::scrub ( const char *  rawbuf,
int  rbytes 
) const
private

This method will scrub all zeros that prefix the given buffer and convert it to a string using the number of allocated bytes given.

Parameters
rawbufA pointer containing the raw buffer to be converted.
rbytesThe number of bytes to be read in.
Returns
QString A string converted from the given raw buffer.

Definition at line 98 of file GisBlob.cpp.

Referenced by GisBlob(), and setPolygon().

◆ setPolygon()

void Isis::GisBlob::setPolygon ( const QString &  wkt)

Sets the polygon using the given well-known text string.

Parameters
wktA string containing the well-known text that defines a polygon.

Definition at line 76 of file GisBlob.cpp.

References m_wkt, Isis::Blob::p_buffer, Isis::Blob::p_nbytes, and scrub().

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

Definition at line 158 of file Blob.cpp.

◆ Type()

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

Accessor method that returns a string containing the Blob type.

Returns
string Type of blob.

Definition at line 140 of file Blob.cpp.

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

◆ 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

Definition at line 369 of file Blob.cpp.

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

Definition at line 418 of file Blob.cpp.

References Isis::PvlObject::addObject(), Isis::PvlContainer::name(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::toString().

◆ WriteData()

void Isis::Blob::WriteData ( std::fstream &  stream)
protectedvirtualinherited

Writes blob data to a stream.

Parameters
streamOutput steam blob data will be written to
Exceptions
IException::Io- Error writing data to stream

Reimplemented in Isis::ImagePolygon, Isis::Table, and Isis::OriginalXmlLabel.

Definition at line 502 of file Blob.cpp.

References _FILEINFO_.

◆ WriteInit()

void Isis::Blob::WriteInit ( )
protectedvirtualinherited

This virtual method for classes that inherit Blob.

It is not defined in the Blob class.

Reimplemented in Isis::ImagePolygon, Isis::Table, Isis::History, Isis::OriginalLabel, and Isis::OriginalXmlLabel.

Definition at line 492 of file Blob.cpp.

Member Data Documentation

◆ m_wkt

QString Isis::GisBlob::m_wkt
private

Well-known text string containing the polygon defintion for this GIS blob.

Definition at line 63 of file GisBlob.h.

Referenced by GisBlob(), polygon(), and setPolygon().

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

Definition at line 101 of file Blob.h.

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

◆ p_labelFile

QString Isis::Blob::p_labelFile
protectedinherited

The file containing the labels.

Definition at line 102 of file Blob.h.

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.

Definition at line 98 of file Blob.h.

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

◆ p_type

QString Isis::Blob::p_type
protectedinherited

Type of data stored in the buffer.

Definition at line 100 of file Blob.h.

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


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