Isis 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 
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
Isis::FileTool::updateTool
void updateTool()
Updates the tool.
Definition: FileTool.cpp:992
Isis::FileTool::discard
void discard()
This slot emits a signal to discard all changes to the current viewport.
Definition: FileTool.cpp:792
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
Portal.h
Isis::FileTool::enableSave
void enableSave(bool enable)
This slot enables or disables save and save as.
Definition: FileTool.cpp:984
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
MdiCubeViewport.h
Isis::FileTool::saveAction
QPointer< QAction > saveAction()
Definition: FileTool.h:72
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
ViewportMainWindow.h
Isis::Tool::cubeViewportList
CubeViewportList * cubeViewportList() const
Return the list of cubeviewports.
Definition: Tool.cpp:390
Isis::CubeViewport::getAllWhatsThisInfo
void getAllWhatsThisInfo(Pvl &pWhatsThisPvl)
Get All WhatsThis info - viewport, cube, area in PVL format.
Definition: CubeViewport.cpp:1372
Isis::Enlarge
Enlarge the pixel dimensions of an image.
Definition: Enlarge.h:34
Isis::FileTool::FileTool
FileTool(QWidget *parent)
Constructs a FileTool object.
Definition: FileTool.cpp:46
Isis::Tool
Base class for the Qisis tools.
Definition: Tool.h:67
Isis::FileTool::addTo
void addTo(QMenu *menu)
Adds the file tool's actions to the menu.
Definition: FileTool.cpp:169
MainWindow.h
QMenu
Isis::Tool::toolIconDir
QString toolIconDir() const
returns the path to the icon directory.
Definition: Tool.h:113
Isis::FileTool::p_fileList
QStringList p_fileList
File list.
Definition: FileTool.h:77
FileTool.h
Reduce.h
Isis::UnsignedWord
@ UnsignedWord
Definition: PixelType.h:31
Isis::Cube::close
void close(bool remove=false)
Closes the cube and updates the labels.
Definition: Cube.cpp:260
Isis::FileTool::browse
virtual void browse()
This method allows the user to navigate and browse cubes with a file dialog .
Definition: FileTool.cpp:236
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Tool.h
Isis::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
Isis::FileDialog
Class for browsing cubes.
Definition: FileDialog.h:32
Isis::ProcessRubberSheet::StartProcess
virtual void StartProcess(Transform &trans, Interpolator &interp)
Applies a Transform and an Interpolator to every pixel in the output cube.
Definition: ProcessRubberSheet.cpp:132
Isis::Pvl::write
void write(const QString &file)
Opens and writes PVL information to a file and handles the end of line sequence.
Definition: Pvl.cpp:130
Isis::FileTool::exportView
virtual void exportView()
This method allows the user to export the current view as an image file.
Definition: FileTool.cpp:801
Isis::FileTool::print
void print()
This method allows the user to print the current viewport.
Definition: FileTool.cpp:908
Isis::SignedWord
@ SignedWord
Definition: PixelType.h:32
Isis::FileTool::addToPermanent
void addToPermanent(QToolBar *perm)
Adds the file tool's actions to the permanent toolbar.
Definition: FileTool.cpp:203
Isis::FileTool::closeAll
virtual bool closeAll()
Try to close all open cubes and save/discard if necessary.
Definition: FileTool.cpp:944
QToolBar
QStringList
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
SubArea.h
Isis::SaveAsDialog::ExportFullRes
@ ExportFullRes
Definition: SaveAsDialog.h:45
Isis::Process::EndProcess
virtual void EndProcess()
End the processing sequence and cleans up by closing cubes, freeing memory, etc.
Definition: Process.cpp:455
Isis::Buffer
Buffer for reading and writing cube data.
Definition: Buffer.h:53
Isis::FileTool::save
virtual void save()
This method saves any changes made to the current cube, these changes are finalized!...
Definition: FileTool.cpp:258
Enlarge.h
Isis::BrowseDialog
Class for browsing cubes.
Definition: BrowseDialog.h:36
OriginalLabel.h
Isis::AttachedLabel
@ AttachedLabel
The input label is embedded in the image file.
Definition: CubeAttribute.h:32
Isis::FileTool::openAction
QPointer< QAction > openAction()
Definition: FileTool.h:68
Isis::Buffer::Copy
void Copy(const Buffer &in, bool includeRawBuf=true)
Allows copying of the buffer contents to another Buffer.
Definition: Buffer.cpp:255
Isis::SaveAsDialog::ExportAsIs
@ ExportAsIs
Definition: SaveAsDialog.h:45
Isis::SaveAsDialog
Widget to save(Save As) Isis cubes(used in qview) to display the FileDialog to select the output cube...
Definition: SaveAsDialog.h:38
Pvl.h
Isis::Tool::setCubeViewport
void setCubeViewport(MdiCubeViewport *cvp)
Sets the current viewport to the given cvp.
Definition: Tool.cpp:160
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
Isis::ViewportMainWindow
This was called the Qisis MainWindow.
Definition: ViewportMainWindow.h:43
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Workspace::mdiArea
QMdiArea * mdiArea()
This method returns the QMdiArea.
Definition: Workspace.cpp:295
FileDialog.h
Isis::FileTool::fileSelected
void fileSelected(QString)
This signal is called when a file is selected.
Isis::Process::SetInputCube
virtual Isis::Cube * SetInputCube(const QString &parameter, const int requirements=0)
Opens an input cube specified by the user and verifies requirements are met.
Definition: Process.cpp:136
Isis::Tool::addTo
void addTo(ViewportMainWindow *mw)
Adds the tool to the application.
Definition: Tool.cpp:78
Workspace.h
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::FileTool::saveAs
virtual void saveAs()
SaveAs Action - Displays the FileDialog with the filterlist (*.cub) to select the output cube.
Definition: FileTool.cpp:284
BrowseDialog.h
Isis::Enlarge::UpdateOutputLabel
PvlGroup UpdateOutputLabel(Cube *pOutCube)
Update the Mapping, Instrument, and AlphaCube groups in the output cube label.
Definition: Enlarge.cpp:114
ProcessByLine.h
Isis::FileTool::menuName
QString menuName() const
Definition: FileTool.h:81
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Interpolator
Pixel interpolator.
Definition: Interpolator.h:34
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::Cube::bandCount
virtual int bandCount() const
Returns the number of virtual bands for the cube.
Definition: Cube.cpp:1410
Isis::FileTool::exit
virtual void exit()
Exit the program, this slot called when the exit is chosen from the File menu.
Definition: FileTool.cpp:972
Isis::FileTool::discardChanges
void discardChanges(CubeViewport *vp)
This signal is called when changes should be discarded.
Isis::Process::SetOutputCube
virtual Isis::Cube * SetOutputCube(const QString &parameter)
Allocates a user-specified output cube whose size matches the first input cube.
Definition: Process.cpp:160
Brick.h
Isis::Enlarge::SetInputArea
void SetInputArea(double pdStartSample, double pdEndSample, double pdStartLine, double pdEndLine)
Sets the sub area dimensions of the input image.
Definition: Enlarge.cpp:76
Isis::UnsignedInteger
@ UnsignedInteger
Definition: PixelType.h:33
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::FileTool
Definition: FileTool.h:59
Isis::Tool::activate
void activate(bool)
Activates the tool.
Definition: Tool.cpp:131
Isis::SignedInteger
@ SignedInteger
Definition: PixelType.h:34
Isis::FileTool::p_dir
QDir p_dir
Directory.
Definition: FileTool.h:76
Isis::FileTool::p_filterList
QStringList p_filterList
Filter List.
Definition: FileTool.h:74
Isis::FileTool::saveAsCubeByOption
void saveAsCubeByOption(QString)
Save as Isis Cube (FullImage, AsIs, FullRes)
Definition: FileTool.cpp:317
Isis::FileTool::exportToList
virtual void exportToList()
FileTool::exportToList.
Definition: FileTool.cpp:853
Isis::ProcessRubberSheet
Derivative of Process, designed for geometric transformations.
Definition: ProcessRubberSheet.h:104
Isis::FileTool::saveInfo
virtual void saveInfo()
Saves the whatsthis info of the cubeviewport.
Definition: FileTool.cpp:748
Isis::Workspace
Definition: Workspace.h:78
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
SaveAsDialog.h
Isis::Cube::open
void open(const QString &cfile, QString access="r")
This method will open an isis cube for reading or reading/writing.
Definition: Cube.cpp:627
Isis::UnsignedByte
@ UnsignedByte
Definition: PixelType.h:29
Interpolator.h
QAction
Isis::CubeViewport::cube
Cube * cube() const
Definition: CubeViewport.h:338
ProcessRubberSheet.h
Isis::FileTool::saveChanges
void saveChanges(CubeViewport *vp)
This signal is called when changes should be saved.
Isis::Interpolator::NearestNeighborType
@ NearestNeighborType
Definition: Interpolator.h:42
Isis::Tool::cubeViewport
MdiCubeViewport * cubeViewport() const
Return the current cubeviewport.
Definition: Tool.h:197
Isis::SaveAsDialog::FullImage
@ FullImage
Definition: SaveAsDialog.h:45
CubeAttribute.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::Cube::reopen
void reopen(QString access="r")
This method will reopen an isis sube for reading or reading/writing.
Definition: Cube.cpp:774
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::FileTool::open
virtual void open()
This method allows the user to navigate and open a cube with a file dialog.
Definition: FileTool.cpp:215
Isis::Real
@ Real
Definition: PixelType.h:35