27 #ifndef QTREGIONSHAPEMANAGER_QO_H_
28 #define QTREGIONSHAPEMANAGER_QO_H_
31 #include <QStackedLayout>
34 #include <display/RegionShapes/QtRegionShapeManager.ui.h>
35 #include <display/RegionShapes/QtRSFileLoader.ui.h>
36 #include <display/RegionShapes/QtRSFileSaver.ui.h>
47 class QtSingleRegionShape;
83 unsigned int numShapes(
bool includeComposites =
true)
const;
87 std::vector<RegionShape*>
shapes(
bool includeComposites =
true)
const;
99 bool warn =
true)
const;
139 const std::vector<RegionShape*>& compositeParents);
Class for loading region shape files.
casacore::String getFilename()
Gets the current filename chosen by the user.
static const QString LAST_FILE
QStackedLayout * m_formatOptions
Layout holding widgets for specialized format options.
casacore::String getFormat()
Gets the current region file format chosen by the user.
void save()
Saves loaded region shapes from a file.
void addShape(RegionShape *shape)
Adds the given shape to the manager.
void ok()
Check that the entered file is valid, then accept().
void addShapes(const std::vector< RegionShape * > &shapes)
Adds the given shapes to the manager.
void showHideOptions(bool show)
Show/hide the region-specific options frame.
static const casacore::String DRAWERRORMSG
Constant message used when a error was reported during a shape drawing.
void saveState(QDomDocument &document)
Appends an XML state representation of loaded shapes to the given document.
void restoreState(QDomDocument &document)
Restores loaded shapes from the given document.
void showSimpleError(const casacore::String &message, bool warn=true) const
Shows the given error message (should be short).
void browse()
Show a file chooser dialog.
QtRSFileSaver(casacore::String file="", casacore::String format="", casacore::String dir="")
Constructor.
void enable()
Enables the manager.
Abstract superclass for any class that reads a format that produces RegionShapes from a file...
QWidget * getOptions()
Gets the current options widget.
~QtRegionShapeManager()
Destructor.
void dismiss()
Dismiss/close window.
QtRSFileLoader(casacore::String file="", casacore::String format="", casacore::String dir="")
Constructor.
static const QString WINDOW_VISIBLE
static const QString LAST_DIRECTORY
void show(const variant &v)
~QtRSFileSaver()
Destructor.
casacore::String m_lastFormat
Abstract superclass for any class that writes RegionShapes to a region file format.
static const QString LAST_FORMAT
vector< QtSingleRegionShape * > m_shapes
void newShape()
Create a new shape.
void removeShape(RegionShape *shape, bool deleteShape=true)
Removes and (optionally) deletes the given shape from the manager.
static RSFileReader * getFileReader(casacore::String *file=NULL, casacore::String *format=NULL, casacore::String *directory=NULL)
Opens a new QtRSFileLoader so that the user can input a filename and file format, and then returns a ...
Widget for displaying a single region in the list of a QtRegionShapeManager.
Parent class for all RegionShapes.
casacore::String getDirectory()
Gets the directory of the filename chosen by the user.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
QtDisplayPanel * panel() const
Returns the parent panel.
void load()
Load region shapes from a file.
casacore::String m_lastFile
casacore::String getDirectory()
Gets the directory of the filename chosen by the user.
static const QString HIDDEN
XML attributes.
casacore::String m_lastDirectory
casacore::String getFormat()
Gets the current region file format chosen by the user.
static RSFileWriter * getFileWriter(casacore::String *file=NULL, casacore::String *format=NULL, casacore::String *directory=NULL)
Opens a new QtRegionFileSaver so that the user can input a filename, file format, and format options...
unsigned int numShapes(bool includeComposites=true) const
Returns the number of shapes in the manager.
String: the storage and methods of handling collections of characters.
std::vector< RegionShape * > shapes(bool includeComposites=true) const
Returns the shapes in the manager.
void browse()
Show a file chooser dialog.
void ok()
Check that the entered file is valid, then accept().
~QtRSFileLoader()
Destructor.
void deleteAll()
Delete all loaded region shapes.
void showDetailedError(const casacore::String &message, const casacore::String &details, bool warn=true) const
Shows the given detailed error message.
Class for saving region files.
QtSingleRegionShape * shapeWidget(RegionShape *shape) const
Returns the QtSingleRegionShape wrapper for the given shape, or NULL for invalid. ...
casacore::String getFilename()
Gets the current filename chosen by the user.
void showHideAll(bool checked)
Show or hide all loaded region shapes.
QtRegionShapeManager(QtDisplayPanel *panel)
Constructor which takes the parent panel.
Defines nreal time structures used by the VLA table filler.