34 #include <QHBoxLayout>
35 #include <QPushButton>
54 static QHBoxLayout*
hlayout(QWidget* parent = NULL);
55 static QVBoxLayout*
vlayout(QWidget* parent = NULL);
65 static QWidget*
hline();
66 static QWidget*
vline();
74 QWidget* parent = NULL);
158 linY(worldY.getValue().size());
159 return worldToLinear(worldX, worldY, linX, linY, wch, fromSys, wrap,
168 return pixelToLinear(pixelX, pixelY, linX, linY, wch, error) &&
182 const std::vector<int>& xSign,
const std::vector<int>& ySign,
191 return linearToWorld(linearX, linearY, worldX, worldY, wch, toSys,
192 std::vector<int>(), std::vector<int>(),
false, error);
209 std::vector<int>(), std::vector<int>(),
false, error);
217 const std::vector<int>& xSign,
const std::vector<int>& ySign,
222 xSign, ySign,
true, error);
230 return screenToLinear(screenX, screenY, linX, linY, wch, error) &&
261 QWidget* parent = NULL);
266 QtColorWidget(
const std::vector<casacore::String>& colors,
bool showButton =
false,
284 static std::vector<casacore::String> v(9);
336 RSValue(
bool hms,
long hd,
long m,
double s,
bool minus =
false) :
398 RSOption(
const std::vector<casacore::String>& v);
459 RSHandle(
const std::vector<double>& x,
const std::vector<double>& y,
501 bool getVertices(std::vector<double>& x, std::vector<double>& y)
const;
static casacore::MDirection::Types worldSystem(const DisplayCoordinateSystem &cs)
Returns the world system type for the given coordinate system.
static bool screenToLinear(const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::String *error=NULL)
void setMarkerType(Display::Marker type)
Display::Marker getMarkerType() const
static QHBoxLayout * hlayout(QWidget *parent=NULL)
Returns a new layout with the given parent, and calls setupLayout on it;.
static bool convertBetween(const QString &from, const casacore::String &fromUnits, RSValue &to)
Converts the value in the given QString in the given units to the given RSValue.
const casacore::String & asString() const
Value methods.
virtual WorldCanvas * worldCanvas() const
Return the WorldCanvas which is held by this WorldCanvasHolder.
A "handle" is a four-point structure (usually a rectangle) that describes the boundaries in screen pi...
static bool hasDirectionCoordinate(const WorldCanvasHolder &wch)
const std::vector< casacore::String > & asStringArray() const
virtual Type type()
Return the type enum.
void setMarkerHeight(int height)
Display::Marker m_markerType
static bool screenToWorld(const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, const std::vector< int > &xSign, const std::vector< int > &ySign, casacore::String *error=NULL)
Convenience class for a casacore::String, bool, or double.
static const casacore::String HMS
static const casacore::String ARCMIN
std::vector< double > m_y
static bool hasDirectionCoordinate(const WorldCanvas *wc)
static bool screenToWorld(const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, casacore::String *error=NULL)
RSOption & operator=(const casacore::String &str)
static bool pixelToLinear(const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::String *error=NULL)
static QtColorWidget * colorWidget(bool showButton=false, casacore::String setColor="", QWidget *parent=NULL)
Returns a new color widget.
static const casacore::String RAD
static void appendUniqueMessage(casacore::String *ss, const casacore::String &message)
static const casacore::String DMS
casacore::String getMarkerColor() const
Base class defining interface to pixel-based output devices.
static bool linearToScreen(const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::String *error=NULL)
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
RSValue(double d, casacore::Unit u)
static casacore::MDirection::Types worldSystem(const WorldCanvas *wc)
Returns the world system type for the given WorldCanvas.
void setMarkerColor(const casacore::String &color)
static bool pixelToScreen(const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::String *error=NULL)
bool draw(PixelCanvas *canvas) const
Draws the handles on the given canvas and returns whether the operation succeeded or not (i...
int getMarkerHeight() const
Gets/sets the marker height/color/type.
static bool convertWCS(const casacore::Quantum< casacore::Vector< double > > &from, casacore::MDirection::Types fromSys, casacore::Quantum< casacore::Vector< double > > &to, casacore::MDirection::Types toSys)
Converts between coordinate systems.
static bool linearToWorld(const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, casacore::String *error=NULL)
bool getVertices(std::vector< double > &x, std::vector< double > &y) const
Gets the handle vertices coordinates and returns whether the operation succeeded or not (i...
bool operator==(const RSOption &other)
Operators.
RSHandle()
Constructor which makes an invalid handle.
static bool pixelToWorld(const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, bool wrap=true, casacore::String *error=NULL)
static QWidget * hline()
Returns a horizontal or vertical line (QFrame).
static bool worldToPixel(const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
Converts the given coordinates between different systems, using the given WorldCanvas and world syste...
bool isStringArray() const
casacore::String m_markerColor
Quantities (i.e. dimensioned values)
static bool linearToPixel(const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::String *error=NULL)
bool containsPoint(double x, double y) const
Returns true if the handle is valid and the given point is inside.
static bool hasDirectionCoordinate(const DisplayCoordinateSystem &cs)
Returns whether or not the given coordinate system has a direction coordinate or not.
const DisplayCoordinateSystem & coordinateSystem() const
RSValue(bool hms, long hd, long m, double s, bool minus=false)
static QVBoxLayout * vlayout(QWidget *parent=NULL)
casacore::Quantum< double > val
static void appendUniqueMessage(stringstream &ss, const casacore::String &message)
Appends the given message to the given stream, if the stream does not already contain an identical me...
static bool screenToPixel(const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::String *error=NULL)
static void setupLayout(QLayout *layout)
Sets up the given layout by setting: 1) margins to 0, 2) spacing to 3.
static bool worldToLinear(const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
casacore::String m_string
bool operator!=(const RSOption &other)
A holder to interface between DisplayDatas and a WorldCanvas.
Implementation of drawing in world coordinates on top of a PixelCanvas.
static const casacore::String DEFAULT_MARKER_COLOR
static const casacore::String PIXEL
Pixel coordinate system.
static const casacore::String ARCSEC
String: the storage and methods of handling collections of characters.
static void appendUniqueMessage(stringstream *ss, const casacore::String &message)
GRID LAYOUT CLASSES casacore::Coordinate for a grid layout
static bool worldToScreen(const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
TableExprNode hms(const TableExprNode &node)
Functions for angle-values.
std::vector< double > m_x
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the color(i.e.,"000000"for black) and
static bool linearToWorld(const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, const std::vector< int > &xSign, const std::vector< int > &ySign, bool wrap=true, casacore::String *error=NULL)
RSOption(const casacore::String &str)
casacore::String constructor.
bool isValid() const
Returns whether the handle is valid (has four valid points) or not.
static const int DEFAULT_MARKER_HEIGHT
Defaults.
bool isString() const
Type methods.
Common utilities/constants for region shapes.
static const Display::Marker DEFAULT_MARKER_TYPE
static casacore::MDirection::Types worldSystem(const WorldCanvasHolder &wch)
Returns the world system type for the given WorldCanvasHolder.
static const casacore::String DEG
casacore::Conversion methods/constants //
std::vector< casacore::String > m_stringArray
Convenience class for the different units available for coordinates/sizes.