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< 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.
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 179 of file QtSingleRegionShape.qo.h.


Constructor & Destructor Documentation

casa::QtEditRegionShape::QtEditRegionShape ( QtSingleRegionShape shape  ) 

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.

casa::QtEditRegionShape::~QtEditRegionShape (  ) 

Destructor.


Member Function Documentation

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 343 of file QtSingleRegionShape.qo.h.

References apply(), applyClicked(), and m_creation.

String casa::QtEditRegionShape::chosenCoordinateSystem (  )  const

Methods used for accessing what coordinate system/unit the user has chosen.

String casa::QtEditRegionShape::chosenPositionUnit (  )  const
String casa::QtEditRegionShape::chosenSizeUnit (  )  const
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 311 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 322 of file QtSingleRegionShape.qo.h.

References casa::RSValue::ARCMIN, casa::RSValue::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 192 of file QtSingleRegionShape.qo.h.

References casa::viewer::region::B1950, casa::viewer::ECLIPTIC, casa::viewer::GALACTIC, casa::viewer::region::J2000, and casa::RSUtils::PIXEL.

Referenced by systemsChooser().

static QComboBox* casa::QtEditRegionShape::systemsChooser (  )  [inline, static]

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

References systems().


Member Data Documentation

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

Coordinate editing fields.

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

Coord types.

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

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

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

Referenced by applySlot().

Shape being created.

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

Label color widget.

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

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

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

Last chosen system, position unit, and size unit.

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

Line color widget.

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

Linethrough color widget.

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

Shape manager.

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

Option types.

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

Option widgets.

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

Shape being edited.

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

const String casa::QtEditRegionShape::SEXAGESIMAL [static]

Static Members //.

System/Unit constants.

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

Referenced by positionUnits().

const String casa::QtEditRegionShape::UNKNOWN [static]

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


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1