23 #include "KDChartNormalPlotter_p.h"
25 #include "PaintingHelpers_p.h"
32 NormalPlotter::NormalPlotter(
Plotter*
d )
45 return plotterCompressor().dataBoundaries();
47 return compressor().dataBoundaries();
52 reverseMapper().clear();
56 const int colCount = compressor().modelDataColumns();
57 const int rowCount = compressor().modelDataRows();
63 for (
int dataset = 0; dataset < plotterCompressor().datasetCount(); ++dataset )
65 LineAttributesInfoList lineList;
71 const QModelIndex sourceIndex = attributesModel()->mapToSource( point.
index );
75 if ( ISNAN( point.
key ) || ISNAN( point.
value ) )
92 if ( !point.
hidden && PaintingHelpers::isFinite( b ) ) {
94 const QPointF c( plane->
translate( QPointF( lastPoint.
key, 0.0 ) ) );
95 const QPointF
d( plane->
translate( QPointF( point.
key, 0.0 ) ) );
102 const bool lineValid = a.toPoint() != b.toPoint() && PaintingHelpers::isFinite( a );
105 lineList.append( LineAttributesInfo( sourceIndex, a, b ) );
111 polygon << a << b <<
d << c;
114 attributesModel()->mapToSource( lastPoint.
index ),
128 if ( colCount == 0 || rowCount == 0 )
130 for (
int column = 0; column < colCount; ++column )
132 LineAttributesInfoList lineList;
133 CartesianDiagramDataCompressor::DataPoint lastPoint;
135 for (
int row = 0; row < rowCount; ++row )
137 const CartesianDiagramDataCompressor::CachePosition position( row, column );
138 const CartesianDiagramDataCompressor::DataPoint point = compressor().data( position );
140 const QModelIndex sourceIndex = attributesModel()->mapToSource( point.index );
144 if ( ISNAN( point.key ) || ISNAN( point.value ) )
153 lastPoint = CartesianDiagramDataCompressor::DataPoint();
159 const QPointF b( plane->
translate( QPointF( point.key, point.value ) ) );
161 if ( !point.hidden && PaintingHelpers::isFinite( b ) ) {
162 const QPointF a( plane->
translate( QPointF( lastPoint.key, lastPoint.value ) ) );
163 const QPointF c( plane->
translate( QPointF( lastPoint.key, 0.0 ) ) );
164 const QPointF
d( plane->
translate( QPointF( point.key, 0.0 ) ) );
171 const bool lineValid = a.toPoint() != b.toPoint() && PaintingHelpers::isFinite( a );
174 lineList.append( LineAttributesInfo( sourceIndex, a, b ) );
180 polygon << a << b <<
d << c;
183 attributesModel()->mapToSource( lastPoint.index ),