27 #include "../../../dataaccess/dataset/ObjectIdSet.h" 35 #include <qwt_symbol.h> 47 setStyle(QwtPlotCurve::NoCurve);
48 setPaintAttribute(QwtPlotCurve::FilterPoints );
52 m_selection->setPaintAttribute(QwtPlotCurve::FilterPoints);
63 newSymbol->setSize(QSize(2 , 2));
68 setSymbol(
new QwtSymbol( QwtSymbol::Ellipse, QBrush( Qt::gray ), QPen( Qt::black, 1 ), QSize( 8, 8 )));
83 m_selection->setPaintAttribute(QwtPlotCurve::FilterPoints);
87 setStyle(QwtPlotCurve::NoCurve);
88 setPaintAttribute(QwtPlotCurve::FilterPoints);
113 setSamples( samples );
153 QwtSymbol* selSymbol =
new QwtSymbol( symbol()->style(), symbol()->brush().color().darker (180 ), symbol()->pen().color().darker( 180), symbol()->size());
154 QPixmap selPixmap = symbol()->pixmap();
156 selSymbol->setPixmap(selPixmap);
165 std::set<te::da::ObjectId*, te::common::LessCmp<te::da::ObjectId*> >::const_iterator itObjSet;
166 QVector<QPointF> highlightedPoints;
168 for(itObjSet = oids->
begin(); itObjSet != oids->
end(); ++itObjSet)
170 std::pair<double, double> point =
m_scatter->
find((*itObjSet));
171 if(this->boundingRect().contains(point.first, point.second))
172 highlightedPoints.push_back(QPointF(point.first, point.second));
183 const QwtScaleMap xMap = plot()->canvasMap( xAxis() );
184 const QwtScaleMap yMap = plot()->canvasMap( yAxis() );
186 const double cx = xMap.transform( point.rx());
187 const double cy = yMap.transform( point.ry() );
189 QPoint mappedPoint = QPoint(cx, cy);
191 int index = closestPoint( mappedPoint);
193 double x = sample(index).x();
194 double y = sample(index).y();
200 QwtSeriesData<QPointF>* values = data();
201 std::vector<QPointF> selected;
203 if(rect.width() == 0 && rect.height() == 0)
204 return highlight(QPoint(rect.x(), rect.y()));
207 for(
size_t i = 0; i < values->size(); ++i)
209 if( rect.contains(values->sample(i)))
210 selected.push_back(values->sample(i));
This class represents a set of unique ids created in the same context. i.e. from the same data set...
A class to represent a scatter's chart.
A class to represent a scatter.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator end() const
Returns an iterator for the object ids in container.
std::set< ObjectId *, te::common::LessCmp< ObjectId * > >::const_iterator begin() const
Returns an iterator for the object ids in container.