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

Implementation of a line. More...

#include <DSLine.h>

Inheritance diagram for casa::DSLine:
casa::DSPolyLine casa::DSBasic casa::DisplayShape casa::DSArrow casa::DSPixelArrow casa::DSScreenArrow casa::DSWorldArrow

List of all members.

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< FloatgetEnds ()
 General utility functions.
virtual Matrix< FloatasPolyLine (const Vector< Float > &startPos, const Vector< Float > &endPos)

Private Attributes

Bool itsValidStart
 
   

Bool itsValidEnd
Vector< FloatitsStart
 These are to hold the points while line is being made (line is invalid).
Vector< FloatitsEnd

Detailed Description

Implementation of a line.

Prerequisite

Etymology

DSLine is a method of managing the drawing of a line onto a PixelCanvas.

Synopsis

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 .

Motivation

The need for a basic line drawing tool.

Example

    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.


Constructor & Destructor Documentation

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]

Member Function Documentation

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::DSScreenArrow, casa::DSWorldArrow, and casa::DSPixelArrow.

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]
virtual Bool casa::DSLine::setOptions ( const Record newSettings) [virtual]

Get and set this shapes options.

Reimplemented from casa::DSPolyLine.

Reimplemented in casa::DSArrow, casa::DSScreenArrow, casa::DSWorldArrow, and casa::DSPixelArrow.

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.


Member Data Documentation

Definition at line 129 of file DSLine.h.

These are to hold the points while line is being made (line is invalid).

Definition at line 128 of file DSLine.h.

Reimplemented in casa::DSArrow.

Definition at line 125 of file DSLine.h.

Referenced by validEnd().

   

Reimplemented in casa::DSArrow.

Definition at line 125 of file DSLine.h.

Referenced by validStart().


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