casa
5.7.0-16
|
The abstract base class for all "DisplayShapes". More...
#include <DisplayShape.h>
Public Types | |
enum | HandleShape { Filled_Square, Open_Square, Filled_Circle, Open_Circle, Filled_Triangle, Open_Triangle } |
Handle style. More... | |
Public Member Functions | |
DisplayShape () | |
Default constructor. More... | |
DisplayShape (const DisplayShape &other) | |
Copy constructor. More... | |
virtual | ~DisplayShape () |
Destructor. More... | |
virtual void | draw (PixelCanvas *pc) |
These functions contol behaviour of handles during a call to the display shape object. More... | |
virtual void | rotateAbout (const casacore::Float &relAngle, const casacore::Float &aboutX, const casacore::Float &aboutY) |
virtual void | move (const casacore::Float &dX, const casacore::Float &dY) |
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::Bool | inObject (const casacore::Float &xPos, const casacore::Float &yPos)=0 |
Is the supplied point within the DisplayShape? More... | |
virtual casacore::Float | toRadians (const casacore::Float °rees) |
Convert degrees to radians. More... | |
virtual casacore::Float | toDegrees (const casacore::Float &radians) |
Conver radians to degree. More... | |
virtual void | setCenter (const casacore::Float &xPos, const casacore::Float &yPos)=0 |
Sets the center of the DisplayShape. More... | |
virtual casacore::Vector < casacore::Float > | getCenter ()=0 |
Returns the center of the DisplayShape (x,y). More... | |
virtual void | changePoint (const casacore::Vector< casacore::Float > &newPos)=0 |
Changes the closest point to the supplied location to that location. More... | |
virtual void | changePoint (const casacore::Vector< casacore::Float > &newPoint, const casacore::Int nPoint)=0 |
Changes the nth point making up the DisplayShape ot the specified location. 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 | rotate (const casacore::Float &angle)=0 |
Rotate the shape about its center by a set angle (angle in degrees). More... | |
virtual void | scale (const casacore::Float &scaleFactor)=0 |
Scale the shape about its center by the scaleFactor. 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 DSClosed * | makeHandle (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 casacore::Bool | whichHandle (const casacore::Float &xPos, const casacore::Float &yPos, casacore::Int &out) |
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 casacore::Record | getOptions () |
Settings. More... | |
virtual casacore::Bool | setOptions (const casacore::Record &settings) |
virtual void | recalculateScreenPosition () |
Private Member Functions | |
virtual void | setDefaultOptions () |
Set default options. More... | |
Private Attributes | |
DParameterColorChoice * | itsColor |
Object. More... | |
casacore::PtrBlock< DSClosed * > | itsHandles |
Handles. More... | |
casacore::PtrBlock < DisplayShape * > | itsLocks |
Locks. More... | |
casacore::Bool | itsHasHandles |
Do I have handles / can a user resize me? i.e. More... | |
casacore::Bool | itsDrawHandles |
Should handles be shown if they exist. More... | |
casacore::Bool | itsValidHandles |
Have valid handles been made/supplied yet? More... | |
casacore::String | itsHandleColor |
Handle settings. More... | |
DisplayShape::HandleShape | itsHandleShape |
casacore::Int | itsHandleSize |
The abstract base class for all "DisplayShapes".
DisplayShape is a way of providing a consistant interface to a large number of different shapes.
DisplayShape provides a framework from which a large number of different shapes can be made, all with the same interface. Any new DisplayShape should inherit from this class, or higher level classes (see DSPoly etc).
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.
A common interface to a large number of shapes was desired.
Definition at line 77 of file DisplayShape.h.
Handle style.
Enumerator | |
---|---|
Filled_Square | |
Open_Square | |
Filled_Circle | |
Open_Circle | |
Filled_Triangle | |
Open_Triangle |
Definition at line 81 of file DisplayShape.h.
casa::DisplayShape::DisplayShape | ( | ) |
Default constructor.
Creates shape with default options set
casa::DisplayShape::DisplayShape | ( | const DisplayShape & | other | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
|
virtual |
Allow locking of other shapes onto this one.
When a shape is locked, if the current shape is moved, so to will the locked shape.
|
inlinevirtual |
If applicable, this function will add a point to the shape in the most meaningful location.
Reimplemented in casa::DSPolyLine, casa::DSPoly, casa::DSRectangle, casa::DSWorldPoly, casa::DSScreenPoly, casa::DSWorldPolyLine, and casa::DSScreenPolyLine.
Definition at line 170 of file DisplayShape.h.
|
virtual |
Handle management.
|
pure virtual |
Changes the closest point to the supplied location to that location.
Implemented in casa::DSArrow, casa::DSMarker, casa::DSPolyLine, casa::DSText, casa::DSRectangle, casa::DSSquare, casa::DSEllipse, casa::DSCircle, casa::DSPoly, casa::DSWorldPoly, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSScreenPoly, casa::DSWorldEllipse, casa::DSScreenPolyLine, casa::DSWorldRectangle, casa::DSScreenEllipse, and casa::DSScreenRectangle.
|
pure virtual |
Changes the nth point making up the DisplayShape ot the specified location.
Implemented in casa::DSArrow, casa::DSMarker, casa::DSPolyLine, casa::DSText, casa::DSRectangle, casa::DSSquare, casa::DSEllipse, casa::DSCircle, casa::DSPoly, casa::DSWorldPoly, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSScreenPoly, casa::DSWorldEllipse, casa::DSScreenPolyLine, casa::DSWorldRectangle, casa::DSScreenEllipse, and casa::DSScreenRectangle.
|
virtual |
Determine the two vertices (firstVert, secondVert) which join the line closest to the xPos, yPos point supplied.
If closedPoly is left as true, the points supplied are treated as a polygon, if not as a poly line.
|
virtual |
For a specified set of points, find the closest to xPos,YPos.
out relates the matrix index (row number) of the closest point.
|
virtual |
Find the closest two Points from a casacore::Matrix to the specified point.
|
virtual |
These functions contol behaviour of handles during a call to the display shape object.
(These calls should be propogated up through the class tree).
Reimplemented in casa::DSArrow, casa::DSMarker, casa::DSText, casa::DSClosed, casa::DSPolyLine, casa::DSBasic, casa::DSPoly, casa::DSEllipse, casa::DSWorldPoly, casa::DSWorldPolyLine, casa::DSWorldArrow, casa::DSWorldEllipse, casa::DSWorldRectangle, casa::DSWorldMarker, and casa::DSWorldText.
|
inlinevirtual |
Definition at line 201 of file DisplayShape.h.
References itsDrawHandles.
|
pure virtual |
Returns the center of the DisplayShape (x,y).
Implemented in casa::DSMarker, casa::DSText, casa::DSPoly, casa::DSEllipse, and casa::DSPolyLine.
|
virtual |
|
virtual |
|
virtual |
Settings.
Reimplemented in casa::DSArrow, casa::DSMarker, casa::DSLine, casa::DSRectangle, casa::DSPolyLine, casa::DSPoly, casa::DSEllipse, casa::DSText, casa::DSCircle, casa::DSSquare, casa::DSClosed, casa::DSBasic, casa::DSWorldPoly, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSWorldEllipse, casa::DSWorldRectangle, casa::DSScreenPoly, casa::DSScreenPolyLine, casa::DSWorldMarker, casa::DSWorldText, casa::DSPixelEllipse, casa::DSScreenText, casa::DSPixelRectangle, casa::DSPixelPoly, casa::DSScreenMarker, casa::DSScreenEllipse, casa::DSPixelPolyLine, casa::DSScreenRectangle, casa::DSPixelArrow, casa::DSPixelMarker, and casa::DSPixelText.
|
pure virtual |
Is the supplied point within the DisplayShape?
Implemented in casa::DSMarker, casa::DSText, casa::DSCircle, casa::DSPolyLine, casa::DSPoly, and casa::DSEllipse.
|
virtual |
Is xPos, YPos inside the supplied points (column 1 - x values, clolumn 2 - y values)
|
virtual |
|
virtual |
Reimplemented in casa::DSArrow, casa::DSMarker, casa::DSText, casa::DSRectangle, casa::DSClosed, casa::DSPolyLine, casa::DSPoly, casa::DSBasic, casa::DSEllipse, casa::DSWorldPoly, casa::DSScreenText, casa::DSScreenArrow, casa::DSScreenPoly, casa::DSWorldEllipse, casa::DSWorldPolyLine, casa::DSWorldArrow, casa::DSWorldRectangle, casa::DSScreenMarker, casa::DSScreenPolyLine, casa::DSWorldMarker, casa::DSWorldText, casa::DSScreenEllipse, and casa::DSScreenRectangle.
|
virtual |
|
virtual |
|
inlinevirtual |
Reimplemented in casa::DSWorldPoly, casa::DSPixelMarker, casa::DSPixelText, casa::DSScreenPoly, casa::DSScreenArrow, casa::DSScreenText, casa::DSWorldMarker, casa::DSWorldText, casa::DSWorldEllipse, casa::DSWorldPolyLine, casa::DSScreenPolyLine, casa::DSWorldArrow, casa::DSWorldRectangle, casa::DSScreenMarker, casa::DSScreenEllipse, and casa::DSScreenRectangle.
Definition at line 223 of file DisplayShape.h.
|
virtual |
|
virtual |
|
virtual |
Removes a lock from the specified shape.
|
pure virtual |
Rotate the shape about its center by a set angle (angle in degrees).
Implemented in casa::DSMarker, casa::DSArrow, casa::DSText, casa::DSRectangle, casa::DSPolyLine, casa::DSCircle, casa::DSEllipse, casa::DSPoly, casa::DSWorldPoly, casa::DSScreenArrow, casa::DSScreenPoly, casa::DSWorldEllipse, casa::DSWorldPolyLine, casa::DSWorldArrow, casa::DSWorldRectangle, casa::DSScreenPolyLine, casa::DSScreenEllipse, and casa::DSScreenRectangle.
|
virtual |
Reimplemented in casa::DSArrow, casa::DSRectangle, casa::DSPolyLine, casa::DSPoly, casa::DSClosed, casa::DSEllipse, and casa::DSBasic.
|
virtual |
Rotates a point around the point specified.
NB Angle in radians.
|
virtual |
Rotate the supplied polygon (column 1 - x values, column 2 - y values) about the supplied point by the supplied angle.
NB Angle in radians
|
pure virtual |
Scale the shape about its center by the scaleFactor.
Implemented in casa::DSArrow, casa::DSMarker, casa::DSText, casa::DSEllipse, casa::DSPolyLine, casa::DSPoly, casa::DSWorldPoly, casa::DSScreenArrow, casa::DSWorldPolyLine, casa::DSWorldArrow, casa::DSScreenPoly, and casa::DSScreenPolyLine.
|
pure virtual |
Sets the center of the DisplayShape.
Implemented in casa::DSArrow, casa::DSMarker, casa::DSLine, casa::DSText, casa::DSRectangle, casa::DSPoly, casa::DSPolyLine, casa::DSEllipse, casa::DSCircle, casa::DSWorldPoly, casa::DSScreenText, casa::DSScreenArrow, casa::DSWorldEllipse, casa::DSWorldPolyLine, casa::DSWorldArrow, casa::DSWorldRectangle, casa::DSScreenMarker, casa::DSScreenPoly, casa::DSWorldMarker, casa::DSWorldText, casa::DSScreenPolyLine, casa::DSScreenEllipse, and casa::DSScreenRectangle.
|
virtual |
Manage the color of object.
(Does not include handles)
|
privatevirtual |
Set default options.
Reimplemented in casa::DSArrow, casa::DSMarker, casa::DSText, casa::DSRectangle, casa::DSEllipse, casa::DSPolyLine, casa::DSPoly, casa::DSCircle, and casa::DSClosed.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in casa::DSArrow, casa::DSMarker, casa::DSLine, casa::DSRectangle, casa::DSPoly, casa::DSPolyLine, casa::DSEllipse, casa::DSText, casa::DSCircle, casa::DSSquare, casa::DSClosed, casa::DSBasic, casa::DSWorldPoly, casa::DSWorldPolyLine, casa::DSScreenArrow, casa::DSWorldArrow, casa::DSWorldEllipse, casa::DSWorldRectangle, casa::DSScreenPoly, casa::DSScreenPolyLine, casa::DSWorldMarker, casa::DSWorldText, casa::DSPixelEllipse, casa::DSScreenText, casa::DSPixelRectangle, casa::DSPixelPoly, casa::DSScreenMarker, casa::DSPixelMarker, casa::DSScreenEllipse, casa::DSPixelPolyLine, casa::DSScreenRectangle, casa::DSPixelArrow, and casa::DSPixelText.
|
virtual |
Conver radians to degree.
|
virtual |
Convert degrees to radians.
|
virtual |
Translate an entire matrix by the specified dx / dy amounts.
|
virtual |
Reimplemented in casa::DSMarker.
|
private |
Object.
Definition at line 231 of file DisplayShape.h.
|
private |
Should handles be shown if they exist.
Definition at line 245 of file DisplayShape.h.
Referenced by drawingHandles().
|
private |
Handle settings.
Definition at line 252 of file DisplayShape.h.
|
private |
Handles.
Definition at line 234 of file DisplayShape.h.
|
private |
Definition at line 253 of file DisplayShape.h.
|
private |
Definition at line 254 of file DisplayShape.h.
|
private |
Do I have handles / can a user resize me? i.e.
Do I ever want to draw handles (e.g. will be false for an object which IS a handle!)
Definition at line 242 of file DisplayShape.h.
|
private |
Locks.
Definition at line 237 of file DisplayShape.h.
|
private |
Have valid handles been made/supplied yet?
Definition at line 248 of file DisplayShape.h.