Isis 3 Programmer Reference
ProjectItemModel.cpp
Go to the documentation of this file.
1 
21 #include "IsisDebug.h"
22 
23 #include "ProjectItemModel.h"
24 #include <QDebug>
25 #include <QItemSelection>
26 #include <QList>
27 #include <QMessageBox>
28 #include <QMimeData>
29 #include <QModelIndex>
30 #include <QObject>
31 #include <QRegExp>
32 #include <QRegExpValidator>
33 #include <QStandardItemModel>
34 #include <QString>
35 #include <QValidator>
36 
37 #include "BundleSolutionInfo.h"
38 #include "Control.h"
39 #include "ControlList.h"
40 #include "FileItem.h"
41 #include "GuiCameraList.h"
42 #include "ImageList.h"
43 #include "Project.h"
44 #include "ProjectItem.h"
45 #include "ShapeList.h"
46 #include "TargetBodyList.h"
47 #include "TemplateList.h"
48 
49 
50 namespace Isis {
57  m_selectionModel = new QItemSelectionModel(this, this);
58  connect(m_selectionModel, SIGNAL(selectionChanged(const QItemSelection &,
59  const QItemSelection &) ),
60  this, SLOT(onSelectionChanged(const QItemSelection &, const QItemSelection &) ) );
61 
62  connect( this, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
63  this, SLOT(onRowsInserted(const QModelIndex &, int, int)) );
64 
65  connect( this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
66  this, SLOT(onRowsRemoved(const QModelIndex &, int, int)) );
67 
68  }
69 
70 
75 
76  }
77 
78 
92  bool ProjectItemModel::canDropMimeData(const QMimeData *data,
93  Qt::DropAction action,
94  int row, int column,
95  const QModelIndex &parent) const {
96  return false;
97  }
98 
99 
105  QItemSelectionModel *ProjectItemModel::selectionModel() {
106  return m_selectionModel;
107  }
108 
109 
120 
121  connect(project, SIGNAL( nameChanged(QString) ),
122  this, SLOT( onNameChanged(QString) ) );
123  connect(project, SIGNAL( bundleSolutionInfoAdded(BundleSolutionInfo *) ),
125  connect(project, SIGNAL( controlAdded(Control *) ),
126  this, SLOT( onControlAdded(Control *) ) );
127  connect(project, SIGNAL( controlListAdded(ControlList *) ),
128  this, SLOT( onControlListAdded(ControlList *) ) );
129  connect(project, SIGNAL( imagesAdded(ImageList *) ),
130  this, SLOT( onImagesAdded(ImageList *) ) );
131  connect(project, SIGNAL( shapesAdded(ShapeList *) ),
132  this, SLOT( onShapesAdded(ShapeList *) ) );
133  connect(project, SIGNAL( targetsAdded(TargetBodyList *) ),
134  this, SLOT( onTargetsAdded(TargetBodyList *) ) );
135  connect(project, SIGNAL( templatesAdded(TemplateList *)),
136  this, SLOT( onTemplatesAdded(TemplateList *)));
137  connect(project, SIGNAL( guiCamerasAdded(GuiCameraList *) ),
138  this, SLOT( onGuiCamerasAdded(GuiCameraList *) ) );
139  ProjectItem *projectItem = new ProjectItem(project);
140  appendRow(projectItem);
141 // qDebug()<<"ProjectItem::addProject after appendRow projectItem rowCount = "<<rowCount();
142  return projectItem;
143  }
144 
145 
152 
153  ProjectItem *item = itemFromIndex( selectionModel()->currentIndex() );
154 
155  // We do this because if the user was in a footprint or cubeDN view, then
156  // There is no valid currentIndex(). In that case, we grab whichever item
157  // was right clicked that triggered this call.
158  if (item == NULL) {
159  item = selectedItems().at(0);
160  }
161  return item;
162  }
163 
164 
171  QItemSelection selection = selectionModel()->selection();
172  QList<ProjectItem *> items;
173 
174 
175  foreach ( QModelIndex index, selection.indexes() ) {
176  items.append( itemFromIndex(index) );
177  }
178 
179  return items;
180  }
190 
191  QItemSelection selection = selectionModel()->selection();
192  QList<ProjectItem *> items;
193  QModelIndexList indices = selection.indexes();
194 
195  // If nothing is selected, fill items with all image lists and images.
196  if (indices.size() == 0) {
197  ProjectItem *imageRoot = findItemData(QVariant("Images"), 0);
198  items.append(imageRoot);
199  for (int i = 0; i < imageRoot->rowCount(); i++) {
200  ProjectItem *imglistItem = imageRoot->child(i);
201  items.append(imglistItem);
202  for (int j = 0; j < imglistItem->rowCount(); j++) {
203  ProjectItem *imgItem = imglistItem->child(j);
204  if (imgItem->isImage()) {
205  items.append(imgItem);
206  }
207  }
208  }
209  return items;
210  }
211 
212  //Query the selected items to see if they have children
213  foreach ( QModelIndex ix, indices ) {
214 
215  ProjectItem *item = this->itemFromIndex(ix);
216 
217  //Anything that is not an image or an image list does
218  //not make sense to display in the BOSS treeview tab,
219  //so we need to exclude these items.
220  if (item->isImageList() || item->isImage() ) {
221  items.append( item );
222  }
223  else {
224  return items;
225  }
226 
227  //If the selected ImageList has children, we have to handle
228  //the case where some of the children are selected, or
229  //the possibility that the user wants all of the children selected.
230  if (this->hasChildren(ix)) {
231 
232  //If the node has children, loop through all of them
233  //and add them to selected items.
234  bool childrenSelected(false);
235  int numChildren = this->rowCount(ix);
236 
237  //First loop through the children to see if any of them are also selected
238  for (int i = 0; i < numChildren;i++) {
239  QModelIndex ixchild = this->index(i,0,ix);
240  if (indices.contains(ixchild) ){
241  childrenSelected=true;
242  break;
243  }
244  }
245  //If they are, then add them to selected items
246  if (childrenSelected) {
247  for (int i =0;i < numChildren;i++) {
248  QModelIndex ixchild = this->index(i,0,ix);
249  if (indices.contains(ixchild))
250  items.append(this->itemFromIndex(ixchild ));
251  }
252  }
253  //No children selected, so we are assuming that the user
254  //wanted to select all of the children under the parent.
255  else {
256  for (int i =0;i < numChildren;i++) {
257  QModelIndex ixchild = this->index(i,0,ix);
258  items.append(this->itemFromIndex(ixchild ));
259  }
260 
261  }
262 
263  }//end if
264 
265  //Append the parent of any selected child. This is so
266  //the children aren't hanging on the tree without
267  //a collapsible parent node.
268  if( item->parent() ->hasChildren()) {
269  ProjectItem * parent = item->parent();
270  if (!items.contains(parent)){
271  items.append(parent);
272  }// end inner if
273  }//end outer if
274  //Also include the grandparent. This handles the event
275  //that we may have multiple image lists selected to the treeview
276  //and we need a grandparent node attached to group them under.
277  if (this->itemFromIndex(ix)->parent()->parent() ){
278  ProjectItem *grandparent = this->itemFromIndex(ix)->parent()->parent();
279  if (!items.contains(grandparent)) {
280  items.append(grandparent);
281  } //end inner if
282 
283  } //end outer if
284 
285  }// end foreach
286 
287  return items;
288 
289  }
290 
291 
302  ProjectItem *ProjectItemModel::findItemData(const QVariant &data, int role) {
303 
304 // qDebug()<<"ProjectItemModel::findItemData incoming data = "<<data;
305  for (int i=0; i<rowCount(); i++) {
306 // qDebug()<<"ProjectItemModel::findItemData BEFORE call: item(i)->findItemData...";
307  ProjectItem *projectItem = item(i)->findItemData(data, role);
308 // qDebug()<<"ProjectItemModel::findItemData AFTER call: item(i)->findItemData...";
309  if (projectItem) {
310  return projectItem;
311  }
312  }
313 
314  return 0;
315  }
316 
317 
328  if (!item) {
329  return;
330  }
331 
332  // remove any children the item has first
333  if (item->hasChildren()) {
334  for (int row = (item->rowCount() - 1); row >= 0; row--) {
335  removeRow(item->child(row)->row(), item->index());
336  }
337  }
338 
339  if (ProjectItem *parentItem = item->parent()) {
340  // remove the item from its parent
341  removeRow(item->row(), parentItem->index());
342  }
343  else {
344  removeRow(item->row());
345  }
346  }
347 
348 
355  foreach (ProjectItem *item, items) {
356  removeItem(item);
357  }
358  }
359 
360 
367  QStandardItemModel::appendRow(item);
368  }
369 
370 
378  QModelIndex ProjectItemModel::indexFromItem(const ProjectItem *item) {
379  return QStandardItemModel::indexFromItem(item);
380  }
381 
382 
390  QStandardItemModel::insertRow(row, item);
391  }
392 
393 
402  return static_cast<ProjectItem *>( QStandardItemModel::item(row) );
403  }
404 
405 
413  ProjectItem *ProjectItemModel::itemFromIndex(const QModelIndex &index) {
414  return static_cast<ProjectItem *>( QStandardItemModel::itemFromIndex(index) );
415  }
416 
417 
424  void ProjectItemModel::setItem(int row, ProjectItem *item) {
425  QStandardItemModel::setItem(row, item);
426  }
427 
428 
437  QList<QStandardItem *> items = QStandardItemModel::takeRow(row);
438 
439  if ( items.isEmpty() ) {
440  return 0;
441  }
442 
443  return static_cast<ProjectItem *>( items.first() );
444  }
445 
446 
453  void ProjectItemModel::onNameChanged(QString newName) {
454  Project *project = qobject_cast<Project *>( sender() );
455 
456  if (!project) {
457  return;
458  }
459 
460  for (int i=0; i<rowCount(); i++) {
461  ProjectItem *projectItem = item(i);
462  if (projectItem->project() == project) {
463  projectItem->setText(newName);
464  }
465  }
466  project->setClean(false);
467  }
468 
469 
481  Project *project = qobject_cast<Project *>( sender() );
482  m_reservedNames.append(bundleSolutionInfo->name() );
483 
484  if (!project) {
485  return;
486  }
487 
488  for (int i=0; i<rowCount(); i++) {
489  ProjectItem *projectItem = item(i);
490  if (projectItem->project() == project) {
491  for (int j=0; j < projectItem->rowCount(); j++) {
492  ProjectItem *resultsItem = projectItem->child(j);
493  if (resultsItem->text() == "Results") {
494  ProjectItem *pItem = new ProjectItem(bundleSolutionInfo);
495  resultsItem->appendRow( pItem );
496 
497  // Append text bundle summary and CSV files to the Statistics in the project
498  ProjectItem *bundleSummaryItem = new ProjectItem(FileItemQsp(
499  new FileItem(bundleSolutionInfo->savedBundleOutputFilename())),
500  "Summary", bundleSolutionInfo->savedBundleOutputFilename(),
501  QIcon(FileName("$base/icons/office-chart-pie.png")
502  .expanded()));
503  pItem->child(2)->appendRow(bundleSummaryItem);
504  ProjectItem *residualsItem = new ProjectItem(FileItemQsp(
505  new FileItem(bundleSolutionInfo->savedResidualsFilename())),
506  "Measure Residuals", bundleSolutionInfo->savedResidualsFilename(),
507  QIcon(FileName("$base/icons/office-chart-pie.png")
508  .expanded()));
509  pItem->child(2)->appendRow(residualsItem);
510  ProjectItem *imagesItem = new ProjectItem(FileItemQsp(
511  new FileItem(bundleSolutionInfo->savedImagesFilename())),
512  "Image", bundleSolutionInfo->savedImagesFilename(),
513  QIcon(FileName("$base/icons/office-chart-pie.png")
514  .expanded()));
515  pItem->child(2)->appendRow(imagesItem);
516  ProjectItem *pointsItem = new ProjectItem(FileItemQsp(
517  new FileItem(bundleSolutionInfo->savedPointsFilename())),
518  "Control Points", bundleSolutionInfo->savedPointsFilename(),
519  QIcon(FileName("$base/icons/office-chart-pie.png")
520  .expanded()));
521  pItem->child(2)->appendRow(pointsItem);
522  }
523  }
524  }
525  }
526  }
527 
528 
538  Project *project = qobject_cast<Project *>( sender() );
539  if (!project) { return; }
540 
541  // Start at our project's node
542  // Start at our project's node
543  for (int i = 0; i<rowCount(); i++) {
544  ProjectItem *projectItem = item(i);
545  if (projectItem->project() == project) {
546 
547  // Find the "Templates" node
548  for (int j = 0; j < projectItem->rowCount(); j++) {
549  ProjectItem *templatesItem = projectItem->child(j);
550  if (templatesItem->text() == "Templates"){
551 
552  // Find either the "Maps" or "Registrations" node
553  QString type = templateList->type();
554  for (int k = 0; k < templatesItem->rowCount(); k++) {
555  ProjectItem *templateType = templatesItem->child(k);
556  if (templateType->text().toLower() == type) {
557  templateType->appendRow( new ProjectItem(templateList));
558  }
559  }
560  }
561  }
562  }
563  }
564  }
565 
566 
576  Project *project = qobject_cast<Project *>( sender() );
577  m_reservedNames.append(control->id() );
578 
579  if (!project) {
580  return;
581  }
582 
583  for (int i=0; i<rowCount(); i++) {
584  ProjectItem *projectItem = item(i);
585  if (projectItem->project() == project) {
586  for (int j=0; j < projectItem->rowCount(); j++) {
587  ProjectItem *controlsItem = projectItem->child(j);
588  if (controlsItem->text() == "Control Networks") {
589  for (int k=0; k < controlsItem->rowCount(); k++) {
590  ProjectItem *controlListItem = controlsItem->child(k);
591  ControlList *controlList = controlListItem->controlList();
592  if ( controlList && controlList->contains(control) ) {
593  controlListItem->appendRow( new ProjectItem(control) );
594  }
595  }
596  }
597  }
598  }
599  }
600 // qDebug()<<"ProjectItemModel::onControlAdded rowCount = "<<rowCount();
601  }
602 
603 
615  Project *project = qobject_cast<Project *>( sender() );
616  m_reservedNames.append(controlList->name() );
617 
618  if (!project) {
619  return;
620  }
621 
622  for (int i=0; i<rowCount(); i++) {
623  ProjectItem *projectItem = item(i);
624  if (projectItem->project() == project) {
625  for (int j=0; j < projectItem->rowCount(); j++) {
626  ProjectItem *controlsItem = projectItem->child(j);
627  if (controlsItem->text() == "Control Networks") {
628  controlsItem->appendRow( new ProjectItem(controlList) );
629  }
630  }
631  }
632  }
633  }
634 
635 
645 // qDebug()<<"ProjectItemModel::onImagesAdded before add rowCount = "<<rowCount();
646  Project *project = qobject_cast<Project *>( sender() );
647  m_reservedNames.append(imageList->name() );
648  if (!project) {
649  return;
650  }
651 
652  for (int i=0; i<rowCount(); i++) {
653  ProjectItem *projectItem = item(i);
654  if (projectItem->project() == project) {
655  for (int j=0; j < projectItem->rowCount(); j++) {
656  ProjectItem *imagesItem = projectItem->child(j);
657  if (imagesItem->text() == "Images") {
658  imagesItem->appendRow( new ProjectItem(imageList) );
659  }
660  }
661  }
662  }
663 // qDebug()<<"ProjectItemModel::onImagesAdded after add rowCount = "<<rowCount();
664  }
665 
666 
675  Project *project = qobject_cast<Project *>( sender() );
676  m_reservedNames.append(shapes->name());
677 
678  if (!project) {
679  return;
680  }
681  for (int i=0; i<rowCount(); i++) {
682  ProjectItem *projectItem = item(i);
683  if (projectItem->project() == project) {
684  for (int j=0; j < projectItem->rowCount(); j++) {
685  ProjectItem *shapesItem = projectItem->child(j);
686  if (shapesItem->text() == "Shapes") {
687  shapesItem->appendRow( new ProjectItem(shapes) );
688  }
689  }
690  }
691  }
692  }
693 
694 
704  Project *project = qobject_cast<Project *>( sender() );
705  m_reservedNames.append(targets->name() );
706 
707  if (!project) {
708  return;
709  }
710 
711  for (int i=0; i<rowCount(); i++) {
712  ProjectItem *projectItem = item(i);
713  if (projectItem->project() == project) {
714  for (int j=0; j < projectItem->rowCount(); j++) {
715  ProjectItem *targetsItem = projectItem->child(j);
716  if (targetsItem->text() == "Target Body") {
717  foreach(TargetBodyQsp target, *targets) {
718  bool append = true;
719  for (int k=0; k < targetsItem->rowCount(); k++) {
720  ProjectItem *targetItem = targetsItem->child(k);
721  if (targetItem->targetBody() == target) {
722  append = false;
723  }
724  }
725  if (append) {
726  targetsItem->appendRow( new ProjectItem(target) );
727  }
728  }
729  }
730  }
731  }
732  }
733  }
734 
735 
745  Project *project = qobject_cast<Project *>( sender() );
746  m_reservedNames.append(cameras->name() );
747 
748  if (!project) {
749  return;
750  }
751 
752  for (int i=0; i<rowCount(); i++) {
753  ProjectItem *projectItem = item(i);
754  if (projectItem->project() == project) {
755  for (int j=0; j < projectItem->rowCount(); j++) {
756  ProjectItem *camerasItem = projectItem->child(j);
757  if (camerasItem->text() == "Sensors") {
758  foreach(GuiCameraQsp camera, *cameras) {
759  bool append = true;
760  for (int k=0; k < camerasItem->rowCount(); k++) {
761  ProjectItem *cameraItem = camerasItem->child(k);
762  if (cameraItem->guiCamera() == camera) {
763  append = false;
764  }
765  }
766  if (append) {
767  camerasItem->appendRow( new ProjectItem(camera) );
768  }
769  }
770  }
771  }
772  }
773  }
774  }
775 
776 
787  void ProjectItemModel::onSelectionChanged(const QItemSelection &selected,
788  const QItemSelection &deselected) {
790  foreach ( QModelIndex index, selected.indexes() ) {
791  selectedItems.append( itemFromIndex(index) );
792  }
793 
794  foreach (ProjectItem *item, selectedItems) {
795  if ( item->isImage() ) {
797  }
798  }
799 
800  QList<ProjectItem *> deselectedItems;
801  foreach ( QModelIndex index, deselected.indexes() ) {
802  deselectedItems.append( itemFromIndex(index) );
803  }
804 
805  foreach (ProjectItem *item, deselectedItems) {
806  if ( item->isImage() ) {
807  item->image()->displayProperties()->setSelected(false);
808  }
809  }
810 
811  }
812 
813 
824  void ProjectItemModel::onRowsInserted(const QModelIndex &parent, int start, int end) {
825  for (int row=start; row <= end; row++) {
826  QModelIndex newIndex = index(row, 0, parent);
827  ProjectItem *item = itemFromIndex(newIndex);
828  emit itemAdded(item);
829  }
830  }
831 
832 
842  void ProjectItemModel::onRowsRemoved(const QModelIndex &parent, int start, int end) {
843  for (int row=start; row <= end; row++) {
844  QModelIndex newIndex = index(row, 0, parent);
845  ProjectItem *item = itemFromIndex(newIndex);
846 // qDebug()<<"ProjectItemModel::onRowsRemoved this = "<<this<<" item = "<<item;
847  emit itemRemoved(item);
848  }
849 // qDebug()<<"ProjectItemModel::onRowsRemoved Source model : "<<this<<" row count = "<<rowCount();
850  }
851 
852 
866  bool ProjectItemModel::setData(const QModelIndex &index, const QVariant &value, int role) {
867 
868  ProjectItem *item = itemFromIndex(index);
869 
870  QString name = value.toString();
871 
872  bool rejected =rejectName(m_reservedNames,name);
873 
874  if (rejected) {
875  QMessageBox nameRejected;
876  nameRejected.setText("That name is already in use within this project.");
877  nameRejected.exec();
878  return true;
879  }
880 
881  m_reservedNames.append(name);
882 
883  if (item->isProject() && role == Qt::EditRole) {
884  emit projectNameEdited(name);
885  }
886 
887  else if (item->isBundleSolutionInfo() && role == Qt::EditRole) {
888  item->setText(name);
889  item->bundleSolutionInfo()->setName(name);
890  emit cleanProject(false);
891  }
892  else if (item->isImageList() && role == Qt::EditRole) {
893  item->setText(name);
894  item->imageList()->setName(name);
895  emit cleanProject(false);
896  }
897  else if (item->isControlList() && role == Qt::EditRole) {
898  item->setText(name);
899  item->controlList()->setName(name);
900  emit cleanProject(false);
901  }
902  else if (item->isShapeList() && role == Qt::EditRole) {
903  item->setText(name);
904  item->shapeList()->setName(name);
905  emit cleanProject(false);
906  }
907  else if (item->isTemplate() && role == Qt::EditRole) {
908  item->setText(name);
909  emit cleanProject(false);
910  }
911  return true;
912  }
913 
914 
926  Qt::ItemFlags ProjectItemModel::flags(const QModelIndex &index) const {
927 
928  return Qt::ItemIsEditable | QStandardItemModel::flags(index);
929  }
930 
931 
932 
941  bool ProjectItemModel::rejectName(QStringList &reserved, QString target) {
942 
943 
944  QRegExpValidator valid;
945  QValidator::State state;
946  int pos =0;
947  foreach (QString name, reserved) {
948 
949  QRegExp rx(name);
950  valid.setRegExp(rx);
951  state = valid.validate(target,pos);
952 
953  if (state == 2) {
954  return true;
955  }
956  } //end for
957 
958  return false;
959  }
960 
965  for (int i=0; i<rowCount(); i++) {
966  ProjectItem *projectItem = item(i);
967  if (projectItem->project()) {
968  for (int j=0; j < projectItem->rowCount(); j++) {
969  if (projectItem->hasChildren()) {
970  ProjectItem *subProjectItem = projectItem->child(j);
971 
972  // The header "Templates" has two subheaders that we want to keep
973  if (subProjectItem->text() == "Templates") {
974  if (subProjectItem->hasChildren()) {
975  for (int k=0; k < subProjectItem->rowCount(); k++) {
976  ProjectItem *tempProjectItem = subProjectItem->child(k);
977  while (tempProjectItem->hasChildren()) {
978  removeItem(tempProjectItem->child(0));
979  }
980  }
981  }
982  }
983  else {
984  while (subProjectItem->hasChildren()) {
985  removeItem(subProjectItem->child(0));
986  }
987  }
988  }
989  }
990  }
991  }
992  }
993 
994 
995 }
QModelIndex indexFromItem(const ProjectItem *item)
Returns the QModelIndex corresponding to a given ProjectItem.
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:79
Internalizes a list of shapes and allows for operations on the entire list.
Definition: ShapeList.h:33
void insertRow(int row, ProjectItem *item)
Inserts a top-level item at the given row.
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.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
void itemAdded(ProjectItem *)
This signal is emitted when a ProjectItem is added to the model.
ProjectItem * takeItem(int row)
Removes the top-level row and returns the removed item.
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:724
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
$Date$ $Revision$
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
void onControlAdded(Control *control)
Slot to connect to the controlAdded() signal from a project.
bool rejectName(QStringList &reserved, QString target)
Checks to see if we are adding a reserved name to the project (ex.
GuiCameraQsp guiCamera() const
Returns the GuiCameraQsp stored in the data of the item.
The main project for ipce.
Definition: Project.h:289
bool isImage() const
Returns true if an Image is stored in the data of the item.
void appendRow(ProjectItem *item)
Appends an item to the children of this item.
QSharedPointer< FileItem > FileItemQsp
A FileItem smart pointer.
Definition: FileItem.h:48
File name manipulation and expansion.
Definition: FileName.h:116
ProjectItem * itemFromIndex(const QModelIndex &index)
Returns the ProjectItem corresponding to a given QModelIndex.
Container class for BundleAdjustment results.
ControlList * controlList() const
Returns the ControlList stored in the data of the item.
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
void cleanProject(bool)
This signal is emitted whrn a ProjectItem&#39;s name is changed.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
Definition: ControlList.h:36
void setName(QString newName)
Set the human-readable name of this control list.
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...
bool isProject() const
Returns true if a Project is stored in the data of the item.
ProjectItem * currentItem()
Returns the current item of the internal selection model.
void onImagesAdded(ImageList *images)
Slot to connect to the imagesAdded() signal from a Project.
List for holding TargetBodies.
void setSelected(bool)
Change the selected state associated with this cube.
QString name() const
Returns the name of the bundle.
Project * project() const
Returns the Project stored in the data of the item.
void onControlListAdded(ControlList *controlList)
Slot to connect to the controlListAdded() signal from a Project.
QString savedPointsFilename()
Returns filename of output bundle points csv file.
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. ...
void onBundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo)
Slot to connect to the bundleSolutionInfoAdded() signal from a project.
void onRowsRemoved(const QModelIndex &parent, int start, int end)
Slot to connect to the rowsAboutToBeRemoved() signal from QAbstractItemModel.
ProjectItem * parent() const
Returns the parent item of this item.
void onTargetsAdded(TargetBodyList *targets)
Slot to connect to the targetsAdded() signal from a Project.
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
void setName(QString newName)
Set the human-readable name of this shape list.
Definition: ShapeList.cpp:548
QString name() const
Get the human-readable name of this gui cameray list.
bool isBundleSolutionInfo() const
Returns true if a BundleSolutionInfo is stored in the data of the item.
void projectNameEdited(QString)
This signal is emitted when the project name is edited.
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...
void setName(QString name)
Sets the name of the bundle.
void itemRemoved(ProjectItem *)
This signal is emitted when a ProjectItem is removed to the model.
virtual void removeItems(QList< ProjectItem *> items)
Removes a list of items and their children from the model.
void appendRow(ProjectItem *item)
Appends a top-level item to the model.
QItemSelectionModel * selectionModel()
Returns the internal selection model.
void clean()
Used to clean the ProjectItemModel of everything but the headers.
void onGuiCamerasAdded(GuiCameraList *cameras)
Slot to connect to the guiCamerasAdded() signal from a Project.
TargetBodyQsp targetBody() const
Returns the TargetBodyQsp stored in the data of the item.
BundleSolutionInfo * bundleSolutionInfo() const
Returns the BundleSolutionInfo stored in the data of the item.
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
Image * image() const
Returns the Image stored in the data of the item.
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
ProjectItem * item(int row)
Returns the top-level item at the given row.
void onNameChanged(QString newName)
Slot to connect to the nameChanged() signal from a Project.
~ProjectItemModel()
Destructs the model.
List of GuiCameras saved as QSharedPointers.
Definition: GuiCameraList.h:35
Qt::ItemFlags flags(const QModelIndex &index) const
This virtual method was added to handle changing the project name by double-clicking the project name...
void setItem(int row, ProjectItem *item)
Sets the item at the top-level row.
void onRowsInserted(const QModelIndex &parent, int start, int end)
Slot to connect to the rowsInserted() signal from QAbstractItemModel.
QString name() const
Get the human-readable name of this control list.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
ProjectItem * child(int row) const
Returns the child item at a given row.
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Slot to connect to the selectionChanged() signal from a selection model.
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
void onTemplatesAdded(TemplateList *templateList)
Slot connected to the templatesAdded() signal from a project.
Represents an item of a ProjectItemModel in Qt&#39;s model-view framework.
Definition: ProjectItem.h:146
QString name() const
Get the human-readable name of this target body list.
QString type() const
Get the type of template in this TemplateList.
QList< ProjectItem * > selectedBOSSImages()
ProjectItemModel::selectedBOSSImages.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QString name() const
Get the human-readable name of this shape list.
Definition: ShapeList.cpp:569
QString savedBundleOutputFilename()
Returns bundleout text filename.
A container for a filename to be represented as a ProjectItem on the project tree.
Definition: FileItem.h:40
QItemSelectionModel * m_selectionModel
The internal selection model.
QString id() const
Access the unique ID associated with this Control.
Definition: Control.cpp:274
ProjectItemModel(QObject *parent=0)
Constructs an empty model.
void setName(QString newName)
Set the human-readable name of this image list.
Definition: ImageList.cpp:703
QString savedImagesFilename()
Returns filename of output bundle images csv file.
void onShapesAdded(ShapeList *shapes)
Slot to connect to the shapesAdded() signal from a Project.
ProjectItem * addProject(Project *project)
Adds a Project to the model.
void setClean(bool value)
Function to change the clean state of the project.
Definition: Project.cpp:1595
ShapeList * shapeList() const
Returns the ShapeList stored in the data of the item.