9 #include <qwt_legend.h>
10 #include <qwt3d_plot.h>
12 using namespace Qwt3D;
17 : QMainWindow(
p, Qt::Dialog )
24 setWindowTitle( tr(
"XYZ Data 3-Dimensional Viewer" ) );
27 setAttribute( Qt::WA_DeleteOnClose,
true );
30 QSize p1size( 960, 720 );
38 setCentralWidget(
frame );
69 poffsSlider->setTickPosition( QSlider::TicksAbove );
70 resolSlider->setTickPosition( QSlider::TicksAbove );
77 poffsSlider->setStatusTip( tr(
"Polygon Offset increase surface quality)" ));
78 resolSlider->setStatusTip( tr(
"Data Resolution (rectangular data)" ) );
79 normqSlider->setStatusTip( tr(
"Normals Quality (Roundness)" ) );
80 normlSlider->setStatusTip( tr(
"Normals Length" ) );
86 ck_ortho =
new QCheckBox( tr(
"Ortho" ) );
87 ck_legend =
new QCheckBox( tr(
"Legend" ) );
88 ck_autosc =
new QCheckBox( tr(
"Autoscale" ) );
89 ck_mouse =
new QCheckBox( tr(
"Mouse" ) );
90 ck_shade =
new QCheckBox( tr(
"Shading" ) );
98 ck_ortho ->setAutoFillBackground(
true );
101 ck_legend->setAutoFillBackground(
true );
104 ck_autosc->setAutoFillBackground(
true );
107 ck_mouse ->setAutoFillBackground(
true );
110 ck_shade ->setAutoFillBackground(
true );
112 QLabel* normLabl =
new QLabel( tr(
"Normals" ) );
123 pb_std =
new QPushButton( tr(
"Std" ) );
124 pb_light =
new QPushButton( tr(
"Lighting" ) );
126 pb_std ->setToolTip( tr(
"Standard View" ) );
127 pb_light->setToolTip( tr(
"Calibrate Lighting" ) );
128 ck_light->setToolTip( tr(
"Lighting On/Off" ) );
129 pb_std ->setStatusTip( tr(
"Set standard view" ) );
130 pb_light->setStatusTip( tr(
"Calibrate Lighting" ) );
131 ck_light->setStatusTip( tr(
"Turn Lighting On/Off" ) );
134 ck_light ->setAutoFillBackground(
true );
136 QLabel* offsLabl =
new QLabel( tr(
"Polygon Offset" ) );
137 QLabel* resoLabl =
new QLabel( tr(
"Resolution" ) );
138 QLabel* dumyLabl =
new QLabel(
" " );
139 offsLabl->setAlignment( Qt::AlignVCenter | Qt::AlignHCenter );
140 resoLabl->setAlignment( Qt::AlignVCenter | Qt::AlignHCenter );
160 statusBar()->showMessage( tr(
"status bar active" ) );
170 connect(
pb_std, SIGNAL( clicked() ),
172 connect(
pb_light, SIGNAL( clicked() ),
175 connect(
cb_ifmt, SIGNAL( activated(
int ) ),
178 connect(
ck_light, SIGNAL( stateChanged(
int ) ),
180 connect(
ck_ortho, SIGNAL( stateChanged(
int ) ),
182 connect(
ck_legend, SIGNAL( stateChanged(
int ) ),
184 connect(
ck_autosc, SIGNAL( stateChanged(
int ) ),
186 connect(
ck_mouse, SIGNAL( stateChanged(
int ) ),
188 connect(
ck_shade, SIGNAL( stateChanged(
int ) ),
191 connect(
poffsSlider, SIGNAL( valueChanged(
int ) ),
193 connect(
resolSlider, SIGNAL( valueChanged(
int ) ),
195 connect(
normlSlider, SIGNAL( valueChanged(
int ) ),
197 connect(
normqSlider, SIGNAL( valueChanged(
int ) ),
200 timer =
new QTimer(
this );
201 connect(
movieAct, SIGNAL( toggled(
bool ) ),
203 connect(
timer, SIGNAL( timeout() ),
205 connect(
openAct, SIGNAL( triggered(
bool ) ),
207 connect(
saveAct, SIGNAL( triggered(
bool ) ),
209 connect(
exitAct, SIGNAL( triggered(
bool ) ),
212 connect(
coaxesAct, SIGNAL( triggered(
bool ) ),
214 connect(
cobackAct, SIGNAL( triggered(
bool ) ),
216 connect(
comeshAct, SIGNAL( triggered(
bool ) ),
218 connect(
conumbAct, SIGNAL( triggered(
bool ) ),
220 connect(
colablAct, SIGNAL( triggered(
bool ) ),
222 connect(
cocaptAct, SIGNAL( triggered(
bool ) ),
224 connect(
codataAct, SIGNAL( triggered(
bool ) ),
226 connect(
corsetAct, SIGNAL( triggered(
bool ) ),
229 connect(
fnnumbAct, SIGNAL( triggered(
bool ) ),
231 connect(
fnaxesAct, SIGNAL( triggered(
bool ) ),
233 connect(
fncaptAct, SIGNAL( triggered(
bool ) ),
235 connect(
fnrsetAct, SIGNAL( triggered(
bool ) ),
238 connect(
frameAct, SIGNAL( toggled(
bool ) ),
240 connect(
boxAct, SIGNAL( toggled(
bool ) ),
242 connect(
noneAct, SIGNAL( toggled(
bool ) ),
245 connect(
gridfrAct, SIGNAL( toggled(
bool ) ),
247 connect(
gridbAct, SIGNAL( toggled(
bool ) ),
249 connect(
gridrAct, SIGNAL( toggled(
bool ) ),
251 connect(
gridlAct, SIGNAL( toggled(
bool ) ),
253 connect(
gridcAct, SIGNAL( toggled(
bool ) ),
255 connect(
gridfAct, SIGNAL( toggled(
bool ) ),
257 connect(
gridbAct, SIGNAL( toggled(
bool ) ),
259 connect(
gridbAct, SIGNAL( toggled(
bool ) ),
262 connect(
scattdAct, SIGNAL( toggled(
bool ) ),
264 connect(
wirefrAct, SIGNAL( toggled(
bool ) ),
266 connect(
hiddlnAct, SIGNAL( toggled(
bool ) ),
268 connect(
polygnAct, SIGNAL( toggled(
bool ) ),
270 connect(
fdmeshAct, SIGNAL( toggled(
bool ) ),
272 connect(
nodataAct, SIGNAL( toggled(
bool ) ),
275 connect(
fldataAct, SIGNAL( toggled(
bool ) ),
277 connect(
flisolAct, SIGNAL( toggled(
bool ) ),
279 connect(
flemptAct, SIGNAL( toggled(
bool ) ),
282 connect(
normsAct, SIGNAL( toggled(
bool ) ),
285 dataWidget->coordinates()->setLineSmooth(
true );
294 dataWidget->setTitle( tr(
"XYZ 3-D Plot " ) );
318 QString xat, QString yat, QString zat )
320 const double VROUND = 10.0;
321 const double MAX_ANNO = (99.9/VROUND);
324 const double VNEGOF = (1.0/VROUND);
325 double xround = VROUND;
326 double yround = VROUND;
328 int nidpt =
xyzdat->count();
335 setWindowTitle( wndt );
351 for (
int ii = 1; ii < nidpt; ii++ )
353 xval =
xyzdat->at( ii ).x();
354 yval =
xyzdat->at( ii ).y();
355 zval =
xyzdat->at( ii ).z();
385 double xavg = (
xmin +
xmax ) * 0.5;
386 double yavg = (
ymin +
ymax ) * 0.5;
394 powry = qRound( log10( y_norm ) );
395 powrz = qRound( log10(
z_norm ) );
399 y_norm = pow( 10.0, (
double)
powry );
400 z_norm = pow( 10.0, (
double)powrz );
409 if ( ( xavg *
x_norm ) > MAX_ANNO )
415 if ( ( yavg * y_norm ) > MAX_ANNO )
422 if ( ( zmax *
z_norm ) > MAX_ANNO )
428 DbgLv(1) <<
"P3D:sR: powx powy" << powrx << powry <<
"xnorm ynorm znorm"
429 << x_norm << y_norm <<
z_norm;
436 DbgLv(1) <<
"P3D:sR: nrm'd xmin xmax" <<
xmin <<
xmax <<
"ymin ymax"
439 xmin = (double)( (
int)(
xmin * xround ) ) / xround;
440 xmax = (double)( (
int)(
xmax * xround ) + 1 ) / xround;
442 ymin = (double)( (
int)(
ymin * yround ) ) / yround;
443 ymax = (double)( (
int)(
ymax * yround ) + 1 ) / yround;
445 zmax = (double)( (
int)( zmax * VROUND ) + 1 ) / VROUND;
460 double x_scale,
double y_scale,
double z_scale,
461 double a_alpha,
double a_beta )
492 int nidpt =
xyzdat->count();
493 QList< double > xvals;
495 for (
int ii = 0; ii < nidpt; ii++ )
497 double xval =
xyzdat->at( ii ).x();
498 if ( ! xvals.contains( xval ) )
503 nrows = xvals.count();
506 DbgLv(1) <<
"P3D:rD: x0 x1 xm xn" << xvals[0] << xvals[1] << xvals[nrows-2]
532 int nidpt =
xyzdat->count();
534 DbgLv(1) <<
"P3D:cC: tdata N" <<
tdata.size();
536 DbgLv(1) <<
"P3D:cC: tdata M" <<
tdata[0].size();
541 for (
int ii = 0; ii <
ncols; ii++ )
543 for (
int jj = 0; jj <
nrows; jj++ )
547 qDebug() <<
"P3Dxyz: *ERROR* xyzdat overrun" << nidpt;
551 QVector3D v3d =
xyzdat->at( kk++ );
552 double xval = v3d.x() *
x_norm;
553 double yval = v3d.y() *
y_norm;
554 double zval = v3d.z() *
z_norm;
555 tdata[ ii ][ jj ] = Triple( xval, yval, zval );
565 int nidpt =
xyzdat->count();
566 int kcols =
zdata.count();
567 int krows = ( kcols == 0 ) ? 0 :
zdata[ 0 ].count();
575 int hixd =
ncols / 5;
576 int hiyd =
nrows / 5;
581 DbgLv(1) <<
"cP: ncols nrows hixd hiyd" <<
ncols <<
nrows << hixd << hiyd;
591 double dfac = M_PI * 0.5 /
beta;
594 double xpinc = (double)(
nrows - 1 ) / xdif;
595 double ypinc = (double)(
ncols - 1 ) / ydif;
597 DbgLv(1) <<
"cP: dfac xdif ydif" << dfac << xdif << ydif
598 <<
"xpinc ypinc zfact" << xpinc << ypinc << zfact;
617 xdif = acos( pow( 1e-18, ( 1.0 /
alpha) ) )
618 *
beta / ( M_PI * 0.5 * sqrt( 2.0 ) );
619 nxd = qRound( xdif * xpinc );
620 nyd = qRound( xdif * ypinc );
621 DbgLv(1) <<
"cP: xdif nxd nyd" << xdif << nxd << nyd <<
"nidpt" << nidpt;
624 nxd = qMin( nxd, hixd );
625 nyd = qMin( nyd, hiyd );
626 nxd = qMax( nxd, loxd );
627 nyd = qMax( nyd, loyd );
628 DbgLv(1) <<
"cP: nxd nyd" << nxd << nyd <<
"ncols nrows" <<
ncols <<
nrows;
633 for (
int ii = 0; ii <
ncols; ii++ )
634 for (
int jj = 0; jj <
nrows; jj++ )
635 zdata[ ii ][ jj ] = zval;
637 for (
int kk = 0; kk < nidpt; kk++ )
643 rx = (int)( xval * xpinc );
647 lx = qMin( lx, nrows );
649 ry = (int)( yval * ypinc );
653 ly = qMin( ly, ncols );
656 for (
int ii = fx; ii < lx; ii++ )
658 xdif =
sq( (
double)ii / xpinc - xval );
662 for (
int jj = fy; jj < ly; jj++ )
664 ydif =
sq( (
double)jj / ypinc - yval );
667 dist = sqrt( xdif + ydif );
687 zdata[ ii ][ jj ] += ( ( zval *
688 ( pow( cos( dist * dfac ),
alpha ) ) ) * zfact );
713 unsigned int kcols = (
unsigned int)
ncols;
714 unsigned int krows = (
unsigned int)
nrows;
725 Triple** wdata = NULL;
726 double** wddat = NULL;
727 int lcol =
ncols - 1;
733 wdata =
new Triple* [
ncols ];
734 DbgLv(1) <<
"P3D:replot: wdata size" <<
tdata.size();
736 DbgLv(1) <<
"P3D:replot: wdata0 size" <<
tdata[0].size();
742 for (
int ii = 0; ii <
ncols; ii++ )
744 wdata[ ii ] =
new Triple [
nrows ];
747 for (
int jj = 0; jj <
nrows; jj++ )
749 double xval =
tdata[ kk ][ jj ].x;
750 double yval = ( yroff -
tdata[ kk ][ jj ].y );
751 double zval =
tdata[ kk ][ jj ].z;
752 wdata[ ii ][ jj ] = Triple( xval, yval, zval );
759 for (
int ii = 0; ii <
ncols; ii++ )
761 wdata[ ii ] =
new Triple [
nrows ];
762 for (
int jj = 0; jj <
nrows; jj++ )
763 wdata[ ii ][ jj ] =
tdata[ ii ][ jj ];
769 double xval = wdata[ lcol ][ 0 ].x;
770 double yval = wdata[ lcol ][ 0 ].y;
771 wdata[ lcol ][ 0 ]= Triple( xval, yval,
zmax );
776 DbgLv(1) <<
"P3D:replot: wdata[0][0]" << wdata[0][0].x << wdata[0][0].y
778 DbgLv(1) <<
"P3D:replot: wdata[n][0]" << wdata[n][0].x << wdata[n][0].y
780 DbgLv(1) <<
"P3D:replot: wdata[0][m]" << wdata[0][m].x << wdata[0][m].y
782 DbgLv(1) <<
"P3D:replot: wdata[n][m]" << wdata[n][m].x << wdata[n][m].y
785 DbgLv(1) <<
"P3D:replot: ldDa rev_y ycmin ycmax" <<
reverse_y << ycmin << ycmax;
789 dataWidget->loadFromData( wdata, kcols, krows, uperio, vperio );
790 DbgLv(1) <<
"P3D:replot: createCoordSys";
791 dataWidget->createCoordinateSystem( Triple( xcmin, ycmin, zcmin ),
792 Triple( xcmax, ycmax, zcmax ) );
793 DbgLv(1) <<
"P3D:replot: xmin xmax ycmin ycmax" <<
xmin <<
xmax
794 << ycmin << ycmax <<
"zcmin zcmax" << zcmin << zcmax;
799 wddat =
new double* [
ncols ];
800 zdmx =
zdata[ 0 ][ 0 ];
802 for (
int ii = 0; ii <
ncols; ii++ )
804 if ((ii&63)==1)
DbgLv(2) <<
"P3D: rp: row" << ii;
805 wddat[ ii ] =
new double [
nrows ];
807 for (
int jj = 0; jj <
nrows; jj++ )
809 double zval =
zdata[ ii ][ jj ];
810 wddat[ ii ][ jj ] = zval;
811 zdmx = qMax( zdmx, zval );
812 if ((ii&63)==1&&(jj&63)==1)
DbgLv(2) <<
"P3D: rp: col" << jj
818 zfac = ( zdmx < 1e-20 ) ?
zmax : (
zmax / zdmx );
820 for (
int ii = 0; ii <
ncols; ii++ )
821 for (
int jj = 0; jj <
nrows; jj++ )
822 wddat[ ii ][ jj ] *= zfac;
825 << ycmin << ycmax <<
"zmin zmax zfac zdmx" <<
zmin <<
zmax << zfac << zdmx;
841 dataWidget->legend()->setScale( LINEARSCALE );
843 for (
uint ii = 0; ii !=
dataWidget->coordinates()->axes.size(); ++ii )
845 dataWidget->coordinates()->axes[ ii ].setMajors( 7 );
846 dataWidget->coordinates()->axes[ ii ].setMinors( 5 );
852 dataWidget->coordinates()->setLabelColor( Qwt3D::RGBA( 0, 0, 0, 1 ) );
861 QString annopad(
" " );
897 double xtic2 = xtic1 * 0.4;
898 double ytic2 = ytic1 * 0.4;
899 double ztic2 = ztic1 * 0.4;
900 DbgLv(1) <<
"P3D:rP: xtic1 ytic1 ztic1" << xtic1 << ytic1 << ztic1;
902 dataWidget->coordinates()->axes[X1].setLabelString( xatitle );
903 dataWidget->coordinates()->axes[X2].setLabelString( xatitle );
904 dataWidget->coordinates()->axes[X3].setLabelString( xatitle );
905 dataWidget->coordinates()->axes[X4].setLabelString( xatitle );
914 DbgLv(1) <<
"P3D:rp: xatitle yatitle" << xatitle <<
yatitle;
915 dataWidget->coordinates()->axes[X1].setTicLength( xtic1, xtic2 );
916 dataWidget->coordinates()->axes[X2].setTicLength( xtic1, xtic2 );
917 dataWidget->coordinates()->axes[X3].setTicLength( xtic1, xtic2 );
918 dataWidget->coordinates()->axes[X4].setTicLength( xtic1, xtic2 );
919 dataWidget->coordinates()->axes[Y1].setTicLength( ytic1, ytic2 );
920 dataWidget->coordinates()->axes[Y2].setTicLength( ytic1, ytic2 );
921 dataWidget->coordinates()->axes[Y3].setTicLength( ytic1, ytic2 );
922 dataWidget->coordinates()->axes[Y4].setTicLength( ytic1, ytic2 );
923 dataWidget->coordinates()->axes[Z1].setTicLength( ztic1, ztic2 );
924 dataWidget->coordinates()->axes[Z2].setTicLength( ztic1, ztic2 );
925 dataWidget->coordinates()->axes[Z3].setTicLength( ztic1, ztic2 );
926 dataWidget->coordinates()->axes[Z4].setTicLength( ztic1, ztic2 );
937 dataWidget->coordinates()->setStandardScale();
944 DbgLv(1) <<
"P3D:rp: Data/GL updated";
948 for (
int ii = 0; ii <
ncols; ii++ )
949 delete [] wdata[ ii ];
957 for (
int ii = 0; ii <
ncols; ii++ )
958 delete [] wddat[ ii ];
963 DbgLv(1) <<
"P3D:rp: Data freed";
981 return IO::save(
dataWidget, filename, imagetype );
986 QString atitle = tr(
"s" );
1004 atitle = tr(
"f/f0" );
1007 atitle = tr(
"vbar" );
1011 if ( sclnorm != 1.0 )
1012 atitle = atitle +
" * " + QString::number( sclnorm );
1014 DbgLv(2) <<
"P3D: xyAT: type atitle" << type << atitle;
1020 QString atitle = tr(
"Concentration " );
1023 atitle = tr(
"Mol.Concentr. " );
1042 openAct =
new QAction( QIcon(
":/images/fileopen.png" ),
1043 tr(
"&Open File" ),
this );
1044 openffAct =
new QAction( QIcon(
":/images/filecell.png" ),
1045 tr(
"Open FEM File" ),
this );
1046 saveAct =
new QAction( QIcon(
":/images/savecontent.png" ),
1047 tr(
"Dump Contents" ),
this );
1048 movieAct =
new QAction( QIcon(
":/images/movie.png" ),
1049 tr(
"Animation" ),
this );
1051 frameAct =
new QAction( QIcon(
":/images/frame.png" ),
1052 tr(
"Frame Axes" ),
this );
1053 boxAct =
new QAction( QIcon(
":/images/box.png" ),
1054 tr(
"Box Axes" ),
this );
1055 noneAct =
new QAction( QIcon(
":/images/none.png" ),
1056 tr(
"No Axes" ),
this );
1058 gridfrAct =
new QAction( QIcon(
":/images/gridfr.png" ),
1059 tr(
"Front Grid" ),
this );
1060 gridbAct =
new QAction( QIcon(
":/images/gridb.png" ),
1061 tr(
"Back Grid" ),
this );
1062 gridrAct =
new QAction( QIcon(
":/images/gridr.png" ),
1063 tr(
"Right Grid" ),
this );
1064 gridlAct =
new QAction( QIcon(
":/images/gridl.png" ),
1065 tr(
"Left Grid" ),
this );
1066 gridcAct =
new QAction( QIcon(
":/images/gridc.png" ),
1067 tr(
"Ceiling Grid" ),
this );
1068 gridfAct =
new QAction( QIcon(
":/images/gridf.png" ),
1069 tr(
"Floor Grid" ),
this );
1071 scattdAct =
new QAction( QIcon(
":/images/scattered.png" ),
1072 tr(
"Points" ),
this );
1073 wirefrAct =
new QAction( QIcon(
":/images/wireframe.png" ),
1074 tr(
"Wire Frame" ),
this );
1075 hiddlnAct =
new QAction( QIcon(
":/images/hiddenline.png" ),
1076 tr(
"Hidden Line" ),
this );
1077 polygnAct =
new QAction( QIcon(
":/images/polygon.png" ),
1078 tr(
"Polygon only" ),
this );
1079 fdmeshAct =
new QAction( QIcon(
":/images/filledmesh.png" ),
1080 tr(
"Filled Mesh" ),
this );
1082 nodataAct =
new QAction( QIcon(
":/images/nodata.png" ),
1083 tr(
"No Data" ),
this );
1084 fldataAct =
new QAction( QIcon(
":/images/floordata.png" ),
1085 tr(
"Floor Data" ),
this );
1086 flisolAct =
new QAction( QIcon(
":/images/flooriso.png" ),
1087 tr(
"Floor Isolines" ),
this );
1088 flemptAct =
new QAction( QIcon(
":/images/floorempty.png" ),
1089 tr(
"Floor Empty" ),
this );
1091 normsAct =
new QAction( QIcon(
":/images/normals.png" ),
1092 tr(
"Normal Vectors" ),
this );
1093 iconAct =
new QAction( QIcon(
":/images/icon.png" ),
1094 tr(
"Icon" ),
this );
1095 qwtpltAct =
new QAction( QIcon(
":/images/qwtplot.png" ),
1096 tr(
"QwtPlot" ),
this );
1098 exitAct =
new QAction( tr(
"Exit" ),
this );
1100 coaxesAct =
new QAction( tr(
"Axes" ),
this );
1101 cobackAct =
new QAction( tr(
"Background" ),
this );
1102 comeshAct =
new QAction( tr(
"Mesh" ),
this );
1103 conumbAct =
new QAction( tr(
"Number" ),
this );
1104 colablAct =
new QAction( tr(
"Label" ),
this );
1105 cocaptAct =
new QAction( tr(
"Caption" ),
this );
1106 codataAct =
new QAction( tr(
"Data Color" ),
this );
1107 corsetAct =
new QAction( tr(
"Reset" ),
this );
1109 fnnumbAct =
new QAction( tr(
"Scale numbering" ),
this );
1110 fnaxesAct =
new QAction( tr(
"Axes label" ),
this );
1111 fncaptAct =
new QAction( tr(
"Caption" ),
this );
1112 fnrsetAct =
new QAction( tr(
"Reset" ),
this );
1114 cb_ifmt =
new QComboBox(
this );
1115 cb_ifmt->addItem( tr(
"BMP" ) );
1116 cb_ifmt->addItem( tr(
"JPEG" ) );
1117 cb_ifmt->addItem( tr(
"PBM" ) );
1118 cb_ifmt->addItem( tr(
"PGM" ) );
1119 cb_ifmt->addItem( tr(
"PNG" ) );
1120 cb_ifmt->addItem( tr(
"PPM" ) );
1121 cb_ifmt->addItem( tr(
"XBM" ) );
1122 cb_ifmt->addItem( tr(
"XPM" ) );
1123 cb_ifmt->addItem( tr(
"EPS" ) );
1124 cb_ifmt->addItem( tr(
"PS" ) );
1125 cb_ifmt->addItem( tr(
"EPS-GZ" ) );
1126 cb_ifmt->addItem( tr(
"PS-GZ" ) );
1127 cb_ifmt->addItem( tr(
"PDF" ) );
1133 fileMenu = menuBar()->addMenu( tr(
"&File" ) );
1140 colorMenu = menuBar()->addMenu( tr(
"&Color" ) );
1150 fontMenu = menuBar()->addMenu( tr(
"Font" ) );
1180 boxAct ->setCheckable(
true );
1181 noneAct ->setCheckable(
true );
1240 openAct ->setStatusTip( tr(
"Open GridData (.mes) files" ) );
1241 openffAct->setStatusTip( tr(
"Open Node/Cell files" ) );
1242 saveAct ->setStatusTip( tr(
"Dump content to image file" ) );
1243 cb_ifmt ->setStatusTip( tr(
"Select image file format" ) );
1244 movieAct ->setStatusTip( tr(
"Turn on animation" ) );
1245 frameAct ->setStatusTip( tr(
"Show frame axes" ) );
1246 boxAct ->setStatusTip( tr(
"Show box axes" ) );
1247 noneAct ->setStatusTip( tr(
"Hide axes" ) );
1248 gridfrAct->setStatusTip( tr(
"Show front grid" ) );
1249 gridbAct ->setStatusTip( tr(
"Show back grid" ) );
1250 gridrAct ->setStatusTip( tr(
"Show right grid" ) );
1251 gridlAct ->setStatusTip( tr(
"Show left grid" ) );
1252 gridcAct ->setStatusTip( tr(
"Show ceiling grid" ) );
1253 gridfAct ->setStatusTip( tr(
"Show floor grid" ) );
1254 scattdAct->setStatusTip( tr(
"Display scattered points data" ) );
1255 wirefrAct->setStatusTip( tr(
"Display wire frame data" ) );
1256 hiddlnAct->setStatusTip( tr(
"Display hidden line data" ) );
1257 polygnAct->setStatusTip( tr(
"Display polygon only data" ) );
1258 fdmeshAct->setStatusTip( tr(
"Display mesh & filled polygons" ) );
1259 nodataAct->setStatusTip( tr(
"Hide data" ) );
1260 fldataAct->setStatusTip( tr(
"Floor data projection" ) );
1261 flisolAct->setStatusTip( tr(
"Floor isolines" ) );
1262 flemptAct->setStatusTip( tr(
"Floor empty" ) );
1263 normsAct ->setStatusTip( tr(
"Show normal vectors" ) );
1267 int wdim = qRound( (
double)
fileToolBar->size().width() * 0.75 );
1268 int hdim = qRound( (
double)wdim * 0.75 );
1269 setMinimumSize( wdim, hdim );
1271 wdim = qRound( (
double)size().width() * 0.75 );
1272 DbgLv(2) <<
" min x,y dim" << wdim;
1280 double xyval = sc->
s;
1285 xyval = sc->
mw * normscl;
1289 xyval = sc->
s * normscl;
1293 xyval = sc->
D * normscl;
1297 xyval = sc->
f * normscl;
1301 xyval = sc->
f_f0 * normscl;
1305 xyval = sc->
vbar20 * normscl;
1332 DbgLv(2) <<
"light_button";
1338 DbgLv(2) <<
"ifmt_chosen" << index <<
cb_ifmt->itemText(index);
1344 DbgLv(2) <<
"light_check" << (state==Qt::Checked);
1346 pb_light->setEnabled( ( state == Qt::Checked ) );
1352 DbgLv(2) <<
"ortho_check" << (state==Qt::Checked);
1359 DbgLv(2) <<
"legnd_check" << (state==Qt::Checked);
1366 DbgLv(2) <<
"autsc_check" << (state==Qt::Checked);
1367 dataWidget->coordinates()->setAutoScale( state );
1374 DbgLv(2) <<
"mouse_check" << (state==Qt::Checked);
1380 DbgLv(2) <<
"shade_check" << (state==Qt::Checked);
1381 dataWidget->setShading( state ? GOURAUD : FLAT );
1387 DbgLv(2) <<
"poffs_slide" << pos;
1388 dataWidget->setPolygonOffset( (
double)pos / 10.0 );
1396 DbgLv(2) <<
"resol_slide" << pos;
1407 timer->start( redrawWait );
1483 int sum =
dataWidget->coordinates()->grids();
1485 sum = isOn ? ( sum | side ) : ( sum & ~side );
1487 dataWidget->coordinates()->setGridLines(
true,
true, sum );
1586 DbgLv(2) <<
"normals_on" << isOn;
1594 DbgLv(2) <<
"norml_slide" << val;
1595 dataWidget->setNormalLength( (
double)val / 400.0 );
1602 DbgLv(2) <<
"normq_slide" << val;
1616 (
int)(
dataWidget->zRotation() + 1 ) % 360 );
1623 DbgLv(2) <<
"open_file";
1629 DbgLv(2) <<
"close_all";
1641 QColor cc = QColorDialog::getColor( Qt::black,
this,
1642 tr(
"Select Axes Color" ) );
1643 Qwt3D::RGBA rgb = Qt2GL( cc );
1644 dataWidget->coordinates()->setAxesColor( rgb );
1650 QColor cc = QColorDialog::getColor( Qt::white,
this,
1651 tr(
"Select Background Color" ) );
1652 Qwt3D::RGBA rgb = Qt2GL( cc );
1659 QColor cc = QColorDialog::getColor( Qt::black,
this,
1660 tr(
"Select Mesh Color" ) );
1661 Qwt3D::RGBA rgb = Qt2GL( cc );
1669 QColor cc = QColorDialog::getColor( Qt::black,
this,
1670 tr(
"Select Number Color" ) );
1671 Qwt3D::RGBA rgb = Qt2GL( cc );
1672 dataWidget->coordinates()->setNumberColor( rgb );
1678 QColor cc = QColorDialog::getColor( Qt::black,
this,
1679 tr(
"Select Label Color" ) );
1680 Qwt3D::RGBA rgb = Qt2GL( cc );
1681 dataWidget->coordinates()->setLabelColor( rgb );
1687 QColor cc = QColorDialog::getColor( Qt::black,
this,
1688 tr(
"Select Caption Color" ) );
1689 Qwt3D::RGBA rgb = Qt2GL( cc );
1696 QList< QColor > colorlist;
1697 Qwt3D::ColorVector colorvect;
1698 Qwt3D::StandardColor* stdcol;
1701 QString filter = tr(
"Color Map files (*cm-*.xml);;" )
1702 + tr(
"Any XML files (*.xml);;" )
1703 + tr(
"Any files (*)" );
1705 QString mapfname = QFileDialog::getOpenFileName(
this,
1706 tr(
"Load Color Map File" ),
1709 if ( mapfname.isEmpty() )
1714 for (
int ii = 0; ii < colorlist.size(); ii++ )
1716 rgb = Qt2GL( colorlist.at( ii ) );
1717 colorvect.push_back( rgb );
1718 DbgLv(1) <<
"P3D: ii" << ii <<
"cvec[ii]" << colorlist[ii];
1722 stdcol ->setColorVector( colorvect );
1736 const Qwt3D::RGBA blackc = Qt2GL( QColor( Qt::black ) );
1737 const Qwt3D::RGBA whitec = Qt2GL( QColor( Qt::white ) );
1738 QList< QColor > colorlist;
1739 Qwt3D::ColorVector colorvect;
1744 for (
int ii = 0; ii < colorlist.size(); ii++ )
1746 rgb = Qt2GL( colorlist.at( ii ) );
1747 colorvect.push_back( rgb );
1751 Qwt3D::StandardColor* stdcol =
new StandardColor(
dataWidget );
1752 stdcol ->setColorVector( colorvect );
1755 dataWidget->coordinates()->setAxesColor( blackc );
1756 dataWidget->coordinates()->setNumberColor( blackc );
1757 dataWidget->coordinates()->setLabelColor( blackc );
1771 QFont oldfont =
dataWidget->coordinates()->axes[X1].numberFont();
1772 QFont newfont = QFontDialog::getFont( &ok, oldfont,
this,
1773 tr(
"Select Scale Numbers Font" ) );
1778 dataWidget->coordinates()->setNumberFont( newfont );
1785 QFont oldfont =
dataWidget->coordinates()->axes[X1].labelFont();
1786 QFont newfont = QFontDialog::getFont( &ok, oldfont,
this,
1787 tr(
"Select Axes Labels Font" ) );
1792 dataWidget->coordinates()->setLabelFont( newfont );
1799 QFont newfont = QFontDialog::getFont( &ok,
titleFont,
this,
1800 tr(
"Select Title Caption Font" ) );
1805 dataWidget->setTitleFont( newfont.family(), newfont.pointSize(),
1827 QString modldesc =
"xyz";
1828 QString imagetype =
cb_ifmt->currentText();
1829 QString fileext =
cb_ifmt->currentText().toLower();
1830 QString datetime = QDateTime::currentDateTime().toString(
"yyMMddhhmm" );
1832 if ( !imagetype.contains(
"PS" ) && !imagetype.contains(
"PDF" ) )
1833 imagetype = imagetype.toLower();
1837 if ( ! dir.exists( reportDir ) ) dir.mkpath( reportDir );
1840 +
"_" + datetime +
"_plot3d." + fileext;
1842 bool ok = IO::save(
dataWidget, ofname, imagetype );
1844 DbgLv(2) <<
" dump_contents" << ofname <<
" OK " << ok;
1845 DbgLv(2) <<
" imagetype" << imagetype;
1849 statusBar()->showMessage( tr(
"Successful dump to " )
1855 statusBar()->showMessage( tr(
"*ERROR* Unable to create " )
1864 atitle = atitle.section(
"*", 0, 0 );
1867 atitle = atitle.simplified();
1873 int ncol = vec.size();
1874 if ( ncol < 1 )
return;
1876 for (
int ii = 0; ii < ncol; ii++ )
1885 int ncol = vec.size();
1886 if ( ncol < 1 )
return;
1888 for (
int ii = 0; ii < ncol; ii++ )
1896 int ncol,
int nrow )
1900 for (
int ii = 0; ii < ncol; ii++ )
1901 vec[ ii ].resize( nrow );
1906 int ncol,
int nrow )
1910 for (
int ii = 0; ii < ncol; ii++ )
1911 vec[ ii ].resize( nrow );