Loading [MathJax]/jax/output/NativeMML/config.js
Isis Developer Reference
ProjectItemModel.h
Go to the documentation of this file.
1 #ifndef ProjectItemModel_h
2 #define ProjectItemModel_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QStandardItemModel>
13 
14 #include "FileName.h"
15 
16 class QItemSelection;
17 class QItemSelectionModel;
18 class QMimeData;
19 class QModelIndex;
20 class QString;
21 class QStringList;
22 class QVariant;
23 
24 namespace Isis {
25 
26  class ShapeList;
27  class BundleSolutionInfo;
28  class Control;
29  class ControlList;
30  class FileName;
31  class GuiCameraList;
32  class ImageList;
33  class Project;
34  class ProjectItem;
35  class TargetBodyList;
36  class TemplateList;
37 
133 
134  Q_OBJECT
135 
136  public:
137  ProjectItemModel(QObject *parent = 0);
139 
140  QItemSelectionModel *selectionModel();
141 
142  ProjectItem *addProject(Project *project);
143 
144  ProjectItem *findItemData(const QVariant &data, int role = Qt::UserRole+1);
145 
146  virtual bool canDropMimeData(const QMimeData *data,
147  Qt::DropAction action,
148  int row, int column,
149  const QModelIndex& parent) const;
150 
151  virtual void removeItem(ProjectItem *item);
152  virtual void removeItems(QList<ProjectItem *> items);
153 
157 
158 
159  void appendRow(ProjectItem *item);
160  void clean();
161  QModelIndex indexFromItem(const ProjectItem *item);
162  void insertRow(int row, ProjectItem *item);
163  ProjectItem *item(int row);
164  ProjectItem *itemFromIndex(const QModelIndex &index);
165  void setItem(int row, ProjectItem *item);
166  ProjectItem *takeItem(int row);
167 
168  bool setData(const QModelIndex &index, const QVariant &value, int role);
169  Qt::ItemFlags flags(const QModelIndex &index) const;
170 
171  signals:
176 
177 
182 
186  void cleanProject(bool);
187 
188 
192  void projectNameEdited(QString);
193 
194  protected slots:
195  void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
196 
197  private slots:
198  void onNameChanged(QString newName);
199  void onBundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo);
200  void onImagesAdded(ImageList *images);
201  void onShapesAdded(ShapeList *shapes);
202  void onControlAdded(Control *control);
203  void onControlListAdded(ControlList *controlList);
204  void onTargetsAdded(TargetBodyList *targets);
205  void onTemplatesAdded(TemplateList *templateList);
206  void onGuiCamerasAdded(GuiCameraList *cameras);
207  void onRowsInserted(const QModelIndex &parent, int start, int end);
208  void onRowsRemoved(const QModelIndex &parent, int start, int end);
209 
210  private:
211 
212  QItemSelectionModel *m_selectionModel;
213  QStringList m_reservedNames;
214  bool rejectName(QStringList &reserved, QString target);
215 
216 
217  };
218 
219 }
220 
221 #endif
Isis::ProjectItemModel
Provides access to data stored in a Project through Qt's model-view framework.
Definition: ProjectItemModel.h:132
GuiCameraList.h
TargetBodyList.h
Isis::ProjectItem::bundleSolutionInfo
BundleSolutionInfo * bundleSolutionInfo() const
Returns the BundleSolutionInfo stored in the data of the item.
Definition: ProjectItem.cpp:466
ProjectItem.h
Isis::ImageDisplayProperties::setSelected
void setSelected(bool)
Change the selected state associated with this cube.
Definition: ImageDisplayProperties.cpp:82
FileName.h
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::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::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.
ControlList.h
Isis::Project
The main project for ipce.
Definition: Project.h:289
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
ShapeList.h
Isis::ProjectItem::isImageList
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Definition: ProjectItem.cpp:657
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::selectedItems
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Definition: ProjectItemModel.cpp:158
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::ImageList::name
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:724
ProjectItemModel.h
Isis::ProjectItemModel::addProject
ProjectItem * addProject(Project *project)
Adds a Project to the model.
Definition: ProjectItemModel.cpp:107
QStandardItemModel
ImageList.h
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::ProjectItem::isProject
bool isProject() const
Returns true if a Project is stored in the data of the item.
Definition: ProjectItem.cpp:724
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
Control.h
FileItem.h
QObject
Isis::ProjectItemModel::currentItem
ProjectItem * currentItem()
Returns the current item of the internal selection model.
Definition: ProjectItemModel.cpp:139
IsisDebug.h
Isis::GuiCameraList
List of GuiCameras saved as QSharedPointers.
Definition: GuiCameraList.h:35
BundleSolutionInfo.h
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
TemplateList.h
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::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
Isis::ProjectItem::isTemplate
bool isTemplate() const
Definition: ProjectItem.cpp:602

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:12:13