casa
$Rev:20696$
|
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. | |
RSHandle (const vector< double > &x, const vector< double > &y, int markerHeight=DEFAULT_MARKER_HEIGHT, const String &markerColor=DEFAULT_MARKER_COLOR, Display::Marker markerType=DEFAULT_MARKER_TYPE) | |
Constructor which takes x and y vectors. | |
RSHandle (const Vector< double > &x, const Vector< double > &y, int markerHeight=DEFAULT_MARKER_HEIGHT, const String &markerColor=DEFAULT_MARKER_COLOR, Display::Marker markerType=DEFAULT_MARKER_TYPE) | |
Constructor which takes x and y Vectors. | |
~RSHandle () | |
Destructor. | |
int | getMarkerHeight () const |
Gets/sets the marker height/color/type. | |
void | setMarkerHeight (int height) |
String | getMarkerColor () const |
void | setMarkerColor (const 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. | |
bool | containsPoint (double x, double y) const |
Returns true if the handle is valid and the given point is inside. | |
bool | getVertices (vector< double > &x, vector< double > &y) const |
Gets the handle vertices coordinates and returns whether the operation succeeded or not (i.e. | |
bool | draw (PixelCanvas *canvas) const |
Draws the handles on the given canvas and returns whether the operation succeeded or not (i.e. | |
Static Public Attributes | |
static const int | DEFAULT_MARKER_HEIGHT |
Defaults. | |
static const String | DEFAULT_MARKER_COLOR |
static const Display::Marker | DEFAULT_MARKER_TYPE |
Private Attributes | |
bool | m_isValid |
vector< double > | m_x |
vector< double > | m_y |
int | m_markerHeight |
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 437 of file RSUtils.qo.h.
Constructor which makes an invalid handle.
casa::RSHandle::RSHandle | ( | const vector< double > & | x, |
const vector< double > & | y, | ||
int | markerHeight = DEFAULT_MARKER_HEIGHT , |
||
const 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 Vector< double > & | x, |
const Vector< double > & | y, | ||
int | markerHeight = DEFAULT_MARKER_HEIGHT , |
||
const 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.
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.
String casa::RSHandle::getMarkerColor | ( | ) | const [inline] |
Definition at line 470 of file RSUtils.qo.h.
References m_markerColor.
int casa::RSHandle::getMarkerHeight | ( | ) | const [inline] |
Gets/sets the marker height/color/type.
Definition at line 468 of file RSUtils.qo.h.
References m_markerHeight.
Display::Marker casa::RSHandle::getMarkerType | ( | ) | const [inline] |
Definition at line 472 of file RSUtils.qo.h.
References m_markerType.
bool casa::RSHandle::getVertices | ( | vector< double > & | x, |
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.
bool casa::RSHandle::isValid | ( | ) | const [inline] |
Returns whether the handle is valid (has four valid points) or not.
Definition at line 477 of file RSUtils.qo.h.
References m_isValid.
void casa::RSHandle::setMarkerColor | ( | const String & | color | ) |
void casa::RSHandle::setMarkerHeight | ( | int | height | ) |
void casa::RSHandle::setMarkerType | ( | Display::Marker | type | ) |
const String casa::RSHandle::DEFAULT_MARKER_COLOR [static] |
Definition at line 442 of file RSUtils.qo.h.
const int casa::RSHandle::DEFAULT_MARKER_HEIGHT [static] |
Defaults.
Definition at line 441 of file RSUtils.qo.h.
const Display::Marker casa::RSHandle::DEFAULT_MARKER_TYPE [static] |
Definition at line 443 of file RSUtils.qo.h.
bool casa::RSHandle::m_isValid [private] |
Definition at line 493 of file RSUtils.qo.h.
Referenced by isValid().
String casa::RSHandle::m_markerColor [private] |
Definition at line 496 of file RSUtils.qo.h.
Referenced by getMarkerColor().
int casa::RSHandle::m_markerHeight [private] |
Definition at line 495 of file RSUtils.qo.h.
Referenced by getMarkerHeight().
Display::Marker casa::RSHandle::m_markerType [private] |
Definition at line 497 of file RSUtils.qo.h.
Referenced by getMarkerType().
vector<double> casa::RSHandle::m_x [private] |
Definition at line 494 of file RSUtils.qo.h.
vector<double> casa::RSHandle::m_y [private] |
Definition at line 494 of file RSUtils.qo.h.