casa
5.7.0-16
|
A "handle" is a four-point structure (usually a rectangle) that describes the boundaries in screen pixels that a RegionShape takes on a canvas. More...
#include <RSUtils.qo.h>
Public Member Functions | |
RSHandle () | |
Constructor which makes an invalid handle. More... | |
RSHandle (const std::vector< double > &x, const std::vector< double > &y, int markerHeight=DEFAULT_MARKER_HEIGHT, const casacore::String &markerColor=DEFAULT_MARKER_COLOR, Display::Marker markerType=DEFAULT_MARKER_TYPE) | |
Constructor which takes x and y vectors. More... | |
RSHandle (const casacore::Vector< double > &x, const casacore::Vector< double > &y, int markerHeight=DEFAULT_MARKER_HEIGHT, const casacore::String &markerColor=DEFAULT_MARKER_COLOR, Display::Marker markerType=DEFAULT_MARKER_TYPE) | |
Constructor which takes x and y Vectors. More... | |
~RSHandle () | |
Destructor. More... | |
int | getMarkerHeight () const |
Gets/sets the marker height/color/type. More... | |
void | setMarkerHeight (int height) |
casacore::String | getMarkerColor () const |
void | setMarkerColor (const casacore::String &color) |
Display::Marker | getMarkerType () const |
void | setMarkerType (Display::Marker type) |
bool | isValid () const |
Returns whether the handle is valid (has four valid points) or not. More... | |
bool | containsPoint (double x, double y) const |
Returns true if the handle is valid and the given point is inside. More... | |
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.e. More... | |
bool | draw (PixelCanvas *canvas) const |
Draws the handles on the given canvas and returns whether the operation succeeded or not (i.e. More... | |
Static Public Attributes | |
static const int | DEFAULT_MARKER_HEIGHT |
Defaults. More... | |
static const casacore::String | DEFAULT_MARKER_COLOR |
static const Display::Marker | DEFAULT_MARKER_TYPE |
Private Attributes | |
bool | m_isValid |
std::vector< double > | m_x |
std::vector< double > | m_y |
int | m_markerHeight |
casacore::String | m_markerColor |
Display::Marker | m_markerType |
A "handle" is a four-point structure (usually a rectangle) that describes the boundaries in screen pixels that a RegionShape takes on a canvas.
In the future, this will be used for selecting/editing/moving/resizing shapes on the canvas using the mouse.
Definition at line 445 of file RSUtils.qo.h.
casa::RSHandle::RSHandle | ( | ) |
Constructor which makes an invalid handle.
casa::RSHandle::RSHandle | ( | const std::vector< double > & | x, |
const std::vector< double > & | y, | ||
int | markerHeight = DEFAULT_MARKER_HEIGHT , |
||
const casacore::String & | markerColor = DEFAULT_MARKER_COLOR , |
||
Display::Marker | markerType = DEFAULT_MARKER_TYPE |
||
) |
Constructor which takes x and y vectors.
x and y MUST be length 4 or the handle is invalid.
casa::RSHandle::RSHandle | ( | const casacore::Vector< double > & | x, |
const casacore::Vector< double > & | y, | ||
int | markerHeight = DEFAULT_MARKER_HEIGHT , |
||
const casacore::String & | markerColor = DEFAULT_MARKER_COLOR , |
||
Display::Marker | markerType = DEFAULT_MARKER_TYPE |
||
) |
Constructor which takes x and y Vectors.
x and y MUST be length 4 or the handle is invalid.
casa::RSHandle::~RSHandle | ( | ) |
Destructor.
bool casa::RSHandle::containsPoint | ( | double | x, |
double | y | ||
) | const |
Returns true if the handle is valid and the given point is inside.
bool casa::RSHandle::draw | ( | PixelCanvas * | canvas | ) | const |
Draws the handles on the given canvas and returns whether the operation succeeded or not (i.e.
if the handle is valid). If valid, each of the four points is drawn as a marker.
|
inline |
Definition at line 480 of file RSUtils.qo.h.
References m_markerColor.
|
inline |
Gets/sets the marker height/color/type.
Definition at line 476 of file RSUtils.qo.h.
References m_markerHeight.
|
inline |
Definition at line 484 of file RSUtils.qo.h.
References m_markerType.
bool casa::RSHandle::getVertices | ( | std::vector< double > & | x, |
std::vector< double > & | y | ||
) | const |
Gets the handle vertices coordinates and returns whether the operation succeeded or not (i.e.
if the handle is valid). If it succeeded, x and y will be resize to be size 4 if necessary.
|
inline |
Returns whether the handle is valid (has four valid points) or not.
Definition at line 491 of file RSUtils.qo.h.
References m_isValid.
void casa::RSHandle::setMarkerColor | ( | const casacore::String & | color | ) |
void casa::RSHandle::setMarkerHeight | ( | int | height | ) |
void casa::RSHandle::setMarkerType | ( | Display::Marker | type | ) |
|
static |
Definition at line 450 of file RSUtils.qo.h.
|
static |
Defaults.
Definition at line 449 of file RSUtils.qo.h.
|
static |
Definition at line 451 of file RSUtils.qo.h.
|
private |
Definition at line 509 of file RSUtils.qo.h.
Referenced by isValid().
|
private |
Definition at line 512 of file RSUtils.qo.h.
Referenced by getMarkerColor().
|
private |
Definition at line 511 of file RSUtils.qo.h.
Referenced by getMarkerHeight().
|
private |
Definition at line 513 of file RSUtils.qo.h.
Referenced by getMarkerType().
|
private |
Definition at line 510 of file RSUtils.qo.h.
|
private |
Definition at line 510 of file RSUtils.qo.h.