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

Implementation of aan ellipse object for DrawingDisplayData class. More...

#include <DDDPolygon.h>

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

Public Member Functions

 DDDPolygon (const casacore::Record &description, DrawingDisplayData *owner)
 Constructor taking a casacore::Record description. More...
 
virtual ~DDDPolygon ()
 Destructor. More...
 
virtual void draw (const Display::RefreshReason &reason, WorldCanvas *worldcanvas)
 Draw this rectangle object for the given reason on the provided WorldCanvas. 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 void operator() (const WCRefreshEvent &)
 Event handlers. More...
 
virtual void operator() (const WCPositionEvent &ev)
 Default just prints the event to cout. More...
 
virtual void operator() (const WCMotionEvent &ev)
 default sends event to cout More...
 
- Public Member Functions inherited from casa::DDDObject
 DDDObject (const casacore::Record &description, DrawingDisplayData *owner)
 Constructor taking a casacore::Record description. More...
 
virtual ~DDDObject ()
 Destructor. 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::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...
 
- 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

 DDDPolygon ()
 (Required) default constructor. More...
 
 DDDPolygon (const DDDPolygon &other)
 (Required) copy constructor. More...
 
void operator= (const DDDPolygon &other)
 (Required) copy assignment. More...
 
- Protected Member Functions inherited from casa::DDDObject
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 Member Functions

void convertToPixel ()
 COnvert parameters from world to pixel. More...
 
void updateWorldValues ()
 Update private world parameters from current pixel values. More...
 
void decode (const casacore::RecordInterface &description, casacore::Bool required)
 Decode record into private data. More...
 
void encode (casacore::RecordInterface &description) const
 Encode private data into record. More...
 
void createCorners ()
 compute corners of rectangle of bounding box of polygon More...
 
void createHandles ()
 create handles, one per vertex More...
 
void listWorld ()
 Debugging routines. More...
 
void listPixel ()
 

Private Attributes

casacore::Bool itsOutline
 Fill style. More...
 
casacore::Quantum
< casacore::Vector
< casacore::Double > > 
itsWorldX
 Define x and y. More...
 
casacore::Quantum
< casacore::Vector
< casacore::Double > > 
itsWorldY
 
casacore::Vector
< casacore::Double
itsPixelX
 
casacore::Vector
< casacore::Double
itsPixelY
 
casacore::uInt itsNPoints
 
casacore::Matrix
< casacore::Double
itsCorners
 Rotated Rectangle Corners to draw in screen pixel. More...
 
casacore::Block< DDDHandleitsHandles
 casacore::List of handles More...
 
DDDObject::Mode itsMode
 Mode. More...
 
casacore::Double itsBaseMoveX
 Store for movement bases. More...
 
casacore::Double itsBaseMoveY
 
casacore::Bool itsRecompute
 In function draw(), recompute all pixel coordinates when true else use what is currently set. More...
 
casacore::LogIO itsLogger
 LOgger. More...
 
DisplayCoordinateSystem itsCoordinateSystem
 DisplayCoordinateSystem in screen pixel coordinates. More...
 
WorldCanvasitsWorldCanvasPtr
 pointer to world canvas (shallow copy) More...
 
casacore::Bool itsFracX
 Fractional indicators. More...
 
casacore::Bool itsFracY
 

Additional Inherited Members

- Public Types inherited from casa::DDDObject
enum  Mode {
  None,
  Handle,
  Move,
  Rotate
}
 

Detailed Description

Implementation of aan ellipse object for DrawingDisplayData class.

Synopsis

This class implements the interface defined by DDDObject, to provide a polygon object for registration with DrawingDisplayData objects.

Definition at line 66 of file DDDPolygon.h.

Constructor & Destructor Documentation

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

Constructor taking a casacore::Record description.

Fields in the record, on top of what is consumed by the DDDObject constructor, are: Required : x (quantum of vector double) and y (quantum of vector double). Other, not required fields are outline & editable which default to true. When editable=false the object can be moved but not reshaped, when true it can be moved and reshaped. When outline=false the ellipse is filled.

virtual casa::DDDPolygon::~DDDPolygon ( )
virtual

Destructor.

casa::DDDPolygon::DDDPolygon ( )
protected

(Required) default constructor.

casa::DDDPolygon::DDDPolygon ( const DDDPolygon other)
protected

(Required) copy constructor.

Member Function Documentation

void casa::DDDPolygon::convertToPixel ( )
private

COnvert parameters from world to pixel.

void casa::DDDPolygon::createCorners ( )
private

compute corners of rectangle of bounding box of polygon

void casa::DDDPolygon::createHandles ( )
private

create handles, one per vertex

void casa::DDDPolygon::decode ( const casacore::RecordInterface description,
casacore::Bool  required 
)
private

Decode record into private data.

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

Return a record describing this object.

Presently returns only construction description.

Reimplemented from casa::DDDObject.

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

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

Implements casa::DDDObject.

void casa::DDDPolygon::encode ( casacore::RecordInterface description) const
private

Encode private data into record.

void casa::DDDPolygon::listPixel ( )
private
void casa::DDDPolygon::listWorld ( )
private

Debugging routines.

virtual void casa::DDDPolygon::operator() ( const WCRefreshEvent )
inlinevirtual

Event handlers.

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

Implements casa::DDDObject.

Definition at line 100 of file DDDPolygon.h.

virtual void casa::DDDPolygon::operator() ( const WCPositionEvent ev)
virtual

Default just prints the event to cout.

Implements casa::DDDObject.

virtual void casa::DDDPolygon::operator() ( const WCMotionEvent ev)
virtual

default sends event to cout

Implements casa::DDDObject.

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

(Required) copy assignment.

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

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

Reimplemented from casa::DDDObject.

void casa::DDDPolygon::updateWorldValues ( )
private

Update private world parameters from current pixel values.

Member Data Documentation

casacore::Double casa::DDDPolygon::itsBaseMoveX
private

Store for movement bases.

Definition at line 144 of file DDDPolygon.h.

casacore::Double casa::DDDPolygon::itsBaseMoveY
private

Definition at line 144 of file DDDPolygon.h.

DisplayCoordinateSystem casa::DDDPolygon::itsCoordinateSystem
private

DisplayCoordinateSystem in screen pixel coordinates.

Definition at line 156 of file DDDPolygon.h.

casacore::Matrix<casacore::Double> casa::DDDPolygon::itsCorners
private

Rotated Rectangle Corners to draw in screen pixel.

Definition at line 132 of file DDDPolygon.h.

casacore::Bool casa::DDDPolygon::itsFracX
private

Fractional indicators.

Definition at line 162 of file DDDPolygon.h.

casacore::Bool casa::DDDPolygon::itsFracY
private

Definition at line 162 of file DDDPolygon.h.

casacore::Block<DDDHandle> casa::DDDPolygon::itsHandles
private

casacore::List of handles

Definition at line 136 of file DDDPolygon.h.

casacore::LogIO casa::DDDPolygon::itsLogger
private

LOgger.

Definition at line 153 of file DDDPolygon.h.

DDDObject::Mode casa::DDDPolygon::itsMode
private

Mode.

Definition at line 140 of file DDDPolygon.h.

casacore::uInt casa::DDDPolygon::itsNPoints
private

Definition at line 129 of file DDDPolygon.h.

casacore::Bool casa::DDDPolygon::itsOutline
private

Fill style.

Definition at line 124 of file DDDPolygon.h.

casacore::Vector<casacore::Double> casa::DDDPolygon::itsPixelX
private

Definition at line 128 of file DDDPolygon.h.

casacore::Vector<casacore::Double> casa::DDDPolygon::itsPixelY
private

Definition at line 128 of file DDDPolygon.h.

casacore::Bool casa::DDDPolygon::itsRecompute
private

In function draw(), recompute all pixel coordinates when true else use what is currently set.

Definition at line 149 of file DDDPolygon.h.

WorldCanvas* casa::DDDPolygon::itsWorldCanvasPtr
private

pointer to world canvas (shallow copy)

Definition at line 159 of file DDDPolygon.h.

casacore::Quantum<casacore::Vector<casacore::Double> > casa::DDDPolygon::itsWorldX
private

Define x and y.

Definition at line 127 of file DDDPolygon.h.

casacore::Quantum<casacore::Vector<casacore::Double> > casa::DDDPolygon::itsWorldY
private

Definition at line 127 of file DDDPolygon.h.


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