Source
QwtSymbol* sym = new QwtSymbol( QwtSymbol::Cross, QBrush(Qt::black), QPen( Qt::black), QSize(5,5));
//# Copyright (C) 1994,1995,1996,1997,1998,1999,2000
//# 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
//#
using namespace casacore;
namespace casa {
ImageSlice::ImageSlice( int id, QWidget* parent ): QFrame(parent) {
ui.setupUi(this);
regionId = id;
sliceWorker = new SliceWorker( id );
useViewerColors = true;
showCorners = false;
polylineUnit = true;
selected = false;
segmentColors.append(Qt::magenta);
curveWidth = 1;
markerSize = 1;
QHBoxLayout* layout = new QHBoxLayout();
colorBar = new ImageSliceColorBar( ui.colorBarHolder );
layout->addWidget( colorBar );
layout->setContentsMargins(0,0,0,0);
ui.colorBarHolder->setLayout( layout );
maximizeDisplay();
connect( ui.openCloseButton, SIGNAL(clicked()), this, SLOT(openCloseDisplay()));
}
//------------------------------------------------------------------------
// Setters
//-------------------------------------------------------------------------
void ImageSlice::setPlotPreferences( int lineWidth, int cornerSize ) {
if ( cornerSize != markerSize ) {
markerSize = cornerSize;
int markerCount = segmentCorners.size();
for ( int i = 0; i < markerCount; i++ ) {
const QwtSymbol *sym = segmentCorners[i]->symbol();
QwtSymbol symbol(sym->style(),sym->brush(),sym->pen(),sym->size());
QwtSymbol symbol = segmentCorners[i]->symbol();
symbol.setSize( markerSize );
set_symbol( segmentCorners[i], symbol );
}
}
if ( lineWidth != curveWidth ) {
curveWidth = lineWidth;
int segmentCount = segments.size();
for ( int i = 0; i < segmentCount; i++ ) {
segments[i]->setCurveWidth( curveWidth );
}
}
}