#include "StdMeshersGUI_DistrTable.h"#include <SMESHGUI_SpinBox.h>#include <QItemDelegate>#include <QTableWidget>#include <QHeaderView>#include <QPushButton>#include <QVBoxLayout>#include <QHBoxLayout>
Go to the source code of this file.
Data Structures | |
| class | StdMeshersGUI_DistrTableFrame.SpinBoxDelegate |
| Custom item delegate (uses double spin box to edit table item) More... | |
| class | StdMeshersGUI_DistrTableFrame.Table |
| Table function widget. More... | |
| struct | StdMeshersGUI_DistrTableFrame.Table.EditorData |
Defines | |
| #define | SPACING 6 |
Functions | |
| static void | sortData (QList< double > &d) |
| Sort list of points by ascending order. | |
| #define SPACING 6 |
Definition at line 39 of file StdMeshersGUI_DistrTable.cxx.
| static void sortData | ( | QList< double > & | d | ) | [static] |
Sort list of points by ascending order.
Definition at line 45 of file StdMeshersGUI_DistrTable.cxx.
Referenced by StdMeshersGUI_DistrTableFrame.data(), and StdMeshersGUI_DistrTableFrame.setData().
{
typedef QPair<double, double> Pair;
QList<Pair> pairs;
for ( int i = 0; i < d.count() / 2; i++ )
pairs.append( Pair( d[i*2], d[i*2+1] ) );
qSort( pairs );
d.clear();
Pair p;
double prevX = 0.0, prevY = 0.0;
d.append( prevX );
d.append( pairs.count() > 0 ? pairs[0].second : prevY );
foreach( p, pairs ) {
if ( p.first > prevX ) {
d.append( p.first );
d.append( p.second );
prevY = p.second;
}
prevX = p.first;
}
if ( prevX < 1.0 ) {
d.append( 1.0 );
d.append( prevY );
}
}