10 #include <QMessageBox> 
   28 #include "ViewportMainWindow.h" 
   46     m_directory = directory;
 
   51   IpceTool::~IpceTool () {
 
   65      action->setIcon(QPixmap(
toolIconDir()+
"/stock_draw-connector-with-arrows.png"));
 
   66      action->setToolTip(
"Control Point Editor (T)");
 
   67      action->setShortcut(Qt::Key_T);
 
   73    void IpceTool::setControlNet(
ControlNet *cnet) {
 
   91     if (cvp  == NULL) 
return;
 
   95     bool isGroundSource = m_view->viewportContainsShape(cvp);
 
  101     if (s == Qt::LeftButton) {
 
  113         ControlPoint *point = m_controlNet->FindClosest(sn, samp, line);
 
  114         emit modifyControlPoint(point);
 
  117         QString message = 
"No points exist for editing. Create points using the right mouse";
 
  118         message += 
" button.";
 
  119         QMessageBox::warning(m_ipceTool, 
"Warning", message);
 
  124     else if (s == Qt::MidButton) {
 
  126       if (!m_controlNet || m_controlNet->GetNumPoints() == 0) {
 
  127         QString message = 
"No points exist for deleting.  Create points ";
 
  128         message += 
"using the right mouse button.";
 
  129         QMessageBox::warning(m_ipceTool, 
"Warning", message);
 
  143         point = m_controlNet->FindClosest(sn, samp, line);
 
  146           QString message = 
"No points exist for deleting.  Create points ";
 
  147           message += 
"using the right mouse button.";
 
  148           QMessageBox::warning(m_ipceTool, 
"Warning", message);
 
  153         QString message = 
"Cannot find point on this image for deleting.";
 
  154         QMessageBox::critical(m_ipceTool, 
"Error", message);
 
  158       emit deleteControlPoint(point);
 
  160     else if (s == Qt::RightButton) {
 
  164         QString message = 
"Invalid latitude or longitude at this point. ";
 
  165         QMessageBox::critical(NULL, 
"Error", message);
 
  171       emit createControlPoint(lat, lon, cvp->
cube(), isGroundSource);
 
  212        vp->viewport()->update();
 
  241     if (m_controlNet == 0 || m_controlNet->GetNumPoints() == 0) 
return;
 
  252     if (!m_controlNet->GetCubeSerials().contains(
 
  253                       serialNumber)) 
return;
 
  256         m_controlNet->GetMeasuresInCube(serialNumber);
 
  258     for (
int i = 0; i < measures.count(); i++) {
 
  261       double samp = m->GetSample();
 
  262       double line = m->GetLine();
 
  266       if (m->Parent()->IsIgnored()) {
 
  267         painter->setPen(QColor(255, 255, 0)); 
 
  270       else if (m->IsIgnored()) {
 
  271         painter->setPen(QColor(255, 255, 0)); 
 
  275         painter->setPen(Qt::magenta);
 
  278         painter->setPen(Qt::green); 
 
  281       painter->drawLine(x - 5, y, x + 5, y);
 
  282       painter->drawLine(x, y - 5, x, y + 5);
 
Cube display widget for certain Isis MDI applications. 
 
PointType GetType() const 
 
UniversalGroundMap * universalGroundMap() const 
Return the universal ground map associated with the cube (NULL implies none) 
 
double UniversalLatitude() const 
Returns the universal latitude of the camera model or projection. 
 
A Free point is a Control Point that identifies common measurements between two or more cubes...
 
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL. 
 
Cube * cube() const 
Return the cube associated with viewport. 
 
double UniversalLongitude() const 
Returns the universal longitude of the camera model or projection. 
 
void viewportToCube(int x, int y, double &sample, double &line) const 
Convert a viewport x/y to a cube sample/line (may be outside the cube) 
 
bool SetImage(double sample, double line)
Returns whether the sample/line postion was set successfully in the camera model or projection...
 
View that displays cubes in a QView-like way. 
 
void cubeToViewport(double sample, double line, int &x, int &y) const 
Convert a cube sample/line to a viewport x/y (may be outside the viewport) 
 
QString fileName() const 
Returns the opened cube's filename.