Implementation of a line. More...
#include <DSLine.h>
Public Member Functions | |
| DSLine () | |
| Constructors and Destructors. | |
| DSLine (const DSLine &other) | |
| DSLine (const Vector< Float > &startPos, const Vector< Float > &endPos, const Bool &handles=True, const Bool &drawHandles=True) | |
| virtual | ~DSLine () |
| virtual void | setCenter (const Float &xPos, const Float &yPos) |
| This does nothing, it's so arrow and other inheriting classes can take note of new centers. | |
| virtual Bool | isValid () |
| Does this line have a valid start and a valid end? | |
| virtual void | setStartPoint (const Vector< Float > &start) |
| Line specific functions for ease of use. | |
| virtual void | setEndPoint (const Vector< Float > &end) |
| virtual Record | getOptions () |
| Set and get options. | |
| virtual Bool | setOptions (const Record &newSettings) |
| Get and set this shapes options. | |
Protected Member Functions | |
| virtual Bool | validStart () |
| virtual Bool | validEnd () |
| virtual void | make () |
| virtual Matrix< Float > | getEnds () |
| General utility functions. | |
| virtual Matrix< Float > | asPolyLine (const Vector< Float > &startPos, const Vector< Float > &endPos) |
Private Attributes | |
| Bool | itsValidStart |
| Bool | itsValidEnd |
| Vector< Float > | itsStart |
| These are to hold the points while line is being made (line is invalid). | |
| Vector< Float > | itsEnd |
Implementation of a line.
DSLine is a method of managing the drawing of a line onto a PixelCanvas.
DSLine simply extends from DSPolyLine, and adds specific functions to a line with only two points (e.g. setStartPoint)
There are generally two ways to make DisplayShape(s); To create them in "one hit" by providing arguments to the constructor, or by using the default constructor and then the "setOptions" method. A simple interface for all classes inheriting from the DisplayShape class is provided by DisplayShapeInterface .
The need for a basic line drawing tool.
Vector<Float> startPoint(2); startPoint[0] = 100; startPoint[1] = 100; Vector<Float> endPoint(2); endPoint[0] = 200; endPoint[1] = 200; DSLine* myLine = new DSLine(startPoint, endPoint, True, True); myLine->move(10,10); Vector<Float> newStart(2); newStart[0] = 50; newStart[1] = 50; myLine->setStartPoint(newStart); Record newLineOpt; newLineOpt.define("linewidth", 3); myLine->setOptions(newLineOpt); myLine->draw(myPixelCanvas); etc.\.
Definition at line 90 of file DSLine.h.
| casa::DSLine::DSLine | ( | ) |
Constructors and Destructors.
| casa::DSLine::DSLine | ( | const DSLine & | other | ) |
| casa::DSLine::DSLine | ( | const Vector< Float > & | startPos, | |
| const Vector< Float > & | endPos, | |||
| const Bool & | handles = True, |
|||
| const Bool & | drawHandles = True | |||
| ) |
| virtual casa::DSLine::~DSLine | ( | ) | [virtual] |
| virtual Matrix<Float> casa::DSLine::asPolyLine | ( | const Vector< Float > & | startPos, | |
| const Vector< Float > & | endPos | |||
| ) | [protected, virtual] |
| virtual Matrix<Float> casa::DSLine::getEnds | ( | ) | [protected, virtual] |
General utility functions.
| virtual Record casa::DSLine::getOptions | ( | ) | [virtual] |
Set and get options.
Reimplemented from casa::DSPolyLine.
Reimplemented in casa::DSArrow, casa::DSPixelArrow, casa::DSScreenArrow, and casa::DSWorldArrow.
| virtual Bool casa::DSLine::isValid | ( | ) | [virtual] |
Does this line have a valid start and a valid end?
| virtual void casa::DSLine::make | ( | ) | [protected, virtual] |
Reimplemented in casa::DSArrow.
| virtual void casa::DSLine::setCenter | ( | const Float & | xPos, | |
| const Float & | yPos | |||
| ) | [virtual] |
This does nothing, it's so arrow and other inheriting classes can take note of new centers.
Reimplemented from casa::DSPolyLine.
Reimplemented in casa::DSArrow, casa::DSScreenArrow, and casa::DSWorldArrow.
| virtual void casa::DSLine::setEndPoint | ( | const Vector< Float > & | end | ) | [virtual] |
Reimplemented in casa::DSArrow, casa::DSScreenArrow, and casa::DSWorldArrow.
| virtual Bool casa::DSLine::setOptions | ( | const Record & | newSettings | ) | [virtual] |
Get and set this shapes options.
Reimplemented from casa::DSPolyLine.
Reimplemented in casa::DSArrow, casa::DSPixelArrow, casa::DSScreenArrow, and casa::DSWorldArrow.
| virtual void casa::DSLine::setStartPoint | ( | const Vector< Float > & | start | ) | [virtual] |
Line specific functions for ease of use.
Reimplemented in casa::DSArrow, casa::DSScreenArrow, and casa::DSWorldArrow.
| virtual Bool casa::DSLine::validEnd | ( | ) | [inline, protected, virtual] |
Definition at line 137 of file DSLine.h.
References itsValidEnd.
| virtual Bool casa::DSLine::validStart | ( | ) | [inline, protected, virtual] |
Definition at line 133 of file DSLine.h.
References itsValidStart.
Vector<Float> casa::DSLine::itsEnd [private] |
Vector<Float> casa::DSLine::itsStart [private] |
Bool casa::DSLine::itsValidEnd [private] |
Bool casa::DSLine::itsValidStart [private] |
Reimplemented in casa::DSArrow.
Definition at line 125 of file DSLine.h.
Referenced by validStart().
1.6.1