casa
$Rev:20696$
|
Subclass of RegionShape used for drawing polygons. More...
#include <RegionShapes.h>
Public Member Functions | |
RSPolygon (const Vector< double > &x, const Vector< double > &y, MDirection::Types worldSystem, String custName="") | |
Non-Static Members //. | |
RSPolygon (const Vector< double > &x, const Vector< double > &y, String custName="") | |
Pixel Constructor. | |
RSPolygon (const RecordInterface &properties) | |
Record Constructor. | |
~RSPolygon () | |
Destructor. | |
void | setPolygonCoordinates (const Vector< double > &x, const Vector< double > &y) |
Sets the polygon coordinates to the given. | |
bool | drawAndUpdateBoundingBox (WorldCanvasHolder &wch, String *err=NULL) |
Implements RegionShape::drawAndUpdateBoundingBox. | |
String | type () const |
Implements RegionShape::type. | |
String | oneWordType () const |
Overrides RegionShape::oneWordType. | |
void | getPolygonCoordinates (double ¢erX, double ¢erY, String toSystem="") const |
Gets polygon-specific coordinates, to avoid dependence on coordParameterValues() when the shape type is known. | |
void | getPolygonCoordinates (vector< double > &x, vector< double > &y, String toSystem="") const |
Gets actual polygon coordinates. | |
vector< double > | coordParameterValues () const |
Implements RegionShape::coordParameterValues. | |
vector< double > | coordParameterValues (String toSystem) const |
Implements RegionShape::coordParameterValues. | |
vector< String > | coordParameterNames () const |
Implements RegionShape::coordParameterNames. | |
vector< CoordinateParameterType > | coordParameterTypes () const |
Implements RegionShape::coordParameterPositions. | |
void | setCoordParameters (const vector< double > &vals) |
Implements RegionShape::setCoordParameters. | |
void | setCoordParameters (const vector< double > &vals, String valSystem) |
Implements RegionShape::setCoordParameters. | |
void | move (double dx, double dy, String system="") |
Implements RegionShape::move. | |
RSHandle | getHandle () const |
Implements RegionShape::getHandle. | |
vector< String > | optionNames () const |
Implements RegionShape::optionNames. | |
vector< OptionType > | optionTypes () const |
Implements RegionShape::optionTypes. | |
vector< RSOption > | optionValues () const |
Implements RegionShape::optionValues. | |
void | setOptionValues (const vector< RSOption > &options) |
Implements RegionShape::setOptions. | |
Static Public Attributes | |
static const String | PROPXCOORDINATES |
Static Members //. | |
static const String | PROPYCOORDINATES |
Protected Member Functions | |
void | getShapeSpecificProperties (Record &properties) const |
Implements RegionShape::getShapeSpecificProperties. | |
void | setShapeSpecificProperties (const RecordInterface &properties) |
Implements RegionShape::setShapeSpecificProperties. | |
bool | updateScreenCoordinates (WorldCanvasHolder &wch, String *err) |
Updates screen coords using world/pixel coords and the given WorldCanvas. | |
void | updateMinMax () |
Update m_xMin, m_xMax, m_yMin, and m_yMax. | |
Protected Attributes | |
Vector< Double > | m_x |
Vector< Double > | m_y |
double | m_centerX |
double | m_centerY |
Vector< Double > | m_screenX |
Vector< Double > | m_screenY |
unsigned int | m_n |
String | m_custName |
Subclass of RegionShape used for drawing polygons.
A polygon has the following properties in addition to those listed for RegionShape:
The following properties are also available:
Definition at line 312 of file RegionShapes.h.
casa::RSPolygon::RSPolygon | ( | const Vector< double > & | x, |
const Vector< double > & | y, | ||
MDirection::Types | worldSystem, | ||
String | custName = "" |
||
) |
Non-Static Members //.
World Constructor. x and y must both be 1) using the same world system as defined by worldSystem, and 2) in unit RegionShape::UNIT. A custom name can be provided to be returned with RSPolygon::type().
casa::RSPolygon::RSPolygon | ( | const Vector< double > & | x, |
const Vector< double > & | y, | ||
String | custName = "" |
||
) |
Pixel Constructor.
casa::RSPolygon::RSPolygon | ( | const RecordInterface & | properties | ) |
Record Constructor.
Destructor.
vector<String> casa::RSPolygon::coordParameterNames | ( | ) | const [virtual] |
Implements RegionShape::coordParameterNames.
Implements casa::RegionShape.
vector<CoordinateParameterType> casa::RSPolygon::coordParameterTypes | ( | ) | const [virtual] |
Implements RegionShape::coordParameterPositions.
Implements casa::RegionShape.
vector<double> casa::RSPolygon::coordParameterValues | ( | ) | const [virtual] |
Implements RegionShape::coordParameterValues.
Implements casa::RegionShape.
vector<double> casa::RSPolygon::coordParameterValues | ( | String | toSystem | ) | const [virtual] |
Implements RegionShape::coordParameterValues.
Implements casa::RegionShape.
bool casa::RSPolygon::drawAndUpdateBoundingBox | ( | WorldCanvasHolder & | wch, |
String * | err = NULL |
||
) | [virtual] |
Implements RegionShape::drawAndUpdateBoundingBox.
Implements casa::RegionShape.
RSHandle casa::RSPolygon::getHandle | ( | ) | const [virtual] |
Implements RegionShape::getHandle.
Implements casa::RegionShape.
void casa::RSPolygon::getPolygonCoordinates | ( | double & | centerX, |
double & | centerY, | ||
String | toSystem = "" |
||
) | const |
Gets polygon-specific coordinates, to avoid dependence on coordParameterValues() when the shape type is known.
If toSystem is empty, no conversion is done; otherwise see the constraints listed in RegionShape::coordParameterValues(String).
void casa::RSPolygon::getPolygonCoordinates | ( | vector< double > & | x, |
vector< double > & | y, | ||
String | toSystem = "" |
||
) | const |
Gets actual polygon coordinates.
If toSystem is empty, no conversion is done; otherwise see the constraints listed in RegionShape::coordParameterValues(String).
void casa::RSPolygon::getShapeSpecificProperties | ( | Record & | properties | ) | const [protected, virtual] |
Implements RegionShape::getShapeSpecificProperties.
Implements casa::RegionShape.
void casa::RSPolygon::move | ( | double | dx, |
double | dy, | ||
String | system = "" |
||
) | [virtual] |
Implements RegionShape::move.
Implements casa::RegionShape.
String casa::RSPolygon::oneWordType | ( | ) | const [inline, virtual] |
Overrides RegionShape::oneWordType.
Reimplemented from casa::RegionShape.
Definition at line 355 of file RegionShapes.h.
vector<String> casa::RSPolygon::optionNames | ( | ) | const [virtual] |
Implements RegionShape::optionNames.
Implements casa::RegionShape.
vector<OptionType> casa::RSPolygon::optionTypes | ( | ) | const [virtual] |
Implements RegionShape::optionTypes.
Implements casa::RegionShape.
vector<RSOption> casa::RSPolygon::optionValues | ( | ) | const [virtual] |
Implements RegionShape::optionValues.
Implements casa::RegionShape.
void casa::RSPolygon::setCoordParameters | ( | const vector< double > & | vals | ) | [virtual] |
Implements RegionShape::setCoordParameters.
Implements casa::RegionShape.
void casa::RSPolygon::setCoordParameters | ( | const vector< double > & | vals, |
String | valSystem | ||
) | [virtual] |
Implements RegionShape::setCoordParameters.
Implements casa::RegionShape.
void casa::RSPolygon::setOptionValues | ( | const vector< RSOption > & | options | ) | [virtual] |
Implements RegionShape::setOptions.
Implements casa::RegionShape.
void casa::RSPolygon::setPolygonCoordinates | ( | const Vector< double > & | x, |
const Vector< double > & | y | ||
) |
Sets the polygon coordinates to the given.
void casa::RSPolygon::setShapeSpecificProperties | ( | const RecordInterface & | properties | ) | [protected, virtual] |
Implements RegionShape::setShapeSpecificProperties.
Implements casa::RegionShape.
String casa::RSPolygon::type | ( | ) | const [inline, virtual] |
Implements RegionShape::type.
Implements casa::RegionShape.
Definition at line 349 of file RegionShapes.h.
References casa::String::empty(), and m_custName.
void casa::RSPolygon::updateMinMax | ( | ) | [protected] |
Update m_xMin, m_xMax, m_yMin, and m_yMax.
bool casa::RSPolygon::updateScreenCoordinates | ( | WorldCanvasHolder & | wch, |
String * | err | ||
) | [protected] |
Updates screen coords using world/pixel coords and the given WorldCanvas.
double casa::RSPolygon::m_centerX [protected] |
Definition at line 408 of file RegionShapes.h.
double casa::RSPolygon::m_centerY [protected] |
Definition at line 408 of file RegionShapes.h.
String casa::RSPolygon::m_custName [protected] |
Definition at line 411 of file RegionShapes.h.
Referenced by type().
unsigned int casa::RSPolygon::m_n [protected] |
Definition at line 410 of file RegionShapes.h.
Vector<Double> casa::RSPolygon::m_screenX [protected] |
Definition at line 409 of file RegionShapes.h.
Vector<Double> casa::RSPolygon::m_screenY [protected] |
Definition at line 409 of file RegionShapes.h.
Vector<Double> casa::RSPolygon::m_x [protected] |
Definition at line 407 of file RegionShapes.h.
Vector<Double> casa::RSPolygon::m_y [protected] |
Definition at line 407 of file RegionShapes.h.
const String casa::RSPolygon::PROPXCOORDINATES [static] |
Static Members //.
Properties. (See class descriptions of RegionShape and RSPolygon.)
Definition at line 318 of file RegionShapes.h.
const String casa::RSPolygon::PROPYCOORDINATES [static] |
Definition at line 319 of file RegionShapes.h.