casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes
casa::QtEditRegionShape Class Reference

Dialog for editing a single region shape. More...

#include <QtSingleRegionShape.qo.h>

List of all members.

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< Stringsystems ()
 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< StringpositionUnits ()
 Private Static Methods //.
static vector< StringsizeUnits ()
 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.
QtSingleRegionShapem_shape
 Shape being edited.
RegionShapem_cShape
 Shape being created.
QtRegionShapeManagerm_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
QtColorWidgetm_lineColor
 Line color widget.
QtColorWidgetm_ltColor
 Linethrough color widget.
QtColorWidgetm_labelColor
 Label color widget.
vector< QtRSOption * > m_optWidgets
 Option widgets.
vector< RegionShape::OptionTypem_optTypes
 Option types.

Detailed Description

Dialog for editing a single region shape.

Can either be used in editing or creation mode. Currently there are three sections:

  1. Coordinate editing. Using the RegionShape's coordinate parameter methods, the shape's current coordinates are displayed and can be changed (both value and system/unit).
  2. General options. Line width/color, label text/font, linethrough, etc.
  3. Specific options. Customization specific to each shape type.

Definition at line 177 of file QtSingleRegionShape.qo.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

Apply changes to the underlying region shape.

Referenced by applySlot().

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.

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.

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.

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]
static QComboBox* casa::QtEditRegionShape::systemsChooser ( ) [inline, static]

Definition at line 201 of file QtSingleRegionShape.qo.h.

References systems().


Member Data Documentation

vector<QLineEdit*> casa::QtEditRegionShape::m_coordEdits [private]

Coordinate editing fields.

Definition at line 264 of file QtSingleRegionShape.qo.h.

Coord types.

Definition at line 267 of file QtSingleRegionShape.qo.h.

Indicates whether the widget is being used in creation or editing mode.

Definition at line 252 of file QtSingleRegionShape.qo.h.

Referenced by applySlot().

Shape being created.

Definition at line 258 of file QtSingleRegionShape.qo.h.

Label color widget.

Definition at line 279 of file QtSingleRegionShape.qo.h.

Definition at line 270 of file QtSingleRegionShape.qo.h.

Definition at line 270 of file QtSingleRegionShape.qo.h.

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.

Linethrough color widget.

Definition at line 276 of file QtSingleRegionShape.qo.h.

Shape manager.

Definition at line 261 of file QtSingleRegionShape.qo.h.

Option types.

Definition at line 285 of file QtSingleRegionShape.qo.h.

Option widgets.

Definition at line 282 of file QtSingleRegionShape.qo.h.

Shape being edited.

Definition at line 255 of file QtSingleRegionShape.qo.h.

Static Members //.

System/Unit constants.

Definition at line 185 of file QtSingleRegionShape.qo.h.

Referenced by positionUnits().

Definition at line 186 of file QtSingleRegionShape.qo.h.


The documentation for this class was generated from the following file: