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

All regions are specified in "linear coordinates", not "pixel coordinates". More...

#include <Rectangle.h>

Inheritance diagram for casa::viewer::Rectangle:
casa::viewer::Region casa::viewer::dtorNotifier casa::viewer::Ellipse casa::viewer::Point

List of all members.

Public Member Functions

 ~Rectangle ()
 Rectangle (WorldCanvas *wc, QtRegionDock *d, double x1, double y1, double x2, double y2, bool hold_signals=false)
 Rectangle (QtRegionSourceKernel *rs, WorldCanvas *wc, double x1, double y1, double x2, double y2, bool hold_signals=false)
 carry over from QtRegion...
bool clickWithin (double x, double y) const
int clickHandle (double x, double y) const
bool doubleClick (double, double)
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)
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)
void linearCenter (double &x, double &y) const
void pixelCenter (double &x, double &y) const
AnnotationBaseannotation () const
virtual bool flag (MSAsRaster *msar)
void boundingRectangle (double &blcx, double &blcy, double &trcx, double &trcy) const
 in "linear" coordinates...
void output (ds9writer &out) const
region::RegionTypes type () const
 fetch region type...

Protected Member Functions

 Rectangle (const std::string &name, WorldCanvas *wc, QtRegionDock *d, double x1, double y1, double x2, double y2, bool hold_signals=false, QtMouseToolNames::PointRegionSymbols sym=QtMouseToolNames::SYM_UNKNOWN)
RegionInfo::stats_tget_ms_stats (MSAsRaster *msar, double x, double y)
void generate_nonimage_statistics (DisplayData *, std::list< RegionInfo > *)
std::list
< std::tr1::shared_ptr
< RegionInfo > > * 
generate_dds_centers ()
ImageRegionget_image_region (DisplayData *) const
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
void drawRegion (bool)
virtual void setCenter (double &x, double &y, double &deltx, double &delty)

Protected Attributes

double blc_x
double blc_y
double trc_x
double trc_y
double center_x_
double center_y_
double center_delta_x_
double center_delta_y_
double handle_delta_x
double handle_delta_y

Private Member Functions

bool within_vertex_handle (double x, double y) const
unsigned int check_handle (double x, double y) const

Detailed Description

All regions are specified in "linear coordinates", not "pixel coordinates".

This is necessary because "linear coordinates" scale with zooming whereas "pixel coordinates" do not. Unfortunately, this means that coordinate transformation is required each time the region is drawn.

Definition at line 52 of file Rectangle.h.


Constructor & Destructor Documentation

casa::viewer::Rectangle::Rectangle ( WorldCanvas wc,
QtRegionDock d,
double  x1,
double  y1,
double  x2,
double  y2,
bool  hold_signals = false 
)
casa::viewer::Rectangle::Rectangle ( QtRegionSourceKernel rs,
WorldCanvas wc,
double  x1,
double  y1,
double  x2,
double  y2,
bool  hold_signals = false 
)

carry over from QtRegion...

hopefully, removed soon...

casa::viewer::Rectangle::Rectangle ( const std::string &  name,
WorldCanvas wc,
QtRegionDock d,
double  x1,
double  y1,
double  x2,
double  y2,
bool  hold_signals = false,
QtMouseToolNames::PointRegionSymbols  sym = QtMouseToolNames::SYM_UNKNOWN 
) [inline, protected]

Definition at line 99 of file Rectangle.h.

References casa::viewer::Region::complete.


Member Function Documentation

void casa::viewer::Rectangle::boundingRectangle ( double &  blcx,
double &  blcy,
double &  trcx,
double &  trcy 
) const

in "linear" coordinates...

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

returns point state (Region::PointLocation)

Implements casa::viewer::Region.

Reimplemented in casa::viewer::Point.

int casa::viewer::Rectangle::clickHandle ( double  x,
double  y 
) const

Reimplemented in casa::viewer::Point.

bool casa::viewer::Rectangle::clickWithin ( double  x,
double  y 
) const [inline]

Reimplemented in casa::viewer::Point.

Definition at line 62 of file Rectangle.h.

References blc_x, blc_y, and trc_y.

bool casa::viewer::Rectangle::doubleClick ( double  ,
double   
)
void casa::viewer::Rectangle::drawRegion ( bool  ) [protected, virtual]
virtual void casa::viewer::Rectangle::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.

Reimplemented in casa::viewer::Point, and casa::viewer::Ellipse.

virtual bool casa::viewer::Rectangle::flag ( MSAsRaster msar) [virtual]

Reimplemented in casa::viewer::Ellipse.

std::list<std::tr1::shared_ptr<RegionInfo> >* casa::viewer::Rectangle::generate_dds_centers ( ) [protected, virtual]
void casa::viewer::Rectangle::generate_nonimage_statistics ( DisplayData ,
std::list< RegionInfo > *   
) [protected]

Reimplemented in casa::viewer::Ellipse.

Reimplemented in casa::viewer::Ellipse.

RegionInfo::stats_t* casa::viewer::Rectangle::get_ms_stats ( MSAsRaster msar,
double  x,
double  y 
) [protected]
void casa::viewer::Rectangle::linearCenter ( double &  x,
double &  y 
) const
unsigned int casa::viewer::Rectangle::mouseMovement ( double  x,
double  y,
bool  other_selected 
)

returns mouse state (Region::MouseState)

Reimplemented in casa::viewer::Point, and casa::viewer::Ellipse.

void casa::viewer::Rectangle::move ( double  dx,
double  dy 
)
int casa::viewer::Rectangle::moveHandle ( int  handle,
double  x,
double  y 
)

for rectangles, resizing can change the handle...

for rectangles, moving a handle is resizing...

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

Implements casa::viewer::Region.

void casa::viewer::Rectangle::resize ( double  ,
double   
)

Reimplemented in casa::viewer::Point.

virtual void casa::viewer::Rectangle::setCenter ( double &  x,
double &  y,
double &  deltx,
double &  delty 
) [inline, protected, virtual]

Definition at line 116 of file Rectangle.h.

References center_delta_x_, center_delta_y_, center_x_, and center_y_.

fetch region type...

Implements casa::viewer::Region.

Reimplemented in casa::viewer::Point, and casa::viewer::Ellipse.

Definition at line 96 of file Rectangle.h.

References casa::viewer::region::RectRegion.

bool casa::viewer::Rectangle::valid_translation ( double  dx,
double  dy,
double  width_delta,
double  height_delta 
) [virtual]

Implements casa::viewer::Region.

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

Member Data Documentation

double casa::viewer::Rectangle::blc_x [protected]

Definition at line 116 of file Rectangle.h.

Referenced by clickWithin().

double casa::viewer::Rectangle::blc_y [protected]

Definition at line 116 of file Rectangle.h.

Referenced by clickWithin().

Definition at line 121 of file Rectangle.h.

Referenced by setCenter().

Definition at line 121 of file Rectangle.h.

Referenced by setCenter().

Definition at line 120 of file Rectangle.h.

Referenced by setCenter().

Definition at line 120 of file Rectangle.h.

Referenced by setCenter().

Definition at line 122 of file Rectangle.h.

Definition at line 122 of file Rectangle.h.

double casa::viewer::Rectangle::trc_x [protected]

Definition at line 119 of file Rectangle.h.

double casa::viewer::Rectangle::trc_y [protected]

Definition at line 119 of file Rectangle.h.

Referenced by clickWithin().


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