#include <ArrayMap.h>
Public Member Functions | |
AbstractNameLine * | addLine () |
AbstractNameLine * | addLine (const Pen &pen, const Symbol &sym) |
ArrayMap (QWidget *parent=0, AbstractNameLine *referenceLine=0) | |
int | countPoints (double minR, double maxR) |
AbstractNameLine * | line (int index) |
NameLineLayer * | mapLayer () const |
void | optimizeRing (double &minR, double &maxR) |
void | setLimitsArray () |
void | setLimitsCoArray () |
void | setObjectName (QString name) |
~ArrayMap () |
GeopsyGui::ArrayMap::ArrayMap | ( | QWidget * | parent = 0 , |
AbstractNameLine * | referenceLine = 0 |
||
) |
References SciFigs::NameLineLayer::addLine(), SciFigs::GraphContentLayer::addTrackingAction(), SciFigs::LineLayer::setErrorBar(), SciFigs::AbstractLine::setPen(), SciFigs::Axis::setRange(), SciFigs::LineLayer::setReferenceLine(), SciFigs::Axis::setSizeInfo(), SciFigs::Axis::setSizeType(), SciFigs::AbstractLine::setSymbol(), SciFigs::Axis::setTitle(), QGpCoreTools::tr(), TRACE, SciFigs::AxisWindow::updateExternalGeometry(), SciFigs::AxisWindow::xAxis(), and SciFigs::AxisWindow::yAxis().
: AxisWindow(parent) { TRACE; ImageLayer * bg=new ImageLayer(this); bg->setObjectName("background"); bg->addTrackingAction(tr("&Set image scale"), ImageLayer::Scale, tr("Click on at least two points to scale image.")); _mapLayer=new NameLineLayer(this); _mapLayer->setErrorBar(LineLayer::NoBar); _mapLayer->setObjectName("map"); if(!referenceLine) { referenceLine=new NameLine; } referenceLine->setPen(Pen( Qt::black, 0, Qt::NoPen) ); referenceLine->setSymbol(Symbol( Symbol::Circle, 2.0, Pen(Qt::black, 0.0, Qt::NoPen), Brush(Qt::black, Qt::SolidPattern) )); _mapLayer->setReferenceLine(referenceLine); _mapLayer->addLine(); // Must have at least one line (expected by spac tool for instance) xAxis()->setTitle( "X (m)" ); xAxis()->setSizeType(Axis::Scaled); xAxis()->setSizeInfo(1000); xAxis()->setRange(0, 100); yAxis()->setTitle( "Y (m)" ); yAxis()->setSizeType(Axis::Scaled); yAxis()->setSizeInfo(1000); yAxis()->setRange(0, 100); updateExternalGeometry(); }
References SciFigs::GraphicObject::objectName, and TRACE.
{ TRACE; Settings::setSize(this, "ArrayMap"+objectName()); }
AbstractNameLine* GeopsyGui::ArrayMap::addLine | ( | ) | [inline] |
Referenced by MapWindow::signalsUpdate().
{return _mapLayer->addLine();}
AbstractNameLine * GeopsyGui::ArrayMap::addLine | ( | const Pen & | pen, |
const Symbol & | sym | ||
) | [inline] |
References SciFigs::NameLineLayer::addLine().
{ return _mapLayer->addLine(pen, sym); }
int GeopsyGui::ArrayMap::countPoints | ( | double | minR, |
double | maxR | ||
) |
AbstractNameLine* GeopsyGui::ArrayMap::line | ( | int | index | ) | [inline] |
Referenced by countPoints(), and optimizeRing().
{return _mapLayer->line(index);}
NameLineLayer* GeopsyGui::ArrayMap::mapLayer | ( | ) | const [inline] |
Referenced by MapWindow::getSelection(), MapWindow::MapWindow(), MapWindow::setLimits(), and MapWindow::signalsUpdate().
{return _mapLayer;}
void GeopsyGui::ArrayMap::optimizeRing | ( | double & | minR, |
double & | maxR | ||
) |
References SciFigs::AbstractLine::count(), SciFigs::LineLayer::count(), QGpCoreTools::Point::distanceTo(), line(), SciFigs::AbstractLine::point(), and TRACE.
{ TRACE; double newMinR=maxR, newMaxR=minR; Point origin(0, 0, 0); int n=_mapLayer->count(); for(int i=0;i < n;i++ ) { AbstractNameLine * l=line(i); int np=l->count(); for(int j=0;j < np;j++ ) { double r=origin.distanceTo(l->point(j, 0) ); if(r >= minR && r <= maxR) { if(r > newMaxR) newMaxR=r; if(r < newMinR) newMinR=r; } } } minR=newMinR; maxR=newMaxR; }
void GeopsyGui::ArrayMap::setLimitsArray | ( | ) |
References SciFigs::LineLayer::boundingRect(), QGpCoreTools::Rect::enlarge(), QGpCoreTools::LinearScale, SciFigs::AxisWindow::setMapScale(), TRACE, QGpCoreTools::Rect::x1(), QGpCoreTools::Rect::x2(), QGpCoreTools::Rect::y1(), and QGpCoreTools::Rect::y2().
{ TRACE; Rect r=_mapLayer->boundingRect(); r.enlarge(0.05, LinearScale, LinearScale); setMapScale(r.x1(), r.y1(), r.x2(), r.y2()); }
void GeopsyGui::ArrayMap::setObjectName | ( | QString | name | ) | [virtual] |
Re-implemetation of QWidget::setObjectName(const char * name) It is used to avoid duplicate names inside the same GraphicSheet
Reimplemented from SciFigs::GraphicObject.
References TRACE.
Referenced by MapWindow::MapWindow().
{ TRACE; QWidget::setObjectName(name); Settings::getSize(this, "ArrayMap"+name); }