casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
casa::DDDObject Class Referenceabstract

Base class describing interface for objects supported by DrawingDisplayData. More...

#include <DDDObject.h>

Inheritance diagram for casa::DDDObject:
casa::WCRefreshEH casa::WCMotionEH casa::WCPositionEH casa::DisplayEH casa::DDDEllipse casa::DDDPolygon casa::DDDRectangle

Public Types

enum  Mode {
  None,
  Handle,
  Move,
  Rotate
}
 

Public Member Functions

 DDDObject (const casacore::Record &description, DrawingDisplayData *owner)
 Constructor taking a casacore::Record description. More...
 
virtual ~DDDObject ()
 Destructor. More...
 
virtual void draw (const Display::RefreshReason &reason, WorldCanvas *worldcanvas)=0
 Draw this DrawingDisplayData object for the given reason on the provided WorldCanvas. More...
 
virtual void showHandles (const casacore::Bool show, const casacore::Bool tellOwner=true)
 Indicate whether the object should show its handles or not. More...
 
virtual casacore::Bool showingHandles ()
 Query whether the object is showing its handles. More...
 
virtual casacore::Record description ()
 Return a record describing this object. More...
 
virtual void setDescription (const casacore::Record &rec)
 Update this object based on the information in the provided Record. More...
 
virtual casacore::Bool storeClick (const DisplayEvent &ev)
 Store a click in the buffer and look for a double-click event. More...
 
virtual void clearClickBuffer ()
 Clear the click buffer. More...
 
casacore::Int objectID () const
 Return the unique id of this object. More...
 
virtual void operator() (const WCRefreshEvent &ev)=0
 Event handlers. More...
 
virtual void operator() (const WCPositionEvent &ev)=0
 Default just prints the event to cout. More...
 
virtual void operator() (const WCMotionEvent &ev)=0
 default sends event to cout More...
 
- Public Member Functions inherited from casa::WCRefreshEH
 WCRefreshEH ()
 Default Constructor Required. More...
 
virtual ~WCRefreshEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::DisplayEH
virtual void handleEvent (DisplayEvent &)
 Classes that contain this interface (i.e., derive from it) can override this method to implement actions for whatever types of DisplayEvent they're interested in. More...
 
virtual ~DisplayEH ()
 
- Public Member Functions inherited from casa::WCMotionEH
 WCMotionEH ()
 Default Constructor Required. More...
 
virtual ~WCMotionEH ()
 Destructor. More...
 
- Public Member Functions inherited from casa::WCPositionEH
 WCPositionEH ()
 Default Constructor Required. More...
 
virtual ~WCPositionEH ()
 Destructor. More...
 

Protected Member Functions

DrawingDisplayDataowner ()
 Return the owner of this object. More...
 
casacore::String color () const
 Return the color to use to draw this object. More...
 
casacore::String label () const
 Return the label of this object. More...
 
casacore::Int lineWidth () const
 Return the line width of this object. More...
 
casacore::Bool isEditable () const
 
casacore::Bool isMovable () const
 
casacore::Bool isFixed () const
 
 DDDObject ()
 (Required) default constructor. More...
 
 DDDObject (const DDDObject &other)
 (Required) copy constructor. More...
 
void operator= (const DDDObject &other)
 (Required) copy assignment. More...
 
void translateMatrix (casacore::Matrix< casacore::Double > &points, casacore::Double dx, casacore::Double dy)
 Translate Matrix. More...
 
casacore::Matrix
< casacore::Double
rotateMatrix (const casacore::Matrix< casacore::Double > &points, casacore::Double angle)
 Rotate Matrix. More...
 
casacore::Bool inPolygon (const casacore::Matrix< casacore::Double > &points, casacore::Double x, casacore::Double y)
 Is point inside the polygon. More...
 
casacore::Bool inPolygon (const casacore::Vector< casacore::Double > &xP, const casacore::Vector< casacore::Double > &yP, casacore::Double x, casacore::Double y)
 
void convertCoordinateSystem (DisplayCoordinateSystem &cSys, WorldCanvas *wcPtr) const
 Convert DisplayCoordinateSystem to screen pixels. More...
 
casacore::Bool onHandle (const casacore::Block< DDDHandle > &handles, casacore::Double x, casacore::Double y)
 Is the point on a handle. More...
 

Private Attributes

DrawingDisplayDataitsOwner
 DrawingDisplayData which owns this DDDObject. More...
 
casacore::Bool itsShowHandles
 Whether the handles are showing, and therefore whether this DDDObject is presently editable. More...
 
casacore::Bool itsEditable
 Is this object editable. More...
 
casacore::Bool itsMovable
 Is it movable. More...
 
casacore::Double itsLastClickTime
 Timing for double clicks. More...
 
casacore::Double its2ndLastClickTime
 
casacore::String itsColor
 Color of this object. More...
 
casacore::Int itsLineWidth
 Line width of the lines drawn. More...
 
casacore::String itsLabel
 Label for this object. More...
 
casacore::Int itsObjectID
 Unique identification for this object. More...
 

Detailed Description

Base class describing interface for objects supported by DrawingDisplayData.

Synopsis

This class defines the interface which objects that are drawable by the DrawingDisplayData class must provide.

World units of 'pix' and 'frac' are defined. 'pix' units are in screen pixel units. They are not very useful once the display has been zoomed. 'frac' units have range [0,0] -> [1,1] mapping to the display part of the pixel canvas.

Definition at line 62 of file DDDObject.h.

Member Enumeration Documentation

Enumerator
None 
Handle 
Move 
Rotate 

Definition at line 67 of file DDDObject.h.

Constructor & Destructor Documentation

casa::DDDObject::DDDObject ( const casacore::Record description,
DrawingDisplayData owner 
)

Constructor taking a casacore::Record description.

Fields in the record are: color and label.

virtual casa::DDDObject::~DDDObject ( )
virtual

Destructor.

casa::DDDObject::DDDObject ( )
protected

(Required) default constructor.

casa::DDDObject::DDDObject ( const DDDObject other)
protected

(Required) copy constructor.

Member Function Documentation

virtual void casa::DDDObject::clearClickBuffer ( )
virtual

Clear the click buffer.

casacore::String casa::DDDObject::color ( ) const
inlineprotected

Return the color to use to draw this object.

Definition at line 136 of file DDDObject.h.

References itsColor.

void casa::DDDObject::convertCoordinateSystem ( DisplayCoordinateSystem cSys,
WorldCanvas wcPtr 
) const
protected

Convert DisplayCoordinateSystem to screen pixels.

virtual casacore::Record casa::DDDObject::description ( )
virtual

Return a record describing this object.

Reimplemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

virtual void casa::DDDObject::draw ( const Display::RefreshReason reason,
WorldCanvas worldcanvas 
)
pure virtual

Draw this DrawingDisplayData object for the given reason on the provided WorldCanvas.

Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

casacore::Bool casa::DDDObject::inPolygon ( const casacore::Matrix< casacore::Double > &  points,
casacore::Double  x,
casacore::Double  y 
)
protected

Is point inside the polygon.

casacore::Bool casa::DDDObject::inPolygon ( const casacore::Vector< casacore::Double > &  xP,
const casacore::Vector< casacore::Double > &  yP,
casacore::Double  x,
casacore::Double  y 
)
protected
casacore::Bool casa::DDDObject::isEditable ( ) const
inlineprotected

Definition at line 150 of file DDDObject.h.

References itsEditable.

casacore::Bool casa::DDDObject::isFixed ( ) const
inlineprotected

Definition at line 158 of file DDDObject.h.

References itsEditable, and itsMovable.

casacore::Bool casa::DDDObject::isMovable ( ) const
inlineprotected

Definition at line 154 of file DDDObject.h.

References itsMovable.

casacore::String casa::DDDObject::label ( ) const
inlineprotected

Return the label of this object.

Definition at line 141 of file DDDObject.h.

References itsLabel.

casacore::Int casa::DDDObject::lineWidth ( ) const
inlineprotected

Return the line width of this object.

Definition at line 146 of file DDDObject.h.

References itsLineWidth.

casacore::Int casa::DDDObject::objectID ( ) const
inline

Return the unique id of this object.

Definition at line 116 of file DDDObject.h.

References itsObjectID.

casacore::Bool casa::DDDObject::onHandle ( const casacore::Block< DDDHandle > &  handles,
casacore::Double  x,
casacore::Double  y 
)
protected

Is the point on a handle.

virtual void casa::DDDObject::operator() ( const WCRefreshEvent ev)
pure virtual

Event handlers.

The parent DrawingDisplayData will distribute events as necessary to the various DDDObjects which comprise it.

Implements casa::WCRefreshEH.

Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

virtual void casa::DDDObject::operator() ( const WCPositionEvent ev)
pure virtual

Default just prints the event to cout.

Implements casa::WCPositionEH.

Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

virtual void casa::DDDObject::operator() ( const WCMotionEvent ev)
pure virtual

default sends event to cout

Implements casa::WCMotionEH.

Implemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

void casa::DDDObject::operator= ( const DDDObject other)
protected

(Required) copy assignment.

DrawingDisplayData* casa::DDDObject::owner ( )
inlineprotected

Return the owner of this object.

Definition at line 131 of file DDDObject.h.

References itsOwner.

casacore::Matrix<casacore::Double> casa::DDDObject::rotateMatrix ( const casacore::Matrix< casacore::Double > &  points,
casacore::Double  angle 
)
protected

Rotate Matrix.

virtual void casa::DDDObject::setDescription ( const casacore::Record rec)
virtual

Update this object based on the information in the provided Record.

Reimplemented in casa::DDDEllipse, casa::DDDPolygon, and casa::DDDRectangle.

virtual void casa::DDDObject::showHandles ( const casacore::Bool  show,
const casacore::Bool  tellOwner = true 
)
virtual

Indicate whether the object should show its handles or not.

The parent DrawingDisplayData will control this, and either ask all DDDObjects to show their handles or not, via the user setting an option. This actually controls the state of whether this DDDObject is editable, so the parent DrawingDisplayData could also allow editing of only one DDDObject at a time.

virtual casacore::Bool casa::DDDObject::showingHandles ( )
inlinevirtual

Query whether the object is showing its handles.

Definition at line 95 of file DDDObject.h.

References itsShowHandles.

virtual casacore::Bool casa::DDDObject::storeClick ( const DisplayEvent ev)
virtual

Store a click in the buffer and look for a double-click event.

If one is found, then call the doubleClick function in the owning DisplayData. Returns true if a double click was detected.

void casa::DDDObject::translateMatrix ( casacore::Matrix< casacore::Double > &  points,
casacore::Double  dx,
casacore::Double  dy 
)
protected

Translate Matrix.

Member Data Documentation

casacore::Double casa::DDDObject::its2ndLastClickTime
private

Definition at line 206 of file DDDObject.h.

casacore::String casa::DDDObject::itsColor
private

Color of this object.

Definition at line 209 of file DDDObject.h.

Referenced by color().

casacore::Bool casa::DDDObject::itsEditable
private

Is this object editable.

Definition at line 201 of file DDDObject.h.

Referenced by isEditable(), and isFixed().

casacore::String casa::DDDObject::itsLabel
private

Label for this object.

Definition at line 215 of file DDDObject.h.

Referenced by label().

casacore::Double casa::DDDObject::itsLastClickTime
private

Timing for double clicks.

Definition at line 206 of file DDDObject.h.

casacore::Int casa::DDDObject::itsLineWidth
private

Line width of the lines drawn.

Definition at line 212 of file DDDObject.h.

Referenced by lineWidth().

casacore::Bool casa::DDDObject::itsMovable
private

Is it movable.

Definition at line 203 of file DDDObject.h.

Referenced by isFixed(), and isMovable().

casacore::Int casa::DDDObject::itsObjectID
private

Unique identification for this object.

Definition at line 218 of file DDDObject.h.

Referenced by objectID().

DrawingDisplayData* casa::DDDObject::itsOwner
private

DrawingDisplayData which owns this DDDObject.

Definition at line 194 of file DDDObject.h.

Referenced by owner().

casacore::Bool casa::DDDObject::itsShowHandles
private

Whether the handles are showing, and therefore whether this DDDObject is presently editable.

Definition at line 198 of file DDDObject.h.

Referenced by showingHandles().


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