A DisplayData to draw Profiles. More...
#include <Profile2dDD.h>
Public Member Functions | |
Profile2dDD () | |
(Required) default constructor. | |
Profile2dDD (LatticePADisplayData< Float > *dd) | |
Constructor taking a pointer to an already constructed ImageInterface.The Display Data dd must have atleast 3 World Axes and atleast 2 elements in the profile (3rd) world axis. | |
virtual | ~Profile2dDD () |
Destructor. | |
virtual Bool | attachDD (LatticePADisplayData< Float > *dd) |
Attach a Display Data to this Profile2dDD. | |
virtual void | detachDD () |
Detach the currently attached Display Data. | |
virtual Bool | sizeControl (WorldCanvasHolder &wcHolder, AttributeBuffer &holderBuf) |
Overloading ActiveCaching2dDD::sizeControl. | |
virtual void | getDrawData (Matrix< Double > &data, const Bool world=False) |
Store the data to be drawn in the data Matrix. | |
virtual void | getMaskData (Vector< Bool > &mask) |
Store the mask in mask vector. | |
virtual void | getProfileAsRecord (Record &rec) |
Store the details of the current profile in rec Record structure similar to position event structure. | |
virtual const Unit | dataUnit () |
Return the data unit. | |
virtual String | showValue (const Vector< Double > &world) |
Returns an empty string. | |
virtual void | operator() (const WCMotionEvent &ev) |
Motion Event Handler. | |
virtual void | operator() (const WCPositionEvent &ev) |
Position Event Handler. | |
virtual void | handleEvent (DisplayEvent &ev) |
Display Event Handler. | |
virtual void | sendDDModEvent () |
Send out DDModEvents to all DisplayEHs listening. | |
virtual Bool | labelAxes (const WCRefreshEvent &ev) |
Draws and labels the axes based on the refresh event. | |
virtual Bool | canLabelAxes () const |
virtual void | setDefaultOptions () |
Install the default options for this DisplayData. | |
virtual Bool | setOptions (Record &rec, Record &recOut) |
Apply options stored in rec to the DisplayData. | |
virtual Record | getOptions (bool scrub=false) const |
Retrieve the current and default options and parameter types. | |
virtual Display::DisplayDataType | classType () |
Return the type of this DisplayData. | |
virtual CachingDisplayMethod * | newDisplayMethod (WorldCanvas *worldCanvas, AttributeBuffer *wchAttributes, AttributeBuffer *ddAttributes, CachingDisplayData *dd) |
Create a new CachingDisplayMethod for drawing on the given WorldCanvas when the AttributeBuffers are suitably matched to the current state of this DisplayData and of the WorldCanvas/Holder. | |
virtual AttributeBuffer | optionsAsAttributes () |
Return the current options of this DisplayData as an AttributeBuffer. | |
virtual void | notifyUnregister (WorldCanvasHolder &wcHolder, Bool ignoreRefresh=False) |
Take actions on removal from WC[H] (notably, deletion of drawlists). | |
virtual String | profileColor () const |
Return Profile Color. | |
virtual Float | profileLineWidth () const |
Return Profile Line Width. | |
virtual Display::LineStyle | profileLineStyle () |
Return Profile LineStyle. | |
virtual Bool | isRegionProfile () const |
Return True if the last requested profile was for a region. | |
virtual void | regionDimensions (Vector< Double > ®ionBlc, Vector< Double > ®ionTrc) |
get the region dimensions, in pixels, of the last region submitted to Profile2dDD. | |
virtual Double | profileYMin () const |
Return Minimum Y value. | |
virtual Double | profileYMax () const |
Return Maximum Y value. | |
virtual Double | profileXMin () const |
Return Minimum X value. | |
virtual Double | profileXMax () const |
Return Maximum X value. | |
virtual Bool | profileAutoscale () const |
Return the autoscale status (On or Off). | |
virtual Bool | showRestFrequency () const |
Return the rest frequency display status (to draw or not to draw). | |
virtual Double | restFrequency () const |
Return rest frequency. | |
virtual LatticeStatsBase::StatisticsTypes | regionStatType () const |
Return the statistics used for region calculations. | |
virtual Int | regionXRadius () const |
Return the x value added to the pixel at a pixel position to create a region. | |
virtual Int | regionYRadius () const |
Return the y value added to the pixel at a pixel position to create a region. | |
virtual Int | profileAxis () |
Return the profile axis number (from the original image). | |
Protected Member Functions | |
Profile2dDD (const Profile2dDD &other) | |
(Required) copy constructor. | |
void | operator= (const Profile2dDD &other) |
(Required) copy assignment. | |
Private Member Functions | |
Bool | createCoordinateSystem () |
Helper function. | |
Bool | updateCoordinateSys (DisplayCoordinateSystem &cs) |
Update the coordinate system of this Display Data and the axis labeller. | |
Bool | getRegionProfile (Vector< Double > &fpixelBlc, Vector< Double > &fpixelTrc) |
Extract the profile data from the provided pixel region and place it into itsData. | |
Bool | getPointProfile (const Vector< Double > &world) |
Extract the profile data from the provided world position and place it into itsData. | |
Bool | cropRegion (Vector< Double > &fpixelBlc, Vector< Double > &fpixelTrc) |
Crop the region so that it does not define areas outside the data. | |
virtual void | constructParameters () |
Construct the parameters for getOptions and setOptions. | |
virtual void | destructParameters () |
Delete the parameters for getOptions() and setOptions(). | |
Private Attributes | |
LatticePADisplayData< Float > * | itsDD |
A pointer to the attached DisplayData. | |
Bool | itsIsRegionProfile |
Flag to indicate whether the last drawn profile was for a region or for a single point. | |
Bool | itsTrackingState |
A flag to indicate whether tracking is on. | |
Int | itsDependentAxis |
The dependent (world) axis of itsDD. | |
Double | itsYAxisInc |
Increment value for the linear coordinate on the Y axis. | |
Double | itsRestFrequency |
Rest Frequency. | |
Vector< Double > | itsCurrentBlc |
Minimum and maximum X/Y values. | |
Vector< Double > | itsCurrentTrc |
Vector< Double > | itsPixelPosition |
The pixel position on the world canvas when the last motion' event was received. | |
Vector< Double > | itsWorldPosition |
The world position on the world canvas when the last motion' event was received. | |
Vector< Double > | itsRegionBlc |
The region dimensions, in pixels, of the last region event received by Profile2dDD. | |
Vector< Double > | itsRegionTrc |
Matrix< Double > | itsData |
The Profile Data. | |
Vector< Bool > | itsMask |
The Mask Data. | |
Vector< Int > | itsWorldAxisMap |
The axis map between input DD's Coordinate system and itsCompleteCS. | |
Vector< Int > | itsPixelAxisMap |
Vector< String > | itsRegionCalcChoices |
The choices for region calculations. | |
Vector< String > | itsDefaultAxisLabels |
The default x and y axis labels. | |
WCCSNLAxisLabeller | itsAxisLabeller |
The Axis Labeller used to draw Axes. | |
DParameterColorChoice * | itsParamColor |
Display Parameters for. | |
DParameterRange< Float > * | itsParamLineWidth |
DParameterMapKeyChoice * | itsParamLineStyle |
DParameterSwitch * | itsParamAutoscale |
DParameterSwitch * | itsParamShowRestFrequency |
DParameterMapKeyChoice * | itsParamRegionStatType |
DParameterRange< Int > * | itsParamRegionXRadius |
DParameterRange< Int > * | itsParamRegionYRadius |
Friends | |
class | Profile2dDM |
A DisplayData to draw Profiles.
Public interface
This Display Data attaches to itself, another Display Data whos profile (at a point) is to be extracted and drawn. The Display Data attached to Profile2dDD must have atleast 3 world Axes and atleast 2 pixels on it's profile axis (3rd axis). An axis from a Linear Coordinate or Stokes Coordinate presently can not be on the profile axis. All other AIPS++ coordinate types are supported.
Profile2dDD is an implements WCMotionEH and WCPositionEH and listens to motion and position events generated by the attached Display Data. A motion event comes with a new world position on the attached Display Data. Profile2dDD uses this world position to extract and draw a profile on its world canvas. A Position event (key press) switches the profiling on and off. The default switch is the space bar.
Profile2dDD is a DisplayEH (all DisplayDatas are) and listens to DisplayEvents sent out by the attached DisplayData. This is so it can listen for Tool events such as Crosshair event.
Each time the profile is refreshed (with new data), Profile2dDD sends out a DDModEvent to all listening DisplayEHs, to indicate that the data has been modified.
Since Profile2dDD inherit's from ActiveCaching2dDD and uses WCCSNLAxisLabeller, all the options such as position tracking and axis labelling are available. Options specific to Profilng, such as profile color, line width, line style and autoscaling are also available.
Existing Glish implementation is too slow and limited.
Ability to add multiple display datas and overlay their profiles
Definition at line 122 of file Profile2dDD.h.
casa::Profile2dDD::Profile2dDD | ( | ) |
(Required) default constructor.
casa::Profile2dDD::Profile2dDD | ( | LatticePADisplayData< Float > * | dd | ) |
Constructor taking a pointer to an already constructed ImageInterface.The Display Data dd must have atleast 3 World Axes and atleast 2 elements in the profile (3rd) world axis.
virtual casa::Profile2dDD::~Profile2dDD | ( | ) | [virtual] |
Destructor.
casa::Profile2dDD::Profile2dDD | ( | const Profile2dDD & | other | ) | [protected] |
(Required) copy constructor.
virtual Bool casa::Profile2dDD::attachDD | ( | LatticePADisplayData< Float > * | dd | ) | [virtual] |
Attach a Display Data to this Profile2dDD.
The Display Data dd must have atleast 3 World Axes and atleast 2 elements in the profile (3rd) world axis. If any of the above conditions are not met or a Display Data is already attached, False is returned. Otherwise True is returned.
virtual Bool casa::Profile2dDD::canLabelAxes | ( | ) | const [virtual] |
Reimplemented from casa::DisplayData.
virtual Display::DisplayDataType casa::Profile2dDD::classType | ( | ) | [inline, virtual] |
Return the type of this DisplayData.
Implements casa::DisplayData.
Definition at line 209 of file Profile2dDD.h.
References casa::Display::Vector.
virtual void casa::Profile2dDD::constructParameters | ( | ) | [private, virtual] |
Construct the parameters for getOptions and setOptions.
Bool casa::Profile2dDD::createCoordinateSystem | ( | ) | [private] |
Helper function.
Initialise Profile2dDD with a DisplayCoordinateSystem put together from the parent DD
Bool casa::Profile2dDD::cropRegion | ( | Vector< Double > & | fpixelBlc, | |
Vector< Double > & | fpixelTrc | |||
) | [private] |
Crop the region so that it does not define areas outside the data.
Returns False if the entire region is outside image data
virtual const Unit casa::Profile2dDD::dataUnit | ( | ) | [virtual] |
Return the data unit.
virtual void casa::Profile2dDD::destructParameters | ( | ) | [private, virtual] |
Delete the parameters for getOptions() and setOptions().
virtual void casa::Profile2dDD::detachDD | ( | ) | [virtual] |
Detach the currently attached Display Data.
virtual void casa::Profile2dDD::getDrawData | ( | Matrix< Double > & | data, | |
const Bool | world = False | |||
) | [virtual] |
Store the data to be drawn in the data Matrix.
If world is false, pixel coordinates are used. If world is true, then world coordinates are used.
virtual void casa::Profile2dDD::getMaskData | ( | Vector< Bool > & | mask | ) | [virtual] |
Store the mask in mask vector.
virtual Record casa::Profile2dDD::getOptions | ( | bool | scrub = false |
) | const [virtual] |
Retrieve the current and default options and parameter types.
Reimplemented from casa::ActiveCaching2dDD.
Bool casa::Profile2dDD::getPointProfile | ( | const Vector< Double > & | world | ) | [private] |
Extract the profile data from the provided world position and place it into itsData.
Also extract the Mask data (if it exists) and place it into itsMask. Return True if new profile data has been extracted (i.e. a refresh is needed) otherwise return False
virtual void casa::Profile2dDD::getProfileAsRecord | ( | Record & | rec | ) | [virtual] |
Store the details of the current profile in rec Record structure similar to position event structure.
Bool casa::Profile2dDD::getRegionProfile | ( | Vector< Double > & | fpixelBlc, | |
Vector< Double > & | fpixelTrc | |||
) | [private] |
Extract the profile data from the provided pixel region and place it into itsData.
The statistics used is determined by the options. Return True if new profile data has been extracted (i.e. a refresh is needed) otherwise return False
virtual void casa::Profile2dDD::handleEvent | ( | DisplayEvent & | ev | ) | [virtual] |
Display Event Handler.
Reimplemented from casa::DisplayData.
virtual Bool casa::Profile2dDD::isRegionProfile | ( | ) | const [inline, virtual] |
Return True if the last requested profile was for a region.
Return False if the last requested profile was for a single point
Definition at line 248 of file Profile2dDD.h.
References itsIsRegionProfile.
virtual Bool casa::Profile2dDD::labelAxes | ( | const WCRefreshEvent & | ev | ) | [virtual] |
Draws and labels the axes based on the refresh event.
Reimplemented from casa::DisplayData.
virtual CachingDisplayMethod* casa::Profile2dDD::newDisplayMethod | ( | WorldCanvas * | worldCanvas, | |
AttributeBuffer * | wchAttributes, | |||
AttributeBuffer * | ddAttributes, | |||
CachingDisplayData * | dd | |||
) | [virtual] |
Create a new CachingDisplayMethod for drawing on the given WorldCanvas when the AttributeBuffers are suitably matched to the current state of this DisplayData and of the WorldCanvas/Holder.
The tag is a unique number used to identify the age of the newly constructed CachingDisplayMethod.
virtual void casa::Profile2dDD::notifyUnregister | ( | WorldCanvasHolder & | wcHolder, | |
Bool | ignoreRefresh = False | |||
) | [virtual] |
Take actions on removal from WC[H] (notably, deletion of drawlists).
Reimplemented from casa::CachingDisplayData.
virtual void casa::Profile2dDD::operator() | ( | const WCPositionEvent & | ev | ) | [virtual] |
Position Event Handler.
Implements casa::WCPositionEH.
virtual void casa::Profile2dDD::operator() | ( | const WCMotionEvent & | ev | ) | [virtual] |
Motion Event Handler.
Implements casa::WCMotionEH.
void casa::Profile2dDD::operator= | ( | const Profile2dDD & | other | ) | [protected] |
(Required) copy assignment.
Reimplemented from casa::ActiveCaching2dDD.
virtual AttributeBuffer casa::Profile2dDD::optionsAsAttributes | ( | ) | [virtual] |
Return the current options of this DisplayData as an AttributeBuffer.
Reimplemented from casa::ActiveCaching2dDD.
virtual Bool casa::Profile2dDD::profileAutoscale | ( | ) | const [inline, virtual] |
Return the autoscale status (On or Off).
Definition at line 274 of file Profile2dDD.h.
References itsParamAutoscale, and casa::DParameterSwitch::value().
virtual Int casa::Profile2dDD::profileAxis | ( | ) | [virtual] |
Return the profile axis number (from the original image).
virtual String casa::Profile2dDD::profileColor | ( | ) | const [inline, virtual] |
Return Profile Color.
Definition at line 233 of file Profile2dDD.h.
References itsParamColor, and casa::DParameterChoice::value().
virtual Display::LineStyle casa::Profile2dDD::profileLineStyle | ( | ) | [inline, virtual] |
Return Profile LineStyle.
Definition at line 241 of file Profile2dDD.h.
References itsParamLineStyle, and casa::DParameterMapKeyChoice::keyValue().
virtual Float casa::Profile2dDD::profileLineWidth | ( | ) | const [inline, virtual] |
Return Profile Line Width.
Definition at line 237 of file Profile2dDD.h.
References itsParamLineWidth, and casa::DParameterRange< T >::value().
virtual Double casa::Profile2dDD::profileXMax | ( | ) | const [inline, virtual] |
virtual Double casa::Profile2dDD::profileXMin | ( | ) | const [inline, virtual] |
virtual Double casa::Profile2dDD::profileYMax | ( | ) | const [inline, virtual] |
virtual Double casa::Profile2dDD::profileYMin | ( | ) | const [inline, virtual] |
virtual void casa::Profile2dDD::regionDimensions | ( | Vector< Double > & | regionBlc, | |
Vector< Double > & | regionTrc | |||
) | [virtual] |
get the region dimensions, in pixels, of the last region submitted to Profile2dDD.
virtual LatticeStatsBase::StatisticsTypes casa::Profile2dDD::regionStatType | ( | ) | const [inline, virtual] |
Return the statistics used for region calculations.
Definition at line 287 of file Profile2dDD.h.
References itsParamRegionStatType, and casa::DParameterMapKeyChoice::keyValue().
virtual Int casa::Profile2dDD::regionXRadius | ( | ) | const [inline, virtual] |
Return the x value added to the pixel at a pixel position to create a region.
Definition at line 294 of file Profile2dDD.h.
References itsParamRegionXRadius, and casa::DParameterRange< T >::value().
virtual Int casa::Profile2dDD::regionYRadius | ( | ) | const [inline, virtual] |
Return the y value added to the pixel at a pixel position to create a region.
Definition at line 300 of file Profile2dDD.h.
References itsParamRegionYRadius, and casa::DParameterRange< T >::value().
virtual Double casa::Profile2dDD::restFrequency | ( | ) | const [inline, virtual] |
virtual void casa::Profile2dDD::sendDDModEvent | ( | ) | [virtual] |
Send out DDModEvents to all DisplayEHs listening.
virtual void casa::Profile2dDD::setDefaultOptions | ( | ) | [virtual] |
Install the default options for this DisplayData.
Reimplemented from casa::ActiveCaching2dDD.
virtual Bool casa::Profile2dDD::setOptions | ( | Record & | rec, | |
Record & | recOut | |||
) | [virtual] |
Apply options stored in rec
to the DisplayData.
A return value of True
means a refresh is needed. recOut
contains any fields which were implicitly changed as a result of the call to this function.
Reimplemented from casa::ActiveCaching2dDD.
virtual Bool casa::Profile2dDD::showRestFrequency | ( | ) | const [inline, virtual] |
Return the rest frequency display status (to draw or not to draw).
Definition at line 278 of file Profile2dDD.h.
References itsParamShowRestFrequency, and casa::DParameterSwitch::value().
virtual String casa::Profile2dDD::showValue | ( | const Vector< Double > & | world | ) | [virtual] |
Returns an empty string.
Implements casa::DisplayData.
virtual Bool casa::Profile2dDD::sizeControl | ( | WorldCanvasHolder & | wcHolder, | |
AttributeBuffer & | holderBuf | |||
) | [virtual] |
Overloading ActiveCaching2dDD::sizeControl.
Zooming is modified for autoscaling feature.
Reimplemented from casa::ActiveCaching2dDD.
Bool casa::Profile2dDD::updateCoordinateSys | ( | DisplayCoordinateSystem & | cs | ) | [private] |
Update the coordinate system of this Display Data and the axis labeller.
Set new minimum and maximum Y values if necessary
friend class Profile2dDM [friend] |
Definition at line 310 of file Profile2dDD.h.
The Axis Labeller used to draw Axes.
Definition at line 409 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsCurrentBlc [private] |
Minimum and maximum X/Y values.
Definition at line 373 of file Profile2dDD.h.
Referenced by profileXMin(), and profileYMin().
Vector<Double> casa::Profile2dDD::itsCurrentTrc [private] |
Definition at line 374 of file Profile2dDD.h.
Referenced by profileXMax(), and profileYMax().
Matrix<Double> casa::Profile2dDD::itsData [private] |
The Profile Data.
Definition at line 392 of file Profile2dDD.h.
LatticePADisplayData<Float>* casa::Profile2dDD::itsDD [private] |
A pointer to the attached DisplayData.
Definition at line 352 of file Profile2dDD.h.
Vector<String> casa::Profile2dDD::itsDefaultAxisLabels [private] |
The default x and y axis labels.
The x and y labels change to indicate region profiles.
Definition at line 406 of file Profile2dDD.h.
Int casa::Profile2dDD::itsDependentAxis [private] |
The dependent (world) axis of itsDD.
For example, if a RA axis is the profile axis, then the DEC axis will be the dependent axis.
Definition at line 364 of file Profile2dDD.h.
Bool casa::Profile2dDD::itsIsRegionProfile [private] |
Flag to indicate whether the last drawn profile was for a region or for a single point.
Definition at line 356 of file Profile2dDD.h.
Referenced by isRegionProfile().
Vector<Bool> casa::Profile2dDD::itsMask [private] |
The Mask Data.
Definition at line 394 of file Profile2dDD.h.
Definition at line 415 of file Profile2dDD.h.
Referenced by profileAutoscale().
Definition at line 414 of file Profile2dDD.h.
Referenced by profileLineStyle().
DParameterRange<Float>* casa::Profile2dDD::itsParamLineWidth [private] |
Definition at line 413 of file Profile2dDD.h.
Referenced by profileLineWidth().
Definition at line 417 of file Profile2dDD.h.
Referenced by regionStatType().
DParameterRange<Int>* casa::Profile2dDD::itsParamRegionXRadius [private] |
Definition at line 418 of file Profile2dDD.h.
Referenced by regionXRadius().
DParameterRange<Int>* casa::Profile2dDD::itsParamRegionYRadius [private] |
Definition at line 419 of file Profile2dDD.h.
Referenced by regionYRadius().
Definition at line 416 of file Profile2dDD.h.
Referenced by showRestFrequency().
Vector<Int> casa::Profile2dDD::itsPixelAxisMap [private] |
Definition at line 399 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsPixelPosition [private] |
The pixel position on the world canvas when the last motion' event was received.
This position is in the format of itsDD, NOT the original image.
Definition at line 379 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsRegionBlc [private] |
The region dimensions, in pixels, of the last region event received by Profile2dDD.
Definition at line 387 of file Profile2dDD.h.
Vector<String> casa::Profile2dDD::itsRegionCalcChoices [private] |
The choices for region calculations.
eg, mean, median, etc
Definition at line 402 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsRegionTrc [private] |
Definition at line 388 of file Profile2dDD.h.
Double casa::Profile2dDD::itsRestFrequency [private] |
Bool casa::Profile2dDD::itsTrackingState [private] |
A flag to indicate whether tracking is on.
If True, a new profile is extracted each time a new motion event is received.
Definition at line 360 of file Profile2dDD.h.
Vector<Int> casa::Profile2dDD::itsWorldAxisMap [private] |
The axis map between input DD's Coordinate system and itsCompleteCS.
Definition at line 398 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsWorldPosition [private] |
The world position on the world canvas when the last motion' event was received.
This position is in the format of itsDD, NOT the original image.
Definition at line 383 of file Profile2dDD.h.
Double casa::Profile2dDD::itsYAxisInc [private] |
Increment value for the linear coordinate on the Y axis.
Definition at line 367 of file Profile2dDD.h.