casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
casa::RSRectangle Class Reference

Subclass of RegionShape used for drawing rectangles. More...

#include <RegionShapes.h>

Inheritance diagram for casa::RSRectangle:
casa::RegionShape casa::PassiveCachingDD casa::CachingDisplayData casa::DisplayData casa::DisplayOptions casa::DisplayEH casa::DlTarget

List of all members.

Public Member Functions

 RSRectangle (double x, double y, double width, double height, MDirection::Types worldSystem, double angle=0)
 Non-Static Members //.
 RSRectangle (double x, double y, double width, double height, double angle=0)
 Pixel Constructor.
 RSRectangle (const RecordInterface &properties)
 Record Constructor.
 ~RSRectangle ()
 Destructor.
bool drawAndUpdateBoundingBox (WorldCanvasHolder &wch, String *err=NULL)
 Implements RegionShape::drawAndUpdateBoundingBox.
String type () const
 Implements RegionShape::type.
void getRectangleCoordinates (double &x, double &y, double &width, double &height, double &angle, String toSystem="") const
 Gets rectangle-specific coordinates, to avoid dependence on coordParameterValues() when the shape type is known.
vector< double > coordParameterValues () const
 Implements RegionShape::coordParameterValues.
vector< double > coordParameterValues (String toSystem) const
 Implements RegionShape::coordParameterValues.
vector< StringcoordParameterNames () const
 Implements RegionShape::coordParameterNames.
vector< CoordinateParameterTypecoordParameterTypes () 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< StringoptionNames () const
 Implements RegionShape option methods.
vector< OptionTypeoptionTypes () const
 Returns the types for options.
vector< RSOptionoptionValues () const
 Returns the current values for options.
void setOptionValues (const vector< RSOption > &)
 Sets the options to the given.

Static Public Member Functions

static bool getRectanglePoints (double centerX, double centerY, double radiusX, double radiusY, double angle, Vector< double > &xPoints, Vector< double > &yPoints)
 Static Members //.

Protected Member Functions

void getShapeSpecificProperties (Record &properties) const
 same order
void setShapeSpecificProperties (const RecordInterface &)
 Implements RegionShape::setShapeSpecificProperties.
bool updateScreenCoordinates (WorldCanvasHolder &wch, String *err)
 Updates screen coords using world/pixel coords and the given WorldCanvas.
void updatePoints ()
 Translates m_spec into m_x and m_y.
void updateMinMax ()
 Update m_xMin, m_xMax, m_yMin, and m_yMax.

Protected Attributes

vector< double > m_spec
 
     

Vector< double > m_x
 either world or pixel coords
Vector< double > m_y
Vector< double > m_screenX
 in order: [upL, boL, boR, upR]
Vector< double > m_screenY

Detailed Description

Subclass of RegionShape used for drawing rectangles.

A rectangle has the following properties in addition to those listed for RegionShape:

Definition at line 193 of file RegionShapes.h.


Constructor & Destructor Documentation

casa::RSRectangle::RSRectangle ( double  x,
double  y,
double  width,
double  height,
MDirection::Types  worldSystem,
double  angle = 0 
)

Non-Static Members //.

World Constructor. x, y, width, and height must all be 1) using the same world system as defined by worldSystem, and 2) in unit RegionShape::UNIT. (x, y) specifies the center of the rectangle. Angle is in counterclockwise degrees starting at the east vector.

casa::RSRectangle::RSRectangle ( double  x,
double  y,
double  width,
double  height,
double  angle = 0 
)

Pixel Constructor.

(x, y) specifies the center of the rectangle.

Record Constructor.

Destructor.


Member Function Documentation

vector<String> casa::RSRectangle::coordParameterNames ( ) const [virtual]

Implements RegionShape::coordParameterPositions.

Implements casa::RegionShape.

vector<double> casa::RSRectangle::coordParameterValues ( ) const [virtual]
vector<double> casa::RSRectangle::coordParameterValues ( String  toSystem) const [virtual]
bool casa::RSRectangle::drawAndUpdateBoundingBox ( WorldCanvasHolder wch,
String err = NULL 
) [virtual]

Implements RegionShape::getHandle.

Implements casa::RegionShape.

void casa::RSRectangle::getRectangleCoordinates ( double &  x,
double &  y,
double &  width,
double &  height,
double &  angle,
String  toSystem = "" 
) const

Gets rectangle-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).

static bool casa::RSRectangle::getRectanglePoints ( double  centerX,
double  centerY,
double  radiusX,
double  radiusY,
double  angle,
Vector< double > &  xPoints,
Vector< double > &  yPoints 
) [static]

Static Members //.

Gets the four rectangle points for the given center, radii, and angle and puts them in the given vectors. Returns whether or not the operation succeeded. Angle is in counterclockwise degrees. The point order is [top right, top left, bottom left, bottom right] in the coordinate system of the given points.

void casa::RSRectangle::getShapeSpecificProperties ( Record properties) const [inline, protected, virtual]
void casa::RSRectangle::move ( double  dx,
double  dy,
String  system = "" 
) [virtual]

Implements RegionShape::move.

Implements casa::RegionShape.

vector<String> casa::RSRectangle::optionNames ( ) const [inline, virtual]

Implements RegionShape option methods.

Note: rectangles do not have additonal options.

Implements casa::RegionShape.

Definition at line 268 of file RegionShapes.h.

vector<OptionType> casa::RSRectangle::optionTypes ( ) const [inline, virtual]

Returns the types for options.

Implements casa::RegionShape.

Definition at line 269 of file RegionShapes.h.

vector<RSOption> casa::RSRectangle::optionValues ( ) const [inline, virtual]

Returns the current values for options.

Implements casa::RegionShape.

Definition at line 270 of file RegionShapes.h.

void casa::RSRectangle::setCoordParameters ( const vector< double > &  vals) [virtual]
void casa::RSRectangle::setCoordParameters ( const vector< double > &  vals,
String  valSystem 
) [virtual]
void casa::RSRectangle::setOptionValues ( const vector< RSOption > &  options) [inline, virtual]

Sets the options to the given.

Implements casa::RegionShape.

Definition at line 271 of file RegionShapes.h.

void casa::RSRectangle::setShapeSpecificProperties ( const RecordInterface ) [inline, protected, virtual]

Implements RegionShape::setShapeSpecificProperties.

Implements casa::RegionShape.

Definition at line 288 of file RegionShapes.h.

String casa::RSRectangle::type ( ) const [inline, virtual]

Implements RegionShape::type.

Implements casa::RegionShape.

Definition at line 231 of file RegionShapes.h.

void casa::RSRectangle::updateMinMax ( ) [protected]

Update m_xMin, m_xMax, m_yMin, and m_yMax.

void casa::RSRectangle::updatePoints ( ) [protected]

Translates m_spec into m_x and m_y.

bool casa::RSRectangle::updateScreenCoordinates ( WorldCanvasHolder wch,
String err 
) [protected]

Updates screen coords using world/pixel coords and the given WorldCanvas.


Member Data Documentation

Vector<double> casa::RSRectangle::m_screenX [protected]

in order: [upL, boL, boR, upR]

Definition at line 279 of file RegionShapes.h.

Vector<double> casa::RSRectangle::m_screenY [protected]

Definition at line 279 of file RegionShapes.h.

vector<double> casa::RSRectangle::m_spec [protected]

     

Definition at line 275 of file RegionShapes.h.

Vector<double> casa::RSRectangle::m_x [protected]

either world or pixel coords

Definition at line 277 of file RegionShapes.h.

Vector<double> casa::RSRectangle::m_y [protected]

Definition at line 277 of file RegionShapes.h.


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