casa
$Rev:20696$
|
Parent class for all RegionShapes. More...
#include <RegionShape.h>
Public Types | |
enum | CoordinateParameterType { POSITION, SIZE, ANGLE, PIXEL } |
Different types for coordinate parameters. More... | |
enum | OptionType { STRING, STRINGCHOICE, STRINGARRAY, STRINGCHOICEARRAY, DOUBLE, BOOL } |
Different types for options. More... | |
enum | LineStyle { SOLID, DASHED, DOTTED } |
Different line styles. More... | |
Public Member Functions | |
RegionShape (MDirection::Types worldSys) | |
Non-Static Members //. | |
RegionShape () | |
Pixel Constructor. | |
RegionShape (const RecordInterface &properties) | |
Record Constructor. | |
virtual | ~RegionShape () |
Destructor. | |
const Unit | dataUnit () const |
PassiveCachingDD methods //. | |
const IPosition | dataShape () const |
const uInt | dataDim () const |
std::vector< int > | displayAxes () const |
Display::DisplayDataType | classType () |
Implements PassiveCachingDD::classType. | |
CachingDisplayMethod * | newDisplayMethod (WorldCanvas *wc, AttributeBuffer *wchAttr, AttributeBuffer *ddAttr, CachingDisplayData *dd) |
Implements PassiveCachingDD::newDisplayMethod. | |
virtual String | lineColor () const |
Common RegionShape methods //. | |
virtual void | setLineColor (const String &newColor, bool alsoSetLabel=true) |
virtual double | lineWidth () const |
Gets/sets this shape's line width. | |
virtual void | setLineWidth (double width) |
virtual LineStyle | lineStyle () const |
Gets/sets this shape's line style. | |
virtual void | setLineStyle (LineStyle style) |
virtual String | text () const |
Gets/sets this shape's label's text. | |
virtual void | setText (const String &text) |
virtual const RegionShapeLabel & | label () const |
Gets/sets this shape's label. | |
virtual void | setLabel (const RegionShapeLabel &label) |
virtual bool | linethrough () const |
Gets/sets this shape's linethrough properties. | |
virtual String | linethroughColor () const |
virtual double | linethroughWidth () const |
virtual LineStyle | linethroughStyle () const |
virtual void | setLinethrough (bool linethrough, String color="red", double width=1, LineStyle style=SOLID) |
virtual double | xMin () const |
Min/max methods for world/pixel coordinates. | |
virtual double | xMax () const |
virtual double | yMin () const |
virtual double | yMax () const |
virtual double | screenXMin () const |
Bounding box methods. | |
virtual double | screenXMax () const |
virtual double | screenYMin () const |
virtual double | screenYMax () const |
virtual bool | isWorld () const |
Returns whether this shape's coordinates are in world or pixel. | |
virtual MDirection::Types | worldSystem () const |
If this shape is in world coordinates, returns the system used. | |
virtual void | setIsWorld (bool isWorld) |
Set world or pixel system. | |
virtual void | setWorldSystem (MDirection::Types sys) |
Set world system. | |
virtual String | title () const |
Returns this shape's type (color + type). | |
bool | draw (WorldCanvasHolder &wch) |
Checks whether the given WorldCanvasHolder has a direction coordinate. | |
virtual bool | hadDrawingError () const |
Returns whether there was an error during the last call to draw() or not. | |
const String & | lastDrawingError () const |
Returns the error that occurred during the last call to draw(). | |
Record | getProperties () const |
Returns this shape's properties as a Record. | |
Record | toRecord () const |
Synonym. | |
void | setProperties (const RecordInterface &properties) |
Sets this shape's properties from the given Record. | |
virtual bool | drawAndUpdateBoundingBox (WorldCanvasHolder &wch, String *error=NULL)=0 |
Pure Virtual Methods //. | |
virtual String | type () const =0 |
Returns the name/type of this shape, for displaying to the user. | |
String | dataType () const |
Pure virtual function from DisplayData... | |
virtual String | oneWordType () const |
Can be overridden by children. | |
virtual vector< double > | coordParameterValues () const =0 |
Returns the current values for the coordinate parameters. | |
virtual vector< double > | coordParameterValues (String toSystem) const =0 |
Returns the current values for the coordinate parameters in the given world system, by using the last WorldCanvasHolder for conversions if needed. | |
virtual vector< String > | coordParameterNames () const =0 |
Returns the name for the coordinate parameters, in the same order as coordParameterValues(). | |
virtual vector < CoordinateParameterType > | coordParameterTypes () const =0 |
Returns a vector indicating the types of the coordinate parameters, in the same order as coordParameterValues(). | |
virtual void | setCoordParameters (const vector< double > &vals)=0 |
Sets the coordinate parameter values to the given, in the same order as coordParameterValues(). | |
virtual void | setCoordParameters (const vector< double > &vals, String valSystem)=0 |
Sets the coordinate parameter values to the given, in the same order as coordParameterValues(). | |
virtual void | move (double dx, double dy, String system="")=0 |
Moves this shape the given delta x and delta y in the given system (empty for shape's native system). | |
virtual RSHandle | getHandle () const =0 |
Returns a RSHandle (four points in screen coords that are like a bounding box for the shape) for this shape. | |
virtual vector< String > | optionNames () const =0 |
Returns the names for options. | |
virtual vector< OptionType > | optionTypes () const =0 |
Returns the types for options. | |
virtual vector< vector< String > > | optionChoices () const |
For options that are string choices, return the available choices. | |
virtual vector< RSOption > | optionValues () const =0 |
Returns the current values for options. | |
virtual void | setOptionValues (const vector< RSOption > &options)=0 |
Sets the options to the given. | |
Static Public Member Functions | |
static RegionShape * | shapeFromRecord (const RecordInterface &properties, String &error) |
Creates a record of the correct type from the given record (see RegionShape class description), or NULL if a fatal error occurred. | |
static vector< LineStyle > | allLineStyles () |
Returns all available line styles. | |
static String | convLineStyle (LineStyle style) |
Convert between line style enum and String. | |
static LineStyle | convLineStyle (String style) |
Static Public Attributes | |
static const String | UNIT |
Static Members //. | |
static const double | UNIT_WRAPAROUND |
Value used for wrapping negative/positive unit values. | |
static const String | PROPISWORLD |
Properties. | |
static const String | PROPWORLDSYSTEM |
static const String | PROPLINE_COLOR |
static const String | PROPLINE_WIDTH |
static const String | PROPLINE_STYLE |
static const String | PROPTEXT |
static const String | PROPTEXT_COLOR |
static const String | PROPTEXT_FONT |
static const String | PROPTEXT_SIZE |
static const String | PROPTEXT_ITALIC |
static const String | PROPTEXT_BOLD |
static const String | PROPLINETHROUGH |
static const String | PROPLINETHROUGH_COLOR |
static const String | PROPLINETHROUGH_WIDTH |
static const String | PROPLINETHROUGH_STYLE |
static const String | PROPCOORDINATES |
static const String | PROPOPTIONS |
static const String | PROPTYPE |
static const String | PROPTYPE_ELLIPSE |
static const String | PROPTYPE_CIRCLE |
static const String | PROPTYPE_RECTANGLE |
static const String | PROPTYPE_POLYGON |
static const String | PROPTYPE_LINE |
static const String | PROPTYPE_VECTOR |
static const String | PROPTYPE_MARKER |
static const String | PROPTYPE_TEXT |
static const String | PROPTYPE_COMPOSITE |
static const String | DEFAULT_COLOR |
Defaults. | |
static const double | DEFAULT_WIDTH |
static const LineStyle | DEFAULT_STYLE |
Protected Member Functions | |
virtual void | getShapeSpecificProperties (Record &properties) const =0 |
Pure Virtual Methods //. | |
virtual void | setShapeSpecificProperties (const RecordInterface &props)=0 |
Sets shape-specific properties from the given record. | |
void | setLineProperties (PixelCanvas *pc) |
Common RegionShape Methods //. | |
void | setLinethroughProperties (PixelCanvas *pc) |
Sets the linethrough properties (color, width, style) of this shape for the given PixelCanvas. | |
void | resetLineStyle (PixelCanvas *pc) const |
Used for resetting the line style on the given PixelCanvas back to solid, in case future uses are expecting solid lines. | |
bool | worldToPixel (const Quantum< Vector< double > > &worldX, const Quantum< Vector< double > > &worldY, Vector< double > &pixelX, Vector< double > &pixelY, WorldCanvasHolder &wch, bool wrap=true, String *error=NULL) const |
Convenience access to RSUtils conversion methods. | |
bool | pixelToWorld (const Vector< double > &pixelX, const Vector< double > &pixelY, Quantum< Vector< double > > &worldX, Quantum< Vector< double > > &worldY, WorldCanvasHolder &wch, bool wrap=true, String *error=NULL) const |
bool | worldToLinear (const Quantum< Vector< double > > &worldX, const Quantum< Vector< double > > &worldY, Vector< double > &linearX, Vector< double > &linearY, WorldCanvasHolder &wch, bool wrap=true, String *error=NULL) const |
bool | worldToScreen (const Quantum< Vector< double > > &worldX, const Quantum< Vector< double > > &worldY, Vector< double > &screenX, Vector< double > &screenY, WorldCanvasHolder &wch, bool wrap=true, String *error=NULL) const |
bool | linearToWorld (const Vector< double > &linearX, const Vector< double > &linearY, Quantum< Vector< double > > &worldX, Quantum< Vector< double > > &worldY, WorldCanvasHolder &wch, String *error=NULL) const |
bool | linearToWorld (const Vector< double > &linearX, const Vector< double > &linearY, Quantum< Vector< double > > &worldX, Quantum< Vector< double > > &worldY, WorldCanvasHolder &wch, const vector< int > &xSign, const vector< int > &ySign, String *error=NULL) const |
bool | screenToWorld (const Vector< double > &screenX, const Vector< double > &screenY, Quantum< Vector< double > > &worldX, Quantum< Vector< double > > &worldY, WorldCanvasHolder &wch, String *error=NULL) const |
bool | screenToWorld (const Vector< double > &screenX, const Vector< double > &screenY, Quantum< Vector< double > > &worldX, Quantum< Vector< double > > &worldY, WorldCanvasHolder &wch, const vector< int > &xSign, const vector< int > &ySign, String *error=NULL) const |
Protected Attributes | |
bool | m_isWorld |
Common RegionShape Members //. | |
MDirection::Types | m_worldSystem |
World system (undefined if m_isWorld is false). | |
String | m_color |
Line color. | |
double | m_width |
Line width. | |
LineStyle | m_style |
Line style. | |
RegionShapeLabel | m_label |
Label. | |
bool | m_lt |
Linethrough properties. | |
String | m_ltColor |
double | m_ltWidth |
LineStyle | m_ltStyle |
double | m_xMin |
Bounding box, in world/pixel coords. | |
double | m_xMax |
double | m_yMin |
double | m_yMax |
double | m_screenXMin |
Bounding box, in screen pixels. | |
double | m_screenXMax |
double | m_screenYMin |
double | m_screenYMax |
WorldCanvasHolder * | m_lastWCH |
Last seen WorldCanvasHolder. | |
bool | m_hadDrawingError |
For keeping track of drawing/conversion errors. | |
String | m_drawingError |
Private Member Functions | |
void | initDefaults () |
Parent class for all RegionShapes.
Contains operations and properties common to all RegionShapes, such as:
Also contains methods that must be implemented in subclasses:
RegionShapes can also be converted to and from a CASA record. Fields in the record MUST adhere to the properties outlined below and in the shape subclasses. While additional properties may be defined in the shape subclasses, properties at the RegionShape level are:
RegionShape also defines a shapeFromRecord() method that will create and return a new shape based on the given record. This record has the following additional properties:
Definition at line 223 of file RegionShape.h.
Different types for coordinate parameters.
Definition at line 274 of file RegionShape.h.
Different line styles.
NOTE: styles other than solid and dashed are ONLY supported by QtPixelCanvas. Custom line styles are used for custom dash lists.
Definition at line 286 of file RegionShape.h.
Different types for options.
Definition at line 279 of file RegionShape.h.
casa::RegionShape::RegionShape | ( | MDirection::Types | worldSys | ) |
casa::RegionShape::RegionShape | ( | const RecordInterface & | properties | ) |
Record Constructor.
virtual casa::RegionShape::~RegionShape | ( | ) | [virtual] |
Destructor.
static vector<LineStyle> casa::RegionShape::allLineStyles | ( | ) | [inline, static] |
Returns all available line styles.
Definition at line 291 of file RegionShape.h.
Display::DisplayDataType casa::RegionShape::classType | ( | ) | [virtual] |
Implements PassiveCachingDD::classType.
Implements casa::DisplayData.
static String casa::RegionShape::convLineStyle | ( | LineStyle | style | ) | [static] |
Convert between line style enum and String.
static LineStyle casa::RegionShape::convLineStyle | ( | String | style | ) | [static] |
virtual vector<String> casa::RegionShape::coordParameterNames | ( | ) | const [pure virtual] |
Returns the name for the coordinate parameters, in the same order as coordParameterValues().
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual vector<CoordinateParameterType> casa::RegionShape::coordParameterTypes | ( | ) | const [pure virtual] |
Returns a vector indicating the types of the coordinate parameters, in the same order as coordParameterValues().
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual vector<double> casa::RegionShape::coordParameterValues | ( | ) | const [pure virtual] |
Returns the current values for the coordinate parameters.
The number and order depend on the shape type. For world systems (RegionShape::isWorld()), these coordinates have unit RegionShape::UNIT in the system RegionShape::worldSystem().
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual vector<double> casa::RegionShape::coordParameterValues | ( | String | toSystem | ) | const [pure virtual] |
Returns the current values for the coordinate parameters in the given world system, by using the last WorldCanvasHolder for conversions if needed.
The number and order depend on the shape type. toSystem indivates which system the given values are in and should either be: 1) RSUtils::PIXEL for pixel coordinates, or 2) a value that can be converted to a MDirection::Types via MDirection::getType(). Returned coordinates have unit RegionShape::UNIT for world systems.
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
const uInt casa::RegionShape::dataDim | ( | ) | const [inline, virtual] |
Reimplemented from casa::PassiveCachingDD.
Definition at line 336 of file RegionShape.h.
const IPosition casa::RegionShape::dataShape | ( | ) | const [inline, virtual] |
Reimplemented from casa::PassiveCachingDD.
Definition at line 335 of file RegionShape.h.
String casa::RegionShape::dataType | ( | ) | const [inline, virtual] |
Pure virtual function from DisplayData...
Implements casa::DisplayData.
Definition at line 462 of file RegionShape.h.
References type().
const Unit casa::RegionShape::dataUnit | ( | ) | const [virtual] |
PassiveCachingDD methods //.
Implements PassiveCachingDD::dataUnit.
Reimplemented from casa::PassiveCachingDD.
std::vector<int> casa::RegionShape::displayAxes | ( | ) | const [inline, virtual] |
Reimplemented from casa::PassiveCachingDD.
Definition at line 337 of file RegionShape.h.
bool casa::RegionShape::draw | ( | WorldCanvasHolder & | wch | ) |
Checks whether the given WorldCanvasHolder has a direction coordinate.
Updates the last WorldCanvasHolder seen to the given, then calls drawAndUpdateBoundingBox which actually draws this shape onto the world canvas.
virtual bool casa::RegionShape::drawAndUpdateBoundingBox | ( | WorldCanvasHolder & | wch, |
String * | error = NULL |
||
) | [pure virtual] |
Pure Virtual Methods //.
Draw this shape on the given world canvas and update the bounding box protected variables m_screenXMin, m_screenXMax, m_screenYMin, and m_screenYMax. NOTE: implementing classes should be sure to set the line style of the pixel canvas back to Display::LSSolid when finished. The protected method resetLineStyle can be used for this purpose.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
virtual RSHandle casa::RegionShape::getHandle | ( | ) | const [pure virtual] |
Returns a RSHandle (four points in screen coords that are like a bounding box for the shape) for this shape.
If the shape has not previously been drawn on a canvas, this may return an invalid RSHandle. The handle does NOT include the label.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
Record casa::RegionShape::getProperties | ( | ) | const |
Returns this shape's properties as a Record.
Referenced by toRecord().
virtual void casa::RegionShape::getShapeSpecificProperties | ( | Record & | properties | ) | const [protected, pure virtual] |
Pure Virtual Methods //.
Puts shape-specific properties in the given record. MUST at least set PROP_TYPE.
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual bool casa::RegionShape::hadDrawingError | ( | ) | const [inline, virtual] |
Returns whether there was an error during the last call to draw() or not.
Definition at line 434 of file RegionShape.h.
References m_hadDrawingError.
void casa::RegionShape::initDefaults | ( | ) | [private] |
Sets default values where needed for all member variables, EXCEPT m_isWorld and m_worldSystem. Intended to be called from a constructor.
virtual bool casa::RegionShape::isWorld | ( | ) | const [inline, virtual] |
Returns whether this shape's coordinates are in world or pixel.
Definition at line 411 of file RegionShape.h.
References m_isWorld.
Referenced by setIsWorld().
virtual const RegionShapeLabel& casa::RegionShape::label | ( | ) | const [virtual] |
Gets/sets this shape's label.
const String& casa::RegionShape::lastDrawingError | ( | ) | const [inline] |
Returns the error that occurred during the last call to draw().
Definition at line 437 of file RegionShape.h.
References m_drawingError.
bool casa::RegionShape::linearToWorld | ( | const Vector< double > & | linearX, |
const Vector< double > & | linearY, | ||
Quantum< Vector< double > > & | worldX, | ||
Quantum< Vector< double > > & | worldY, | ||
WorldCanvasHolder & | wch, | ||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 647 of file RegionShape.h.
References m_worldSystem.
Referenced by linearToWorld(), and screenToWorld().
bool casa::RegionShape::linearToWorld | ( | const Vector< double > & | linearX, |
const Vector< double > & | linearY, | ||
Quantum< Vector< double > > & | worldX, | ||
Quantum< Vector< double > > & | worldY, | ||
WorldCanvasHolder & | wch, | ||
const vector< int > & | xSign, | ||
const vector< int > & | ySign, | ||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 657 of file RegionShape.h.
References linearToWorld(), and m_worldSystem.
virtual String casa::RegionShape::lineColor | ( | ) | const [virtual] |
virtual LineStyle casa::RegionShape::lineStyle | ( | ) | const [virtual] |
Gets/sets this shape's line style.
virtual bool casa::RegionShape::linethrough | ( | ) | const [virtual] |
Gets/sets this shape's linethrough properties.
virtual String casa::RegionShape::linethroughColor | ( | ) | const [virtual] |
virtual LineStyle casa::RegionShape::linethroughStyle | ( | ) | const [virtual] |
virtual double casa::RegionShape::linethroughWidth | ( | ) | const [virtual] |
virtual double casa::RegionShape::lineWidth | ( | ) | const [virtual] |
Gets/sets this shape's line width.
virtual void casa::RegionShape::move | ( | double | dx, |
double | dy, | ||
String | system = "" |
||
) | [pure virtual] |
Moves this shape the given delta x and delta y in the given system (empty for shape's native system).
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
CachingDisplayMethod* casa::RegionShape::newDisplayMethod | ( | WorldCanvas * | wc, |
AttributeBuffer * | wchAttr, | ||
AttributeBuffer * | ddAttr, | ||
CachingDisplayData * | dd | ||
) | [virtual] |
Implements PassiveCachingDD::newDisplayMethod.
Implements casa::CachingDisplayData.
virtual String casa::RegionShape::oneWordType | ( | ) | const [inline, virtual] |
Can be overridden by children.
Returns a one-word type.
Reimplemented in casa::RSPolygon.
Definition at line 466 of file RegionShape.h.
References type().
virtual vector<vector<String> > casa::RegionShape::optionChoices | ( | ) | const [inline, virtual] |
For options that are string choices, return the available choices.
May return an empty vector if there are no string choices.
Definition at line 526 of file RegionShape.h.
virtual vector<String> casa::RegionShape::optionNames | ( | ) | const [pure virtual] |
Returns the names for options.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
virtual vector<OptionType> casa::RegionShape::optionTypes | ( | ) | const [pure virtual] |
Returns the types for options.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
virtual vector<RSOption> casa::RegionShape::optionValues | ( | ) | const [pure virtual] |
Returns the current values for options.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
bool casa::RegionShape::pixelToWorld | ( | const Vector< double > & | pixelX, |
const Vector< double > & | pixelY, | ||
Quantum< Vector< double > > & | worldX, | ||
Quantum< Vector< double > > & | worldY, | ||
WorldCanvasHolder & | wch, | ||
bool | wrap = true , |
||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 617 of file RegionShape.h.
References m_worldSystem.
void casa::RegionShape::resetLineStyle | ( | PixelCanvas * | pc | ) | const [protected] |
Used for resetting the line style on the given PixelCanvas back to solid, in case future uses are expecting solid lines.
bool casa::RegionShape::screenToWorld | ( | const Vector< double > & | screenX, |
const Vector< double > & | screenY, | ||
Quantum< Vector< double > > & | worldX, | ||
Quantum< Vector< double > > & | worldY, | ||
WorldCanvasHolder & | wch, | ||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 667 of file RegionShape.h.
References linearToWorld(), m_worldSystem, casa::RSUtils::screenToLinear(), and casa::ArrayBase::size().
bool casa::RegionShape::screenToWorld | ( | const Vector< double > & | screenX, |
const Vector< double > & | screenY, | ||
Quantum< Vector< double > > & | worldX, | ||
Quantum< Vector< double > > & | worldY, | ||
WorldCanvasHolder & | wch, | ||
const vector< int > & | xSign, | ||
const vector< int > & | ySign, | ||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 679 of file RegionShape.h.
References linearToWorld(), m_worldSystem, casa::RSUtils::screenToLinear(), and casa::ArrayBase::size().
virtual double casa::RegionShape::screenXMax | ( | ) | const [virtual] |
virtual double casa::RegionShape::screenXMin | ( | ) | const [virtual] |
Bounding box methods.
Returns the min and max of the screen coordinates. Note: these are only valid after a call to drawAndUpdateBoundingBox!
virtual double casa::RegionShape::screenYMax | ( | ) | const [virtual] |
virtual double casa::RegionShape::screenYMin | ( | ) | const [virtual] |
virtual void casa::RegionShape::setCoordParameters | ( | const vector< double > & | vals | ) | [pure virtual] |
Sets the coordinate parameter values to the given, in the same order as coordParameterValues().
For world systems (RegionShape::isWorld()), the values must be in unit RegionShape::UNIT and system RegionShape::worldSystem().
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual void casa::RegionShape::setCoordParameters | ( | const vector< double > & | vals, |
String | valSystem | ||
) | [pure virtual] |
Sets the coordinate parameter values to the given, in the same order as coordParameterValues().
valSystem indicates which system the given values are in and should either be: 1) RSUtils::PIXEL for pixel coordinates, or 2) a value that can be converted to a MDirection::Types via MDirection::getType(). Values must be in unit RegionShape::UNIT for world systems.
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
virtual void casa::RegionShape::setIsWorld | ( | bool | isWorld | ) | [inline, virtual] |
Set world or pixel system.
Definition at line 418 of file RegionShape.h.
virtual void casa::RegionShape::setLabel | ( | const RegionShapeLabel & | label | ) | [virtual] |
virtual void casa::RegionShape::setLineColor | ( | const String & | newColor, |
bool | alsoSetLabel = true |
||
) | [virtual] |
void casa::RegionShape::setLineProperties | ( | PixelCanvas * | pc | ) | [protected] |
Common RegionShape Methods //.
Sets the line properties (color, width, style) of this shape for the given PixelCanvas.
virtual void casa::RegionShape::setLineStyle | ( | LineStyle | style | ) | [virtual] |
virtual void casa::RegionShape::setLinethrough | ( | bool | linethrough, |
String | color = "red" , |
||
double | width = 1 , |
||
LineStyle | style = SOLID |
||
) | [virtual] |
void casa::RegionShape::setLinethroughProperties | ( | PixelCanvas * | pc | ) | [protected] |
Sets the linethrough properties (color, width, style) of this shape for the given PixelCanvas.
virtual void casa::RegionShape::setLineWidth | ( | double | width | ) | [virtual] |
virtual void casa::RegionShape::setOptionValues | ( | const vector< RSOption > & | options | ) | [pure virtual] |
Sets the options to the given.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
void casa::RegionShape::setProperties | ( | const RecordInterface & | properties | ) |
Sets this shape's properties from the given Record.
virtual void casa::RegionShape::setShapeSpecificProperties | ( | const RecordInterface & | props | ) | [protected, pure virtual] |
Sets shape-specific properties from the given record.
Implemented in casa::RSPolygon, casa::RSRectangle, and casa::RSEllipse.
virtual void casa::RegionShape::setText | ( | const String & | text | ) | [virtual] |
virtual void casa::RegionShape::setWorldSystem | ( | MDirection::Types | sys | ) | [inline, virtual] |
static RegionShape* casa::RegionShape::shapeFromRecord | ( | const RecordInterface & | properties, |
String & | error | ||
) | [static] |
Creates a record of the correct type from the given record (see RegionShape class description), or NULL if a fatal error occurred.
virtual String casa::RegionShape::text | ( | ) | const [virtual] |
Gets/sets this shape's label's text.
virtual String casa::RegionShape::title | ( | ) | const [inline, virtual] |
Returns this shape's type (color + type).
Definition at line 424 of file RegionShape.h.
References lineColor(), and type().
Record casa::RegionShape::toRecord | ( | ) | const [inline] |
virtual String casa::RegionShape::type | ( | ) | const [pure virtual] |
Returns the name/type of this shape, for displaying to the user.
Implemented in casa::RSPolygon, casa::RSRectangle, casa::RSCircle, and casa::RSEllipse.
Referenced by casa::RSLine::arrowType(), dataType(), oneWordType(), and title().
virtual MDirection::Types casa::RegionShape::worldSystem | ( | ) | const [inline, virtual] |
If this shape is in world coordinates, returns the system used.
Undefined for pixel coordinates.
Definition at line 415 of file RegionShape.h.
References m_worldSystem.
bool casa::RegionShape::worldToLinear | ( | const Quantum< Vector< double > > & | worldX, |
const Quantum< Vector< double > > & | worldY, | ||
Vector< double > & | linearX, | ||
Vector< double > & | linearY, | ||
WorldCanvasHolder & | wch, | ||
bool | wrap = true , |
||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 626 of file RegionShape.h.
References m_worldSystem.
Referenced by worldToScreen().
bool casa::RegionShape::worldToPixel | ( | const Quantum< Vector< double > > & | worldX, |
const Quantum< Vector< double > > & | worldY, | ||
Vector< double > & | pixelX, | ||
Vector< double > & | pixelY, | ||
WorldCanvasHolder & | wch, | ||
bool | wrap = true , |
||
String * | error = NULL |
||
) | const [inline, protected] |
Convenience access to RSUtils conversion methods.
Definition at line 608 of file RegionShape.h.
References m_worldSystem.
bool casa::RegionShape::worldToScreen | ( | const Quantum< Vector< double > > & | worldX, |
const Quantum< Vector< double > > & | worldY, | ||
Vector< double > & | screenX, | ||
Vector< double > & | screenY, | ||
WorldCanvasHolder & | wch, | ||
bool | wrap = true , |
||
String * | error = NULL |
||
) | const [inline, protected] |
Definition at line 635 of file RegionShape.h.
References casa::RSUtils::linearToScreen(), m_worldSystem, and worldToLinear().
virtual double casa::RegionShape::xMax | ( | ) | const [virtual] |
virtual double casa::RegionShape::xMin | ( | ) | const [virtual] |
virtual double casa::RegionShape::yMax | ( | ) | const [virtual] |
virtual double casa::RegionShape::yMin | ( | ) | const [virtual] |
const String casa::RegionShape::DEFAULT_COLOR [static] |
Defaults.
Definition at line 306 of file RegionShape.h.
const LineStyle casa::RegionShape::DEFAULT_STYLE [static] |
Definition at line 308 of file RegionShape.h.
const double casa::RegionShape::DEFAULT_WIDTH [static] |
Definition at line 307 of file RegionShape.h.
String casa::RegionShape::m_color [protected] |
Line color.
Definition at line 546 of file RegionShape.h.
String casa::RegionShape::m_drawingError [protected] |
Definition at line 578 of file RegionShape.h.
Referenced by lastDrawingError().
bool casa::RegionShape::m_hadDrawingError [protected] |
For keeping track of drawing/conversion errors.
Definition at line 577 of file RegionShape.h.
Referenced by hadDrawingError().
bool casa::RegionShape::m_isWorld [protected] |
Common RegionShape Members //.
Whether this shape uses world or pixel coordinates.
Definition at line 540 of file RegionShape.h.
Referenced by isWorld(), and setIsWorld().
RegionShapeLabel casa::RegionShape::m_label [protected] |
Label.
Definition at line 555 of file RegionShape.h.
WorldCanvasHolder* casa::RegionShape::m_lastWCH [protected] |
Last seen WorldCanvasHolder.
Should only be used by coordParameterValues.
Definition at line 573 of file RegionShape.h.
bool casa::RegionShape::m_lt [protected] |
Linethrough properties.
Definition at line 559 of file RegionShape.h.
String casa::RegionShape::m_ltColor [protected] |
Definition at line 560 of file RegionShape.h.
LineStyle casa::RegionShape::m_ltStyle [protected] |
Definition at line 562 of file RegionShape.h.
double casa::RegionShape::m_ltWidth [protected] |
Definition at line 561 of file RegionShape.h.
double casa::RegionShape::m_screenXMax [protected] |
Definition at line 569 of file RegionShape.h.
double casa::RegionShape::m_screenXMin [protected] |
Bounding box, in screen pixels.
Definition at line 569 of file RegionShape.h.
double casa::RegionShape::m_screenYMax [protected] |
Definition at line 569 of file RegionShape.h.
double casa::RegionShape::m_screenYMin [protected] |
Definition at line 569 of file RegionShape.h.
LineStyle casa::RegionShape::m_style [protected] |
Line style.
Definition at line 552 of file RegionShape.h.
double casa::RegionShape::m_width [protected] |
Line width.
Definition at line 549 of file RegionShape.h.
MDirection::Types casa::RegionShape::m_worldSystem [protected] |
World system (undefined if m_isWorld is false).
Definition at line 543 of file RegionShape.h.
Referenced by linearToWorld(), pixelToWorld(), screenToWorld(), setWorldSystem(), worldSystem(), worldToLinear(), worldToPixel(), and worldToScreen().
double casa::RegionShape::m_xMax [protected] |
Definition at line 566 of file RegionShape.h.
double casa::RegionShape::m_xMin [protected] |
Bounding box, in world/pixel coords.
Definition at line 566 of file RegionShape.h.
double casa::RegionShape::m_yMax [protected] |
Definition at line 566 of file RegionShape.h.
double casa::RegionShape::m_yMin [protected] |
Definition at line 566 of file RegionShape.h.
const String casa::RegionShape::PROPCOORDINATES [static] |
Definition at line 253 of file RegionShape.h.
const String casa::RegionShape::PROPISWORLD [static] |
const String casa::RegionShape::PROPLINE_COLOR [static] |
Definition at line 240 of file RegionShape.h.
const String casa::RegionShape::PROPLINE_STYLE [static] |
Definition at line 242 of file RegionShape.h.
const String casa::RegionShape::PROPLINE_WIDTH [static] |
Definition at line 241 of file RegionShape.h.
const String casa::RegionShape::PROPLINETHROUGH [static] |
Definition at line 249 of file RegionShape.h.
const String casa::RegionShape::PROPLINETHROUGH_COLOR [static] |
Definition at line 250 of file RegionShape.h.
const String casa::RegionShape::PROPLINETHROUGH_STYLE [static] |
Definition at line 252 of file RegionShape.h.
const String casa::RegionShape::PROPLINETHROUGH_WIDTH [static] |
Definition at line 251 of file RegionShape.h.
const String casa::RegionShape::PROPOPTIONS [static] |
Definition at line 254 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT [static] |
Definition at line 243 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT_BOLD [static] |
Definition at line 248 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT_COLOR [static] |
Definition at line 244 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT_FONT [static] |
Definition at line 245 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT_ITALIC [static] |
Definition at line 247 of file RegionShape.h.
const String casa::RegionShape::PROPTEXT_SIZE [static] |
Definition at line 246 of file RegionShape.h.
const String casa::RegionShape::PROPTYPE [static] |
Definition at line 256 of file RegionShape.h.
Referenced by casa::RSEllipse::getShapeSpecificProperties(), casa::RSCircle::getShapeSpecificProperties(), casa::RSRectangle::getShapeSpecificProperties(), and getShapeSpecificProperties().
const String casa::RegionShape::PROPTYPE_CIRCLE [static] |
Definition at line 258 of file RegionShape.h.
Referenced by casa::RSCircle::getShapeSpecificProperties().
const String casa::RegionShape::PROPTYPE_COMPOSITE [static] |
Definition at line 265 of file RegionShape.h.
const String casa::RegionShape::PROPTYPE_ELLIPSE [static] |
Definition at line 257 of file RegionShape.h.
Referenced by casa::RSEllipse::getShapeSpecificProperties().
const String casa::RegionShape::PROPTYPE_LINE [static] |
Definition at line 261 of file RegionShape.h.
Referenced by getShapeSpecificProperties().
const String casa::RegionShape::PROPTYPE_MARKER [static] |
Definition at line 263 of file RegionShape.h.
const String casa::RegionShape::PROPTYPE_POLYGON [static] |
Definition at line 260 of file RegionShape.h.
const String casa::RegionShape::PROPTYPE_RECTANGLE [static] |
Definition at line 259 of file RegionShape.h.
Referenced by casa::RSRectangle::getShapeSpecificProperties().
const String casa::RegionShape::PROPTYPE_TEXT [static] |
Definition at line 264 of file RegionShape.h.
const String casa::RegionShape::PROPTYPE_VECTOR [static] |
Definition at line 262 of file RegionShape.h.
const String casa::RegionShape::PROPWORLDSYSTEM [static] |
Definition at line 239 of file RegionShape.h.
const String casa::RegionShape::UNIT [static] |
Static Members //.
The unit that all native coordinates are in. Currently set to "deg". If this is changed, DS9RegionFileWriter::convertValue() must also be updated.
Definition at line 230 of file RegionShape.h.
const double casa::RegionShape::UNIT_WRAPAROUND [static] |
Value used for wrapping negative/positive unit values.
Currently set to 360 for degrees.
Definition at line 234 of file RegionShape.h.