casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
casa::Profile2dDD Class Reference

A DisplayData to draw Profiles. More...

#include <Profile2dDD.h>

Inheritance diagram for casa::Profile2dDD:
casa::ActiveCaching2dDD casa::WCMotionEH casa::WCPositionEH casa::CachingDisplayData casa::DisplayData casa::DisplayOptions casa::DisplayEH casa::DlTarget

List of all members.

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 CachingDisplayMethodnewDisplayMethod (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 > &regionBlc, Vector< Double > &regionTrc)
 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< DoubleitsCurrentBlc
 Minimum and maximum X/Y values.
Vector< DoubleitsCurrentTrc
Vector< DoubleitsPixelPosition
 The pixel position on the world canvas when the last motion' event was received.
Vector< DoubleitsWorldPosition
 The world position on the world canvas when the last motion' event was received.
Vector< DoubleitsRegionBlc
 The region dimensions, in pixels, of the last region event received by Profile2dDD.
Vector< DoubleitsRegionTrc
Matrix< DoubleitsData
 The Profile Data.
Vector< BoolitsMask
 The Mask Data.
Vector< IntitsWorldAxisMap
 The axis map between input DD's Coordinate system and itsCompleteCS.
Vector< IntitsPixelAxisMap
Vector< StringitsRegionCalcChoices
 The choices for region calculations.
Vector< StringitsDefaultAxisLabels
 The default x and y axis labels.
WCCSNLAxisLabeller itsAxisLabeller
 The Axis Labeller used to draw Axes.
DParameterColorChoiceitsParamColor
 Display Parameters for.
DParameterRange< Float > * itsParamLineWidth
DParameterMapKeyChoiceitsParamLineStyle
DParameterSwitchitsParamAutoscale
DParameterSwitchitsParamShowRestFrequency
DParameterMapKeyChoiceitsParamRegionStatType
DParameterRange< Int > * itsParamRegionXRadius
DParameterRange< Int > * itsParamRegionYRadius

Friends

class Profile2dDM
 
   


Detailed Description

A DisplayData to draw Profiles.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

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.

Example

Motivation

Existing Glish implementation is too slow and limited.

To Do

Definition at line 122 of file Profile2dDD.h.


Constructor & Destructor Documentation

(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.


Member Function Documentation

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.

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.

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.

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]

Return Maximum X value.

Definition at line 266 of file Profile2dDD.h.

References itsCurrentTrc.

virtual const Double casa::Profile2dDD::profileXMin ( ) const [inline, virtual]

Return Minimum X value.

Definition at line 262 of file Profile2dDD.h.

References itsCurrentBlc.

virtual const Double casa::Profile2dDD::profileYMax ( ) const [inline, virtual]

Return Maximum Y value.

Definition at line 258 of file Profile2dDD.h.

References itsCurrentTrc.

virtual const Double casa::Profile2dDD::profileYMin ( ) const [inline, virtual]

Return Minimum Y value.

Definition at line 254 of file Profile2dDD.h.

References itsCurrentBlc.

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]

Return rest frequency.

Definition at line 278 of file Profile2dDD.h.

References itsRestFrequency.

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.

Update the coordinate system of this Display Data and the axis labeller.

Set new minimum and maximum Y values if necessary


Friends And Related Function Documentation

friend class Profile2dDM [friend]

   

Definition at line 302 of file Profile2dDD.h.


Member Data Documentation

The Axis Labeller used to draw Axes.

Definition at line 401 of file Profile2dDD.h.

Minimum and maximum X/Y values.

Definition at line 365 of file Profile2dDD.h.

Referenced by profileXMin(), and profileYMin().

Definition at line 366 of file Profile2dDD.h.

Referenced by profileXMax(), and profileYMax().

The Profile Data.

Definition at line 384 of file Profile2dDD.h.

A pointer to the attached DisplayData.

Definition at line 344 of file Profile2dDD.h.

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.

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.

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().

The Mask Data.

Definition at line 386 of file Profile2dDD.h.

Definition at line 407 of file Profile2dDD.h.

Referenced by profileAutoscale().

Display Parameters for.

Definition at line 404 of file Profile2dDD.h.

Referenced by profileColor().

Definition at line 406 of file Profile2dDD.h.

Referenced by profileLineStyle().

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().

Definition at line 391 of file Profile2dDD.h.

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.

The region dimensions, in pixels, of the last region event received by Profile2dDD.

Definition at line 379 of file Profile2dDD.h.

The choices for region calculations.

eg, mean, median, etc

Definition at line 394 of file Profile2dDD.h.

Definition at line 380 of file Profile2dDD.h.

Rest Frequency.

Definition at line 362 of file Profile2dDD.h.

Referenced by restFrequency().

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.

The axis map between input DD's Coordinate system and itsCompleteCS.

Definition at line 390 of file Profile2dDD.h.

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.

Increment value for the linear coordinate on the Y axis.

Definition at line 359 of file Profile2dDD.h.


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