Isis 3.0 Programmer Reference
Home
ProjectItemModel.h
Go to the documentation of this file.
1 #ifndef ProjectItemModel_h
2 #define ProjectItemModel_h
3 
26 #include <QStandardItemModel>
27 
28 class QItemSelection;
29 class QItemSelectionModel;
30 class QMimeData;
31 class QModelIndex;
32 class QString;
33 class QVariant;
34 
35 namespace Isis {
36 
37  class ShapeList;
38  class BundleSolutionInfo;
39  class Control;
40  class ControlList;
41  class GuiCameraList;
42  class ImageList;
43  class Project;
44  class ProjectItem;
45  class TargetBodyList;
46 
95 
96  Q_OBJECT
97 
98  public:
99  ProjectItemModel(QObject *parent = 0);
101 
102  QItemSelectionModel *selectionModel();
103 
104  ProjectItem *addProject(Project *project);
105 
106  ProjectItem *findItemData(const QVariant &data, int role = Qt::UserRole+1);
107 
108  virtual bool canDropMimeData(const QMimeData *data,
109  Qt::DropAction action,
110  int row, int column,
111  const QModelIndex& parent) const;
112 
113  virtual void removeItem(ProjectItem *item);
114  virtual void removeItems(QList<ProjectItem *> items);
115 
118 
119  void appendRow(ProjectItem *item);
120  QModelIndex indexFromItem(const ProjectItem *item);
121  void insertRow(int row, ProjectItem *item);
122  ProjectItem *item(int row);
123  ProjectItem *itemFromIndex(const QModelIndex &index);
124  void setItem(int row, ProjectItem *item);
125  ProjectItem *takeItem(int row);
126 
127  signals:
131  void itemAdded(ProjectItem *);
132  void itemRemoved(ProjectItem *);
133 
134  protected slots:
135  void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
136 
137  private slots:
138  void onNameChanged(QString newName);
139  void onBundleSolutionInfoAdded(BundleSolutionInfo *bundleSolutionInfo);
140  void onImagesAdded(ImageList *images);
141  void onShapesAdded(ShapeList *shapes);
142  void onControlAdded(Control *control);
143  void onControlListAdded(ControlList *controlList);
144  void onTargetsAdded(TargetBodyList *targets);
145  void onGuiCamerasAdded(GuiCameraList *cameras);
146  void onRowsInserted(const QModelIndex &parent, int start, int end);
147  void onRowsRemoved(const QModelIndex &parent, int start, int end);
148 
149  private:
150  QItemSelectionModel *m_selectionModel;
151 
152  };
153 
154 }
155 
156 #endif
157 
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:57
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.
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.
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:44
void onControlAdded(Control *control)
Slot to connect to the controlAdded() signal from a project.
The main project for cnetsuite.
Definition: Project.h:105
ProjectItem * itemFromIndex(const QModelIndex &index)
Returns the ProjectItem corresponding to a given QModelIndex.
Container class for BundleAdjustment results.
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
Definition: ControlList.h:34
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.
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 onControlListAdded(ControlList *controlList)
Slot to connect to the controlListAdded() signal from a Project.
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.
void onTargetsAdded(TargetBodyList *targets)
Slot to connect to the targetsAdded() signal from a Project.
Provides access to data stored in a Project through Qt&#39;s model-view framework.
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 appendRow(ProjectItem *item)
Appends a top-level item to the model.
QItemSelectionModel * selectionModel()
Returns the internal selection model.
void onGuiCamerasAdded(GuiCameraList *cameras)
Slot to connect to the guiCamerasAdded() signal from a Project.
virtual void removeItems(QList< ProjectItem * > items)
Removes a list of items and their children from the model.
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
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
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.
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Slot to connect to the selectionChanged() signal from a selection model.
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Represents an item of a ProjectItemModel in Qt&#39;s model-view framework.
Definition: ProjectItem.h:113
QItemSelectionModel * m_selectionModel
The internal selection model.
ProjectItemModel(QObject *parent=0)
Constructs an empty model.
void onShapesAdded(ShapeList *shapes)
Slot to connect to the shapesAdded() signal from a Project.
ProjectItem * addProject(Project *project)
Adds a Project to the model.