Source
Vector<double>& screenY, WorldCanvasHolder& wch, String* error) {
//# RSUtils.h: Common utilities/constants for region shapes.
//# Copyright (C) 2008
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
using namespace casacore;
namespace casa {
// RSUTILS DEFINITIONS //
QHBoxLayout* RSUtils::hlayout(QWidget* parent) {
QHBoxLayout* l = new QHBoxLayout(parent);
setupLayout(l);
return l;
}
QVBoxLayout* RSUtils::vlayout(QWidget* parent) {
QVBoxLayout* l = new QVBoxLayout(parent);
setupLayout(l);
return l;
}
void RSUtils::setupLayout(QLayout* layout) {
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(3);
}
QWidget* RSUtils::hline() {
QFrame* line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
return line;
}
QWidget* RSUtils::vline() {
QFrame* line = new QFrame();
line->setFrameShape(QFrame::VLine);
line->setFrameShadow(QFrame::Sunken);
return line;
}
QtColorWidget* RSUtils::colorWidget(bool showButton, String setColor,
QWidget* parent) {
QtColorWidget* w = new QtColorWidget(showButton, setColor, parent);
setupLayout(w);
return w;
}
const String RSUtils::PIXEL = "PIXEL";
bool RSUtils::hasDirectionCoordinate(const DisplayCoordinateSystem& cs) {
for(unsigned int i = 0; i < cs.nCoordinates(); i++)
if(cs.type(i) == Coordinate::DIRECTION) return true;
return false;
}
MDirection::Types RSUtils::worldSystem(const DisplayCoordinateSystem& cs) {
unsigned int dind;
for(dind = 0; dind < cs.nCoordinates(); dind++)
if(cs.type(dind) == Coordinate::DIRECTION) break;
return cs.directionCoordinate(dind).directionType(true);
}