casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
casa::QtEditRegionShape Class Reference

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

#include <QtSingleRegionShape.qo.h>

Inheritance diagram for casa::QtEditRegionShape:

Public Slots

void apply ()
 Apply changes to the underlying region shape. More...
 

Signals

void applyClicked ()
 Only emitted when widget is in creation mode, the apply button is shown, and the apply button is clicked. More...
 

Public Member Functions

 QtEditRegionShape (QtSingleRegionShape *shape)
 Non-Static Members //. More...
 
 QtEditRegionShape (RegionShape *shape, QtRegionShapeManager *manager, QWidget *coordWidget=NULL, bool showPosition=true, bool showSize=true, casacore::String applyButtonText="")
 Creation mode constructor. More...
 
 ~QtEditRegionShape ()
 Destructor. More...
 
casacore::String chosenCoordinateSystem () const
 Methods used for accessing what coordinate system/unit the user has chosen. More...
 
casacore::String chosenPositionUnit () const
 
casacore::String chosenSizeUnit () const
 
bool enteredCoordinatesAreValid (casacore::String &reason) const
 Returns true if the entered coordinates are valid, false otherwise. More...
 

Static Public Member Functions

static std::vector
< casacore::String
systems ()
 Returns available systems for the system chooser. More...
 
static QComboBox * systemsChooser ()
 

Static Public Attributes

static const casacore::String SEXAGESIMAL
 Static Members //. More...
 
static const casacore::String UNKNOWN
 

Private Slots

void coordSystemChanged ()
 Update the displayed values to reflect the coordinate system, position unit, and size unit chosen by the user. More...
 
void coordReset ()
 Resets the values, system, and units to that of the underlying shape. More...
 
void linethrough ()
 Enable/disable the linethrough options. More...
 
void applySlot ()
 Call apply() if in edit mode, otherwise emit applyClicked() signal. More...
 

Private Member Functions

void init (QWidget *coordWidget=NULL, bool showPosition=true, bool showSize=true, casacore::String applyButtonText="")
 Initial GUI setup, depending on creation/edit mode. More...
 
void setupGui ()
 Sets up the GUI to reflect values/properties of the underlying region shape. More...
 
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. More...
 
void displayCoordinates (const std::vector< double > &coords)
 Displays the given coordinates with the proper unit. More...
 

Static Private Member Functions

static std::vector
< casacore::String
positionUnits ()
 Private Static Methods //. More...
 
static std::vector
< casacore::String
sizeUnits ()
 Returns available units for the size unit chooser. More...
 

Private Attributes

bool m_creation
 Indicates whether the widget is being used in creation or editing mode. More...
 
QtSingleRegionShapem_shape
 Shape being edited. More...
 
RegionShapem_cShape
 Shape being created. More...
 
QtRegionShapeManagerm_manager
 Shape manager. More...
 
std::vector< QLineEdit * > m_coordEdits
 casacore::Coordinate editing fields. More...
 
std::vector
< RegionShape::CoordinateParameterType
m_coordTypes
 Coord types. More...
 
casacore::String m_lastSystem
 Last chosen system, position unit, and size unit. More...
 
casacore::String m_lastPosUnit
 
casacore::String m_lastSizeUnit
 
QtColorWidgetm_lineColor
 Line color widget. More...
 
QtColorWidgetm_ltColor
 Linethrough color widget. More...
 
QtColorWidgetm_labelColor
 Label color widget. More...
 
std::vector< QtRSOption * > m_optWidgets
 Option widgets. More...
 
std::vector
< RegionShape::OptionType
m_optTypes
 Option types. More...
 

Detailed Description

Dialog for editing a single region shape.

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

  1. casacore::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,
casacore::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 ( )
inlineprivateslot

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.

casacore::String casa::QtEditRegionShape::chosenCoordinateSystem ( ) const

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

casacore::String casa::QtEditRegionShape::chosenPositionUnit ( ) const
casacore::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 ( )
privateslot

Resets the values, system, and units to that of the underlying shape.

void casa::QtEditRegionShape::coordSystemChanged ( )
privateslot

Update the displayed values to reflect the coordinate system, position unit, and size unit chosen by the user.

void casa::QtEditRegionShape::displayCoordinates ( const std::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 ( casacore::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,
casacore::String  applyButtonText = "" 
)
private

Initial GUI setup, depending on creation/edit mode.

void casa::QtEditRegionShape::linethrough ( )
privateslot

Enable/disable the linethrough options.

static std::vector<casacore::String> casa::QtEditRegionShape::positionUnits ( )
inlinestaticprivate

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 std::vector<casacore::String> casa::QtEditRegionShape::sizeUnits ( )
inlinestaticprivate

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 std::vector<casacore::String> casa::QtEditRegionShape::systems ( )
inlinestatic
static QComboBox* casa::QtEditRegionShape::systemsChooser ( )
inlinestatic

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

References systems().

Member Data Documentation

std::vector<QLineEdit*> casa::QtEditRegionShape::m_coordEdits
private

casacore::Coordinate editing fields.

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

std::vector<RegionShape::CoordinateParameterType> casa::QtEditRegionShape::m_coordTypes
private

Coord types.

Definition at line 269 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 254 of file QtSingleRegionShape.qo.h.

Referenced by applySlot().

RegionShape* casa::QtEditRegionShape::m_cShape
private

Shape being created.

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

QtColorWidget* casa::QtEditRegionShape::m_labelColor
private

Label color widget.

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

casacore::String casa::QtEditRegionShape::m_lastPosUnit
private

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

casacore::String casa::QtEditRegionShape::m_lastSizeUnit
private

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

casacore::String casa::QtEditRegionShape::m_lastSystem
private

Last chosen system, position unit, and size unit.

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

QtColorWidget* casa::QtEditRegionShape::m_lineColor
private

Line color widget.

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

QtColorWidget* casa::QtEditRegionShape::m_ltColor
private

Linethrough color widget.

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

QtRegionShapeManager* casa::QtEditRegionShape::m_manager
private

Shape manager.

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

std::vector<RegionShape::OptionType> casa::QtEditRegionShape::m_optTypes
private

Option types.

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

std::vector<QtRSOption*> casa::QtEditRegionShape::m_optWidgets
private

Option widgets.

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

QtSingleRegionShape* casa::QtEditRegionShape::m_shape
private

Shape being edited.

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

const casacore::String casa::QtEditRegionShape::SEXAGESIMAL
static

Static Members //.

System/casacore::Unit constants.

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

Referenced by positionUnits().

const casacore::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: