casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::DSMarker Class Reference

Implementation of a marker. More...

#include <DSMarker.h>

Inheritance diagram for casa::DSMarker:
casa::DSBasic casa::DisplayShape casa::DSPixelMarker casa::DSScreenMarker casa::DSWorldMarker

Public Member Functions

 DSMarker ()
 Constructors and destructor. More...
 
 DSMarker (const casacore::Float &xPos, const casacore::Float &yPos, const Display::Marker &marker=Display::Square, const casacore::uInt pixelSize=10)
 
 DSMarker (const casacore::Record &settings)
 
 DSMarker (const DSPCMarker &other)
 
 DSMarker (const DSWCMarker &other)
 
 DSMarker (const DSMarker &other)
 
virtual ~DSMarker ()
 
virtual void move (const casacore::Float &dX, const casacore::Float &dY)
 Standard DisplayShape functions. More...
 
virtual void setCenter (const casacore::Float &xPos, const casacore::Float &yPos)
 Sets the center of the DisplayShape. More...
 
virtual casacore::Vector
< casacore::Float
getCenter ()
 Returns the center of the DisplayShape (x,y). More...
 
virtual void scale (const casacore::Float &scaleFactor)
 Scale the shape about its center by the scaleFactor. More...
 
virtual void draw (PixelCanvas *pc)
 Standard fns. More...
 
virtual casacore::Bool inObject (const casacore::Float &xPos, const casacore::Float &yPos)
 Is the supplied point within the DisplayShape? More...
 
virtual void setSize (const casacore::uInt newSize)
 
virtual casacore::Bool setOptions (const casacore::Record &settings)
 Get and set options. More...
 
virtual casacore::Record getOptions ()
 Settings. More...
 
virtual casacore::Bool whichHandle (const casacore::Float &, const casacore::Float &, casacore::Int &)
 Overload, since we never want to click on a marker (Well actually we might, but as yet we have no use, and sometimes people think that have clicked on a marker when actually they are on a handle. More...
 
virtual void rotate (const casacore::Float &)
 These functions do not apply for DSMarkers. More...
 
virtual void changePoint (const casacore::Vector< casacore::Float > &)
 Changes the closest point to the supplied location to that location. More...
 
virtual void changePoint (const casacore::Vector< casacore::Float > &, const casacore::Int)
 Changes the nth point making up the DisplayShape ot the specified location. More...
 
- Public Member Functions inherited from casa::DSBasic
 DSBasic ()
 Default constructor. More...
 
 DSBasic (const DSBasic &other)
 Copy constructor. More...
 
virtual ~DSBasic ()
 Destructor. More...
 
virtual void setLineWidth (const casacore::Int pixels)
 Manage line width. More...
 
virtual casacore::Int getLineWidth ()
 
virtual void rotateAbout (const casacore::Float &angle, const casacore::Float &aboutX, const casacore::Float &aboutY)
 
- Public Member Functions inherited from casa::DisplayShape
 DisplayShape ()
 Default constructor. More...
 
 DisplayShape (const DisplayShape &other)
 Copy constructor. More...
 
virtual ~DisplayShape ()
 Destructor. More...
 
virtual casacore::Matrix
< casacore::Float
rotatePolygon (const casacore::Matrix< casacore::Float > &toRotate, const casacore::Float &angle, const casacore::Float &aboutX, const casacore::Float &aboutY)
 Rotate the supplied polygon (column 1 - x values, column 2 - y values) about the supplied point by the supplied angle. More...
 
virtual casacore::Vector
< casacore::Float
rotatePoint (const casacore::Vector< casacore::Float > &toRotate, const casacore::Float &angle, const casacore::Float &aboutX, const casacore::Float &aboutY)
 Rotates a point around the point specified. More...
 
virtual casacore::Matrix
< casacore::Float
translateMatrix (const casacore::Matrix< casacore::Float > &points, const casacore::Float &dx, const casacore::Float &dy)
 Translate an entire matrix by the specified dx / dy amounts. More...
 
virtual casacore::Bool inPolygon (const casacore::Matrix< casacore::Float > &points, const casacore::Float &xPos, const casacore::Float &yPos)
 Is xPos, YPos inside the supplied points (column 1 - x values, clolumn 2 - y values) More...
 
virtual casacore::Bool closestLine (const casacore::Matrix< casacore::Float > &points, const casacore::Float &xPos, const casacore::Float &yPos, casacore::Int &firstVert, casacore::Int &secondVert, const casacore::Bool &closedPoly=true)
 Determine the two vertices (firstVert, secondVert) which join the line closest to the xPos, yPos point supplied. More...
 
virtual casacore::Bool closestPoint (const casacore::Matrix< casacore::Float > &points, const casacore::Float &xPos, const casacore::Float &yPos, casacore::Int &out)
 For a specified set of points, find the closest to xPos,YPos. More...
 
virtual casacore::Bool closestPoints (const casacore::Matrix< casacore::Float > &points, const casacore::Float &xPos, const casacore::Float &yPos, casacore::Int &outClosest, casacore::Int &outSecond)
 Find the closest two Points from a casacore::Matrix to the specified point. More...
 
virtual casacore::Float toRadians (const casacore::Float &degrees)
 Convert degrees to radians. More...
 
virtual casacore::Float toDegrees (const casacore::Float &radians)
 Conver radians to degree. More...
 
virtual void addPoint (const casacore::Vector< casacore::Float > &)
 If applicable, this function will add a point to the shape in the most meaningful location. More...
 
virtual void addLocked (DisplayShape *toLock)
 Allow locking of other shapes onto this one. More...
 
virtual void removeLocked (DisplayShape *removeLock)
 Removes a lock from the specified shape. More...
 
virtual void buildHandles (const casacore::Matrix< casacore::Float > &startPoints)
 Handle management. More...
 
virtual casacore::Matrix
< casacore::Float
getHandleLocations ()
 
virtual void setHandlePositions (const casacore::Matrix< casacore::Float > &newPoints)
 
virtual DSClosedmakeHandle (const casacore::Vector< casacore::Float > &newHandlePos)
 
virtual void addHandle (const casacore::Vector< casacore::Float > &newHandlePos, const casacore::Bool &atEnd=true, const casacore::Int position=0)
 
virtual casacore::Bool removeHandle (const casacore::Vector< casacore::Float > &getRidOf)
 
virtual casacore::Bool removeHandle (const casacore::Int nHandle)
 
virtual casacore::Bool onHandles (const casacore::Float &xPos, const casacore::Float &yPos)
 
virtual void setDrawHandles (const casacore::Bool &shouldIDraw)
 
virtual casacore::Bool drawingHandles ()
 
virtual void setHasHandles (const casacore::Bool &hasHandles)
 
virtual void setHandleShape (const DisplayShape::HandleShape &shape)
 
virtual void setHandleSize (const casacore::Int pixelSize)
 
virtual void setHandleColor (const casacore::String &handleColor)
 
virtual casacore::uInt nHandles ()
 
virtual void setColor (const casacore::String &newColor)
 Manage the color of object. More...
 
virtual casacore::String getColor ()
 
virtual void recalculateScreenPosition ()
 

Private Member Functions

virtual void setDefaultOptions ()
 virtual void recalculateScreenPosition(); More...
 
void updateHandle ()
 Update location of single handle. More...
 

Private Attributes

casacore::Vector< casacore::FloatitsCenter
 
casacore::Matrix< casacore::FloatitsHandle
 
casacore::Bool itsBuiltHandle
 
DParameterRange< casacore::Int > * itsSize
 
Display::Marker itsMarkerStyle
 
casacore::Bool itsValid
 

Additional Inherited Members

- Public Types inherited from casa::DisplayShape
enum  HandleShape {
  Filled_Square,
  Open_Square,
  Filled_Circle,
  Open_Circle,
  Filled_Triangle,
  Open_Triangle
}
 Handle style. More...
 

Detailed Description

Implementation of a marker.

Prerequisite

Etymology

DSMarker is a method of managind the drawing of a marker onto a pixel canvas.

Synopsis

DSArrow simply extends from DSLine, and adds the management of a polygon to it. The polygon is used to represent the arrow head, and various options regarding its apppearance can be changed.

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

A desire to have markers, similar to those used by PGPlot available as an annotation object. This wrapper is designed to make the management of drawing markers as primitives easier.

Example

Definition at line 87 of file DSMarker.h.

Constructor & Destructor Documentation

casa::DSMarker::DSMarker ( )

Constructors and destructor.

See Display for a list of avaiable markers. Currently, all pixelHeights are changed to an even number, as odd sized markers tend to look funny. The pixelSize corresponds to the height of the marker in pixels.

casa::DSMarker::DSMarker ( const casacore::Float xPos,
const casacore::Float yPos,
const Display::Marker marker = Display::Square,
const casacore::uInt  pixelSize = 10 
)
casa::DSMarker::DSMarker ( const casacore::Record settings)
casa::DSMarker::DSMarker ( const DSPCMarker &  other)
casa::DSMarker::DSMarker ( const DSWCMarker &  other)
casa::DSMarker::DSMarker ( const DSMarker other)
virtual casa::DSMarker::~DSMarker ( )
virtual

Member Function Documentation

virtual void casa::DSMarker::changePoint ( const casacore::Vector< casacore::Float > &  newPos)
inlinevirtual

Changes the closest point to the supplied location to that location.

Implements casa::DisplayShape.

Definition at line 141 of file DSMarker.h.

virtual void casa::DSMarker::changePoint ( const casacore::Vector< casacore::Float > &  newPoint,
const casacore::Int  nPoint 
)
inlinevirtual

Changes the nth point making up the DisplayShape ot the specified location.

Implements casa::DisplayShape.

Definition at line 142 of file DSMarker.h.

virtual void casa::DSMarker::draw ( PixelCanvas pc)
virtual

Standard fns.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSWorldMarker.

virtual casacore::Vector<casacore::Float> casa::DSMarker::getCenter ( )
virtual

Returns the center of the DisplayShape (x,y).

Implements casa::DisplayShape.

virtual casacore::Record casa::DSMarker::getOptions ( )
virtual
virtual casacore::Bool casa::DSMarker::inObject ( const casacore::Float xPos,
const casacore::Float yPos 
)
virtual

Is the supplied point within the DisplayShape?

Implements casa::DisplayShape.

virtual void casa::DSMarker::move ( const casacore::Float dX,
const casacore::Float dY 
)
virtual

Standard DisplayShape functions.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSScreenMarker, and casa::DSWorldMarker.

virtual void casa::DSMarker::rotate ( const casacore::Float )
inlinevirtual

These functions do not apply for DSMarkers.

They are here to ensure no strange behavior

Implements casa::DisplayShape.

Definition at line 140 of file DSMarker.h.

virtual void casa::DSMarker::scale ( const casacore::Float scaleFactor)
virtual

Scale the shape about its center by the scaleFactor.

Implements casa::DisplayShape.

virtual void casa::DSMarker::setCenter ( const casacore::Float xPos,
const casacore::Float yPos 
)
virtual

Sets the center of the DisplayShape.

Implements casa::DisplayShape.

Reimplemented in casa::DSScreenMarker, and casa::DSWorldMarker.

virtual void casa::DSMarker::setDefaultOptions ( )
privatevirtual

virtual void recalculateScreenPosition();

Set the default options. Called by default constructor.

Reimplemented from casa::DisplayShape.

virtual casacore::Bool casa::DSMarker::setOptions ( const casacore::Record settings)
virtual

Get and set options.

Reimplemented from casa::DSBasic.

Reimplemented in casa::DSWorldMarker, casa::DSScreenMarker, and casa::DSPixelMarker.

virtual void casa::DSMarker::setSize ( const casacore::uInt  newSize)
virtual
void casa::DSMarker::updateHandle ( )
private

Update location of single handle.

virtual casacore::Bool casa::DSMarker::whichHandle ( const casacore::Float ,
const casacore::Float ,
casacore::Int  
)
inlinevirtual

Overload, since we never want to click on a marker (Well actually we might, but as yet we have no use, and sometimes people think that have clicked on a marker when actually they are on a handle.

This makes it appear as though the marker isn't moving.

Reimplemented from casa::DisplayShape.

Definition at line 132 of file DSMarker.h.

Member Data Documentation

casacore::Bool casa::DSMarker::itsBuiltHandle
private

Definition at line 157 of file DSMarker.h.

casacore::Vector<casacore::Float> casa::DSMarker::itsCenter
private

Definition at line 155 of file DSMarker.h.

casacore::Matrix<casacore::Float> casa::DSMarker::itsHandle
private

Definition at line 156 of file DSMarker.h.

Display::Marker casa::DSMarker::itsMarkerStyle
private

Definition at line 160 of file DSMarker.h.

DParameterRange<casacore::Int>* casa::DSMarker::itsSize
private

Definition at line 158 of file DSMarker.h.

casacore::Bool casa::DSMarker::itsValid
private

Definition at line 161 of file DSMarker.h.


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