casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
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>

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
 

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

Constructor & Destructor Documentation

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.

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.

casacore::String casa::RSHandle::getMarkerColor ( ) const
inline

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

References m_markerColor.

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

Gets/sets the marker height/color/type.

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

References m_markerHeight.

Display::Marker casa::RSHandle::getMarkerType ( ) const
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.

bool casa::RSHandle::isValid ( ) const
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)

Member Data Documentation

const casacore::String casa::RSHandle::DEFAULT_MARKER_COLOR
static

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

const int casa::RSHandle::DEFAULT_MARKER_HEIGHT
static

Defaults.

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

const Display::Marker casa::RSHandle::DEFAULT_MARKER_TYPE
static

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

bool casa::RSHandle::m_isValid
private

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

Referenced by isValid().

casacore::String casa::RSHandle::m_markerColor
private

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

Referenced by getMarkerColor().

int casa::RSHandle::m_markerHeight
private

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

Referenced by getMarkerHeight().

Display::Marker casa::RSHandle::m_markerType
private

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

Referenced by getMarkerType().

std::vector<double> casa::RSHandle::m_x
private

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

std::vector<double> casa::RSHandle::m_y
private

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


The documentation for this class was generated from the following file: