casa
$Rev:20696$
|
Dialog for editing a single region shape. More...
#include <QtSingleRegionShape.qo.h>
Public Slots | |
void | apply () |
Apply changes to the underlying region shape. | |
Signals | |
void | applyClicked () |
Only emitted when widget is in creation mode, the apply button is shown, and the apply button is clicked. | |
Public Member Functions | |
QtEditRegionShape (QtSingleRegionShape *shape) | |
Non-Static Members //. | |
QtEditRegionShape (RegionShape *shape, QtRegionShapeManager *manager, QWidget *coordWidget=NULL, bool showPosition=true, bool showSize=true, String applyButtonText="") | |
Creation mode constructor. | |
~QtEditRegionShape () | |
Destructor. | |
String | chosenCoordinateSystem () const |
Methods used for accessing what coordinate system/unit the user has chosen. | |
String | chosenPositionUnit () const |
String | chosenSizeUnit () const |
bool | enteredCoordinatesAreValid (String &reason) const |
Returns true if the entered coordinates are valid, false otherwise. | |
Static Public Member Functions | |
static vector< String > | systems () |
Returns available systems for the system chooser. | |
static QComboBox * | systemsChooser () |
Static Public Attributes | |
static const String | SEXAGESIMAL |
Static Members //. | |
static const String | UNKNOWN |
Private Slots | |
void | coordSystemChanged () |
Update the displayed values to reflect the coordinate system, position unit, and size unit chosen by the user. | |
void | coordReset () |
Resets the values, system, and units to that of the underlying shape. | |
void | linethrough () |
Enable/disable the linethrough options. | |
void | applySlot () |
Call apply() if in edit mode, otherwise emit applyClicked() signal. | |
Private Member Functions | |
void | init (QWidget *coordWidget=NULL, bool showPosition=true, bool showSize=true, String applyButtonText="") |
Initial GUI setup, depending on creation/edit mode. | |
void | setupGui () |
Sets up the GUI to reflect values/properties of the underlying region shape. | |
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 number that can be sent to the shape's coordinate parameter methods. | |
void | displayCoordinates (const vector< double > &coords) |
Displays the given coordinates with the proper unit. | |
Static Private Member Functions | |
static vector< String > | positionUnits () |
Private Static Methods //. | |
static vector< String > | sizeUnits () |
Returns available units for the size unit chooser. | |
Private Attributes | |
bool | m_creation |
Indicates whether the widget is being used in creation or editing mode. | |
QtSingleRegionShape * | m_shape |
Shape being edited. | |
RegionShape * | m_cShape |
Shape being created. | |
QtRegionShapeManager * | m_manager |
Shape manager. | |
vector< QLineEdit * > | m_coordEdits |
Coordinate editing fields. | |
vector < RegionShape::CoordinateParameterType > | m_coordTypes |
Coord types. | |
String | m_lastSystem |
Last chosen system, position unit, and size unit. | |
String | m_lastPosUnit |
String | m_lastSizeUnit |
QtColorWidget * | m_lineColor |
Line color widget. | |
QtColorWidget * | m_ltColor |
Linethrough color widget. | |
QtColorWidget * | m_labelColor |
Label color widget. | |
vector< QtRSOption * > | m_optWidgets |
Option widgets. | |
vector< RegionShape::OptionType > | m_optTypes |
Option types. |
Dialog for editing a single region shape.
Can either be used in editing or creation mode. Currently there are three sections:
Definition at line 177 of file QtSingleRegionShape.qo.h.
Non-Static Members //.
Editing mode constructor.
casa::QtEditRegionShape::QtEditRegionShape | ( | RegionShape * | shape, |
QtRegionShapeManager * | manager, | ||
QWidget * | coordWidget = NULL , |
||
bool | showPosition = true , |
||
bool | showSize = true , |
||
String | applyButtonText = "" |
||
) |
Creation mode constructor.
showPosition, showSize, and applyButtonText are only used if coordWidget is not NULL.
Destructor.
void casa::QtEditRegionShape::apply | ( | ) | [slot] |
Apply changes to the underlying region shape.
Referenced by applySlot().
void casa::QtEditRegionShape::applyClicked | ( | ) | [signal] |
Only emitted when widget is in creation mode, the apply button is shown, and the apply button is clicked.
Referenced by applySlot().
void casa::QtEditRegionShape::applySlot | ( | ) | [inline, private, slot] |
Call apply() if in edit mode, otherwise emit applyClicked() signal.
Definition at line 337 of file QtSingleRegionShape.qo.h.
References apply(), applyClicked(), and m_creation.
Methods used for accessing what coordinate system/unit the user has chosen.
double casa::QtEditRegionShape::convertToRS | ( | int | index, |
bool & | ok | ||
) | const [private] |
Takes the value entered in the coordinate at the given index of m_coordEdits and converts it into a number that can be sent to the shape's coordinate parameter methods.
void casa::QtEditRegionShape::coordReset | ( | ) | [private, slot] |
Resets the values, system, and units to that of the underlying shape.
void casa::QtEditRegionShape::coordSystemChanged | ( | ) | [private, slot] |
Update the displayed values to reflect the coordinate system, position unit, and size unit chosen by the user.
void casa::QtEditRegionShape::displayCoordinates | ( | const vector< double > & | coords | ) | [private] |
Displays the given coordinates with the proper unit.
Assumes that the world system matches the GUI and the unit matches RegionShape::UNIT.
bool casa::QtEditRegionShape::enteredCoordinatesAreValid | ( | String & | reason | ) | const |
Returns true if the entered coordinates are valid, false otherwise.
Has no effect if a custom coordinate widget is provided. Entered coordinates are valid if: 1) Non-empty 2) For non-sexagesimal, contains a number 3) For sexagesimal, contains three numbers separated by :'s. If invalid, a reason is given.
void casa::QtEditRegionShape::init | ( | QWidget * | coordWidget = NULL , |
bool | showPosition = true , |
||
bool | showSize = true , |
||
String | applyButtonText = "" |
||
) | [private] |
Initial GUI setup, depending on creation/edit mode.
void casa::QtEditRegionShape::linethrough | ( | ) | [private, slot] |
Enable/disable the linethrough options.
static vector<String> casa::QtEditRegionShape::positionUnits | ( | ) | [inline, static, private] |
Private Static Methods //.
Returns available units for the position unit chooser.
Definition at line 309 of file QtSingleRegionShape.qo.h.
References casa::RSValue::DEG, casa::RSValue::DMS, casa::RSValue::HMS, casa::RSValue::RAD, and SEXAGESIMAL.
void casa::QtEditRegionShape::setupGui | ( | ) | [private] |
Sets up the GUI to reflect values/properties of the underlying region shape.
static vector<String> casa::QtEditRegionShape::sizeUnits | ( | ) | [inline, static, private] |
Returns available units for the size unit chooser.
Definition at line 318 of file QtSingleRegionShape.qo.h.
References casa::viewer::ARCMIN, casa::viewer::ARCSEC, casa::RSValue::DEG, and casa::RSValue::RAD.
static vector<String> casa::QtEditRegionShape::systems | ( | ) | [inline, static] |
Returns available systems for the system chooser.
Definition at line 190 of file QtSingleRegionShape.qo.h.
References casa::MDirection::B1950, casa::MDirection::ECLIPTIC, casa::MDirection::GALACTIC, casa::MDirection::J2000, casa::RSUtils::PIXEL, casa::MDirection::showType(), and casa::MDirection::SUPERGAL.
Referenced by systemsChooser().
static QComboBox* casa::QtEditRegionShape::systemsChooser | ( | ) | [inline, static] |
Definition at line 201 of file QtSingleRegionShape.qo.h.
References systems().
vector<QLineEdit*> casa::QtEditRegionShape::m_coordEdits [private] |
Coordinate editing fields.
Definition at line 264 of file QtSingleRegionShape.qo.h.
vector<RegionShape::CoordinateParameterType> casa::QtEditRegionShape::m_coordTypes [private] |
Coord types.
Definition at line 267 of file QtSingleRegionShape.qo.h.
bool casa::QtEditRegionShape::m_creation [private] |
Indicates whether the widget is being used in creation or editing mode.
Definition at line 252 of file QtSingleRegionShape.qo.h.
Referenced by applySlot().
RegionShape* casa::QtEditRegionShape::m_cShape [private] |
Shape being created.
Definition at line 258 of file QtSingleRegionShape.qo.h.
Label color widget.
Definition at line 279 of file QtSingleRegionShape.qo.h.
String casa::QtEditRegionShape::m_lastPosUnit [private] |
Definition at line 270 of file QtSingleRegionShape.qo.h.
Definition at line 270 of file QtSingleRegionShape.qo.h.
String casa::QtEditRegionShape::m_lastSystem [private] |
Last chosen system, position unit, and size unit.
Definition at line 270 of file QtSingleRegionShape.qo.h.
Line color widget.
Definition at line 273 of file QtSingleRegionShape.qo.h.
QtColorWidget* casa::QtEditRegionShape::m_ltColor [private] |
Linethrough color widget.
Definition at line 276 of file QtSingleRegionShape.qo.h.
Shape manager.
Definition at line 261 of file QtSingleRegionShape.qo.h.
vector<RegionShape::OptionType> casa::QtEditRegionShape::m_optTypes [private] |
Option types.
Definition at line 285 of file QtSingleRegionShape.qo.h.
vector<QtRSOption*> casa::QtEditRegionShape::m_optWidgets [private] |
Option widgets.
Definition at line 282 of file QtSingleRegionShape.qo.h.
Shape being edited.
Definition at line 255 of file QtSingleRegionShape.qo.h.
const String casa::QtEditRegionShape::SEXAGESIMAL [static] |
Static Members //.
System/Unit constants.
Definition at line 185 of file QtSingleRegionShape.qo.h.
Referenced by positionUnits().
const String casa::QtEditRegionShape::UNKNOWN [static] |
Definition at line 186 of file QtSingleRegionShape.qo.h.