casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Static Public Member Functions | Static Public Attributes
casa::RSUtils Class Reference

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

#include <RSUtils.qo.h>

List of all members.

Static Public Member Functions

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

Static Public Attributes

static const String PIXEL
 Pixel coordinate system.

Detailed Description

Common utilities/constants for region shapes.

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


Member Function Documentation

static void casa::RSUtils::appendUniqueMessage ( stringstream &  ss,
const 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 String message 
) [inline, static]

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

References appendUniqueMessage().

static void casa::RSUtils::appendUniqueMessage ( String ss,
const String message 
) [static]
static void casa::RSUtils::appendUniqueMessage ( String ss,
const String message 
) [inline, static]

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

References appendUniqueMessage().

static QtColorWidget* casa::RSUtils::colorWidget ( bool  showButton = false,
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 Quantum< Vector< Double > > &  from,
MDirection::Types  fromSys,
Quantum< Vector< Double > > &  to,
MDirection::Types  toSys 
) [static]

Converts between coordinate systems.

The result has unit RegionShape::UNIT.

static bool casa::RSUtils::hasDirectionCoordinate ( const CoordinateSystem 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) [inline, static]

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

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

static bool casa::RSUtils::hasDirectionCoordinate ( const WorldCanvasHolder wch) [inline, static]
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 Vector< double > &  linearX,
const Vector< double > &  linearY,
Vector< double > &  pixelX,
Vector< double > &  pixelY,
WorldCanvasHolder wch,
String error = NULL 
) [static]

Referenced by screenToPixel().

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

Referenced by linearToWorld(), and screenToWorld().

static bool casa::RSUtils::linearToWorld ( const Vector< double > &  linearX,
const Vector< double > &  linearY,
Quantum< Vector< double > > &  worldX,
Quantum< Vector< double > > &  worldY,
WorldCanvasHolder wch,
MDirection::Types  toSys,
String error = NULL 
) [inline, static]

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

References linearToWorld().

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

Referenced by pixelToScreen().

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

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

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

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

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

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

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

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

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

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

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

References linearToWorld(), screenToLinear(), and casa::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]

Returns the world system type for the given coordinate system.

Referenced by worldSystem().

static MDirection::Types casa::RSUtils::worldSystem ( const WorldCanvas wc) [inline, static]

Returns the world system type for the given WorldCanvas.

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

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

static MDirection::Types casa::RSUtils::worldSystem ( const WorldCanvasHolder wch) [inline, static]

Returns the world system type for the given WorldCanvasHolder.

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

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

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

Referenced by worldToScreen().

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

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

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 String is given, it will be used to record errors when the method returns false.

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

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

References linearToScreen(), and worldToLinear().


Member Data Documentation

const String casa::RSUtils::PIXEL [static]

Pixel coordinate system.

Used for converting between different systems, etc.

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

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


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