Isis Developer 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 (FileName shapeFolder, XmlStackedHandlerReader *xmlReader, QObject *parent=0) | |
Construct this shape from XML. | |
~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: | |
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()).
|
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 |
Isis::Shape::Shape | ( | FileName | shapeFolder, |
XmlStackedHandlerReader * | xmlReader, | ||
QObject * | parent = 0 ) |
Construct this shape from XML.
shapeFolder | Where this shape XML resides - /work/.../projectRoot/shapes/import1 |
xmlReader | An XML reader that's up to an <shape> tag. |
parent | The Qt-relationship parent |
Isis::Shape::~Shape | ( | ) |
Clean up this shape.
If you haven't saved this shape, all of its settings will be lost.
double Isis::Shape::aspectRatio | ( | ) | const |
Get the aspect ratio of this shape, as calculated and attached by camstats.
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.
Referenced by deleteFromDisk(), and updateFileName().
Copy the cub/ecub files associated with this shape into the new project.
References Isis::FileName::name(), Isis::Project::projectRoot(), Isis::FileName::setExtension(), Isis::Project::shapeDataRoot(), and Isis::FileName::toString().
Cube * Isis::Shape::cube | ( | ) |
Get the Cube * associated with this display property.
This will allocate the Cube * if one is not already present.
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::ControlPointEditWidget::createControlPoint(), deleteFromDisk(), and Shape().
void Isis::Shape::deleteFromDisk | ( | ) |
Delete the shape data from disk.
The cube() will no longer be accessible until you call updateFileName().
References _FILEINFO_, closeCube(), cube(), Isis::Cube::externalCubeFileName(), Isis::IException::Io, 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.
Referenced by fromPvl(), initFootprint(), and toPvl().
const ShapeDisplayProperties * Isis::Shape::displayProperties | ( | ) | const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this shape.
Angle Isis::Shape::emissionAngle | ( | ) | const |
Get the emission angle of this shape, as calculated and attached by camstats.
This is the shape-wide average.
QString Isis::Shape::fileName | ( | ) | const |
Get the file name of the cube that this shape represents.
Referenced by Isis::ControlPointEditWidget::createControlPoint(), and Isis::ProjectItem::setShape().
geos::geom::MultiPolygon * Isis::Shape::footprint | ( | ) |
Get the footprint of this shape (if available).
const geos::geom::MultiPolygon * Isis::Shape::footprint | ( | ) | const |
Get the non-mutable (const) footprint of this shape (if available).
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. |
References _FILEINFO_, displayProperties(), Isis::DisplayProperties::fromPvl(), and Isis::IException::Unknown.
QString Isis::Shape::id | ( | ) | const |
Get a unique, identifying string associated with this shape.
Referenced by Isis::CubeDnView::save().
Angle Isis::Shape::incidenceAngle | ( | ) | const |
Get the incidence angle of this shape, as calculated and attached by camstats.
This is the shape-wide average.
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.
References _FILEINFO_, Isis::DisplayProperties::displayName(), displayProperties(), and Isis::IException::Io.
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.
References Isis::Cube::label(), Isis::PvlObject::object(), Isis::ImagePolygon::toBlob(), and Isis::Blob::Type().
Referenced by Isis::Footprint2DViewWorkOrder::isExecutable().
double Isis::Shape::lineResolution | ( | ) | const |
Get the line resolution of this shape, as calculated and attached by camstats.
This is the shape-wide average.
Distance Isis::Shape::localRadius | ( | ) | const |
Get the local radius of this shape, as calculated and attached by camstats.
This is the shape-wide average.
Angle Isis::Shape::northAzimuth | ( | ) | const |
Get the north azimuth of this shape, as calculated and attached by camstats.
This is the shape-wide average.
Angle Isis::Shape::phaseAngle | ( | ) | const |
Get the phase angle of this shape, as calculated and attached by camstats.
This is the shape-wide average.
ControlPoint::RadiusSource::Source Isis::Shape::radiusSource | ( | ) |
Referenced by Isis::ControlPointEditWidget::createControlPoint().
double Isis::Shape::resolution | ( | ) | const |
Get the resolution of this shape, as calculated and attached by camstats.
This is the shape-wide average.
double Isis::Shape::sampleResolution | ( | ) | const |
Get the sample resolution of this shape, as calculated and attached by camstats.
This is the shape-wide average.
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)
References Basemap, Dem, Isis::IsSpecial(), Isis::Angle::isValid(), Isis::Distance::isValid(), Isis::Distance::meters(), Isis::Angle::radians(), Isis::ControlPoint::RadiusSourceToString(), Isis::ShapeDisplayProperties::save(), Isis::ControlPoint::SurfacePointSourceToString(), Isis::IString::ToQt(), and Unprojected.
Referenced by Isis::ShapeList::save().
QString Isis::Shape::serialNumber | ( | ) |
Get the serial number.
Shape::ShapeType Isis::Shape::shapeType | ( | ) |
ControlPoint::SurfacePointSource::Source Isis::Shape::surfacePointSource | ( | ) |
Referenced by Isis::ControlPointEditWidget::createControlPoint().
PvlObject Isis::Shape::toPvl | ( | ) | const |
Convert this Shape to PVL.
The output looks like this:
Object = Shape FileName = ... ID = ... EndObject
References displayProperties(), 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 |
References closeCube(), Isis::FileName::dir(), Isis::FileName::name(), and Isis::Project::shapeDataRoot().