28 #ifndef TRIALDISPLAY_DISPLAYSHAPE_H
29 #define TRIALDISPLAY_DISPLAYSHAPE_H
41 class DParameterColorChoice;
Implementation of DParameterChoice to store color selection parameters.
DParameterColorChoice * itsColor
Object.
DisplayShape()
Default constructor.
virtual casacore::Bool whichHandle(const casacore::Float &xPos, const casacore::Float &yPos, casacore::Int &out)
virtual void addPoint(const casacore::Vector< casacore::Float > &)
If applicable, this function will add a point to the shape in the most meaningful location...
virtual void setHandlePositions(const casacore::Matrix< casacore::Float > &newPoints)
virtual DSClosed * makeHandle(const casacore::Vector< casacore::Float > &newHandlePos)
virtual void removeLocked(DisplayShape *removeLock)
Removes a lock from the specified shape.
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.
virtual casacore::Float toRadians(const casacore::Float °rees)
Convert degrees to radians.
virtual void setHandleSize(const casacore::Int pixelSize)
virtual casacore::Bool onHandles(const casacore::Float &xPos, const casacore::Float &yPos)
virtual casacore::uInt nHandles()
virtual ~DisplayShape()
Destructor.
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.
virtual casacore::Vector< casacore::Float > getCenter()=0
Returns the center of the DisplayShape (x,y).
virtual void recalculateScreenPosition()
casacore::String itsHandleColor
Handle settings.
virtual casacore::Matrix< casacore::Float > getHandleLocations()
casacore::Bool itsHasHandles
Do I have handles / can a user resize me? i.e.
virtual casacore::Bool removeHandle(const casacore::Vector< casacore::Float > &getRidOf)
Base class defining interface to pixel-based output devices.
virtual void rotateAbout(const casacore::Float &relAngle, const casacore::Float &aboutX, const casacore::Float &aboutY)
virtual void setColor(const casacore::String &newColor)
Manage the color of object.
virtual casacore::Record getOptions()
Settings.
casacore::Int itsHandleSize
virtual casacore::Bool inObject(const casacore::Float &xPos, const casacore::Float &yPos)=0
Is the supplied point within the DisplayShape?
virtual void setDefaultOptions()
Set default options.
The abstract base class for all "DisplayShapes".
virtual casacore::String getColor()
virtual void setHandleColor(const casacore::String &handleColor)
virtual casacore::Float toDegrees(const casacore::Float &radians)
Conver radians to degree.
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.
virtual void draw(PixelCanvas *pc)
These functions contol behaviour of handles during a call to the display shape object.
virtual void scale(const casacore::Float &scaleFactor)=0
Scale the shape about its center by the scaleFactor.
virtual void addLocked(DisplayShape *toLock)
Allow locking of other shapes onto this one.
virtual void setCenter(const casacore::Float &xPos, const casacore::Float &yPos)=0
Sets the center of the DisplayShape.
casacore::Bool itsDrawHandles
Should handles be shown if they exist.
virtual void addHandle(const casacore::Vector< casacore::Float > &newHandlePos, const casacore::Bool &atEnd=true, const casacore::Int position=0)
virtual void move(const casacore::Float &dX, const casacore::Float &dY)
A hierarchical collection of named fields of various types.
bool Bool
Define the standard types used by Casacore.
DisplayShape::HandleShape itsHandleShape
virtual void setHasHandles(const casacore::Bool &hasHandles)
casacore::PtrBlock< DSClosed * > itsHandles
Handles.
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 th...
virtual casacore::Bool setOptions(const casacore::Record &settings)
virtual void setDrawHandles(const casacore::Bool &shouldIDraw)
A drop-in replacement for Block<T*>.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
DSClosed provides common functionality for all "closed" shapes.
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) ...
virtual void setHandleShape(const DisplayShape::HandleShape &shape)
casacore::PtrBlock< DisplayShape * > itsLocks
Locks.
String: the storage and methods of handling collections of characters.
virtual void changePoint(const casacore::Vector< casacore::Float > &newPos)=0
Changes the closest point to the supplied location to that location.
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...
virtual void rotate(const casacore::Float &angle)=0
Rotate the shape about its center by a set angle (angle in degrees).
virtual void buildHandles(const casacore::Matrix< casacore::Float > &startPoints)
Handle management.
virtual casacore::Bool drawingHandles()
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.
casacore::Bool itsValidHandles
Have valid handles been made/supplied yet?