File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ProjectItemModel.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "IsisDebug.h"
10 
11 #include "ProjectItemModel.h"
12 #include <QDebug>
13 #include <QItemSelection>
14 #include <QList>
15 #include <QMessageBox>
16 #include <QMimeData>
17 #include <QModelIndex>
18 #include <QObject>
19 #include <QRegExp>
20 #include <QRegExpValidator>
21 #include <QStandardItemModel>
22 #include <QString>
23 #include <QValidator>
24 
25 #include "BundleSolutionInfo.h"
26 #include "Control.h"
27 #include "ControlList.h"
28 #include "FileItem.h"
29 #include "GuiCameraList.h"
30 #include "ImageList.h"
31 #include "Project.h"
32 #include "ProjectItem.h"
33 #include "ShapeList.h"
34 #include "TargetBodyList.h"
35 #include "TemplateList.h"
36 
37 
38 namespace Isis {
45  m_selectionModel = new QItemSelectionModel(this, this);
46  connect(m_selectionModel, SIGNAL(selectionChanged(const QItemSelection &,
47  const QItemSelection &) ),
48  this, SLOT(onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
49 
50  connect( this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
51  this, SLOT(onRowsInserted(const QModelIndex &, int, int)) );
52 
53  connect( this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
54  this, SLOT(onRowsRemoved(const QModelIndex &, int, int)) );
55 
56  }
57 
58 
63 
64  }
65 
66 
80  bool ProjectItemModel::canDropMimeData(const QMimeData *data,
81  Qt::DropAction action,
82  int row, int column,
83  const QModelIndex &parent) const {
84  return false;
85  }
86 
87 
93  QItemSelectionModel *ProjectItemModel::selectionModel() {
94  return m_selectionModel;
95  }
96 
97 
108 
109  connect(project, SIGNAL( nameChanged(QString) ),
110  this, SLOT( onNameChanged(QString) ) );
111  connect(project, SIGNAL( bundleSolutionInfoAdded(BundleSolutionInfo *) ),
113  connect(project, SIGNAL( controlAdded(Control *) ),
114  this, SLOT( onControlAdded(Control *) ) );
115  connect(project, SIGNAL( controlListAdded(ControlList *) ),
116  this, SLOT( onControlListAdded(ControlList *) ) );
117  connect(project, SIGNAL( imagesAdded(ImageList *) ),
118  this, SLOT( onImagesAdded(ImageList *) ) );
119  connect(project, SIGNAL( shapesAdded(ShapeList *) ),
120  this, SLOT( onShapesAdded(ShapeList *) ) );
121  connect(project, SIGNAL( targetsAdded(TargetBodyList *) ),
122  this, SLOT( onTargetsAdded(TargetBodyList *) ) );
123  connect(project, SIGNAL( templatesAdded(TemplateList *)),
124  this, SLOT( onTemplatesAdded(TemplateList *)));
125  connect(project, SIGNAL( guiCamerasAdded(GuiCameraList *) ),
126  this, SLOT( onGuiCamerasAdded(GuiCameraList *) ) );
127  ProjectItem *projectItem = new ProjectItem(project);
128  appendRow(projectItem);
129 // qDebug()<<"ProjectItem::addProject after appendRow projectItem rowCount = "<<rowCount();
130  return projectItem;
131  }
132 
133 
140 
141  ProjectItem *item = itemFromIndex( selectionModel()->currentIndex() );
142 
143  // We do this because if the user was in a footprint or cubeDN view, then
144  // There is no valid currentIndex(). In that case, we grab whichever item
145  // was right clicked that triggered this call.
146  if (item == NULL) {
147  item = selectedItems().at(0);
148  }
149  return item;
150  }
151 
152 
159  QItemSelection selection = selectionModel()->selection();
160  QList<ProjectItem *> items;
161 
162 
163  foreach ( QModelIndex index, selection.indexes() ) {
164  items.append( itemFromIndex(index) );
165  }
166 
167  return items;
168  }
178 
179  QItemSelection selection = selectionModel()->selection();
180  QList<ProjectItem *> items;
181  QModelIndexList indices = selection.indexes();
182 
183  // If nothing is selected, fill items with all image lists and images.
184  if (indices.size() == 0) {
185  ProjectItem *imageRoot = findItemData(QVariant("Images"), 0);
186  items.append(imageRoot);
187  for (int i = 0; i < imageRoot->rowCount(); i++) {
188  ProjectItem *imglistItem = imageRoot->child(i);
189  items.append(imglistItem);
190  for (int j = 0; j < imglistItem->rowCount(); j++) {
191  ProjectItem *imgItem = imglistItem->child(j);
192  if (imgItem->isImage()) {
193  items.append(imgItem);
194  }
195  }
196  }
197  return items;
198  }
199 
200  //Query the selected items to see if they have children
201  foreach ( QModelIndex ix, indices ) {
202 
203  ProjectItem *item = this->itemFromIndex(ix);
204 
205  //Anything that is not an image or an image list does
206  //not make sense to display in the BOSS treeview tab,
207  //so we need to exclude these items.
208  if (item->isImageList() || item->isImage() ) {
209  items.append( item );
210  }
211  else {
212  return items;
213  }
214 
215  //If the selected ImageList has children, we have to handle
216  //the case where some of the children are selected, or
217  //the possibility that the user wants all of the children selected.
218  if (this->hasChildren(ix)) {
219 
220  //If the node has children, loop through all of them
221  //and add them to selected items.
222  bool childrenSelected(false);
223  int numChildren = this->rowCount(ix);
224 
225  //First loop through the children to see if any of them are also selected
226  for (int i = 0; i < numChildren;i++) {
227  QModelIndex ixchild = this->index(i,0,ix);
228  if (indices.contains(ixchild) ){
229  childrenSelected=true;
230  break;
231  }
232  }
233  //If they are, then add them to selected items
234  if (childrenSelected) {
235  for (int i =0;i < numChildren;i++) {
236  QModelIndex ixchild = this->index(i,0,ix);
237  if (indices.contains(ixchild))
238  items.append(this->itemFromIndex(ixchild ));
239  }
240  }
241  //No children selected, so we are assuming that the user
242  //wanted to select all of the children under the parent.
243  else {
244  for (int i =0;i < numChildren;i++) {
245  QModelIndex ixchild = this->index(i,0,ix);
246  items.append(this->itemFromIndex(ixchild ));
247  }
248 
249  }
250 
251  }//end if
252 
253  //Append the parent of any selected child. This is so
254  //the children aren't hanging on the tree without
255  //a collapsible parent node.
256  if( item->parent() ->hasChildren()) {
257  ProjectItem * parent = item->parent();
258  if (!items.contains(parent)){
259  items.append(parent);
260  }// end inner if
261  }//end outer if
262  //Also include the grandparent. This handles the event
263  //that we may have multiple image lists selected to the treeview
264  //and we need a grandparent node attached to group them under.
265  if (this->itemFromIndex(ix)->parent()->parent() ){
266  ProjectItem *grandparent = this->itemFromIndex(ix)->parent()->parent();
267  if (!items.contains(grandparent)) {
268  items.append(grandparent);
269  } //end inner if
270 
271  } //end outer if
272 
273  }// end foreach
274 
275  return items;
276 
277  }
278 
279 
290  ProjectItem *ProjectItemModel::findItemData(const QVariant &data, int role) {
291 
292 // qDebug()<<"ProjectItemModel::findItemData incoming data = "<<data;
293  for (int i=0; i<rowCount(); i++) {
294 // qDebug()<<"ProjectItemModel::findItemData BEFORE call: item(i)->findItemData...";
295  ProjectItem *projectItem = item(i)->findItemData(data, role);
296 // qDebug()<<"ProjectItemModel::findItemData AFTER call: item(i)->findItemData...";
297  if (projectItem) {
298  return projectItem;
299  }
300  }
301 
302  return 0;
303  }
304 
305 
316  if (!item) {
317  return;
318  }
319 
320  // remove any children the item has first
321  if (item->hasChildren()) {
322  for (int row = (item->rowCount() - 1); row >= 0; row--) {
323  removeRow(item->child(row)->row(), item->index());
324  }
325  }
326 
327  if (ProjectItem *parentItem = item->parent()) {
328  // remove the item from its parent
329  removeRow(item->row(), parentItem->index());
330  }
331  else {
332  removeRow(item->row());
333  }
334  }
335 
336 
343  foreach (ProjectItem *item, items) {
344  removeItem(item);
345  }
346  }
347 
348 
355  QStandardItemModel::appendRow(item);
356  }
357 
358 
366  QModelIndex ProjectItemModel::indexFromItem(const ProjectItem *item) {
367  return QStandardItemModel::indexFromItem(item);
368  }
369 
370 
378  QStandardItemModel::insertRow(row, item);
379  }
380 
381 
390  return static_cast<ProjectItem *>( QStandardItemModel::item(row) );
391  }
392 
393 
401  ProjectItem *ProjectItemModel::itemFromIndex(const QModelIndex &index) {
402  return static_cast<ProjectItem *>( QStandardItemModel::itemFromIndex(index) );
403  }
404 
405 
412  void ProjectItemModel::setItem(int row, ProjectItem *item) {
413  QStandardItemModel::setItem(row, item);
414  }
415 
416 
425  QList<QStandardItem *> items = QStandardItemModel::takeRow(row);
426 
427  if ( items.isEmpty() ) {
428  return 0;
429  }
430 
431  return static_cast<ProjectItem *>( items.first() );
432  }
433 
434 
441  void ProjectItemModel::onNameChanged(QString newName) {
442  Project *project = qobject_cast<Project *>( sender() );
443 
444  if (!project) {
445  return;
446  }
447 
448  for (int i=0; i<rowCount(); i++) {
449  ProjectItem *projectItem = item(i);
450  if (projectItem->project() == project) {
451  projectItem->setText(newName);
452  }
453  }
454  project->setClean(false);
455  }
456 
457 
469  Project *project = qobject_cast<Project *>( sender() );
470  m_reservedNames.append(bundleSolutionInfo->name() );
471 
472  if (!project) {
473  return;
474  }
475 
476  for (int i=0; i<rowCount(); i++) {
477  ProjectItem *projectItem = item(i);
478  if (projectItem->project() == project) {
479  for (int j=0; j < projectItem->rowCount(); j++) {
480  ProjectItem *resultsItem = projectItem->child(j);
481  if (resultsItem->text() == "Results") {
482  ProjectItem *pItem = new ProjectItem(bundleSolutionInfo);
483  resultsItem->appendRow( pItem );
484 
485  // Append text bundle summary and CSV files to the Statistics in the project
486  ProjectItem *bundleSummaryItem = new ProjectItem(FileItemQsp(
487  new FileItem(bundleSolutionInfo->savedBundleOutputFilename())),
488  "Summary", bundleSolutionInfo->savedBundleOutputFilename(),
489  QIcon(FileName("$ISISROOT/appdata/images/icons/office-chart-pie.png")
490  .expanded()));
491  pItem->child(2)->appendRow(bundleSummaryItem);
492  ProjectItem *residualsItem = new ProjectItem(FileItemQsp(
493  new FileItem(bundleSolutionInfo->savedResidualsFilename())),
494  "Measure Residuals", bundleSolutionInfo->savedResidualsFilename(),
495  QIcon(FileName("$ISISROOT/appdata/images/icons/office-chart-pie.png")
496  .expanded()));
497  pItem->child(2)->appendRow(residualsItem);
498  ProjectItem *imagesItem = new ProjectItem(FileItemQsp(
499  new FileItem(bundleSolutionInfo->savedImagesFilename())),
500  "Image", bundleSolutionInfo->savedImagesFilename(),
501  QIcon(FileName("$ISISROOT/appdata/images/icons/office-chart-pie.png")
502  .expanded()));
503  pItem->child(2)->appendRow(imagesItem);
504  ProjectItem *pointsItem = new ProjectItem(FileItemQsp(
505  new FileItem(bundleSolutionInfo->savedPointsFilename())),
506  "Control Points", bundleSolutionInfo->savedPointsFilename(),
507  QIcon(FileName("$ISISROOT/appdata/images/icons/office-chart-pie.png")
508  .expanded()));
509  pItem->child(2)->appendRow(pointsItem);
510  }
511  }
512  }
513  }
514  }
515 
516 
526  Project *project = qobject_cast<Project *>( sender() );
527  if (!project) { return; }
528 
529  // Start at our project's node
530  // Start at our project's node
531  for (int i = 0; i<rowCount(); i++) {
532  ProjectItem *projectItem = item(i);
533  if (projectItem->project() == project) {
534 
535  // Find the "Templates" node
536  for (int j = 0; j < projectItem->rowCount(); j++) {
537  ProjectItem *templatesItem = projectItem->child(j);
538  if (templatesItem->text() == "Templates"){
539 
540  // Find either the "Maps" or "Registrations" node
541  QString type = templateList->type();
542  for (int k = 0; k < templatesItem->rowCount(); k++) {
543  ProjectItem *templateType = templatesItem->child(k);
544  if (templateType->text().toLower() == type) {
545  templateType->appendRow( new ProjectItem(templateList));
546  }
547  }
548  }
549  }
550  }
551  }
552  }
553 
554 
564  Project *project = qobject_cast<Project *>( sender() );
565  m_reservedNames.append(control->id() );
566 
567  if (!project) {
568  return;
569  }
570 
571  for (int i=0; i<rowCount(); i++) {
572  ProjectItem *projectItem = item(i);
573  if (projectItem->project() == project) {
574  for (int j=0; j < projectItem->rowCount(); j++) {
575  ProjectItem *controlsItem = projectItem->child(j);
576  if (controlsItem->text() == "Control Networks") {
577  for (int k=0; k < controlsItem->rowCount(); k++) {
578  ProjectItem *controlListItem = controlsItem->child(k);
579  ControlList *controlList = controlListItem->controlList();
580  if ( controlList && controlList->contains(control) ) {
581  controlListItem->appendRow( new ProjectItem(control) );
582  }
583  }
584  }
585  }
586  }
587  }
588 // qDebug()<<"ProjectItemModel::onControlAdded rowCount = "<<rowCount();
589  }
590 
591 
603  Project *project = qobject_cast<Project *>( sender() );
604  m_reservedNames.append(controlList->name() );
605 
606  if (!project) {
607  return;
608  }
609 
610  for (int i=0; i<rowCount(); i++) {
611  ProjectItem *projectItem = item(i);
612  if (projectItem->project() == project) {
613  for (int j=0; j < projectItem->rowCount(); j++) {
614  ProjectItem *controlsItem = projectItem->child(j);
615  if (controlsItem->text() == "Control Networks") {
616  controlsItem->appendRow( new ProjectItem(controlList) );
617  }
618  }
619  }
620  }
621  }
622 
623 
633 // qDebug()<<"ProjectItemModel::onImagesAdded before add rowCount = "<<rowCount();
634  Project *project = qobject_cast<Project *>( sender() );
635  m_reservedNames.append(imageList->name() );
636  if (!project) {
637  return;
638  }
639 
640  for (int i=0; i<rowCount(); i++) {
641  ProjectItem *projectItem = item(i);
642  if (projectItem->project() == project) {
643  for (int j=0; j < projectItem->rowCount(); j++) {
644  ProjectItem *imagesItem = projectItem->child(j);
645  if (imagesItem->text() == "Images") {
646  imagesItem->appendRow( new ProjectItem(imageList) );
647  }
648  }
649  }
650  }
651 // qDebug()<<"ProjectItemModel::onImagesAdded after add rowCount = "<<rowCount();
652  }
653 
654 
663  Project *project = qobject_cast<Project *>( sender() );
664  m_reservedNames.append(shapes->name());
665 
666  if (!project) {
667  return;
668  }
669  for (int i=0; i<rowCount(); i++) {
670  ProjectItem *projectItem = item(i);
671  if (projectItem->project() == project) {
672  for (int j=0; j < projectItem->rowCount(); j++) {
673  ProjectItem *shapesItem = projectItem->child(j);
674  if (shapesItem->text() == "Shapes") {
675  shapesItem->appendRow( new ProjectItem(shapes) );
676  }
677  }
678  }
679  }
680  }
681 
682 
692  Project *project = qobject_cast<Project *>( sender() );
693  m_reservedNames.append(targets->name() );
694 
695  if (!project) {
696  return;
697  }
698 
699  for (int i=0; i<rowCount(); i++) {
700  ProjectItem *projectItem = item(i);
701  if (projectItem->project() == project) {
702  for (int j=0; j < projectItem->rowCount(); j++) {
703  ProjectItem *targetsItem = projectItem->child(j);
704  if (targetsItem->text() == "Target Body") {
705  foreach(TargetBodyQsp target, *targets) {
706  bool append = true;
707  for (int k=0; k < targetsItem->rowCount(); k++) {
708  ProjectItem *targetItem = targetsItem->child(k);
709  if (targetItem->targetBody() == target) {
710  append = false;
711  }
712  }
713  if (append) {
714  targetsItem->appendRow( new ProjectItem(target) );
715  }
716  }
717  }
718  }
719  }
720  }
721  }
722 
723 
733  Project *project = qobject_cast<Project *>( sender() );
734  m_reservedNames.append(cameras->name() );
735 
736  if (!project) {
737  return;
738  }
739 
740  for (int i=0; i<rowCount(); i++) {
741  ProjectItem *projectItem = item(i);
742  if (projectItem->project() == project) {
743  for (int j=0; j < projectItem->rowCount(); j++) {
744  ProjectItem *camerasItem = projectItem->child(j);
745  if (camerasItem->text() == "Sensors") {
746  foreach(GuiCameraQsp camera, *cameras) {
747  bool append = true;
748  for (int k=0; k < camerasItem->rowCount(); k++) {
749  ProjectItem *cameraItem = camerasItem->child(k);
750  if (cameraItem->guiCamera() == camera) {
751  append = false;
752  }
753  }
754  if (append) {
755  camerasItem->appendRow( new ProjectItem(camera) );
756  }
757  }
758  }
759  }
760  }
761  }
762  }
763 
764 
775  void ProjectItemModel::onSelectionChanged(const QItemSelection &selected,
776  const QItemSelection &deselected) {
778  foreach ( QModelIndex index, selected.indexes() ) {
779  selectedItems.append( itemFromIndex(index) );
780  }
781 
782  foreach (ProjectItem *item, selectedItems) {
783  if ( item->isImage() ) {
785  }
786  }
787 
788  QList<ProjectItem *> deselectedItems;
789  foreach ( QModelIndex index, deselected.indexes() ) {
790  deselectedItems.append( itemFromIndex(index) );
791  }
792 
793  foreach (ProjectItem *item, deselectedItems) {
794  if ( item->isImage() ) {
795  item->image()->displayProperties()->setSelected(false);
796  }
797  }
798 
799  }
800 
801 
812  void ProjectItemModel::onRowsInserted(const QModelIndex &parent, int start, int end) {
813  for (int row=start; row <= end; row++) {
814  QModelIndex newIndex = index(row, 0, parent);
815  ProjectItem *item = itemFromIndex(newIndex);
816  emit itemAdded(item);
817  }
818  }
819 
820 
830  void ProjectItemModel::onRowsRemoved(const QModelIndex &parent, int start, int end) {
831  for (int row=start; row <= end; row++) {
832  QModelIndex newIndex = index(row, 0, parent);
833  ProjectItem *item = itemFromIndex(newIndex);
834 // qDebug()<<"ProjectItemModel::onRowsRemoved this = "<<this<<" item = "<<item;
835  emit itemRemoved(item);
836  }
837 // qDebug()<<"ProjectItemModel::onRowsRemoved Source model : "<<this<<" row count = "<<rowCount();
838  }
839 
840 
854  bool ProjectItemModel::setData(const QModelIndex &index, const QVariant &value, int role) {
855 
856  ProjectItem *item = itemFromIndex(index);
857 
858  QString name = value.toString();
859 
860  bool rejected =rejectName(m_reservedNames,name);
861 
862  if (rejected) {
863  QMessageBox nameRejected;
864  nameRejected.setText("That name is already in use within this project.");
865  nameRejected.exec();
866  return true;
867  }
868 
869  m_reservedNames.append(name);
870 
871  if (item->isProject() && role == Qt::EditRole) {
872  emit projectNameEdited(name);
873  }
874 
875  else if (item->isBundleSolutionInfo() && role == Qt::EditRole) {
876  item->setText(name);
877  item->bundleSolutionInfo()->setName(name);
878  emit cleanProject(false);
879  }
880  else if (item->isImageList() && role == Qt::EditRole) {
881  item->setText(name);
882  item->imageList()->setName(name);
883  emit cleanProject(false);
884  }
885  else if (item->isControlList() && role == Qt::EditRole) {
886  item->setText(name);
887  item->controlList()->setName(name);
888  emit cleanProject(false);
889  }
890  else if (item->isShapeList() && role == Qt::EditRole) {
891  item->setText(name);
892  item->shapeList()->setName(name);
893  emit cleanProject(false);
894  }
895  else if (item->isTemplate() && role == Qt::EditRole) {
896  item->setText(name);
897  emit cleanProject(false);
898  }
899  return true;
900  }
901 
902 
914  Qt::ItemFlags ProjectItemModel::flags(const QModelIndex &index) const {
915 
916  return Qt::ItemIsEditable | QStandardItemModel::flags(index);
917  }
918 
919 
920 
929  bool ProjectItemModel::rejectName(QStringList &reserved, QString target) {
930 
931 
932  QRegExpValidator valid;
933  QValidator::State state;
934  int pos =0;
935  foreach (QString name, reserved) {
936 
937  QRegExp rx(name);
938  valid.setRegExp(rx);
939  state = valid.validate(target,pos);
940 
941  if (state == 2) {
942  return true;
943  }
944  } //end for
945 
946  return false;
947  }
948 
953  for (int i=0; i<rowCount(); i++) {
954  ProjectItem *projectItem = item(i);
955  if (projectItem->project()) {
956  for (int j=0; j < projectItem->rowCount(); j++) {
957  if (projectItem->hasChildren()) {
958  ProjectItem *subProjectItem = projectItem->child(j);
959 
960  // The header "Templates" has two subheaders that we want to keep
961  if (subProjectItem->text() == "Templates") {
962  if (subProjectItem->hasChildren()) {
963  for (int k=0; k < subProjectItem->rowCount(); k++) {
964  ProjectItem *tempProjectItem = subProjectItem->child(k);
965  while (tempProjectItem->hasChildren()) {
966  removeItem(tempProjectItem->child(0));
967  }
968  }
969  }
970  }
971  else {
972  while (subProjectItem->hasChildren()) {
973  removeItem(subProjectItem->child(0));
974  }
975  }
976  }
977  }
978  }
979  }
980  }
981 
982 
983 }
Isis::ProjectItem::bundleSolutionInfo
BundleSolutionInfo * bundleSolutionInfo() const
Returns the BundleSolutionInfo stored in the data of the item.
Definition: ProjectItem.cpp:466
Isis::ImageDisplayProperties::setSelected
void setSelected(bool)
Change the selected state associated with this cube.
Definition: ImageDisplayProperties.cpp:82
Isis::BundleSolutionInfo::savedPointsFilename
QString savedPointsFilename()
Returns filename of output bundle points csv file.
Definition: BundleSolutionInfo.cpp:146
Isis::ProjectItemModel::setItem
void setItem(int row, ProjectItem *item)
Sets the item at the top-level row.
Definition: ProjectItemModel.cpp:412
Isis::ProjectItemModel::onRowsInserted
void onRowsInserted(const QModelIndex &parent, int start, int end)
Slot to connect to the rowsInserted() signal from QAbstractItemModel.
Definition: ProjectItemModel.cpp:812
Isis::ProjectItemModel::onControlListAdded
void onControlListAdded(ControlList *controlList)
Slot to connect to the controlListAdded() signal from a Project.
Definition: ProjectItemModel.cpp:602
Isis::BundleSolutionInfo::savedResidualsFilename
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
Definition: BundleSolutionInfo.cpp:156
Isis::ControlList::setName
void setName(QString newName)
Set the human-readable name of this control list.
Definition: ControlList.cpp:518
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Project.h
Isis::ProjectItemModel::onSelectionChanged
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Slot to connect to the selectionChanged() signal from a selection model.
Definition: ProjectItemModel.cpp:775
Isis::ProjectItemModel::projectNameEdited
void projectNameEdited(QString)
This signal is emitted when the project name is edited.
Isis::ProjectItem::image
Image * image() const
Returns the Image stored in the data of the item.
Definition: ProjectItem.cpp:476
Isis::ProjectItemModel::appendRow
void appendRow(ProjectItem *item)
Appends a top-level item to the model.
Definition: ProjectItemModel.cpp:354
Isis::ProjectItemModel::onGuiCamerasAdded
void onGuiCamerasAdded(GuiCameraList *cameras)
Slot to connect to the guiCamerasAdded() signal from a Project.
Definition: ProjectItemModel.cpp:732
Isis::ProjectItemModel::selectedBOSSImages
QList< ProjectItem * > selectedBOSSImages()
ProjectItemModel::selectedBOSSImages.
Definition: ProjectItemModel.cpp:177
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ControlList
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
Definition: ControlList.h:44
Isis::BundleSolutionInfo::name
QString name() const
Returns the name of the bundle.
Definition: BundleSolutionInfo.cpp:387
Isis::ShapeList::setName
void setName(QString newName)
Set the human-readable name of this shape list.
Definition: ShapeList.cpp:534
Isis::ProjectItemModel::removeItems
virtual void removeItems(QList< ProjectItem * > items)
Removes a list of items and their children from the model.
Definition: ProjectItemModel.cpp:342
Isis::ProjectItemModel::selectionModel
QItemSelectionModel * selectionModel()
Returns the internal selection model.
Definition: ProjectItemModel.cpp:93
Isis::ProjectItemModel::ProjectItemModel
ProjectItemModel(QObject *parent=0)
Constructs an empty model.
Definition: ProjectItemModel.cpp:44
Isis::TemplateList
Definition: TemplateList.h:35
Isis::ProjectItemModel::clean
void clean()
Used to clean the ProjectItemModel of everything but the headers.
Definition: ProjectItemModel.cpp:952
Isis::ProjectItem::child
ProjectItem * child(int row) const
Returns the child item at a given row.
Definition: ProjectItem.cpp:1179
Isis::BundleSolutionInfo::setName
void setName(QString name)
Sets the name of the bundle.
Definition: BundleSolutionInfo.cpp:376
Isis::ProjectItem::isControlList
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
Definition: ProjectItem.cpp:702
Isis::BundleSolutionInfo::savedBundleOutputFilename
QString savedBundleOutputFilename()
Returns bundleout text filename.
Definition: BundleSolutionInfo.cpp:126
Isis::Control
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:66
Isis::BundleSolutionInfo::savedImagesFilename
QString savedImagesFilename()
Returns filename of output bundle images csv file.
Definition: BundleSolutionInfo.cpp:136
QSharedPointer< TargetBody >
Isis::ProjectItemModel::item
ProjectItem * item(int row)
Returns the top-level item at the given row.
Definition: ProjectItemModel.cpp:389
Isis::ProjectItemModel::itemFromIndex
ProjectItem * itemFromIndex(const QModelIndex &index)
Returns the ProjectItem corresponding to a given QModelIndex.
Definition: ProjectItemModel.cpp:401
QStringList
Isis::ProjectItemModel::itemAdded
void itemAdded(ProjectItem *)
This signal is emitted when a ProjectItem is added to the model.
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::ProjectItemModel::onControlAdded
void onControlAdded(Control *control)
Slot to connect to the controlAdded() signal from a project.
Definition: ProjectItemModel.cpp:563
Isis::ProjectItemModel::~ProjectItemModel
~ProjectItemModel()
Destructs the model.
Definition: ProjectItemModel.cpp:62
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::ImageList::setName
void setName(QString newName)
Set the human-readable name of this image list.
Definition: ImageList.cpp:703
Isis::ProjectItem::isImageList
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Definition: ProjectItem.cpp:657
Isis::ProjectItemModel::onTemplatesAdded
void onTemplatesAdded(TemplateList *templateList)
Slot connected to the templatesAdded() signal from a project.
Definition: ProjectItemModel.cpp:525
Isis::ProjectItem::isShapeList
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
Definition: ProjectItem.cpp:679
Isis::ProjectItem::guiCamera
GuiCameraQsp guiCamera() const
Returns the GuiCameraQsp stored in the data of the item.
Definition: ProjectItem.cpp:576
Isis::ProjectItem::isImage
bool isImage() const
Returns true if an Image is stored in the data of the item.
Definition: ProjectItem.cpp:646
Isis::ProjectItemModel::onImagesAdded
void onImagesAdded(ImageList *images)
Slot to connect to the imagesAdded() signal from a Project.
Definition: ProjectItemModel.cpp:632
Isis::ProjectItemModel::selectedItems
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Definition: ProjectItemModel.cpp:158
Isis::ProjectItemModel::m_selectionModel
QItemSelectionModel * m_selectionModel
The internal selection model.
Definition: ProjectItemModel.h:212
Isis::ProjectItem::appendRow
void appendRow(ProjectItem *item)
Appends an item to the children of this item.
Definition: ProjectItem.cpp:1166
Isis::ProjectItem::shapeList
ShapeList * shapeList() const
Returns the ShapeList stored in the data of the item.
Definition: ProjectItem.cpp:506
Isis::ProjectItemModel::cleanProject
void cleanProject(bool)
This signal is emitted whrn a ProjectItem's name is changed.
Isis::BundleSolutionInfo
Container class for BundleAdjustment results.
Definition: BundleSolutionInfo.h:159
Isis::ProjectItemModel::onShapesAdded
void onShapesAdded(ShapeList *shapes)
Slot to connect to the shapesAdded() signal from a Project.
Definition: ProjectItemModel.cpp:662
Isis::ImageList::name
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:724
Isis::ProjectItemModel::addProject
ProjectItem * addProject(Project *project)
Adds a Project to the model.
Definition: ProjectItemModel.cpp:107
QStandardItemModel
Isis::ShapeList
Internalizes a list of shapes and allows for operations on the entire list.
Definition: ShapeList.h:33
Isis::TargetBodyList
List for holding TargetBodies.
Definition: TargetBodyList.h:33
Isis::ProjectItemModel::findItemData
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
Definition: ProjectItemModel.cpp:290
Isis::ProjectItemModel::canDropMimeData
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
You cannot drop mime data into the ProjectItemModel.
Definition: ProjectItemModel.cpp:80
Isis::ProjectItem::controlList
ControlList * controlList() const
Returns the ControlList stored in the data of the item.
Definition: ProjectItem.cpp:546
Isis::ProjectItemModel::onBundleSolutionInfoAdded
void onBundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo)
Slot to connect to the bundleSolutionInfoAdded() signal from a project.
Definition: ProjectItemModel.cpp:468
Isis::ProjectItem::isProject
bool isProject() const
Returns true if a Project is stored in the data of the item.
Definition: ProjectItem.cpp:724
Isis::ProjectItemModel::rejectName
bool rejectName(QStringList &reserved, QString target)
Checks to see if we are adding a reserved name to the project (ex.
Definition: ProjectItemModel.cpp:929
Isis::ProjectItemModel::itemRemoved
void itemRemoved(ProjectItem *)
This signal is emitted when a ProjectItem is removed to the model.
Isis::Image::displayProperties
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
Isis::ProjectItemModel::insertRow
void insertRow(int row, ProjectItem *item)
Inserts a top-level item at the given row.
Definition: ProjectItemModel.cpp:377
Isis::TargetBodyList::name
QString name() const
Get the human-readable name of this target body list.
Definition: TargetBodyList.cpp:671
Isis::ProjectItemModel::indexFromItem
QModelIndex indexFromItem(const ProjectItem *item)
Returns the QModelIndex corresponding to a given ProjectItem.
Definition: ProjectItemModel.cpp:366
Isis::ShapeList::name
QString name() const
Get the human-readable name of this shape list.
Definition: ShapeList.cpp:555
Isis::TemplateList::type
QString type() const
Get the type of template in this TemplateList.
Definition: TemplateList.cpp:91
Isis::ProjectItem::project
Project * project() const
Returns the Project stored in the data of the item.
Definition: ProjectItem.cpp:566
Isis::ProjectItemModel::takeItem
ProjectItem * takeItem(int row)
Removes the top-level row and returns the removed item.
Definition: ProjectItemModel.cpp:424
Isis::ProjectItem::findItemData
ProjectItem * findItemData(const QVariant &value, int role=Qt::UserRole+1)
Finds and returns the first item in the model that contains the data in the role.
Definition: ProjectItem.cpp:1145
Isis::FileItemQsp
QSharedPointer< FileItem > FileItemQsp
A FileItem smart pointer.
Definition: FileItem.h:36
Isis::ProjectItem::parent
ProjectItem * parent() const
Returns the parent item of this item.
Definition: ProjectItem.cpp:1211
Isis::ProjectItem::imageList
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
Definition: ProjectItem.cpp:486
Isis::ControlList::name
QString name() const
Get the human-readable name of this control list.
Definition: ControlList.cpp:539
Isis::GuiCameraList::name
QString name() const
Get the human-readable name of this gui cameray list.
Definition: GuiCameraList.cpp:693
QObject
Isis::ProjectItemModel::onNameChanged
void onNameChanged(QString newName)
Slot to connect to the nameChanged() signal from a Project.
Definition: ProjectItemModel.cpp:441
Isis::ProjectItemModel::currentItem
ProjectItem * currentItem()
Returns the current item of the internal selection model.
Definition: ProjectItemModel.cpp:139
Isis::GuiCameraList
List of GuiCameras saved as QSharedPointers.
Definition: GuiCameraList.h:35
Isis::FileItem
A container for a filename to be represented as a ProjectItem on the project tree.
Definition: FileItem.h:28
Isis::Project::setClean
void setClean(bool value)
Function to change the clean state of the project.
Definition: Project.cpp:1595
Isis::Control::id
QString id() const
Access the unique ID associated with this Control.
Definition: Control.cpp:282
Isis::ProjectItemModel::removeItem
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
Definition: ProjectItemModel.cpp:315
Isis::ProjectItem::isBundleSolutionInfo
bool isBundleSolutionInfo() const
Returns true if a BundleSolutionInfo is stored in the data of the item.
Definition: ProjectItem.cpp:635
Isis::ProjectItemModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role)
This virtual method was added to handle changing the project name by double-clicking the project name...
Definition: ProjectItemModel.cpp:854
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProjectItemModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const
This virtual method was added to handle changing the project name by double-clicking the project name...
Definition: ProjectItemModel.cpp:914
Isis::ProjectItemModel::onRowsRemoved
void onRowsRemoved(const QModelIndex &parent, int start, int end)
Slot to connect to the rowsAboutToBeRemoved() signal from QAbstractItemModel.
Definition: ProjectItemModel.cpp:830
Isis::ProjectItemModel::onTargetsAdded
void onTargetsAdded(TargetBodyList *targets)
Slot to connect to the targetsAdded() signal from a Project.
Definition: ProjectItemModel.cpp:691
Isis::ProjectItem::targetBody
TargetBodyQsp targetBody() const
Returns the TargetBodyQsp stored in the data of the item.
Definition: ProjectItem.cpp:587
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134

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/13/2023 15:17:05