casa
$Rev:20696$
|
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 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 () |
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 const String | profileColor () const |
Return Profile Color. | |
virtual const Float | profileLineWidth () const |
Return Profile Line Width. | |
virtual const Display::LineStyle | profileLineStyle () |
Return Profile LineStyle. | |
virtual const 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 const Double | profileYMin () const |
Return Minimum Y value. | |
virtual const Double | profileYMax () const |
Return Maximum Y value. | |
virtual const Double | profileXMin () const |
Return Minimum X value. | |
virtual const Double | profileXMax () const |
Return Maximum X value. | |
virtual const Bool | profileAutoscale () const |
Return the autoscale status (On or Off) | |
virtual const Bool | showRestFrequency () const |
Return the rest frequency display status (to draw or not to draw) | |
virtual const Double | restFrequency () const |
Return rest frequency. | |
virtual const LatticeStatsBase::StatisticsTypes | regionStatType () const |
Return the statistics used for region calculations. | |
virtual const Int | regionXRadius () const |
Return the x value added to the pixel at a pixel position to create a region. | |
virtual const Int | regionYRadius () const |
Return the y value added to the pixel at a pixel position to create a region. | |
virtual const 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 (CoordinateSystem &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.
(Required) default constructor.
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 Display::DisplayDataType casa::Profile2dDD::classType | ( | ) | [inline, virtual] |
Return the type of this DisplayData.
Implements casa::DisplayData.
Definition at line 208 of file Profile2dDD.h.
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 CoordinateSystem 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 | ( | ) | [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 const 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 245 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.
Implements casa::CachingDisplayData.
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 WCMotionEvent & | ev | ) | [virtual] |
Motion Event Handler.
Implements casa::WCMotionEH.
virtual void casa::Profile2dDD::operator() | ( | const WCPositionEvent & | ev | ) | [virtual] |
Position Event Handler.
Implements casa::WCPositionEH.
void casa::Profile2dDD::operator= | ( | const Profile2dDD & | other | ) | [protected] |
(Required) copy assignment.
virtual AttributeBuffer casa::Profile2dDD::optionsAsAttributes | ( | ) | [virtual] |
Return the current options of this DisplayData as an AttributeBuffer.
Reimplemented from casa::ActiveCaching2dDD.
virtual const Bool casa::Profile2dDD::profileAutoscale | ( | ) | const [inline, virtual] |
Return the autoscale status (On or Off)
Definition at line 270 of file Profile2dDD.h.
References itsParamAutoscale, and casa::DParameterSwitch::value().
virtual const Int casa::Profile2dDD::profileAxis | ( | ) | [virtual] |
Return the profile axis number (from the original image)
virtual const String casa::Profile2dDD::profileColor | ( | ) | const [inline, virtual] |
Return Profile Color.
Definition at line 230 of file Profile2dDD.h.
References itsParamColor, and casa::DParameterChoice::value().
virtual const Display::LineStyle casa::Profile2dDD::profileLineStyle | ( | ) | [inline, virtual] |
Return Profile LineStyle.
Definition at line 238 of file Profile2dDD.h.
References itsParamLineStyle, and casa::DParameterMapKeyChoice::keyValue().
virtual const Float casa::Profile2dDD::profileLineWidth | ( | ) | const [inline, virtual] |
Return Profile Line Width.
Definition at line 234 of file Profile2dDD.h.
References itsParamLineWidth, and casa::DParameterRange< T >::value().
virtual const Double casa::Profile2dDD::profileXMax | ( | ) | const [inline, virtual] |
virtual const Double casa::Profile2dDD::profileXMin | ( | ) | const [inline, virtual] |
virtual const Double casa::Profile2dDD::profileYMax | ( | ) | const [inline, virtual] |
virtual const 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 const LatticeStatsBase::StatisticsTypes casa::Profile2dDD::regionStatType | ( | ) | const [inline, virtual] |
Return the statistics used for region calculations.
Definition at line 281 of file Profile2dDD.h.
References itsParamRegionStatType, and casa::DParameterMapKeyChoice::keyValue().
virtual const 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 288 of file Profile2dDD.h.
References itsParamRegionXRadius, and casa::DParameterRange< T >::value().
virtual const 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 292 of file Profile2dDD.h.
References itsParamRegionYRadius, and casa::DParameterRange< T >::value().
virtual const 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 const Bool casa::Profile2dDD::showRestFrequency | ( | ) | const [inline, virtual] |
Return the rest frequency display status (to draw or not to draw)
Definition at line 274 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 | ( | CoordinateSystem & | 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 302 of file Profile2dDD.h.
The Axis Labeller used to draw Axes.
Definition at line 401 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsCurrentBlc [private] |
Minimum and maximum X/Y values.
Definition at line 365 of file Profile2dDD.h.
Referenced by profileXMin(), and profileYMin().
Vector<Double> casa::Profile2dDD::itsCurrentTrc [private] |
Definition at line 366 of file Profile2dDD.h.
Referenced by profileXMax(), and profileYMax().
Matrix<Double> casa::Profile2dDD::itsData [private] |
The Profile Data.
Definition at line 384 of file Profile2dDD.h.
LatticePADisplayData<Float>* casa::Profile2dDD::itsDD [private] |
A pointer to the attached DisplayData.
Definition at line 344 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 398 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 356 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 348 of file Profile2dDD.h.
Referenced by isRegionProfile().
Vector<Bool> casa::Profile2dDD::itsMask [private] |
The Mask Data.
Definition at line 386 of file Profile2dDD.h.
Definition at line 407 of file Profile2dDD.h.
Referenced by profileAutoscale().
Definition at line 406 of file Profile2dDD.h.
Referenced by profileLineStyle().
DParameterRange<Float>* casa::Profile2dDD::itsParamLineWidth [private] |
Definition at line 405 of file Profile2dDD.h.
Referenced by profileLineWidth().
Definition at line 409 of file Profile2dDD.h.
Referenced by regionStatType().
Definition at line 410 of file Profile2dDD.h.
Referenced by regionXRadius().
Definition at line 411 of file Profile2dDD.h.
Referenced by regionYRadius().
Definition at line 408 of file Profile2dDD.h.
Referenced by showRestFrequency().
Vector<Int> casa::Profile2dDD::itsPixelAxisMap [private] |
Definition at line 391 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 371 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 379 of file Profile2dDD.h.
Vector<String> casa::Profile2dDD::itsRegionCalcChoices [private] |
The choices for region calculations.
eg, mean, median, etc
Definition at line 394 of file Profile2dDD.h.
Vector<Double> casa::Profile2dDD::itsRegionTrc [private] |
Definition at line 380 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 352 of file Profile2dDD.h.
Vector<Int> casa::Profile2dDD::itsWorldAxisMap [private] |
The axis map between input DD's Coordinate system and itsCompleteCS.
Definition at line 390 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 375 of file Profile2dDD.h.
Double casa::Profile2dDD::itsYAxisInc [private] |
Increment value for the linear coordinate on the Y axis.
Definition at line 359 of file Profile2dDD.h.