98 return _useUsedRows ? _usedRows : rows();
105 return _useUsedCols ? _usedCols : cols();
109bool KDChartTableDataBase::cellsHaveSeveralCoordinates(
110 TQVariant::Type* type2Ref ) const
116bool KDChartTableDataBase::cellsHaveSeveralCoordinates(
119 TQVariant::Type* type2Ref ) const
129 TQVariant::Type testType = TQVariant::Invalid;
135 for ( uint row = row1; row < r2; ++row ){
136 for ( uint col = 0; col < usedCols(); ++col ){
138 if( TQVariant::Invalid != value2.type() ){
139 if( (TQVariant::Invalid != testType) &&
149 } else if( TQVariant::Invalid != value1.type() ){
161TQVariant::Type KDChartTableDataBase::cellsValueType(
164 int coordinate ) const
166 TQVariant::Type res = TQVariant::Invalid;
172 for ( uint row = row1; row < r2; ++row )
173 for ( uint col = 0; col < usedCols(); ++col )
175 if( TQVariant::Invalid != value.type() )
181TQVariant::Type KDChartTableDataBase::cellsValueType(
182 int coordinate ) const
188double KDChartTableDataBase::maxValue( int coordinate ) const
190 double maxValue = 0.0;
194 for ( uint row = 0; row < usedRows(); row++ ) {
195 for ( uint col = 0; col < usedCols(); col++ ) {
197 TQVariant::Double == value.type() ) {
198 dVal = value.toDouble();
214double KDChartTableDataBase::minValue( int coordinate, bool bOnlyGTZero ) const
216 double minValue = 0.0;
220 for ( uint row = 0; row < usedRows(); row++ ) {
221 for ( uint col = 0; col < usedCols(); col++ ) {
223 TQVariant::Double == value.type() ) {
224 dVal = value.toDouble();
240TQDateTime KDChartTableDataBase::maxDtValue( int coordinate ) const
242 TQDateTime maxValue = TQDateTime( TQDate(1970,1,1) );
246 for ( uint row = 0; row < usedRows(); row++ ) {
247 for ( uint col = 0; col < usedCols(); col++ ) {
249 TQVariant::DateTime == value.type() ) {
250 dtVal = value.toDateTime();
264TQDateTime KDChartTableDataBase::minDtValue( int coordinate ) const
266 TQDateTime minValue = TQDateTime( TQDate(1970,1,1) );
270 for ( uint row = 0; row < usedRows(); row++ ) {
271 for ( uint col = 0; col < usedCols(); col++ ) {
273 TQVariant::DateTime == value.type() ) {
274 dtVal = value.toDateTime();
287double KDChartTableDataBase::maxColSum( int coordinate ) const
289 double maxValue = 0.0;
291 for ( uint col = 0; col < usedCols(); col++ ) {
303double KDChartTableDataBase::minColSum( int coordinate ) const
305 double minValue = 0.0;
307 for ( uint col = 0; col < usedCols(); col++ ) {
320double KDChartTableDataBase::maxColSum( uint row, uint row2, int coordinate ) const
331 for ( uint col = 0; col < usedCols(); col++ ) {
335 for ( uint row = a; row <= z; row++ ) {
337 TQVariant::Double == value.type() ) {
338 dVal = value.toDouble();
354double KDChartTableDataBase::minColSum( uint row, uint row2, int coordinate ) const
365 for ( uint col = 0; col < usedCols(); col++ ) {
369 for ( uint row = a; row <= z; row++ ) {
371 TQVariant::Double == value.type() ) {
372 dVal = value.toDouble();
388double KDChartTableDataBase::colSum( uint col, int coordinate ) const
393 for ( uint row = 0; row < usedRows(); row++ ) {
395 TQVariant::Double == value.type() ) {
396 dVal = value.toDouble();
406double KDChartTableDataBase::colAbsSum( uint col, int coordinate ) const
411 for ( uint row = 0; row < usedRows(); row++ ) {
413 TQVariant::Double == value.type() ) {
414 dVal = value.toDouble();
424double KDChartTableDataBase::maxRowSum( int coordinate ) const
426 double maxValue = 0.0;
428 for ( uint row = 0; row < usedRows(); row++ ) {
440double KDChartTableDataBase::minRowSum( int coordinate ) const
442 double minValue = 0.0;
444 for ( uint row = 0; row < usedRows(); row++ ) {
457double KDChartTableDataBase::rowSum( uint row, int coordinate ) const
462 for ( uint col = 0; col < usedCols(); col++ ) {
464 TQVariant::Double == value.type() ) {
465 dVal = value.toDouble();
474double KDChartTableDataBase::rowAbsSum( uint row, int coordinate ) const
479 for ( uint col = 0; col < usedCols(); col++ ) {
481 TQVariant::Double == value.type() ) {
482 dVal = value.toDouble();
491double KDChartTableDataBase::maxInColumn( uint col, int coordinate ) const
493 double maxValue = 0.0;
497 for ( uint row = 0; row < usedRows(); row++ ) {
499 TQVariant::Double == value.type() ) {
500 dVal = value.toDouble();
515double KDChartTableDataBase::minInColumn( uint col, int coordinate ) const
517 double minValue = 0.0;
521 for ( uint row = 0; row < usedRows(); row++ ) {
523 TQVariant::Double == value.type() ) {
524 dVal = value.toDouble();
539double KDChartTableDataBase::maxInRow( uint row, int coordinate ) const
546 for ( uint col = 0; col < usedCols(); col++ ) {
548 TQVariant::Double == value.type() ) {
549 dVal = value.toDouble();
564double KDChartTableDataBase::minInRow( uint row, int coordinate ) const
571 for ( uint col = 0; col < usedCols(); col++ ) {
573 TQVariant::Double == value.type() ) {
574 dVal = value.toDouble();
589double KDChartTableDataBase::maxInRows( uint row, uint row2, int coordinate ) const
591 double maxValue = 0.0;
602 for ( uint row = a; row <= z; ++row ) {
605 for ( uint col = 0; col < usedCols(); ++col ) {
607 TQVariant::Double == value.type() ) {
608 dVal = value.toDouble();
624double KDChartTableDataBase::minInRows( uint row, uint row2, int coordinate, bool bOnlyGTZero ) const
626 double minValue = 0.0;
637 for ( uint row = a; row <= z; ++row ) {
640 for ( uint col = 0; col < usedCols(); ++col ) {
642 TQVariant::Double == value.type() ) {
643 dVal = value.toDouble();
662TQDateTime KDChartTableDataBase::maxDtInRows( uint row, uint row2,
663 int coordinate ) const
665 TQDateTime maxValue = TQDateTime( TQDate(1970,1,1) );
674 for ( uint row = a; row <= z; ++row ) {
677 for ( uint col = 0; col < usedCols(); ++col ) {
679 TQVariant::DateTime == value.type() ) {
680 dtVal = value.toDateTime();
694TQDateTime KDChartTableDataBase::minDtInRows( uint row, uint row2,
695 int coordinate ) const
697 TQDateTime minValue = TQDateTime( TQDate(1970,1,1) );
706 for ( uint row = a; row <= z; ++row ) {
709 for ( uint col = 0; col < usedCols(); ++col ) {
711 TQVariant::DateTime == value.type() ) {
712 dtVal = value.toDateTime();
726uint KDChartTableDataBase::lastPositiveCellInColumn( uint col, int coordinate ) const
731 for ( uint row = 0; row < usedRows(); row++ ) {
733 TQVariant::Double == value.type() ) {
734 dVal = value.toDouble();
743void KDChartTableDataBase::importFromQTable( TQTable* table )
750 for( int row = 0; row < table->numRows(); row++ )
751 for( int col = 0; col < table->numCols(); col++ ) {
779#include "KDChartTableBase.moc"
Provides a table class holding all data values that are to be used in a chart.
virtual uint usedCols() const Returns the number of cols in the table that actually contain data.
virtual bool cellCoord(uint _row, uint _col, TQVariant &_value, int coordinate=1) const =0 Returns one of the coordinate data value(s) stored in a cell.
virtual bool isNormalDouble(double value) const Returns true if the given value represents a normal double value.
virtual void setSorted(bool sorted) Specified whether the table is sorted.
virtual void setUsedCols(uint _cols) Sets the number of cols in the table that actually contain data.
virtual void expand(uint _rows, uint _cols)=0 Increases the number of rows (and/or columns, resp.) stored in this table.
virtual uint cols() const =0 Returns the number of cols in the table.
virtual uint rows() const =0 Returns the number of rows in the table.
virtual bool cellCoords(uint _row, uint _col, TQVariant &_value1, TQVariant &_value2) const
virtual uint usedRows() const Returns the number of rows in the table that actually contain data.
virtual void setUsedRows(uint _rows) Sets the number of rows in the table that actually contain data.
virtual bool sorted() const Returns whether the table is sorted.
virtual void setCell(uint _row, uint _col, const TQVariant &_value1, const TQVariant &_value2=TQVariant())=0 Stores data in a cell.
|