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

#include <Polygon.h>

Inheritance diagram for casa::viewer::Polygon:
casa::viewer::Region casa::viewer::dtorNotifier

List of all members.

Public Types

typedef std::pair< double, double > pt
typedef std::vector< ptpoint_list

Public Member Functions

 Polygon (WorldCanvas *wc, QtRegionDock *d, double x1, double y1)
 Polygon (WorldCanvas *wc, QtRegionDock *d, const std::vector< std::pair< double, double > > &pts)
 Polygon (QtRegionSourceKernel *, WorldCanvas *wc, const std::vector< std::pair< double, double > > &pts, bool hold_signals=false)
 carry over from QtRegion...
 Polygon (QtRegionSourceKernel *rs, WorldCanvas *wc, double x1, double y1, bool hold_signals=false)
 ~Polygon ()
bool clickWithin (double x, double y) const
int clickHandle (double x, double y) const
int moveHandle (int handle, double x, double y)
 for rectangles, resizing can change the handle...
void move (double dx, double dy)
void resize (double, double)
bool valid_translation (double dx, double dy, double width_delta, double height_delta)
region::PointInfo checkPoint (double x, double y) const
 returns point state (Region::PointLocation)
unsigned int mouseMovement (double x, double y, bool other_selected)
 returns mouse state (Region::MouseState)
void linearCenter (double &x, double &y) const
void pixelCenter (double &x, double &y) const
void closeFigure (bool signal_complete=true)
void polygonComplete ()
void addVertex (double x, double y, bool rewrite_last_point=false)
AnnotationBaseannotation () const
void boundingRectangle (double &blcx, double &blcy, double &trcx, double &trcy) const
 return the drawing bounding rectangle...
int numVertices () const
void output (ds9writer &out) const
region::RegionTypes type () const
 fetch region type...

Protected Types

enum  YScaleTo {
  ScaleTop,
  ScaleBottom
}
enum  XScaleTo {
  ScaleLeft,
  ScaleRight
}
enum  Tranformations {
  FLIP_X,
  FLIP_Y
}

Protected Member Functions

unsigned int check_handle (double x, double y) const
std::list
< std::tr1::shared_ptr
< RegionInfo > > * 
generate_dds_centers ()
ImageRegionget_image_region (DisplayData *) const
void drawRegion (bool)
virtual void fetch_region_details (region::RegionTypes &type, std::vector< std::pair< int, int > > &pixel_pts, std::vector< std::pair< double, double > > &world_pts) const
const point_listdrawing_points () const

Private Member Functions

bool within_vertex_handle (double x, double y) const
int move_sizing_rectangle_handle (int handle, double x, double y)
int move_vertex (int handle, double x, double y)
void update_drawing_bounds_rectangle ()
void update_reference_bounds_rectangle ()
void update_drawing_state ()
void update_reference_state (int transformations, int handle, int new_handle)
virtual void setCenter (double &x, double &y, double &deltx, double &delty)

Private Attributes

double handle_delta_x
double handle_delta_y
point_list _ref_points_
double _ref_blc_x_
double _ref_blc_y_
double _ref_trc_x_
double _ref_trc_y_
double _ref_width_
double _ref_height_
point_list _drawing_points_
double _drawing_blc_x_
double _drawing_blc_y_
double _drawing_trc_x_
double _drawing_trc_y_
double _drawing_width_
double _drawing_height_
double _center_x
double _center_y
double _center_delta_x
double _center_delta_y
XScaleTo _x_origin_
YScaleTo _y_origin_

Detailed Description

Definition at line 47 of file Polygon.h.


Member Typedef Documentation

typedef std::vector<pt> casa::viewer::Polygon::point_list

Definition at line 50 of file Polygon.h.

typedef std::pair<double,double> casa::viewer::Polygon::pt

Definition at line 49 of file Polygon.h.


Member Enumeration Documentation

Enumerator:
FLIP_X 
FLIP_Y 

Definition at line 109 of file Polygon.h.

Enumerator:
ScaleLeft 
ScaleRight 

Definition at line 108 of file Polygon.h.

Enumerator:
ScaleTop 
ScaleBottom 

Definition at line 107 of file Polygon.h.


Constructor & Destructor Documentation

casa::viewer::Polygon::Polygon ( WorldCanvas wc,
QtRegionDock d,
double  x1,
double  y1 
)
casa::viewer::Polygon::Polygon ( WorldCanvas wc,
QtRegionDock d,
const std::vector< std::pair< double, double > > &  pts 
)
casa::viewer::Polygon::Polygon ( QtRegionSourceKernel ,
WorldCanvas wc,
const std::vector< std::pair< double, double > > &  pts,
bool  hold_signals = false 
)

carry over from QtRegion...

hopefully, removed soon...

casa::viewer::Polygon::Polygon ( QtRegionSourceKernel rs,
WorldCanvas wc,
double  x1,
double  y1,
bool  hold_signals = false 
)

Definition at line 62 of file Polygon.h.


Member Function Documentation

void casa::viewer::Polygon::addVertex ( double  x,
double  y,
bool  rewrite_last_point = false 
)
void casa::viewer::Polygon::boundingRectangle ( double &  blcx,
double &  blcy,
double &  trcx,
double &  trcy 
) const

return the drawing bounding rectangle...

in "linear" coordinates...

unsigned int casa::viewer::Polygon::check_handle ( double  x,
double  y 
) const [protected]
region::PointInfo casa::viewer::Polygon::checkPoint ( double  x,
double  y 
) const [virtual]

returns point state (Region::PointLocation)

Implements casa::viewer::Region.

int casa::viewer::Polygon::clickHandle ( double  x,
double  y 
) const
bool casa::viewer::Polygon::clickWithin ( double  x,
double  y 
) const
void casa::viewer::Polygon::closeFigure ( bool  signal_complete = true)
const point_list& casa::viewer::Polygon::drawing_points ( ) const [inline, protected]

Definition at line 118 of file Polygon.h.

References _drawing_points_.

Referenced by numVertices().

void casa::viewer::Polygon::drawRegion ( bool  ) [protected, virtual]

Implements casa::viewer::Region.

virtual void casa::viewer::Polygon::fetch_region_details ( region::RegionTypes type,
std::vector< std::pair< int, int > > &  pixel_pts,
std::vector< std::pair< double, double > > &  world_pts 
) const [protected, virtual]

Reimplemented from casa::viewer::Region.

std::list<std::tr1::shared_ptr<RegionInfo> >* casa::viewer::Polygon::generate_dds_centers ( ) [protected, virtual]

Implements casa::viewer::Region.

void casa::viewer::Polygon::linearCenter ( double &  x,
double &  y 
) const
unsigned int casa::viewer::Polygon::mouseMovement ( double  x,
double  y,
bool  other_selected 
)

returns mouse state (Region::MouseState)

void casa::viewer::Polygon::move ( double  dx,
double  dy 
)
int casa::viewer::Polygon::move_sizing_rectangle_handle ( int  handle,
double  x,
double  y 
) [private]
int casa::viewer::Polygon::move_vertex ( int  handle,
double  x,
double  y 
) [private]
int casa::viewer::Polygon::moveHandle ( int  handle,
double  x,
double  y 
)

for rectangles, resizing can change the handle...

for rectangles, moving a handle is resizing...

int casa::viewer::Polygon::numVertices ( ) const [inline]

Definition at line 93 of file Polygon.h.

References drawing_points().

void casa::viewer::Polygon::pixelCenter ( double &  x,
double &  y 
) const [virtual]

Implements casa::viewer::Region.

void casa::viewer::Polygon::resize ( double  ,
double   
)
virtual void casa::viewer::Polygon::setCenter ( double &  x,
double &  y,
double &  deltx,
double &  delty 
) [inline, private, virtual]

Definition at line 134 of file Polygon.h.

References _center_delta_x, _center_delta_y, _center_x, and _center_y.

region::RegionTypes casa::viewer::Polygon::type ( ) const [inline, virtual]

fetch region type...

Implements casa::viewer::Region.

Definition at line 100 of file Polygon.h.

References casa::viewer::region::PolyRegion.

void casa::viewer::Polygon::update_reference_state ( int  transformations,
int  handle,
int  new_handle 
) [private]
bool casa::viewer::Polygon::valid_translation ( double  dx,
double  dy,
double  width_delta,
double  height_delta 
) [virtual]

Implements casa::viewer::Region.

bool casa::viewer::Polygon::within_vertex_handle ( double  x,
double  y 
) const [private]

Member Data Documentation

Definition at line 154 of file Polygon.h.

Referenced by setCenter().

Definition at line 154 of file Polygon.h.

Referenced by setCenter().

Definition at line 153 of file Polygon.h.

Referenced by setCenter().

Definition at line 153 of file Polygon.h.

Referenced by setCenter().

Definition at line 149 of file Polygon.h.

Definition at line 149 of file Polygon.h.

Definition at line 151 of file Polygon.h.

Definition at line 148 of file Polygon.h.

Referenced by drawing_points().

Definition at line 150 of file Polygon.h.

Definition at line 150 of file Polygon.h.

Definition at line 151 of file Polygon.h.

Definition at line 144 of file Polygon.h.

Definition at line 144 of file Polygon.h.

Definition at line 146 of file Polygon.h.

Definition at line 143 of file Polygon.h.

Definition at line 145 of file Polygon.h.

Definition at line 145 of file Polygon.h.

Definition at line 146 of file Polygon.h.

Definition at line 156 of file Polygon.h.

Definition at line 157 of file Polygon.h.

Definition at line 139 of file Polygon.h.

Definition at line 139 of file Polygon.h.


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