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

Common utilities/constants for region shapes. More...

#include <RSUtils.qo.h>

Static Public Member Functions

static QHBoxLayout * hlayout (QWidget *parent=NULL)
 Returns a new layout with the given parent, and calls setupLayout on it;. More...
 
static QVBoxLayout * vlayout (QWidget *parent=NULL)
 
static void setupLayout (QLayout *layout)
 Sets up the given layout by setting: 1) margins to 0, 2) spacing to 3. More...
 
static QWidget * hline ()
 Returns a horizontal or vertical line (QFrame). More...
 
static QWidget * vline ()
 
static QtColorWidgetcolorWidget (bool showButton=false, casacore::String setColor="", QWidget *parent=NULL)
 Returns a new color widget. More...
 
static bool hasDirectionCoordinate (const DisplayCoordinateSystem &cs)
 Returns whether or not the given coordinate system has a direction coordinate or not. More...
 
static bool hasDirectionCoordinate (const WorldCanvas *wc)
 
static bool hasDirectionCoordinate (const WorldCanvasHolder &wch)
 
static casacore::MDirection::Types worldSystem (const DisplayCoordinateSystem &cs)
 Returns the world system type for the given coordinate system. More...
 
static casacore::MDirection::Types worldSystem (const WorldCanvas *wc)
 Returns the world system type for the given WorldCanvas. More...
 
static casacore::MDirection::Types worldSystem (const WorldCanvasHolder &wch)
 Returns the world system type for the given WorldCanvasHolder. More...
 
static bool convertWCS (const casacore::Quantum< casacore::Vector< double > > &from, casacore::MDirection::Types fromSys, casacore::Quantum< casacore::Vector< double > > &to, casacore::MDirection::Types toSys)
 Converts between coordinate systems. More...
 
static bool worldToPixel (const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
 Converts the given coordinates between different systems, using the given WorldCanvas and world system (if applicable). More...
 
static bool pixelToWorld (const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, bool wrap=true, casacore::String *error=NULL)
 
static bool worldToLinear (const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
 
static bool pixelToLinear (const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static bool linearToScreen (const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static bool worldToScreen (const casacore::Quantum< casacore::Vector< double > > &worldX, const casacore::Quantum< casacore::Vector< double > > &worldY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::MDirection::Types fromSys, bool wrap=true, casacore::String *error=NULL)
 
static bool pixelToScreen (const casacore::Vector< double > &pixelX, const casacore::Vector< double > &pixelY, casacore::Vector< double > &screenX, casacore::Vector< double > &screenY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static bool screenToLinear (const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Vector< double > &linearX, casacore::Vector< double > &linearY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static bool linearToWorld (const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, const std::vector< int > &xSign, const std::vector< int > &ySign, bool wrap=true, casacore::String *error=NULL)
 
static bool linearToWorld (const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, casacore::String *error=NULL)
 
static bool linearToPixel (const casacore::Vector< double > &linearX, const casacore::Vector< double > &linearY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static bool screenToWorld (const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, casacore::String *error=NULL)
 
static bool screenToWorld (const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Quantum< casacore::Vector< double > > &worldX, casacore::Quantum< casacore::Vector< double > > &worldY, WorldCanvasHolder &wch, casacore::MDirection::Types toSys, const std::vector< int > &xSign, const std::vector< int > &ySign, casacore::String *error=NULL)
 
static bool screenToPixel (const casacore::Vector< double > &screenX, const casacore::Vector< double > &screenY, casacore::Vector< double > &pixelX, casacore::Vector< double > &pixelY, WorldCanvasHolder &wch, casacore::String *error=NULL)
 
static void appendUniqueMessage (stringstream &ss, const casacore::String &message)
 Appends the given message to the given stream, if the stream does not already contain an identical message. More...
 
static void appendUniqueMessage (stringstream *ss, const casacore::String &message)
 
static void appendUniqueMessage (casacore::String &ss, const casacore::String &message)
 
static void appendUniqueMessage (casacore::String *ss, const casacore::String &message)
 

Static Public Attributes

static const casacore::String PIXEL
 Pixel coordinate system. More...
 

Detailed Description

Common utilities/constants for region shapes.

Definition at line 49 of file RSUtils.qo.h.

Member Function Documentation

static void casa::RSUtils::appendUniqueMessage ( stringstream &  ss,
const casacore::String message 
)
static

Appends the given message to the given stream, if the stream does not already contain an identical message.

Messages are newline-separated.

Referenced by appendUniqueMessage().

static void casa::RSUtils::appendUniqueMessage ( stringstream *  ss,
const casacore::String message 
)
inlinestatic

Definition at line 240 of file RSUtils.qo.h.

References appendUniqueMessage().

static void casa::RSUtils::appendUniqueMessage ( casacore::String ss,
const casacore::String message 
)
static
static void casa::RSUtils::appendUniqueMessage ( casacore::String ss,
const casacore::String message 
)
inlinestatic

Definition at line 244 of file RSUtils.qo.h.

References appendUniqueMessage().

static QtColorWidget* casa::RSUtils::colorWidget ( bool  showButton = false,
casacore::String  setColor = "",
QWidget *  parent = NULL 
)
static

Returns a new color widget.

If margins and spacing are given, they are applied to the widget. If a frame is given, the widget is inserted into the frame.

static bool casa::RSUtils::convertWCS ( const casacore::Quantum< casacore::Vector< double > > &  from,
casacore::MDirection::Types  fromSys,
casacore::Quantum< casacore::Vector< double > > &  to,
casacore::MDirection::Types  toSys 
)
static

Converts between coordinate systems.

The result has unit RegionShape::UNIT.

static bool casa::RSUtils::hasDirectionCoordinate ( const DisplayCoordinateSystem cs)
static

Returns whether or not the given coordinate system has a direction coordinate or not.

Referenced by hasDirectionCoordinate().

static bool casa::RSUtils::hasDirectionCoordinate ( const WorldCanvas wc)
inlinestatic

Definition at line 86 of file RSUtils.qo.h.

References casa::WorldCanvas::coordinateSystem(), and hasDirectionCoordinate().

static bool casa::RSUtils::hasDirectionCoordinate ( const WorldCanvasHolder wch)
inlinestatic
static QHBoxLayout* casa::RSUtils::hlayout ( QWidget *  parent = NULL)
static

Returns a new layout with the given parent, and calls setupLayout on it;.

static QWidget* casa::RSUtils::hline ( )
static

Returns a horizontal or vertical line (QFrame).

static bool casa::RSUtils::linearToPixel ( const casacore::Vector< double > &  linearX,
const casacore::Vector< double > &  linearY,
casacore::Vector< double > &  pixelX,
casacore::Vector< double > &  pixelY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
static

Referenced by screenToPixel().

static bool casa::RSUtils::linearToScreen ( const casacore::Vector< double > &  linearX,
const casacore::Vector< double > &  linearY,
casacore::Vector< double > &  screenX,
casacore::Vector< double > &  screenY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
static
static bool casa::RSUtils::linearToWorld ( const casacore::Vector< double > &  linearX,
const casacore::Vector< double > &  linearY,
casacore::Quantum< casacore::Vector< double > > &  worldX,
casacore::Quantum< casacore::Vector< double > > &  worldY,
WorldCanvasHolder wch,
casacore::MDirection::Types  toSys,
const std::vector< int > &  xSign,
const std::vector< int > &  ySign,
bool  wrap = true,
casacore::String error = NULL 
)
static
static bool casa::RSUtils::linearToWorld ( const casacore::Vector< double > &  linearX,
const casacore::Vector< double > &  linearY,
casacore::Quantum< casacore::Vector< double > > &  worldX,
casacore::Quantum< casacore::Vector< double > > &  worldY,
WorldCanvasHolder wch,
casacore::MDirection::Types  toSys,
casacore::String error = NULL 
)
inlinestatic

Definition at line 185 of file RSUtils.qo.h.

References linearToWorld().

static bool casa::RSUtils::pixelToLinear ( const casacore::Vector< double > &  pixelX,
const casacore::Vector< double > &  pixelY,
casacore::Vector< double > &  linearX,
casacore::Vector< double > &  linearY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
static

Referenced by pixelToScreen().

static bool casa::RSUtils::pixelToScreen ( const casacore::Vector< double > &  pixelX,
const casacore::Vector< double > &  pixelY,
casacore::Vector< double > &  screenX,
casacore::Vector< double > &  screenY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
inlinestatic

Definition at line 163 of file RSUtils.qo.h.

References linearToScreen(), pixelToLinear(), and casacore::ArrayBase::size().

static bool casa::RSUtils::pixelToWorld ( const casacore::Vector< double > &  pixelX,
const casacore::Vector< double > &  pixelY,
casacore::Quantum< casacore::Vector< double > > &  worldX,
casacore::Quantum< casacore::Vector< double > > &  worldY,
WorldCanvasHolder wch,
casacore::MDirection::Types  toSys,
bool  wrap = true,
casacore::String error = NULL 
)
static
static bool casa::RSUtils::screenToLinear ( const casacore::Vector< double > &  screenX,
const casacore::Vector< double > &  screenY,
casacore::Vector< double > &  linearX,
casacore::Vector< double > &  linearY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
static
static bool casa::RSUtils::screenToPixel ( const casacore::Vector< double > &  screenX,
const casacore::Vector< double > &  screenY,
casacore::Vector< double > &  pixelX,
casacore::Vector< double > &  pixelY,
WorldCanvasHolder wch,
casacore::String error = NULL 
)
inlinestatic

Definition at line 225 of file RSUtils.qo.h.

References linearToPixel(), screenToLinear(), and casacore::ArrayBase::size().

static bool casa::RSUtils::screenToWorld ( const casacore::Vector< double > &  screenX,
const casacore::Vector< double > &  screenY,
casacore::Quantum< casacore::Vector< double > > &  worldX,
casacore::Quantum< casacore::Vector< double > > &  worldY,
WorldCanvasHolder wch,
casacore::MDirection::Types  toSys,
casacore::String error = NULL 
)
inlinestatic

Definition at line 200 of file RSUtils.qo.h.

References linearToWorld(), screenToLinear(), and casacore::ArrayBase::size().

static bool casa::RSUtils::screenToWorld ( const casacore::Vector< double > &  screenX,
const casacore::Vector< double > &  screenY,
casacore::Quantum< casacore::Vector< double > > &  worldX,
casacore::Quantum< casacore::Vector< double > > &  worldY,
WorldCanvasHolder wch,
casacore::MDirection::Types  toSys,
const std::vector< int > &  xSign,
const std::vector< int > &  ySign,
casacore::String error = NULL 
)
inlinestatic

Definition at line 212 of file RSUtils.qo.h.

References linearToWorld(), screenToLinear(), and casacore::ArrayBase::size().

static void casa::RSUtils::setupLayout ( QLayout *  layout)
static

Sets up the given layout by setting: 1) margins to 0, 2) spacing to 3.

static QVBoxLayout* casa::RSUtils::vlayout ( QWidget *  parent = NULL)
static
static QWidget* casa::RSUtils::vline ( )
static
static casacore::MDirection::Types casa::RSUtils::worldSystem ( const DisplayCoordinateSystem cs)
static

Returns the world system type for the given coordinate system.

Referenced by worldSystem().

static casacore::MDirection::Types casa::RSUtils::worldSystem ( const WorldCanvas wc)
inlinestatic

Returns the world system type for the given WorldCanvas.

Definition at line 98 of file RSUtils.qo.h.

References casa::WorldCanvas::coordinateSystem(), and worldSystem().

static casacore::MDirection::Types casa::RSUtils::worldSystem ( const WorldCanvasHolder wch)
inlinestatic

Returns the world system type for the given WorldCanvasHolder.

Definition at line 103 of file RSUtils.qo.h.

References casa::WorldCanvas::coordinateSystem(), casa::WorldCanvasHolder::worldCanvas(), and worldSystem().

static bool casa::RSUtils::worldToLinear ( const casacore::Quantum< casacore::Vector< double > > &  worldX,
const casacore::Quantum< casacore::Vector< double > > &  worldY,
casacore::Vector< double > &  linearX,
casacore::Vector< double > &  linearY,
WorldCanvasHolder wch,
casacore::MDirection::Types  fromSys,
bool  wrap = true,
casacore::String error = NULL 
)
static
static bool casa::RSUtils::worldToPixel ( const casacore::Quantum< casacore::Vector< double > > &  worldX,
const casacore::Quantum< casacore::Vector< double > > &  worldY,
casacore::Vector< double > &  pixelX,
casacore::Vector< double > &  pixelY,
WorldCanvasHolder wch,
casacore::MDirection::Types  fromSys,
bool  wrap = true,
casacore::String error = NULL 
)
static

Converts the given coordinates between different systems, using the given WorldCanvas and world system (if applicable).

casacore::Input world values are expected to have unit RegionShape::UNIT; output world values always have unit RegionShape::UNIT. Methods that have a "wrap" flag will check the sign of the values when converting between different world coordinate systems, and wrap the values to have the same sign. If a casacore::String is given, it will be used to record errors when the method returns false.

Referenced by casa::RegionShape::worldToPixel().

static bool casa::RSUtils::worldToScreen ( const casacore::Quantum< casacore::Vector< double > > &  worldX,
const casacore::Quantum< casacore::Vector< double > > &  worldY,
casacore::Vector< double > &  screenX,
casacore::Vector< double > &  screenY,
WorldCanvasHolder wch,
casacore::MDirection::Types  fromSys,
bool  wrap = true,
casacore::String error = NULL 
)
inlinestatic

Definition at line 152 of file RSUtils.qo.h.

References linearToScreen(), and worldToLinear().

Member Data Documentation

const casacore::String casa::RSUtils::PIXEL
static

Pixel coordinate system.

Used for converting between different systems, etc.

Definition at line 79 of file RSUtils.qo.h.

Referenced by casa::QtEditRegionShape::systems().


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