Isis 3 Programmer Reference
|
This represents a shape in a project-based GUI interface. More...
#include <Shape.h>
Public Types | |
enum | ShapeType { Dem , Basemap , Unprojected , Unknown } |
Public Slots | |
void | updateFileName (Project *) |
Change the on-disk file name for this cube to be where the shape ought to be in the given project. | |
Public Member Functions | |
Shape (QString shapeFileName, QObject *parent=0) | |
Create an Shape from a cube file on disk. | |
Shape (Cube *shapeCube, QObject *parent=0) | |
Create an shape from a cube file on disk. | |
~Shape () | |
Clean up this shape. | |
void | fromPvl (const PvlObject &pvl) |
Read the shape settings from a Pvl. | |
PvlObject | toPvl () const |
Convert this Shape to PVL. | |
bool | isFootprintable () const |
Test to see if it's possible to create a footprint from this shape. | |
Cube * | cube () |
Get the Cube * associated with this display property. | |
void | closeCube () |
Cleans up the Cube *. | |
ControlPoint::SurfacePointSource::Source | surfacePointSource () |
ControlPoint::RadiusSource::Source | radiusSource () |
ShapeDisplayProperties * | displayProperties () |
Get the display (GUI) properties (information) associated with this shape. | |
ShapeType | shapeType () |
const ShapeDisplayProperties * | displayProperties () const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this shape. | |
QString | fileName () const |
Get the file name of the cube that this shape represents. | |
QString | serialNumber () |
Get the serial number. | |
geos::geom::MultiPolygon * | footprint () |
Get the footprint of this shape (if available). | |
const geos::geom::MultiPolygon * | footprint () const |
Get the non-mutable (const) footprint of this shape (if available). | |
void | setId (QString id) |
Override the automatically generated ID with the given ID. | |
bool | initFootprint (QMutex *cameraMutex) |
Calculate a footprint for this shape. | |
double | aspectRatio () const |
Get the aspect ratio of this shape, as calculated and attached by camstats. | |
QString | id () const |
Get a unique, identifying string associated with this shape. | |
double | resolution () const |
Get the resolution of this shape, as calculated and attached by camstats. | |
Angle | emissionAngle () const |
Get the emission angle of this shape, as calculated and attached by camstats. | |
Angle | incidenceAngle () const |
Get the incidence angle of this shape, as calculated and attached by camstats. | |
double | lineResolution () const |
Get the line resolution of this shape, as calculated and attached by camstats. | |
Distance | localRadius () const |
Get the local radius of this shape, as calculated and attached by camstats. | |
Angle | northAzimuth () const |
Get the north azimuth of this shape, as calculated and attached by camstats. | |
Angle | phaseAngle () const |
Get the phase angle of this shape, as calculated and attached by camstats. | |
double | sampleResolution () const |
Get the sample resolution of this shape, as calculated and attached by camstats. | |
void | copyToNewProjectRoot (const Project *project, FileName newProjectRoot) |
Copy the cub/ecub files associated with this shape into the new project. | |
void | deleteFromDisk () |
Delete the shape data from disk. | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Output format: | |
Private Member Functions | |
Shape (const Shape &other) | |
Shape & | operator= (const Shape &rhs) |
void | initMemberData () |
void | initShape () |
void | initCamStats () |
TODO. | |
void | initMapStats () |
void | initDemStats () |
geos::geom::MultiPolygon * | createFootprint (QMutex *cameraMutex) |
Calculate a footprint for an Shape using the camera or projection information. | |
void | initQuickFootprint () |
Private Attributes | |
SpiceInt * | m_bodyCode |
The NaifBodyCode value, if it exists in the labels. | |
Cube * | m_cube |
The cube associated with this Shape. | |
ControlPoint::SurfacePointSource::Source | m_surfacePointSource |
ControlPoint::RadiusSource::Source | m_radiusSource |
ShapeType | m_shapeType |
ShapeDisplayProperties * | m_displayProperties |
The GUI information for how this Shape ought to be displayed. | |
QString | m_fileName |
The on-disk file name of the cube associated with this Shape. | |
QString | m_serialNumber |
This will always be simply the filename and is created on construction. | |
QString | m_instrumentId |
Instrument id associated with this Shape. | |
QString | m_spacecraftName |
Spacecraft name associated with this Shape. | |
geos::geom::MultiPolygon * | m_footprint |
A 0-360 ocentric lon,lat degrees footprint of this Shape. | |
QUuid * | m_id |
A unique ID for this Shape (useful for others to reference this Shape when saving to disk). | |
double | m_aspectRatio |
double | m_resolution |
Angle | m_emissionAngle |
Angle | m_incidenceAngle |
double | m_lineResolution |
Distance | m_localRadius |
Angle | m_northAzimuth |
Angle | m_phaseAngle |
double | m_sampleResolution |
QString | m_targetName |
QString | m_projectionName |
Longitude | m_centerLongitude |
Latitude | m_centerLatitude |
Latitude | m_minimumLatitude |
Latitude | m_maximumLatitude |
Longitude | m_minimumLongitude |
Longitude | m_maximumLongitude |
double | m_pixelResolution |
double | m_scale |
Distance | m_minimumRadius |
Distance | m_maximumRadius |
This represents a shape in a project-based GUI interface.
The actual cube doesn't have to be open. This encapsulates ideas about an shape such as it's footprint, it's cube, how it should be viewed, where it is on disk, etc. This class is designed to be semi-light weight - we should be able to have tens of thousands of these in memory without any issues (provided the Cube files aren't open - see closeCube()).
2016-10-21 Tracie Sucharski - Add Image to the Shape class. This was done because the qmos class expect Images, and we want to display a footprint of a Shape.
2018-09-10 Tracie Sucharski - Added surface point source and radius source along with access methods.
2018-09-21 Tracie Sucharski - Serial number is composed on construction and is always the filename.
2018-10-03 Tracie Sucharski - Fixed problem in constructor with cube being set before member data was initialized. Fixed the computation for surfacePointSource and radiusSource. References #5504.
|
explicit |
Create an Shape from a cube file on disk.
ShapeFileName | The name of a cube on disk - /work/users/.../blah.cub |
parent | The Qt-relationship parent |
Definition at line 44 of file Shape.cpp.
References cube(), and m_fileName.
Create an shape from a cube file on disk.
shapeFileName | The name of a cube on disk - /work/users/.../blah.cub |
parent | The Qt-relationship parent |
Definition at line 60 of file Shape.cpp.
References m_cube, and m_fileName.
Isis::Shape::~Shape | ( | ) |
Clean up this shape.
If you haven't saved this shape, all of its settings will be lost.
Definition at line 73 of file Shape.cpp.
References m_bodyCode, m_cube, m_displayProperties, m_footprint, and m_id.
double Isis::Shape::aspectRatio | ( | ) | const |
void Isis::Shape::closeCube | ( | ) |
Cleans up the Cube *.
You want to call this once you're sure you are done with the Cube because the OS will limit how many of these we have open.
Definition at line 326 of file Shape.cpp.
References m_cube.
Referenced by deleteFromDisk(), and updateFileName().
Copy the cub/ecub files associated with this shape into the new project.
Definition at line 539 of file Shape.cpp.
References m_fileName, Isis::FileName::name(), Isis::Project::projectRoot(), Isis::FileName::setExtension(), Isis::Project::shapeDataRoot(), and Isis::FileName::toString().
|
private |
Calculate a footprint for an Shape using the camera or projection information.
cameraMutex | A mutex that guarantees us serial access to the camera/projection classes |
Definition at line 622 of file Shape.cpp.
References cube(), displayProperties(), Isis::Cube::lineCount(), Isis::PolygonTools::MakeMultiPolygon(), Isis::Cube::sampleCount(), and Isis::IException::User.
Referenced by initFootprint().
Cube * Isis::Shape::cube | ( | ) |
Get the Cube * associated with this display property.
This will allocate the Cube * if one is not already present.
Definition at line 308 of file Shape.cpp.
References m_cube, m_fileName, and Isis::IException::Programmer.
Referenced by Isis::ControlPointEditWidget::createControlPoint(), createFootprint(), deleteFromDisk(), Isis::ControlNetTool::drawAllMeasurements(), initCamStats(), Isis::CubeDnView::onItemAdded(), Isis::Footprint2DView::onItemAdded(), Isis::ControlPointEditWidget::setShapesForPoint(), and Shape().
void Isis::Shape::deleteFromDisk | ( | ) |
Delete the shape data from disk.
The cube() will no longer be accessible until you call updateFileName().
Definition at line 575 of file Shape.cpp.
References closeCube(), cube(), Isis::Cube::externalCubeFileName(), Isis::IException::Io, m_fileName, Isis::FileName::path(), and Isis::FileName::setExtension().
Referenced by Isis::ShapeList::deleteFromDisk().
ShapeDisplayProperties * Isis::Shape::displayProperties | ( | ) |
Get the display (GUI) properties (information) associated with this shape.
Definition at line 339 of file Shape.cpp.
References m_displayProperties.
Referenced by createFootprint(), fromPvl(), initFootprint(), and toPvl().
const ShapeDisplayProperties * Isis::Shape::displayProperties | ( | ) | const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this shape.
Definition at line 350 of file Shape.cpp.
References m_displayProperties.
Angle Isis::Shape::emissionAngle | ( | ) | const |
QString Isis::Shape::fileName | ( | ) | const |
Get the file name of the cube that this shape represents.
Definition at line 360 of file Shape.cpp.
References m_fileName.
Referenced by Isis::ControlPointEditWidget::createControlPoint(), Isis::ControlPointEditWidget::loadPoint(), Isis::ControlPointEditWidget::setGroundSourceInfo(), Isis::ProjectItem::setShape(), and Isis::ControlPointEditWidget::setShapesForPoint().
geos::geom::MultiPolygon * Isis::Shape::footprint | ( | ) |
Get the footprint of this shape (if available).
Definition at line 378 of file Shape.cpp.
References m_footprint.
Referenced by Isis::Footprint2DView::onItemAdded().
const geos::geom::MultiPolygon * Isis::Shape::footprint | ( | ) | const |
Get the non-mutable (const) footprint of this shape (if available).
Definition at line 396 of file Shape.cpp.
References m_footprint.
void Isis::Shape::fromPvl | ( | const PvlObject & | pvl | ) |
Read the shape settings from a Pvl.
Object = Shape FileName = ... ID = ... EndObject
pvl | The PvlObject that contains shape information. |
Definition at line 220 of file Shape.cpp.
References displayProperties(), m_fileName, m_id, and Isis::IException::Unknown.
Referenced by Isis::ShapeReader::VariantToShapeFunctor::operator()().
QString Isis::Shape::id | ( | ) | const |
Get a unique, identifying string associated with this shape.
Definition at line 443 of file Shape.cpp.
References m_id.
Referenced by Isis::WorkOrder::listenForShapeDestruction(), and Isis::Footprint2DView::onItemAdded().
Angle Isis::Shape::incidenceAngle | ( | ) | const |
|
private |
TODO.
Definition at line 649 of file Shape.cpp.
References cube(), Isis::Angle::Degrees, Isis::Cube::label(), m_fileName, m_instrumentId, m_spacecraftName, Isis::Distance::Meters, Isis::PvlObject::object(), and Isis::PvlObject::objects().
bool Isis::Shape::initFootprint | ( | QMutex * | cameraMutex | ) |
Calculate a footprint for this shape.
If the footprint is already stored inside the cube, that will be used instead. If no footprint can be found, this throws an exception.
Definition at line 405 of file Shape.cpp.
References createFootprint(), Isis::DisplayProperties::displayName(), displayProperties(), Isis::IException::Io, and m_footprint.
Referenced by Isis::ShapeReader::VariantToShapeFunctor::operator()().
bool Isis::Shape::isFootprintable | ( | ) | const |
Test to see if it's possible to create a footprint from this shape.
This may not give an accurate answer if the cube isn't open.
Definition at line 278 of file Shape.cpp.
References Isis::Cube::label(), m_cube, m_footprint, Isis::PvlObject::object(), Isis::ImagePolygon::toBlob(), and Isis::Blob::Type().
Referenced by Isis::Footprint2DViewWorkOrder::isExecutable().
double Isis::Shape::lineResolution | ( | ) | const |
Distance Isis::Shape::localRadius | ( | ) | const |
Angle Isis::Shape::northAzimuth | ( | ) | const |
Angle Isis::Shape::phaseAngle | ( | ) | const |
ControlPoint::RadiusSource::Source Isis::Shape::radiusSource | ( | ) |
double Isis::Shape::resolution | ( | ) | const |
double Isis::Shape::sampleResolution | ( | ) | const |
void Isis::Shape::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot ) const |
Output format:
<shape id="..." fileName="..."> ... </shape>
(fileName attribute is just the base name)
Definition at line 815 of file Shape.cpp.
References Isis::IsSpecial(), Isis::Angle::isValid(), Isis::Distance::isValid(), m_displayProperties, m_fileName, m_footprint, m_id, m_instrumentId, m_serialNumber, m_spacecraftName, Isis::Distance::meters(), Isis::Angle::radians(), Isis::ControlPoint::RadiusSourceToString(), Isis::ShapeDisplayProperties::save(), Isis::ControlPoint::SurfacePointSourceToString(), and Isis::IString::ToQt().
Referenced by Isis::ShapeList::save().
QString Isis::Shape::serialNumber | ( | ) |
Get the serial number.
Definition at line 369 of file Shape.cpp.
References m_serialNumber.
Referenced by Isis::ControlNetTool::drawAllMeasurements().
void Isis::Shape::setId | ( | QString | id | ) |
ControlPoint::SurfacePointSource::Source Isis::Shape::surfacePointSource | ( | ) |
PvlObject Isis::Shape::toPvl | ( | ) | const |
Convert this Shape to PVL.
The output looks like this:
Object = Shape FileName = ... ID = ... EndObject
Definition at line 252 of file Shape.cpp.
References displayProperties(), m_fileName, m_id, and Isis::DisplayProperties::toPvl().
|
slot |
Change the on-disk file name for this cube to be where the shape ought to be in the given project.
project | The project that this shape is stored in |
Definition at line 606 of file Shape.cpp.
References closeCube(), Isis::FileName::dir(), m_fileName, Isis::FileName::name(), and Isis::Project::shapeDataRoot().
|
private |
|
private |
The cube associated with this Shape.
This is usually NULL once the shape is done initializing because no more than a thousand of these should ever be open at once.
Definition at line 141 of file Shape.h.
Referenced by closeCube(), cube(), isFootprintable(), Shape(), and ~Shape().
|
private |
The GUI information for how this Shape ought to be displayed.
Definition at line 149 of file Shape.h.
Referenced by displayProperties(), displayProperties(), save(), and ~Shape().
|
private |
The on-disk file name of the cube associated with this Shape.
Definition at line 153 of file Shape.h.
Referenced by copyToNewProjectRoot(), cube(), deleteFromDisk(), fileName(), fromPvl(), initCamStats(), save(), Shape(), Shape(), toPvl(), and updateFileName().
|
private |
A 0-360 ocentric lon,lat degrees footprint of this Shape.
Definition at line 169 of file Shape.h.
Referenced by footprint(), footprint(), initFootprint(), isFootprintable(), save(), and ~Shape().
|
private |
|
private |
Instrument id associated with this Shape.
Definition at line 161 of file Shape.h.
Referenced by initCamStats(), and save().
|
private |
|
private |
This will always be simply the filename and is created on construction.
Definition at line 157 of file Shape.h.
Referenced by save(), and serialNumber().
|
private |
Spacecraft name associated with this Shape.
Definition at line 165 of file Shape.h.
Referenced by initCamStats(), and save().
|
private |