casa::RSHandle Class Reference

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>

List of all members.

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

Detailed Description

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 441 of file RSUtils.qo.h.


Constructor & Destructor Documentation

casa::RSHandle::RSHandle (  ) 

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.

casa::RSHandle::~RSHandle (  ) 

Destructor.


Member Function Documentation

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 476 of file RSUtils.qo.h.

References m_markerColor.

int casa::RSHandle::getMarkerHeight (  )  const [inline]

Gets/sets the marker height/color/type.

Definition at line 472 of file RSUtils.qo.h.

References m_markerHeight.

Display::Marker casa::RSHandle::getMarkerType (  )  const [inline]

Definition at line 480 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 487 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  ) 

Member Data Documentation

const String casa::RSHandle::DEFAULT_MARKER_COLOR [static]

Definition at line 446 of file RSUtils.qo.h.

Defaults.

Definition at line 445 of file RSUtils.qo.h.

Definition at line 447 of file RSUtils.qo.h.

bool casa::RSHandle::m_isValid [private]

Definition at line 505 of file RSUtils.qo.h.

Referenced by isValid().

Definition at line 508 of file RSUtils.qo.h.

Referenced by getMarkerColor().

Definition at line 507 of file RSUtils.qo.h.

Referenced by getMarkerHeight().

Definition at line 509 of file RSUtils.qo.h.

Referenced by getMarkerType().

vector<double> casa::RSHandle::m_x [private]

Definition at line 506 of file RSUtils.qo.h.

vector<double> casa::RSHandle::m_y [private]

Definition at line 506 of file RSUtils.qo.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1