27 #ifndef QTSINGLEREGIONSHAPE_QO_H
28 #define QTSINGLEREGIONSHAPE_QO_H
32 #include <display/RegionShapes/QtSingleRegionShape.ui.h>
33 #include <display/RegionShapes/QtEditRegionShape.ui.h>
42 class QtRegionShapeManager;
64 bool reportDrawErrors =
false,
137 const RSOption&
value,
const std::vector<casacore::String>& choices);
192 static std::vector<casacore::String>
systems() {
193 static std::vector<casacore::String> v(6);
204 std::vector<casacore::String> v =
systems();
205 QComboBox* b =
new QComboBox();
206 for(
unsigned int i = 0; i < v.size(); i++) b->addItem(v[i].c_str());
219 QWidget* coordWidget = NULL,
bool showPosition =
true,
291 void init(QWidget* coordWidget = NULL,
bool showPosition =
true,
312 static std::vector<casacore::String> v(5);
323 static std::vector<casacore::String> v(4);
casacore::String chosenPositionUnit() const
bool enteredCoordinatesAreValid(casacore::String &reason) const
Returns true if the entered coordinates are valid, false otherwise.
void showHide(bool show, bool reportErrors=true)
Show/hide the region shape by registering/unregistering.
std::vector< RegionShape::CoordinateParameterType > m_coordTypes
Coord types.
std::vector< casacore::String > m_choices
QtColorWidget * m_lineColor
Line color widget.
casacore::String m_lastSizeUnit
void registerShape()
Registers the shape on the underlying display panel, if applicable.
void linethrough()
Enable/disable the linethrough options.
bool m_creation
Indicates whether the widget is being used in creation or editing mode.
void setShouldDelete(bool shouldDelete=true)
Sets whether the QtSingleRegionShape should delete its RegionShape during destruction or not...
casacore::String m_lastSystem
Last chosen system, position unit, and size unit.
RegionShape * shape()
Returns the RegionShape.
void edit()
Show a QtEditRegionShape for editing.
virtual Type type()
Return the type enum.
void init(QWidget *coordWidget=NULL, bool showPosition=true, bool showSize=true, casacore::String applyButtonText="")
Initial GUI setup, depending on creation/edit mode.
RegionShape * m_compositeParent
casacore::String m_lastPosUnit
static const casacore::String UNKNOWN
Convenience class for a casacore::String, bool, or double.
static const casacore::String HMS
static const casacore::String ARCMIN
std::vector< QComboBox * > m_choiceArray
std::vector< RegionShape::OptionType > m_optTypes
Option types.
std::vector< QtRSOption * > m_optWidgets
Option widgets.
RegionShape::OptionType m_type
Type.
void deleteShape()
Deletes this shape by unregistering the region shape and then calling the manager's delete method...
void applySlot()
Call apply() if in edit mode, otherwise emit applyClicked() signal.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
std::vector< QLineEdit * > m_stringArray
static const casacore::String RAD
void coordReset()
Resets the values, system, and units to that of the underlying shape.
void show(const variant &v)
void applyClicked()
Only emitted when widget is in creation mode, the apply button is shown, and the apply button is clic...
static const casacore::String DMS
static std::vector< casacore::String > systems()
Returns available systems for the system chooser.
QtRSOption(RegionShape::OptionType type, const casacore::String &name, const RSOption &value, const std::vector< casacore::String > &choices)
Constructor.
Dialog for editing a single region shape.
casacore::String chosenSizeUnit() const
QtColorWidget * m_ltColor
Linethrough color widget.
QtDisplayPanel * panel()
Returns the display panel.
void displayCoordinates(const std::vector< double > &coords)
Displays the given coordinates with the proper unit.
void coordSystemChanged()
Update the displayed values to reflect the coordinate system, position unit, and size unit chosen by ...
QDoubleSpinBox * m_double
RSOption value() const
Returns entered value.
QtSingleRegionShape * m_shape
Shape being edited.
static std::vector< casacore::String > positionUnits()
Private Static Methods //.
void moreArray()
Add another array widget.
RegionShape * m_cShape
Shape being created.
static QComboBox * systemsChooser()
void showHide_(bool show)
Slot for checkbox.
~QtSingleRegionShape()
Destructor.
void apply()
Apply changes to the underlying region shape.
QtEditRegionShape(QtSingleRegionShape *shape)
Non-Static Members //.
void setupGui()
Sets up the GUI to reflect values/properties of the underlying region shape.
QtColorWidget * m_labelColor
Label color widget.
void refresh()
Refreshes the GUI display.
QtSingleRegionShape(RegionShape *shape, QtRegionShapeManager *parent, bool reportDrawErrors=false, RegionShape *compositeParent=NULL)
Constructor which takes the RegionShape, the manager parent, and the optional composite parent...
~QtEditRegionShape()
Destructor.
Widget for displaying a single region in the list of a QtRegionShapeManager.
Parent class for all RegionShapes.
static std::vector< casacore::String > sizeUnits()
Returns available units for the size unit chooser.
void unregisterShape()
Unregisters the shape on the underlying display panel, if applicable.
void lessArray()
Remove an array widget.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
QtRegionShapeManager * m_manager
Shape manager.
static const String & showType(MDirection::Types tp)
double convertToRS(int index, bool &ok) const
Takes the value entered in the coordinate at the given index of m_coordEdits and converts it into a n...
Widget that can be used to input a casacore::String, casacore::String choice, double, bool, casacore::String array, or casacore::String choice array.
QToolButton * m_moreButton
QToolButton * m_lessButton
void setupGUI()
Sets up the GUI widgets to display information from the underlying region shape.
static const casacore::String PIXEL
Pixel coordinate system.
static const casacore::String ARCSEC
String: the storage and methods of handling collections of characters.
bool isShown() const
Returns whether this shape is currently showing (registered) on the panel or not. ...
static const casacore::String SEXAGESIMAL
Static Members //.
RegionShape * compositeParent()
Returns this shape's composite parent, or NULL if it has none.
OptionType
Different types for options.
QtRegionShapeManager * manager()
Returns the parent manager.
casacore::String chosenCoordinateSystem() const
Methods used for accessing what coordinate system/unit the user has chosen.
QLineEdit * m_string
Value widgets.
QtRegionShapeManager * m_parent
static const casacore::String DEG
casacore::Conversion methods/constants //
std::vector< QLineEdit * > m_coordEdits
casacore::Coordinate editing fields.