|
Isis 3 Programmer Reference
|
Go to the documentation of this file.
24 #include "ProjectItem.h"
28 #include <QStandardItem>
32 #include "BundleResults.h"
33 #include "BundleSolutionInfo.h"
35 #include "ControlList.h"
36 #include "CorrelationMatrix.h"
38 #include "ImageList.h"
40 #include "ProjectItemModel.h"
42 #include "ShapeList.h"
44 #include "TemplateList.h"
51 setTextColor(Qt::black);
64 setTextColor(Qt::black);
65 item->setEditable(
false);
67 for (
int i=0; i < item->rowCount(); i++) {
81 setTextColor(Qt::black);
83 setData(QVariant::fromValue<FileItemQsp>(filename));
98 setTextColor(Qt::black);
100 setData(QVariant::fromValue<FileItemQsp>(filename));
102 setToolTip(toolTipText);
114 setTextColor(Qt::black);
127 setTextColor(Qt::black);
140 setTextColor(Qt::black);
159 setTextColor(Qt::black);
171 setTextColor(Qt::black);
186 setTextColor(Qt::black);
202 setTextColor(Qt::black);
214 setTextColor(Qt::black);
226 setTextColor(Qt::black);
241 setTextColor(Qt::black);
256 setTextColor(Qt::black);
268 setTextColor(Qt::black);
283 setTextColor(Qt::black);
298 setTextColor(Qt::black);
311 setTextColor(Qt::black);
326 setTextColor(Qt::black);
340 setTextColor(Qt::black);
353 setTextColor(Qt::black);
368 setTextColor(Qt::black);
399 setTextColor(Qt::black);
414 setTextColor(Qt::black);
426 setTextColor(Qt::black);
477 return data().value<
Image *>();
497 return data().value<
Shape *>();
537 return data().value<
Control *>();
567 return data().value<
Project *>();
602 bool ProjectItem::isTemplate()
const {
603 return data().canConvert<
Template *>();
647 return data().canConvert<
Image *>();
669 return data().canConvert<
Shape *>();
691 return data().canConvert<
Control *>();
725 return data().canConvert<
Project *>();
768 setTextColor(Qt::black);
769 setText( item->text() );
770 setIcon( item->icon() );
771 setData( item->data() );
772 setEditable(item->isEditable());
782 setTextColor(Qt::black);
783 setText(
"Statistics");
784 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/kchart.png")
786 setData( QVariant::fromValue<BundleResults>(
bundleResults) );
796 setTextColor(Qt::black);
798 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/applications-system.png")
800 setData( QVariant::fromValue<BundleSettingsQsp>(
bundleSettings) );
810 setTextColor(Qt::black);
817 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/kchart.png")
829 setTextColor(Qt::black);
831 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/view-preview.png")
833 setData( QVariant::fromValue<Image *>(
image) );
843 setTextColor(Qt::black);
850 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-image.png")
852 setData( QVariant::fromValue<ImageList *>(
imageList) );
860 setTextColor(Qt::black);
862 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-image.png")
864 setData( QVariant() );
874 setTextColor(Qt::black);
876 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/rating.png")
878 setData( QVariant::fromValue<Shape *>(
shape) );
888 setTextColor(Qt::black);
895 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-orange.png")
897 setData( QVariant::fromValue<ShapeList *>(
shapeList) );
905 setTextColor(Qt::black);
907 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-red.png")
909 setData( QVariant() );
919 setTextColor(Qt::black);
920 setText( QFileInfo( newTemplate->
fileName() ).fileName() );
921 setIcon( QIcon(
":folder"));
922 setData( QVariant::fromValue<Template *>(newTemplate) );
932 setTextColor(Qt::black);
939 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-orange.png")
941 setData( QVariant::fromValue<TemplateList *>(
templateList) );
949 setText(
"Templates");
950 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-red.png")
952 setData( QVariant() );
955 mapsItem->setText(
"Maps");
956 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-red.png")
958 mapsItem->setData( QVariant() );
963 registrationsItem->setText(
"Registrations");
964 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-red.png")
966 registrationsItem->setData( QVariant() );
977 setTextColor(Qt::black);
979 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/network-server-database.png")
981 setData( QVariant::fromValue<Control *>(
control) );
991 setTextColor(Qt::black);
993 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder.png")
995 setData( QVariant::fromValue<ControlList *>(
controlList) );
1003 setTextColor(Qt::black);
1004 setText(
"Control Networks");
1005 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-remote.png")
1007 setData( QVariant() );
1017 setTextColor(Qt::black);
1018 setText(
"Correlation Matrix");
1019 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/network-server-database.png")
1036 setTextColor(Qt::black);
1038 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/folder-activities.png")
1040 setData( QVariant::fromValue<Project *>(
project) );
1049 setTextColor(Qt::black);
1051 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/kchart.png")
1053 setData( QVariant() );
1063 setTextColor(Qt::black);
1064 setText(
guiCamera->displayProperties()->displayName() );
1065 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/camera-photo.png")
1067 setData( QVariant::fromValue<GuiCameraQsp>(
guiCamera) );
1075 setTextColor(Qt::black);
1077 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/camera-photo.png")
1079 setData( QVariant() );
1087 setTextColor(Qt::black);
1088 setText(
"Spacecraft");
1089 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/preferences-desktop-launch-feedback.png")
1091 setData( QVariant() );
1102 setTextColor(Qt::black);
1103 setText(
targetBody->displayProperties()->displayName() );
1104 if (
targetBody->displayProperties()->displayName() ==
"MOON")
1105 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/weather-clear-night.png")
1107 else if (
targetBody->displayProperties()->displayName() ==
"Enceladus")
1108 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/nasa_enceladus.png")
1110 else if (
targetBody->displayProperties()->displayName() ==
"Mars")
1111 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/nasa_mars.png")
1113 else if (
targetBody->displayProperties()->displayName() ==
"Titan")
1114 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/nasa_titan.png")
1117 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/view-web-browser-dom-tree.png")
1120 setData( QVariant::fromValue<TargetBodyQsp>(
targetBody) );
1128 setTextColor(Qt::black);
1129 setText(
"Target Body");
1130 setIcon( QIcon(
FileName(
"$ISISROOT/appdata/images/icons/view-web-browser-dom-tree.png")
1132 setData( QVariant() );
1146 if ( data(role) == value ) {
1150 for (
int i=0; i<rowCount(); i++) {
1167 setTextColor(Qt::black);
1168 QStandardItem::appendRow(item);
1180 return static_cast<ProjectItem *
>( QStandardItem::child(row) );
1191 setTextColor(Qt::black);
1192 QStandardItem::insertRow(row, item);
1212 return static_cast<ProjectItem *
>( QStandardItem::parent() );
1223 setTextColor(Qt::black);
1224 QStandardItem::setChild(row, item);
1238 if ( items.isEmpty() ) {
1242 return static_cast<ProjectItem *
>( items.first() );
1246 void ProjectItem::setTextColor(Qt::GlobalColor color) {
1247 setForeground(QBrush(color));
Provides access to data stored in a Project through Qt's model-view framework.
BundleSolutionInfo * bundleSolutionInfo() const
Returns the BundleSolutionInfo stored in the data of the item.
QString path() const
Get the path to the images in the image list (relative to project root).
BundleResults bundleResults() const
Returns the BundleResults stored in the data of the item.
bool isGuiCamera() const
Returns true if a GuiCameraQsp is stored in the data of the item.
void setCorrelationMatrix(CorrelationMatrix correlationMatrix)
Sets the text, icon, and data corresponding to a CorrelationMatrix.
This is free and unencumbered software released into the public domain.
void setImages()
Sets the text, icon, and data corresponding to a list of ImageList.
void setGuiCameraList()
Sets the text, icon, and data corresponding to a GuiCameraQsp.
bool isControl() const
Returns true if a Control is stored in the data of the item.
void setResults()
Sets the text, icon, and data corresponding to a list of Results.
Image * image() const
Returns the Image stored in the data of the item.
void setTemplates()
Sets the text, icon, and data corresponding to a list of TemplateList.
File name manipulation and expansion.
CorrelationMatrix correlationMatrix() const
Returns the CorrelationMatrix stored the item.
Maintains a list of Controls so that control nets can easily be copied from one Project to another,...
bool isTargetBody() const
Returns true if a TargetBodyQsp is stored in the data of the item.
Shape * shape() const
Returns the Shape stored in the data of the item.
ProjectItem()
Constructs an item without children, a parent, or a model.
QString name() const
Returns the name of the bundle.
bool isBundleResults() const
Returns true if BundleResults are stored in the data of the item.
void setBundleSolutionInfo(BundleSolutionInfo *bundleSolutionInfo)
Sets the text, icon, and data corresponding to a BundleSolutionInfo.
bool isCorrelationMatrix() const
Returns true if a CorrelationMatrix is stored in the data of the item.
void setShapeList(ShapeList *shapeList)
Sets the text, icon, and data corresponding to an ShapeList.
QString path() const
Get the path to these Templates in the TemplateList (relative to project root).
ProjectItem * child(int row) const
Returns the child item at a given row.
QString fileName() const
Get the file name of the cube that this image represents.
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
Control * control() const
Returns the Control stored in the data of the item.
QList< TemplateList * > templates()
Return all template FileNames.
This represents an ISIS control net in a project-based GUI interface.
~ProjectItem()
Destructs a ProjectItem.
bool isShape() const
Returns true if an Shape is stored in the data of the item.
This is a container for the correlation matrix that comes from a bundle adjust.
The main project for ipce.
Internalizes a list of images and allows for operations on the entire list.
QString fileName() const
Get the file name of the cube that this shape represents.
static QStringList images(QStringList)
Verify that the input fileNames are image files.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
BundleResults bundleResults()
Returns the bundle results.
QString fileName() const
Get the file name that this Template represents.
bool isShapeList() const
Returns true if an ShapeList is stored in the data of the item.
GuiCameraQsp guiCamera() const
Returns the GuiCameraQsp stored in the data of the item.
bool isImage() const
Returns true if an Image is stored in the data of the item.
bool isBundleSettings() const
Returns true if BundleSettings are stored in the data of the item.
void appendRow(ProjectItem *item)
Appends an item to the children of this item.
void setTargetBody(TargetBodyQsp targetBody)
Sets the text, icon, and data corresponding to a TargetBodyQsp.
ShapeList * shapeList() const
Returns the ShapeList stored in the data of the item.
bool isFileItem() const
Returns true if a FileItemQsp is stored in the data of the item.
Container class for BundleAdjustment results.
void setProject(Project *project)
Sets the text, icon, and data corresponding to a Project.
QString runTime() const
Returns the run time.
QList< ImageList * > adjustedImages() const
Returns the list of images that were adjusted after a bundle.
This represents a shape in a project-based GUI interface.
TemplateList * templateList() const
Returns the TemplateList stored in the data of the item.
QString name() const
Get the human-readable name of this image list.
FileItemQsp fileItem() const
Returns the FileItemQsp stored in the data of the item.
Internalizes a list of shapes and allows for operations on the entire list.
List for holding TargetBodies.
void setChild(int row, ProjectItem *item)
Sets the child at the given row to an item.
void setControls()
Sets the text, icon, and data corresponding to a list of ControlList.
This represents a cube in a project-based GUI interface.
void setTemplateList(TemplateList *templateList)
Sets the text, icon, and data corresponding to an TemplateList.
ControlList * controlList() const
Returns the ControlList stored in the data of the item.
QList< BundleSolutionInfo * > bundleSolutionInfo()
Return BundleSolutionInfo objects in Project.
QString projectRoot() const
Get the top-level folder of the project.
void setControlList(ControlList *controlList)
Sets the text, icon, and data corresponding to a ControlList.
bool isProject() const
Returns true if a Project is stored in the data of the item.
void setSpacecraft()
Sets the text, icon, and data corresponding to SpaceCraft.
QList< ControlList * > controls()
Return controls in project.
void setImage(Image *image)
Sets the text, icon, and data corresponding to an Image.
QString name() const
Get the human-readable name of this TemplateList.
void setShapes()
Sets the text, icon, and data corresponding to a list of ShapeList.
QString name() const
Get the project's GUI name.
QString name() const
Get the human-readable name of this shape list.
void setGuiCamera(GuiCameraQsp guiCamera)
Sets the text, icon, and data corresponding to a GuiCameraQsp.
Project * project() const
Returns the Project stored in the data of the item.
void setBundleSettings(BundleSettingsQsp bundleSettings)
Sets the text, icon, and data corresponding to BundleSettings.
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.
ProjectItem * parent() const
Returns the parent item of this item.
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
QString name() const
Get the human-readable name of this control list.
void setTargetBodyList()
Sets the text, icon, and data corresponding to a TargetBodyList.
void setTemplate(Template *newTemplate)
Sets the text, icon, and data corresponding to a Template.
void setControl(Control *control)
Sets the text, icon, and data corresponding to a Control.
void setBundleResults(BundleResults bundleResults)
Sets the text, icon, and data corresponding to BundleResults.
A container class for statistical results from a BundleAdjust solution.
Control * control() const
Returns bundle output Control object.
void setShape(Shape *shape)
Sets the text, icon, and data corresponding to an Shape.
ProjectItemModel * model() const
Returns the ProjectItemModel associated with this item.
void insertRow(int row, ProjectItem *item)
Inserts an item to the children of this item at the row.
void setProjectItem(ProjectItem *item)
Sets the text, icon, and data to those of another item.
void setImageList(ImageList *imageList)
Sets the text, icon, and data corresponding to an ImageList.
List of GuiCameras saved as QSharedPointers.
Template * getTemplate() const
Returns the Template stored in the data of the item.
BundleSettingsQsp bundleSettings() const
Returns the BundleSettings stored in the data of the item.
bool isBundleSolutionInfo() const
Returns true if a BundleSolutionInfo is stored in the data of the item.
BundleSettingsQsp bundleSettings()
Returns bundle settings.
ProjectItem * takeChild(int row)
Removes the child item at the given row and returns the removed item.
This is free and unencumbered software released into the public domain.
QString path() const
Get the path to the shapes in the shape list (relative to project root).
TargetBodyQsp targetBody() const
Returns the TargetBodyQsp stored in the data of the item.
Represents an item of a ProjectItemModel in Qt's model-view framework.
QString fileName() const
Access the name of the control network file associated with this Control.