Isis 3 Developer Reference
FileTool.h
Go to the documentation of this file.
1 #ifndef FileTool_h
2 #define FileTool_h
3 
4 #include "Tool.h"
5 
6 #include <QDir>
7 #include <QPointer>
8 #include <QStringList>
9 
10 class QAction;
11 
12 namespace Isis {
13  class Brick;
14  class Buffer;
15  class Cube;
16  class CubeAttributeOutput;
17  class MdiCubeViewport;
18  class SaveAsDialog;
19 
59  class FileTool : public Tool {
60  Q_OBJECT
61 
62  public:
63  FileTool(QWidget *parent);
64  void addTo(QMenu *menu);
65  void addTo(Workspace *ws);
66  void addToPermanent(QToolBar *perm);
68  QPointer<QAction> openAction() {
69  return p_open;
70  };
72  QPointer<QAction> saveAction() {
73  return p_saveAs;
74  };
76  QDir p_dir;
78 
79 
81  QString menuName() const {
82  return "&File";
83  }
84 
85  signals:
86  void fileSelected(QString);
87 
92  void saveChanges(CubeViewport *vp);
98  void discardChanges(CubeViewport *vp);
99 
100  public slots:
101  virtual void open();
102  virtual void browse();
103  void print();
104  virtual void save();
105  virtual void saveAs();
106  virtual void saveInfo();
107  virtual void exportView();
108  virtual void exportToList();
109  virtual bool closeAll();
110  virtual void exit();
111  void enableSave(bool enable);
112  void discard();
113  void saveAsCubeByOption(QString);
114 
115  protected:
117  void updateTool();
118 
119  private:
120  static void copy(Buffer &in, Buffer &out);
121  QPointer<QAction> p_open;
122  QPointer<QAction> p_browse;
123  QPointer<QAction> p_print;
124  QPointer<QAction> p_save;
125  QPointer<QAction> p_saveAs;
126  QPointer<QAction> p_saveInfo;
127  QPointer<QAction> p_exportView;
128  QPointer<QAction> p_exportToList;
129  QPointer<QAction> p_closeAll;
130  QPointer<QAction> p_exit;
131  QPointer<QWidget> p_parent;
132  QString p_lastDir;
133  QPointer<Workspace> p_workSpace;
134  QPointer<MdiCubeViewport> p_lastViewport;
135  QPointer<SaveAsDialog> p_saveAsDialog;
136 
143  void saveAsFullImage(Cube *icube, Cube *ocube);
144 
155  void copyCubeDetails(const QString & psFileName, Cube *icube,
156  Cube *ocube, int piNumSamples, int piNumLines, int piNumBands);
157 
163  void saveAs_AsIs(Cube *icube, const QString & psOutFile);
164 
172  void saveAs_FullResolution(Cube *pInCube, Cube *pOutCube,
173  int pNumSamples, int pNumLines);
174 
180  void saveAsEnlargedCube(Cube *icube, const QString & psOutFile);
181 
187  void saveAsReducedCube (Cube *icube, const QString & psOutFile);
188  };
189 };
190 
191 #endif
virtual void exportToList()
FileTool::exportToList.
Definition: FileTool.cpp:854
Buffer for reading and writing cube data.
Definition: Buffer.h:69
void saveChanges(CubeViewport *vp)
This signal is called when changes should be saved.
QPointer< QAction > saveAction()
Definition: FileTool.h:72
void fileSelected(QString)
This signal is called when a file is selected.
void discard()
This slot emits a signal to discard all changes to the current viewport.
Definition: FileTool.cpp:793
virtual void open()
This method allows the user to navigate and open a cube with a file dialog.
Definition: FileTool.cpp:215
QDir p_dir
Directory.
Definition: FileTool.h:76
QStringList p_fileList
File list.
Definition: FileTool.h:77
QStringList p_filterList
Filter List.
Definition: FileTool.h:74
QPointer< QAction > openAction()
Definition: FileTool.h:68
void discardChanges(CubeViewport *vp)
This signal is called when changes should be discarded.
virtual void saveInfo()
Saves the whatsthis info of the cubeviewport.
Definition: FileTool.cpp:749
void enableSave(bool enable)
This slot enables or disables save and save as.
Definition: FileTool.cpp:985
virtual bool closeAll()
Try to close all open cubes and save/discard if necessary.
Definition: FileTool.cpp:945
void addTo(QMenu *menu)
Adds the file tool&#39;s actions to the menu.
Definition: FileTool.cpp:169
void print()
This method allows the user to print the current viewport.
Definition: FileTool.cpp:909
virtual void save()
This method saves any changes made to the current cube, these changes are finalized! There is no undo...
Definition: FileTool.cpp:258
void addToPermanent(QToolBar *perm)
Adds the file tool&#39;s actions to the permanent toolbar.
Definition: FileTool.cpp:203
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:132
QString menuName() const
Definition: FileTool.h:81
virtual void browse()
This method allows the user to navigate and browse cubes with a file dialog .
Definition: FileTool.cpp:236
virtual void saveAs()
SaveAs Action - Displays the FileDialog with the filterlist (*.cub) to select the output cube...
Definition: FileTool.cpp:284
virtual void exportView()
This method allows the user to export the current view as an image file.
Definition: FileTool.cpp:802
void updateTool()
Updates the tool.
Definition: FileTool.cpp:993
void saveAsCubeByOption(QString)
Save as Isis Cube (FullImage, AsIs, FullRes)
Definition: FileTool.cpp:317
Definition: FileTool.h:59
FileTool(QWidget *parent)
Constructs a FileTool object.
Definition: FileTool.cpp:46
virtual void exit()
Exit the program, this slot called when the exit is chosen from the File menu.
Definition: FileTool.cpp:973
Definition: Workspace.h:90
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Base class for the Qisis tools.
Definition: Tool.h:81
IO Handler for Isis Cubes.
Definition: Cube.h:170