27 #ifndef QTNEWREGIONSHAPE_QO_H
28 #define QTNEWREGIONSHAPE_QO_H
31 #include <QStackedLayout>
32 #include <QListWidget>
33 #include <QRadioButton>
36 #include <display/RegionShapes/QtNewRegionShape.ui.h>
43 class QtRegionShapeManager;
44 class QtEditRegionShape;
56 static std::vector<std::pair<casacore::String, RegionShape*> >
58 std::vector<std::pair<casacore::String, RegionShape*> > v(includeComposite ? 9 : 8);
59 for(
unsigned int i = 0; i < v.size(); i++)
70 bool includeComposite =
true,
bool deleteOnClose =
true);
90 if(i < 0)
return NULL;
91 else if(i == 0)
return new RSEllipse(0,0,0,0);
92 else if(i == 1)
return new RSCircle(0,0,0);
95 else if(i == 4)
return new RSLine(0,0,0,0,7);
96 else if(i == 5)
return new RSVector(0,0,0,0,7);
98 else if(i == 7)
return new RSText(0,0,
"");
108 else if(i == 0)
return "ellipse";
109 else if(i == 1)
return "circle";
110 else if(i == 2)
return "rectangle";
111 else if(i == 3)
return "polygon";
112 else if(i == 4)
return "line";
113 else if(i == 5)
return "vector";
114 else if(i == 6)
return "marker";
115 else if(i == 7)
return "text";
116 else if(i == 8)
return "composite";
QRadioButton * m_newShapes
std::vector< RegionShape * > m_existingShapes
QComboBox * m_editChooser
void listDelete()
Deletes the selected coordinate in the list.
~QtNewRSComposite()
Destructor.
QListWidget * m_existingList
Second screen: existing shapes.
QtNewRSComposite(RSComposite *comp, QtRegionShapeManager *manager)
Constructor which takes the composite to modify.
void shapeCreated(RegionShape *createdShape)
Emitted whenever the user creates a shape.
QtRegionShapeManager * m_manager
Top-lebel members.
Specialized widget for creating a new polygon.
vector< std::pair< QString, QString > > m_enteredCoords
QListWidget * m_newShapeList
Second screen: new shapes.
QStackedLayout * m_editWidgets
void eRemoveShape()
Remove the selected shape from the composite.
void next()
Switches to second page.
static casacore::String creationName(int i)
std::vector< RegionShape * > m_children
void eAddShape()
Existing shapes.
Subclass of RegionShape used for drawing lines.
std::vector< RegionShape * > m_moveShapes
Subclass of RegionShape used for drawing composite regions.
std::string errorMessage() const
Non-Static Members //.
void updateLists()
Updated m_existingList and m_moveList based on m_existingShapes and m_movesshapes.
void show(const variant &v)
void nListDelete()
Deletes the selected shape in the list.
Specialized widget for creating a new composite.
~QtNewRegionShape()
Destructor.
~QtNewRSPolygon()
Destructor.
Dialog for editing a single region shape.
void addCoordinates()
Add the values entered in the line edits to the coord list.
void nListDown()
Moves the selected shape down in the list.
void apply()
Applies the entered values to the RSComposite.
QtRegionShapeManager * m_manager
bool enteredValuesAreValid(casacore::String &reason) const
Returns whether the entered values are valid or not.
Subclass of RegionShape used for drawing rectangles.
Subclass of RegionShape used for drawing ellipses.
QtNewRegionShape(QtRegionShapeManager *manager, bool includeComposite=true, bool deleteOnClose=true)
Constructor that takes parent.
unsigned int adjustedIndex(int row)
Returns the adjusted index (m_existingList => m_existingShapes).
QtNewRSPolygon(RSPolygon *poly, QtRegionShapeManager *manager)
Constructor which takes the polygon to modify.
void listMoveUp()
Moves the selected coordinate up in the list.
QLabel * m_dependentLabel2
void listMoveDown()
Moves the selected coordinate down in the list.
Subclass of RegionShape used for drawing markers.
bool enteredCoordinatesAreValid(casacore::String &reason) const
See QtEditRegionShape::enteredCoordinatesAreValid.
QtEditRegionShape * m_editor
void apply()
Applies the entered values to the RSPolygon.
vector< RegionShape * > m_shapes
Parent class for all RegionShapes.
QRadioButton * m_dependentChildren
First screen.
void eListUp()
Moves the selected shape up in the list.
QLabel * m_dependentLabel1
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
static RegionShape * creationShape(int i)
QWidget * initSecondScreen2()
static std::vector< std::pair< casacore::String, RegionShape * > > creationShapes(bool includeComposite=true)
Static Members //.
QListWidget * m_coordList
Subclass of RSLine that takes a length and angle instead of a second point.
static casacore::String creationName(unsigned int i)
QWidget * initSecondScreen1()
Subclass of RSEllipse used for drawing circles.
void showCloseButton(bool show=true)
Shows/hides the close button.
Dialog for creating a new region shape.
String: the storage and methods of handling collections of characters.
QWidget * initFirstScreen()
GUI initialization methods.
RSComposite * m_composite
void nAddShape(RegionShape *shape)
New shapes.
QStackedLayout * m_layout
QStackedLayout * m_widgets
void nListUp()
Moves the selected shape up in the list.
void create()
When the "create" button is clicked.
Subclass of RegionShape used for drawing text.
void eListDown()
Moves the selected shape down in the list.
Subclass of RegionShape used for drawing polygons.
static RegionShape * creationShape(unsigned int i)