From b85a292ce06475d560bfa1195b63a8bfe211f22d Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 11 Jul 2012 14:15:27 -0500 Subject: Add 0.2.7 release of qwtplot3d for future TQt3 conversion and use --- .../examples/mesh2/src/colormapreader.cpp | 81 + lib/tqwtplot3d/examples/mesh2/src/colormapreader.h | 28 + .../examples/mesh2/src/designerworkaround.cpp | 146 ++ .../examples/mesh2/src/designerworkaround.h | 76 + lib/tqwtplot3d/examples/mesh2/src/femreader.h | 83 + lib/tqwtplot3d/examples/mesh2/src/functions.h | 214 +++ lib/tqwtplot3d/examples/mesh2/src/lightingdlg.cpp | 220 +++ lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h | 100 ++ .../examples/mesh2/src/lightingdlgbase.ui | 361 ++++ .../examples/mesh2/src/lightingdlgbase4.ui | 293 ++++ .../examples/mesh2/src/lightingdlgbaseimpl.cpp | 22 + .../examples/mesh2/src/lightingdlgbaseimpl.h | 15 + lib/tqwtplot3d/examples/mesh2/src/main.cpp | 32 + lib/tqwtplot3d/examples/mesh2/src/mesh.cpp | 57 + .../examples/mesh2/src/mesh2mainwindow.cpp | 956 +++++++++++ .../examples/mesh2/src/mesh2mainwindow.h | 134 ++ .../examples/mesh2/src/mesh2mainwindowbase.ui | 1728 ++++++++++++++++++++ .../examples/mesh2/src/mesh2mainwindowbase4.ui | 479 ++++++ lib/tqwtplot3d/examples/mesh2/src/thesis.tex | 9 + 19 files changed, 5034 insertions(+) create mode 100644 lib/tqwtplot3d/examples/mesh2/src/colormapreader.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/colormapreader.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/designerworkaround.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/designerworkaround.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/femreader.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/functions.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlg.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase.ui create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase4.ui create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/main.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/mesh.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.cpp create mode 100644 lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.h create mode 100644 lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase.ui create mode 100644 lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase4.ui create mode 100644 lib/tqwtplot3d/examples/mesh2/src/thesis.tex (limited to 'lib/tqwtplot3d/examples/mesh2/src') diff --git a/lib/tqwtplot3d/examples/mesh2/src/colormapreader.cpp b/lib/tqwtplot3d/examples/mesh2/src/colormapreader.cpp new file mode 100644 index 0000000..90f7d0c --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/colormapreader.cpp @@ -0,0 +1,81 @@ +#include + +#include +#include +#include +#include + +#include "colormapreader.h" + +using namespace Qwt3D; +using namespace std; + +#if QT_VERSION < 0x040000 + +ColorMapPreview::ColorMapPreview( QWidget *parent ) +: QFrame( parent ) +{ + label_ = new QLabel(this); + setFrameShape( QFrame::StyledPanel ); + setFrameShadow( QFrame::Sunken ); + QGridLayout* layout = new QGridLayout( this, 1, 1, 10); + + layout->addWidget( label_, 0, 0, Qt::AlignJustify ); +} + +void ColorMapPreview::previewUrl( const QUrl &u ) +{ + QString path = u.path(); + QFileInfo fi( path ); + if (fi.extension() != "map" && fi.extension() != "MAP") + label_->setText( "No color map" ); + else + { + if ( open(path) ) + label_->setPixmap( pix_ ); + } +} + +bool ColorMapPreview::open(QString fname) +{ + if (fname.isEmpty()) + return false; + + ifstream file(QWT3DLOCAL8BIT(fname)); + + RGBA rgb; + cv.clear(); + + while ( file ) + { + file >> rgb.r >> rgb.g >> rgb.b; + file.ignore(10000,'\n'); + if (!file.good()) + break; + else + { + rgb.a = 1; + rgb.r /= 255; + rgb.g /= 255; + rgb.b /= 255; + cv.push_back(rgb); + } + } + + pix_.resize(80, cv.size()); + QPainter p( &pix_ ); + p.translate( 0, cv.size()-1 ); + for (unsigned i=0; i!=cv.size(); ++i) + { + rgb = cv[i]; + p.setPen(GL2Qt(rgb.r,rgb.g,rgb.b)); + p.drawLine(QPoint(0,0),QPoint(pix_.width(),0)); + p.translate( 0, -1 ); + } + p.end(); + + return true; +} + +#else +#endif diff --git a/lib/tqwtplot3d/examples/mesh2/src/colormapreader.h b/lib/tqwtplot3d/examples/mesh2/src/colormapreader.h new file mode 100644 index 0000000..3322846 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/colormapreader.h @@ -0,0 +1,28 @@ +#ifndef __colormapreader_2003_06_08_13_23__ +#define __colormapreader_2003_06_08_13_23__ + +#include +#include +#include + +#include "../../../include/qwt3d_types.h" + +#if QT_VERSION < 0x040000 + +class ColorMapPreview : public QFrame, public QFilePreview +{ +public: + ColorMapPreview( QWidget *parent=0 ); + void previewUrl( const QUrl &u ); + +private: + Qwt3D::ColorVector cv; + QLabel* label_; + QPixmap pix_; + bool open(QString); +}; + +#else // if present in Qt4 +#endif + +#endif diff --git a/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.cpp b/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.cpp new file mode 100644 index 0000000..433a317 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.cpp @@ -0,0 +1,146 @@ +#include "designerworkaround.h" + +namespace{ + QString tr(const char* val) + { + return QObject::tr(val); + } + + void setCheckable(QActionGroup* ag) + { + QList tmplist = ag->actions(); + for (QList::iterator it=tmplist.begin(); it!=tmplist.end(); ++it) + (*it)->setCheckable(true); + } + +} + + +void DesignerWorkaround::setupWorkaround(QMainWindow* mw) +{ + // actions + + openFile = new QAction(QIcon(":/images/fileopen.png"), tr("&Open File"), mw); + openFile->setShortcut( QKeySequence(tr("CTRL+O"))); + openMeshFile = new QAction(QIcon(":/images/filecell.png"), tr("Open FEM File"), mw); + + Exit = new QAction(tr("&Exit"), mw); + Exit->setShortcut( QKeySequence(tr("CTRL+Q"))); + + animation = new QAction(QIcon(":/images/movie.png"), tr("Animation"), mw); + animation->setCheckable(true); + dump = new QAction(QIcon(":/images/savecontent.png"), "", mw); + + coord = new QActionGroup(mw); + Box = new QAction(QIcon(":/images/box.png"), "", coord); + Frame = new QAction(QIcon(":/images/frame.png"), "", coord); + None = new QAction(QIcon(":/images/grid.png"), "", coord); + setCheckable(coord); + + grids = new QActionGroup(mw); + front = new QAction(QIcon(":/images/gridfr.png"), "", grids); + back = new QAction(QIcon(":/images/gridb.png"), "", grids); + right = new QAction(QIcon(":/images/gridr.png"), "", grids); + left = new QAction(QIcon(":/images/gridl.png"), "", grids); + ceil = new QAction(QIcon(":/images/gridc.png"), "", grids); + floor = new QAction(QIcon(":/images/gridf.png"), "", grids); + grids->setExclusive(false); + setCheckable(grids); + + plotstyle = new QActionGroup(mw); + pointstyle = new QAction(QIcon(":/images/scattered.png"), "", plotstyle); + wireframe = new QAction(QIcon(":/images/wireframe.png"), "", plotstyle); + hiddenline = new QAction(QIcon(":/images/hiddenline.png"), "", plotstyle); + polygon = new QAction(QIcon(":/images/polygon.png"), "", plotstyle); + filledmesh = new QAction(QIcon(":/images/filledmesh.png"), "", plotstyle); + nodata = new QAction(QIcon(":/images/nodata.png"), "", plotstyle); + setCheckable(plotstyle); + + floorstyle = new QActionGroup(mw); + floordata = new QAction(QIcon(":/images/floordata.png"), "", floorstyle); + flooriso = new QAction(QIcon(":/images/flooriso.png"), "", floorstyle); + floornone = new QAction(QIcon(":/images/floorempty.png"), "", floorstyle); + setCheckable(floorstyle); + + normals = new QAction(QIcon(":/images/normals.png"), "", mw); + normals->setCheckable(true); + + color = new QActionGroup(mw); + axescolor = new QAction(tr("&Axes"), color); + backgroundcolor = new QAction(tr("&Background"), color); + meshcolor = new QAction(tr("&Mesh"), color); + numbercolor = new QAction(tr("&Numbers"), color); + labelcolor = new QAction(tr("&Label"), color); + titlecolor = new QAction(tr("Caption"), color); + datacolor = new QAction(tr("Data color"), color); + resetcolor = new QAction(tr("&Reset"), color); + + font = new QActionGroup(mw); + numberfont = new QAction(tr("&Scale numbering"), font); + labelfont = new QAction(tr("&Axes label"), font); + titlefont = new QAction(tr("&Caption"), font); + resetfont = new QAction(tr("&Reset"), font); + + + // toolbars + mainToolbar = new QToolBar( QString(""), mw ); + mainToolbar->setMovable( false ); + + mainToolbar->addAction(openFile); + mainToolbar->addAction(openMeshFile); + mainToolbar->addAction(dump); + + filetypeCB = new QComboBox; + functionCB = new QComboBox; + psurfaceCB = new QComboBox; + + mainToolbar->addWidget(filetypeCB); + mainToolbar->addWidget(functionCB); + mainToolbar->addWidget(psurfaceCB); + + mainToolbar->addAction(animation); + + csToolbar = new QToolBar( QString(""), mw ); + csToolbar->setMovable( false ); + + csToolbar->addActions(coord->actions()); + csToolbar->addActions(grids->actions()); + csToolbar->addActions(plotstyle->actions()); + csToolbar->addActions(floorstyle->actions()); + csToolbar->addAction(normals); + + // menubar + menubar = mw->menuBar();//new QMenuBar(); + filemenu = menubar->addMenu("&File"); + filemenu->addAction(openFile); + filemenu->addAction(openMeshFile); + filemenu->addAction(animation); + filemenu->addAction(Exit); + colormenu = menubar->addMenu(tr("&Color")); + colormenu->addActions(color->actions()); + fontmenu = menubar->addMenu(tr("&Fonts")); + fontmenu->addActions(font->actions()); + + mw->addToolBar(mainToolbar); + mw->addToolBar(csToolbar); + + + functionCB->clear(); + functionCB->addItem( tr( "---" ) ); + functionCB->addItem( tr( "Hat" ) ); + functionCB->addItem( tr( "Rosenbrock" ) ); + functionCB->addItem( tr( "Saddle" ) ); + functionCB->addItem( tr( "Sombrero" ) ); + functionCB->addItem( tr( "Ripple" ) ); + functionCB->setToolTip(tr( "Display function" ) ); + psurfaceCB->clear(); + psurfaceCB->addItem( tr( "---" ) ); + psurfaceCB->addItem( tr( "Torus" ) ); + psurfaceCB->addItem( tr( "Seashell" ) ); + psurfaceCB->addItem( tr( "Boy" ) ); + psurfaceCB->addItem( tr( "Dini" ) ); + psurfaceCB->addItem( tr( "Cone" ) ); + psurfaceCB->setToolTip(tr( "Display parametric surface. Turn Lighting on for better quality.")); + + QObject::connect(Exit, SIGNAL(triggered()), mw, SLOT(close())); +} diff --git a/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.h b/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.h new file mode 100644 index 0000000..d57418a --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/designerworkaround.h @@ -0,0 +1,76 @@ +#ifndef designerworkaround_h__2005_07_10_10_46_begin_guarded_code +#define designerworkaround_h__2005_07_10_10_46_begin_guarded_code + +#include +#include +#include +#include +#include +#include +#include + + +class DesignerWorkaround +{ +public: + QMenuBar *menubar; + QMenu *filemenu; + QMenu *colormenu; + QMenu *fontmenu; + QToolBar *mainToolbar; + QToolBar *csToolbar; + QAction* openFile; + QAction* openMeshFile; + QAction* animation; + QAction* dump; + QAction* normals; + QAction* Exit; + + QActionGroup* coord; + QAction* Box; + QAction* Frame; + QAction* None; + + QActionGroup* plotstyle; + QAction* wireframe; + QAction* hiddenline; + QAction* polygon; + QAction* filledmesh; + QAction* nodata; + QAction* pointstyle; + + QActionGroup* color; + QAction* axescolor; + QAction* backgroundcolor; + QAction* meshcolor; + QAction* numbercolor; + QAction* labelcolor; + QAction* titlecolor; + QAction* datacolor; + QAction* resetcolor; + + QActionGroup* font; + QAction* numberfont; + QAction* labelfont; + QAction* titlefont; + QAction* resetfont; + + QActionGroup* floorstyle; + QAction* floordata; + QAction* flooriso; + QAction* floornone; + + QActionGroup* grids; + QAction* front; + QAction* back; + QAction* right; + QAction* left; + QAction* ceil; + QAction* floor; + + QComboBox* filetypeCB, *functionCB, *psurfaceCB; + + void setupWorkaround(QMainWindow* mw); +}; + +#endif diff --git a/lib/tqwtplot3d/examples/mesh2/src/femreader.h b/lib/tqwtplot3d/examples/mesh2/src/femreader.h new file mode 100644 index 0000000..374a181 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/femreader.h @@ -0,0 +1,83 @@ +#ifndef femreader_h__2004_03_07_14_03_begin_guarded_code +#define femreader_h__2004_03_07_14_03_begin_guarded_code + +#include +#include +#include "qwt3d_global.h" +#include "qwt3d_types.h" + +class NodeFilter +{ + public: + explicit NodeFilter() + { + values = std::vector(6); + } + + Qwt3D::Triple readLine(std::ifstream& str) + { + for (unsigned i = 0; i!=values.size(); ++i) + str >> values[i]; + + return Qwt3D::Triple(values[1], values[2], values[5] / 1000); + } + + private: + std::vector values; +}; + +class CellFilter +{ + public: + + Qwt3D::Cell readLine(std::ifstream& str) + { + Qwt3D::Cell cell(4); + str >> cell[0]; // dummy (cell number) - overridden in next step + for (unsigned i = 0; i> cell[i]; + cell[i] = cell[i] - 1; + } + return cell; + } +}; + + +template +bool readNodes(Qwt3D::TripleField& v, const char* fname, FILTER fil) +{ + std::ifstream file(fname); + + v.clear(); + + Qwt3D::Triple t; + while ( file ) + { + t = fil.readLine( file ); + if (!file.good()) + break; + v.push_back( t ); + } + return true; +} + +template +bool readConnections(Qwt3D::CellField& v, const char* fname, FILTER fil) +{ + std::ifstream file(fname); + + v.clear(); + + Qwt3D::Cell cell; + while ( file ) + { + cell = fil.readLine( file ); + if (!file.good()) + break; + v.push_back(cell); + } + return true; +} + +#endif /* include guarded */ diff --git a/lib/tqwtplot3d/examples/mesh2/src/functions.h b/lib/tqwtplot3d/examples/mesh2/src/functions.h new file mode 100644 index 0000000..1a86e0d --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/functions.h @@ -0,0 +1,214 @@ +#ifndef __EXAMPLE_H__ +#define __EXAMPLE_H__ + +#include +#include "../../../include/qwt3d_parametricsurface.h" +#include "../../../include/qwt3d_function.h" + +using namespace Qwt3D; + + +class Rosenbrock : public Function +{ +public: + + Rosenbrock(SurfacePlot& pw) + :Function(pw) + { + } + + double operator()(double x, double y) + { + return 0.7 * log10((1-x)*(1-x) + 10 * (y - x*x)*(y - x*x)); + } +// QString name() const {return "Almost {\\it Rosenbrock}\\,:\\quad$\\frac{\\ln((1-x)^2 + 100(y-x^2)^2)}{8}$";} +}; + +class Hat : public Function +{ +public: + + Hat(SurfacePlot& pw) + :Function(pw) + { + //setMinZ(0.3); + setDomain(0,10,0,10); + } + + double operator()(double x, double y) + { + return 1.0 / (x*x+y*y+0.5); + //return x*x*y/(x*x*x*x+y*y); + } +}; + + +class Ripple : public Function +{ +public: + + Ripple(SurfacePlot& pw) + :Function(pw) + { + double l = 12; + setDomain(-l,l,-l,l); + } + + double operator()(double x, double y) + { + return (cos(sqrt(x*x+y*y) + cos(sqrt(((x+.913*2*Qwt3D::PI)*(x+.913*2*Qwt3D::PI))+y*y)) + + cos(sqrt(((x-.913*2*Qwt3D::PI)*(x-.913*2*Qwt3D::PI))+(y*y))))*4); + } +}; + +class Saddle : public Function +{ +public: + + Saddle() + :Function() + { + // setMaxZ(0.8); + } + + double operator()(double x, double y) + { + return x*x - y*y; + } +// QString name() const {return "$x^2-y^2$";} +}; + +class Mex : public Function +{ +public: + + Mex() + :Function() + { + // setMaxZ(0.8); + } + + double operator()(double x, double y) + { + double n = sqrt(x*x+y*y); + + if (n < DBL_MIN) + return 20; + + return 20 * sin(sqrt(x*x+y*y)) / n; + } +// QString name() const {return "$\\frac{20\\sin\\sqrt{x^2+y^2}}{\\sqrt{x^2+y^2}}$";} +}; + +class Torus : public ParametricSurface +{ +public: + + Torus(SurfacePlot& pw) + :ParametricSurface(pw) + { + setMesh(41,31); + setDomain(-2*Qwt3D::PI, 0,-2*Qwt3D::PI,0); + setPeriodic(true,true); + } + + + Triple operator()(double u, double v) + { + double x,y,z; + double c = 1.9; + x = (c + cos(v)) * cos(u); + y = (c + cos(v)) * sin(u); + z = sin(v) + cos(v); + return Triple(x,y,z); + } +}; + +class Seashell : public ParametricSurface +{ +public: + + Seashell(SurfacePlot& pw) + :ParametricSurface(pw) + { + setMesh(41,131); + setDomain(0,2*Qwt3D::PI,0,2*Qwt3D::PI); + setPeriodic(true,true); + } + + + Triple operator()(double u, double v) + { + double x,y,z; + double a = 1; + double b = 6; + double c = 0.5; + int n = 3; + + double f = v/(2*Qwt3D::PI); + + x = a*(1-f)*cos(n*v)*(1+cos(u)) + c*cos(n*v) ; + y = a*(1-f)*sin(n*v)*(1+cos(u)) + c*sin(n*v) ; + z = b*f + a*(1-f)*sin(u); + return Triple(x,y,z); + } +}; + +class Boy : public ParametricSurface +{ +public: + + Boy(SurfacePlot& pw) + :ParametricSurface(pw) + { + setMesh(141,131); + setDomain(0,Qwt3D::PI,0,Qwt3D::PI); + setPeriodic(true,true); + } + + + Triple operator()(double u, double v) + { + double x,y,z; + double a = 2/3.; + double b = sqrt(2.); + + x = a*(cos(u)*cos(2*v)+b*sin(u)*cos(v))*cos(u) / (b-sin(2*u)*sin(3*v)); + y = a*(cos(u)*sin(2*v)-b*sin(u)*sin(v))*cos(u) / (b-sin(2*u)*sin(3*v)); + z = b*cos(u)*cos(u) / (b-sin(2*u)*sin(2*v)); + + return Triple(x,y,z); + } +}; + +class Dini : public ParametricSurface +{ +public: + + Dini(SurfacePlot& pw) + :ParametricSurface(pw) + { + setMesh(141,35); + setDomain(0,5*Qwt3D::PI,0.001, 2); + setPeriodic(true,true); + } + + + Triple operator()(double u, double v) + { + double x,y,z; + double a = 5; + double b = 1; + + + x=a*cos(u)*sin(v); + y=a*sin(u)*sin(v); + z=a*(cos(v)+log(tan(v/2)))+b*u; + + return Triple(x,y,z); + } +}; + +void createCone(Qwt3D::TripleField& conepos, Qwt3D::CellField& conecell); + +#endif diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.cpp b/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.cpp new file mode 100644 index 0000000..0d46b2c --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.cpp @@ -0,0 +1,220 @@ +#include +#include +#include +#include +#include + +#include "lightingdlg.h" + +using namespace Qwt3D; + +class Sphere : public ParametricSurface +{ +public: + + Sphere(SurfacePlot& pw) + :ParametricSurface(pw) + { + setMesh(41,31); + setDomain(0,2*Qwt3D::PI,0,Qwt3D::PI); + setPeriodic(false,false); + } + + + Triple operator()(double u, double v) + { + double x,y,z; + double r = 1; + x = r*cos(u)*sin(v); + y = r*sin(u)*sin(v); + z = r*cos(v); + return Triple(x,y,z); + } +}; + + +///////////////////////////////////////////////////////////////// +// +// Plot +// +///////////////////////////////////////////////////////////////// + +Plot::Plot(QWidget *parent) +: SurfacePlot(parent) +{ + setTitle("A Simple SurfacePlot Demonstration"); + + Sphere sphere(*this); + sphere.create(); + + reset(); + assignMouse(Qt::LeftButton, + Qt::RightButton, + Qt::LeftButton, + Qt::NoButton, + Qt::NoButton, + Qt::NoButton, + Qt::NoButton, + Qt::NoButton, + Qt::NoButton + ); + + stick = (Pointer*)addEnrichment(Pointer(0.05)); + stick->setPos(0,0,1); +} + +void Plot::reset() +{ + makeCurrent(); + setRotation(0,0,0); + setTitle("Use your mouse buttons and keyboard"); + setTitleFont("Arial", 8, QFont::Bold); + setTitleColor(RGBA(0.9,0.9,0.9)); + setSmoothMesh(true); + setZoom(0.9); + setCoordinateStyle(NOCOORD); + setMeshColor(RGBA(0.6,0.6,0.6,0.3)); + setPlotStyle(FILLEDMESH); + setBackgroundColor(RGBA(0,0,0)); + + updateData(); +} + +///////////////////////////////////////////////////////////////// +// +// Pointer +// +///////////////////////////////////////////////////////////////// + + +Pointer::Pointer(double rad) +{ + configure(rad); +} + +Pointer::~Pointer() +{ +} + +void Pointer::configure(double rad) +{ + plot = 0; + + radius_ = rad; +} + +void Pointer::drawBegin() +{ + GLint mode; + glGetIntegerv(GL_MATRIX_MODE, &mode); + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + + glColor3d(1,0,0); + glBegin(GL_LINES); + glVertex3d(pos_.x, pos_.y, pos_.z); + glVertex3d(0, 0, 0); + glEnd(); + + glPopMatrix(); + glMatrixMode(mode); +} + + +LightingDlg::LightingDlg(QWidget *parent) +:LightingBase(parent) +{ +#if QT_VERSION < 0x040000 + QGridLayout *grid = new QGridLayout( frame, 0, 0 ); +#else + setupUi(this); + QGridLayout *grid = new QGridLayout( frame); +#endif + + dataPlot = 0; + + plot = new Plot(frame); + plot->updateData(); + + grid->addWidget( plot, 0, 0 ); + + connect( stdlight, SIGNAL( clicked() ), this, SLOT( reset() ) ); + connect( distSL, SIGNAL(valueChanged(int)), this, SLOT(setDistance(int)) ); + connect( emissSL, SIGNAL(valueChanged(int)), this, SLOT(setEmission(int)) ); + connect( ambdiffSL, SIGNAL(valueChanged(int)), this, SLOT(setDiff(int)) ); + connect( specSL, SIGNAL(valueChanged(int)), this, SLOT(setSpec(int)) ); + connect( shinSL, SIGNAL(valueChanged(int)), this, SLOT(setShin(int)) ); + connect( plot, SIGNAL(rotationChanged(double, double, double)), this, SLOT(setRotation(double, double, double)) ); +} + +LightingDlg::~LightingDlg() +{ + delete plot; +} + +void LightingDlg::setEmission(int val) +{ + if (!dataPlot) + return; + dataPlot->setMaterialComponent(GL_EMISSION, val / 100.); + dataPlot->updateGL(); +} +void LightingDlg::setDiff(int val) +{ + if (!dataPlot) + return; + dataPlot->setLightComponent(GL_DIFFUSE, val / 100.); + dataPlot->updateGL(); +} +void LightingDlg::setSpec(int val) +{ + if (!dataPlot) + return; + dataPlot->setMaterialComponent(GL_SPECULAR, val / 100.); + dataPlot->updateGL(); +} +void LightingDlg::setShin(int val) +{ + if (!dataPlot) + return; + dataPlot->setShininess( val / 100.); + dataPlot->updateGL(); +} + +void LightingDlg::reset() +{ + plot->reset(); + if (dataPlot) + dataPlot->updateGL(); +} + +void LightingDlg::setDistance(int val) +{ + + plot->stick->setPos(0,0,val/100.); + plot->updateData(); + plot->updateGL(); + + double drad = (dataPlot->hull().maxVertex-dataPlot->hull().minVertex).length(); + drad *= val/20.; + + dataPlot->setLightShift(drad,drad,drad); + dataPlot->updateGL(); +} + +void LightingDlg::assign(Qwt3D::Plot3D* pl) +{ + if (!pl) + return; + dataPlot = pl; +} + +void LightingDlg::setRotation(double x, double y, double z) +{ + if (!dataPlot) + return; + + setDistance(distSL->value()); + dataPlot->setLightRotation(x,y,z); + dataPlot->updateGL(); +} diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h b/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h new file mode 100644 index 0000000..2dd79b1 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlg.h @@ -0,0 +1,100 @@ +#ifndef lightingdlg_h__2004_03_07_13_35_begin_guarded_code +#define lightingdlg_h__2004_03_07_13_35_begin_guarded_code + +#include +#include +#include "../../../include/qwt3d_parametricsurface.h" +#include "../../../include/qwt3d_surfaceplot.h" +#include "../../../include/qwt3d_enrichment.h" +#include "../../../include/qwt3d_color.h" + +#if QT_VERSION < 0x040000 +#include "lightingdlgbase.h" +#else +#include "ui_lightingdlgbase4.h" +#endif + +class Pointer : public Qwt3D::VertexEnrichment +{ +public: + Pointer(double rad); + ~Pointer(); + + Qwt3D::Enrichment* clone() const {return new Pointer(*this);} + + void configure(double rad); + void drawBegin(); + void draw(Qwt3D::Triple const&){} + void setPos(double x, double y, double z) {pos_ = Qwt3D::Triple(x,y,z);} + +private: + double radius_; + Qwt3D::Triple pos_; +}; + +struct SColor : public Qwt3D::Color +{ + Qwt3D::RGBA operator()(double, double, double) const {return Qwt3D::RGBA(0.8,0,0,0.5);} +}; + +typedef Qwt3D::SurfacePlot SPlot; // moc/VC6 issue in Qt 4.0.0 + +class Plot : public SPlot +{ + Q_OBJECT + +public: + Plot(QWidget* parent); + Pointer* stick; + void reset(); +}; + +//MOC_SKIP_BEGIN +#if QT_VERSION < 0x040000 + class LightingBase : public LightingDlgBase + { + public: + LightingBase(QWidget* parent = 0) + : LightingDlgBase(parent) + { + } + }; +#else + class LightingBase : public QDialog, protected Ui::Dialog + { + public: + LightingBase(QWidget* parent = 0) + : QDialog(parent) + { + } + }; +#endif +//MOC_SKIP_END + + + +class LightingDlg : public LightingBase +{ + Q_OBJECT + +public: + LightingDlg(QWidget *parent=0); + ~LightingDlg(); + + void assign(Qwt3D::Plot3D* pl); + + Plot* plot; + Qwt3D::Plot3D* dataPlot; + +public slots: + void setDistance(int); + void setEmission(int); + void setDiff(int); + void setSpec(int); + void setShin(int); + void reset(); + void setRotation(double x, double y, double z); +}; + + +#endif /* include guarded */ diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase.ui b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase.ui new file mode 100644 index 0000000..6e5af4b --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase.ui @@ -0,0 +1,361 @@ + +LightingDlgBase + + + LightingDlgBase + + + + 0 + 0 + 450 + 345 + + + + + 5 + 5 + 0 + 0 + + + + + 450 + 345 + + + + + 450 + 345 + + + + + 0 + 0 + + + + Lighting Configuration + + + false + + + + unnamed + + + 11 + + + 6 + + + + frame + + + + 290 + 290 + + + + + 290 + 290 + + + + StyledPanel + + + Sunken + + + + + Layout11 + + + + unnamed + + + 0 + + + 6 + + + + stdlight + + + + + + Std + + + true + + + true + + + + + Horizontal Spacing2 + + + Horizontal + + + Expanding + + + + 16 + 0 + + + + + + buttonOk + + + + + + &OK + + + true + + + true + + + + + + + Layout8 + + + + unnamed + + + 0 + + + 6 + + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + ambdiff + + + Ambient & Diffuse Part + + + + + ambdiffSL + + + 100 + + + 80 + + + Horizontal + + + + + + + Layout2_2 + + + + unnamed + + + 0 + + + 6 + + + + spec + + + Specular Part + + + + + specSL + + + 100 + + + 30 + + + Horizontal + + + + + + + Layout2_3 + + + + unnamed + + + 0 + + + 6 + + + + shin + + + Shininess + + + + + shinSL + + + 1000 + + + 500 + + + Horizontal + + + + + + + Layout2_4 + + + + unnamed + + + 0 + + + 6 + + + + emiss + + + Emission + + + + + emissSL + + + 100 + + + Horizontal + + + + + + + Layout2_4_2 + + + + unnamed + + + 0 + + + 6 + + + + dist + + + Distance + + + + + distSL + + + 1000 + + + 100 + + + Horizontal + + + + + + + + + + + buttonOk + clicked() + LightingDlgBase + accept() + + + + diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase4.ui b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase4.ui new file mode 100644 index 0000000..2102170 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbase4.ui @@ -0,0 +1,293 @@ + + + + + Dialog + + + + 0 + 0 + 428 + 330 + + + + Dialog + + + + 8 + + + 6 + + + + + 0 + + + 6 + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 0 + + + 6 + + + + + Std + + + + + + + Qt::Horizontal + + + + 91 + 31 + + + + + + + + &Ok + + + + + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ambient &amp; Diffuse Part</p></body></html> + + + + + + + 100 + + + 80 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Specular Part</p></body></html> + + + + + + + 100 + + + 30 + + + 30 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Shininess</p></body></html> + + + + + + + 1000 + + + 500 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Emission</p></body></html> + + + + + + + 100 + + + 0 + + + Qt::Horizontal + + + + + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Distance</p></body></html> + + + + + + + 1000 + + + 100 + + + Qt::Horizontal + + + + + + + + + + + + + + 10 + 280 + 351 + 33 + + + + + + + + + stdlight + clicked() + Dialog + accept() + + + 278 + 253 + + + 96 + 254 + + + + + buttonOk + clicked() + Dialog + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.cpp b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.cpp new file mode 100644 index 0000000..25ca438 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.cpp @@ -0,0 +1,22 @@ +#include "lightingdlgbaseimpl.h" + +/* + * Constructs a lightingdlgbase which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +lightingdlgbase::lightingdlgbase( QWidget* parent, const char* name, bool modal, WFlags fl ) + : lightingdlgbaseBase( parent, name, modal, fl ) +{ +} + +/* + * Destroys the object and frees any allocated resources + */ +lightingdlgbase::~lightingdlgbase() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.h b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.h new file mode 100644 index 0000000..4255129 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/lightingdlgbaseimpl.h @@ -0,0 +1,15 @@ +#ifndef LIGHTINGDLGBASE_H +#define LIGHTINGDLGBASE_H +#include "lightingdlgbase.h" + +class lightingdlgbase : public lightingdlgbaseBase +{ + Q_OBJECT + +public: + lightingdlgbase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); + ~lightingdlgbase(); + +}; + +#endif // LIGHTINGDLGBASE_H diff --git a/lib/tqwtplot3d/examples/mesh2/src/main.cpp b/lib/tqwtplot3d/examples/mesh2/src/main.cpp new file mode 100644 index 0000000..cce8242 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/main.cpp @@ -0,0 +1,32 @@ +/******************************************************************** + created: 2003/09/09 + filename: main.cpp + + author: Micha Bieber +*********************************************************************/ + +#include +#include "mesh2mainwindow.h" + +int main( int argc, char **argv ) +{ + QApplication::setColorSpec( QApplication::CustomColor ); + QApplication app(argc,argv); + + if ( !QGLFormat::hasOpenGL() ) + { + qWarning( "This system has no OpenGL support. Exiting." ); + return -1; + } + + Mesh2MainWindow mainwindow; + +#if QT_VERSION < 0x040000 + app.setMainWidget(&mainwindow); +#endif + + mainwindow.resize(1024,768); + mainwindow.show(); + + return app.exec(); +} diff --git a/lib/tqwtplot3d/examples/mesh2/src/mesh.cpp b/lib/tqwtplot3d/examples/mesh2/src/mesh.cpp new file mode 100644 index 0000000..60683eb --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/mesh.cpp @@ -0,0 +1,57 @@ +#include "functions.h" + +using namespace std; +using namespace Qwt3D; + + +void createCone(Qwt3D::TripleField& conepos, Qwt3D::CellField& conecell) +{ + conepos.clear(); conecell.clear(); + Cell cell; + + conepos.push_back(Triple(0,0,0)); + + const unsigned int count = 17; + double r1 = 0.7; + double r2 = 0.9 * r1; + + double h1 = 2; + double h2 = 1.03 * h1; + + unsigned i; + + Cell c1; + // outer top border + for (i=0; i + +#include +#include +#include +#include +#include +#include +#include +#include + +#if QT_VERSION < 0x040000 +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mesh2mainwindow.h" + +#include "functions.h" +#include "colormapreader.h" +#include "lightingdlg.h" +#include "femreader.h" +#include "../../../include/qwt3d_io.h" +#include "../../../include/qwt3d_io_gl2ps.h" +#include "../../../include/qwt3d_io_reader.h" + +using namespace Qwt3D; +using namespace std; + + +bool Mesh2MainWindow::connectA (const QObject* sender, const char * slot) +{ +#if QT_VERSION < 0x040000 + return connect( sender, SIGNAL( activated() ), this, slot ); +#else + return connect( sender, SIGNAL( triggered() ), this, slot ); +#endif +} + +bool Mesh2MainWindow::connectAG (const QObject* sender, const char * slot) +{ +#if QT_VERSION < 0x040000 + return connect( sender, SIGNAL( selected( QAction* ) ), this, slot ) ; +#else + return connect( sender, SIGNAL( triggered( QAction* ) ), this, slot ) ; +#endif +} + +Mesh2MainWindow::~Mesh2MainWindow() +{ + delete dataWidget; +} + +Mesh2MainWindow::Mesh2MainWindow( QWidget* parent ) + : DummyBase( parent ) +{ +#if QT_VERSION < 0x040000 + setCaption("Mesh2"); + QGridLayout *grid = new QGridLayout( frame, 0, 0 ); +#else + setupWorkaround(this); + setupUi(this); + QGridLayout *grid = new QGridLayout( frame ); +#endif + + col_ = 0; + legend_ = false; + redrawWait = 50; + activeCoordSystem = None; + + dataWidget = new SurfacePlot(frame); + grid->addWidget( dataWidget, 0, 0 ); + + connectAG( coord, SLOT( pickCoordSystem( QAction* ) ) ); + connectAG( plotstyle, SLOT( pickPlotStyle( QAction* ) ) ); + connectA( axescolor, SLOT( pickAxesColor() ) ); + connectA( backgroundcolor, SLOT( pickBgColor() ) ); + connectAG( floorstyle, SLOT( pickFloorStyle( QAction* ) ) ); + connectA( meshcolor, SLOT( pickMeshColor() ) ); + connectA( numbercolor, SLOT( pickNumberColor() ) ); + connectA( labelcolor, SLOT( pickLabelColor() ) ); + connectA( titlecolor, SLOT( pickTitleColor() ) ); + connectA( datacolor, SLOT( pickDataColor() ) ); + connect( lighting, SIGNAL( clicked() ), this, SLOT( pickLighting() ) ); + connectA( resetcolor, SLOT( resetColors() ) ); + connectA( numberfont, SLOT( pickNumberFont() ) ); + connectA( labelfont, SLOT( pickLabelFont() ) ); + connectA( titlefont, SLOT( pickTitleFont() ) ); + connectA( resetfont, SLOT( resetFonts() ) ); + connect( animation, SIGNAL( toggled(bool) ) , this, SLOT( toggleAnimation(bool) ) ); + connectA( dump, SLOT( dumpImage() ) ); + connectA( openFile, SLOT( open() ) ); + //connect(openFile, SIGNAL(triggered()), this, SLOT(open())); + connectA( openMeshFile, SLOT( openMesh() ) ); + + // only EXCLUSIVE groups emit selected :-/ + connect( left, SIGNAL( toggled( bool ) ), this, SLOT( setLeftGrid( bool ) ) ); + connect( right, SIGNAL( toggled( bool ) ), this, SLOT( setRightGrid( bool ) ) ); + connect( ceil, SIGNAL( toggled( bool ) ), this, SLOT( setCeilGrid( bool ) ) ); + connect( floor, SIGNAL( toggled( bool ) ), this, SLOT( setFloorGrid( bool ) ) ); + connect( back, SIGNAL( toggled( bool ) ), this, SLOT( setBackGrid( bool ) ) ); + connect( front, SIGNAL( toggled( bool ) ), this, SLOT( setFrontGrid( bool ) ) ); + + timer = new QTimer( this ); + connect( timer, SIGNAL(timeout()), this, SLOT(rotate()) ); + + resSlider->setRange(1,70); + connect( resSlider, SIGNAL(valueChanged(int)), dataWidget, SLOT(setResolution(int)) ); + connect( dataWidget, SIGNAL(resolutionChanged(int)), resSlider, SLOT(setValue(int)) ); + resSlider->setValue(1); + + connect( offsSlider, SIGNAL(valueChanged(int)), this, SLOT(setPolygonOffset(int)) ); + + connect(normButton, SIGNAL(clicked()), this, SLOT(setStandardView())); + + QString qwtstr(" qwtplot3d "); + qwtstr += QString::number(QWT3D_MAJOR_VERSION) + "."; + qwtstr += QString::number(QWT3D_MINOR_VERSION) + "."; + qwtstr += QString::number(QWT3D_PATCH_VERSION) + " "; + + QLabel* info = new QLabel(qwtstr, statusBar()); + statusBar()->addWidget(info, 0); + filenameWidget = new QLabel(" ", statusBar()); + statusBar()->addWidget(filenameWidget,0); + dimWidget = new QLabel("", statusBar()); + statusBar()->addWidget(dimWidget,0); + rotateLabel = new QLabel("", statusBar()); + statusBar()->addWidget(rotateLabel,0); + shiftLabel = new QLabel("", statusBar()); + statusBar()->addWidget(shiftLabel,0); + scaleLabel = new QLabel("", statusBar()); + statusBar()->addWidget(scaleLabel,0); + zoomLabel = new QLabel("", statusBar()); + statusBar()->addWidget(zoomLabel,0); + + connect(dataWidget, SIGNAL(rotationChanged(double,double,double)),this,SLOT(showRotate(double,double,double))); + connect(dataWidget, SIGNAL(vieportShiftChanged(double,double)),this,SLOT(showShift(double,double))); + connect(dataWidget, SIGNAL(scaleChanged(double,double,double)),this,SLOT(showScale(double,double,double))); + connect(dataWidget, SIGNAL(zoomChanged(double)),this,SLOT(showZoom(double))); + + connect(functionCB, SIGNAL(activated(const QString&)), this, SLOT(createFunction(const QString&))); + connect(psurfaceCB, SIGNAL(activated(const QString&)), this, SLOT(createPSurface(const QString&))); + connect(projection, SIGNAL( toggled(bool) ), this, SLOT( toggleProjectionMode(bool))); + connect(colorlegend, SIGNAL( toggled(bool) ), this, SLOT( toggleColorLegend(bool))); + connect(autoscale, SIGNAL( toggled(bool) ), this, SLOT( toggleAutoScale(bool))); + connect(shader, SIGNAL( toggled(bool) ), this, SLOT( toggleShader(bool))); + connect(mouseinput, SIGNAL( toggled(bool) ), dataWidget, SLOT( enableMouse(bool))); + connect(lightingswitch, SIGNAL( toggled(bool) ), this, SLOT( enableLighting(bool))); + connect(normals, SIGNAL( toggled(bool) ), this, SLOT( showNormals(bool))); + connect(normalsquality, SIGNAL(valueChanged(int)), this, SLOT(setNormalQuality(int)) ); + connect(normalslength, SIGNAL(valueChanged(int)), this, SLOT(setNormalLength(int)) ); + + setStandardView(); + + dataWidget->coordinates()->setLineSmooth(true); + dataWidget->coordinates()->setGridLinesColor(RGBA(0.35,0.35,0.35,1)); + dataWidget->enableMouse(true); + dataWidget->setKeySpeed(15,20,20); + + lightingdlg_ = new LightingDlg( this ); + lightingdlg_->assign( dataWidget); + +#if QT_VERSION < 0x040000 //todo - restore, when Qt4 re-implements preview functionality + datacolordlg_ = new QFileDialog( this ); + QDir dir("./../../data/colormaps"); + if (dir.exists("./../../data/colormaps")) + datacolordlg_->setDir("./../../data/colormaps"); + datacolordlg_->setFilter("Colormap files (*.map *.MAP)"); + colormappv_ = new ColorMapPreview; + datacolordlg_->setContentsPreviewEnabled( TRUE ); + datacolordlg_->setContentsPreview( colormappv_, colormappv_ ); + datacolordlg_->setPreviewMode( QFileDialog::Contents ); + connect(datacolordlg_, SIGNAL(fileHighlighted(const QString&)), this, SLOT(adaptDataColors(const QString&))); +#else + //connect(datacolordlg_, SIGNAL(filesSelected(const QStringList&)), this, SLOT(adaptDataColors4(const QStringList&))); +#endif + connect(filetypeCB, SIGNAL(activated(const QString&)), this, SLOT(setFileType(const QString&))); + + filetypeCB->clear(); + + QStringList list = IO::outputFormatList(); +#if QT_VERSION < 0x040000 + filetypeCB->insertStringList(list); +#else + filetypeCB->insertItems(0,list); +#endif + + + + filetype_ = filetypeCB->currentText(); + dataWidget->setTitleFont( "Arial", 14, QFont::Normal ); + + grids->setEnabled(false); + + PixmapWriter* pmhandler = (PixmapWriter*)IO::outputHandler("JPEG"); + if (!pmhandler) + pmhandler = (PixmapWriter*)IO::outputHandler("jpeg"); //Qt4 naming scheme change + if (pmhandler) + pmhandler->setQuality(70); + + VectorWriter* handler = (VectorWriter*)IO::outputHandler("PDF"); + handler->setTextMode(VectorWriter::TEX); + handler = (VectorWriter*)IO::outputHandler("EPS"); + handler->setTextMode(VectorWriter::TEX); + handler = (VectorWriter*)IO::outputHandler("EPS_GZ"); + if (handler) // with zlib support only + handler->setTextMode(VectorWriter::TEX); +} + +void Mesh2MainWindow::open() +{ +#if QT_VERSION < 0x040000 + QString s = QFileDialog::getOpenFileName( "../../data", "GridData Files (*.mes *.MES)", this ); +#else + QString s = QFileDialog::getOpenFileName( this, "", "../../data", "GridData Files (*.mes *.MES)"); +#endif + + if ( s.isEmpty() || !dataWidget) + return; + + QFileInfo fi( s ); + +#if QT_VERSION < 0x040000 + QString ext = fi.extension(); // ext = "gz" + QToolTip::add(filenameWidget, s); +#else + filenameWidget->setToolTip(s); + QString ext = fi.suffix(); +#endif + filenameWidget->setText(fi.fileName()); + qApp->processEvents(); // enforces repaint; + + if (IO::load(dataWidget, s, ext)) + { + double a = dataWidget->facets().first; + double b = dataWidget->facets().second; + + dimWidget->setText(QString("Cells ") + QString::number(a*b) + + " (" + QString::number(a) + "x" + QString::number(b) +")" ); + + dataWidget->setResolution(3); + } + + for (unsigned i=0; i!=dataWidget->coordinates()->axes.size(); ++i) + { + dataWidget->coordinates()->axes[i].setMajors(4); + dataWidget->coordinates()->axes[i].setMinors(5); + dataWidget->coordinates()->axes[i].setLabelString(""); + } + + updateColorLegend(4,5); + pickCoordSystem(activeCoordSystem); + dataWidget->showColorLegend(legend_); +} + +void Mesh2MainWindow::createFunction(QString const& name) +{ + dataWidget->makeCurrent(); + + dataWidget->legend()->setScale(LINEARSCALE); + for (unsigned i=0; i!=dataWidget->coordinates()->axes.size(); ++i) + { + dataWidget->coordinates()->axes[i].setMajors(7); + dataWidget->coordinates()->axes[i].setMinors(5); + } + + if (name == QString("Rosenbrock")) + { + Rosenbrock rosenbrock(*dataWidget); + + rosenbrock.setMesh(50,51); + rosenbrock.setDomain(-1.73,1.55,-1.5,1.95); + rosenbrock.setMinZ(-100); + + rosenbrock.create(); + + dataWidget->coordinates()->axes[Z1].setScale(LOG10SCALE); + dataWidget->coordinates()->axes[Z2].setScale(LOG10SCALE); + dataWidget->coordinates()->axes[Z3].setScale(LOG10SCALE); + dataWidget->coordinates()->axes[Z4].setScale(LOG10SCALE); + dataWidget->legend()->setScale(LOG10SCALE); + } + else if (name == QString("Hat")) + { + Hat hat(*dataWidget); + + hat.setMesh(51,72); + hat.setDomain(-1.5,1.5,-1.5,1.5); + hat.create(); + } + else if (name == QString("Ripple")) + { + Ripple ripple(*dataWidget); + ripple.setMesh(120,120); + ripple.create(); + } + else if (name == QString("Saddle")) + { + Saddle saddle; + + saddle.setMesh(71,71); + double dom = 2.5; + saddle.setDomain(-dom, dom, -dom, dom); + saddle.assign(*dataWidget); + saddle.create(); + } + else if (name == QString("Sombrero")) + { + Mex mex; + + mex.setMesh(91,91); + double dom = 15; + mex.setDomain(-dom, dom, -dom, dom); + mex.create(*dataWidget); + } + + double a = dataWidget->facets().first; + double b = dataWidget->facets().second; + + dimWidget->setText(QString("Cells ") + QString::number(a*b) + + " (" + QString::number(a) + "x" + QString::number(b) +")" ); + + updateColorLegend(7,5); + + dataWidget->coordinates()->axes[X1].setLabelString(QString("X1")); + dataWidget->coordinates()->axes[X2].setLabelString(QString("X2")); + dataWidget->coordinates()->axes[X3].setLabelString(QString("X3")); + dataWidget->coordinates()->axes[X4].setLabelString(QString("X4")); + + dataWidget->coordinates()->axes[Y1].setLabelString(QString("Y1")); + dataWidget->coordinates()->axes[Y2].setLabelString(QString("Y2")); + dataWidget->coordinates()->axes[Y3].setLabelString(QString("Y3")); + dataWidget->coordinates()->axes[Y4].setLabelString(QString("Y4")); + + dataWidget->coordinates()->axes[Z1].setLabelString(QString("Z1")); + dataWidget->coordinates()->axes[Z2].setLabelString(QString("Z2")); + dataWidget->coordinates()->axes[Z3].setLabelString(QString("Z3")); + dataWidget->coordinates()->axes[Z4].setLabelString(QString("Z4")); + + pickCoordSystem(activeCoordSystem); +} + +void Mesh2MainWindow::createPSurface(QString const& name) +{ + dataWidget->makeCurrent(); + if (name == QString("Torus")) + { + Torus sf(*dataWidget); + sf.create(); + } + else if (name == QString("Seashell")) + { + Seashell ss(*dataWidget); + ss.create(); + } + else if (name == QString("Boy")) + { + Boy boy(*dataWidget); + boy.create(); + } + else if (name == QString("Dini")) + { + Dini dini(*dataWidget); + dini.create(); + } + else if (name == QString("Cone")) + { + TripleField conepos; + CellField conecell; + createCone(conepos,conecell); + dataWidget->loadFromData(conepos, conecell); + } + for (unsigned i=0; i!=dataWidget->coordinates()->axes.size(); ++i) + { + dataWidget->coordinates()->axes[i].setMajors(7); + dataWidget->coordinates()->axes[i].setMinors(5); + } + + double a = dataWidget->facets().first; + double b = dataWidget->facets().second; + + dimWidget->setText(QString("Cells ") + QString::number(a*b) + + " (" + QString::number(a) + "x" + QString::number(b) +")" ); + + updateColorLegend(7,5); + + dataWidget->coordinates()->axes[X1].setLabelString(QString("X1")); + dataWidget->coordinates()->axes[X2].setLabelString(QString("X2")); + dataWidget->coordinates()->axes[X3].setLabelString(QString("X3")); + dataWidget->coordinates()->axes[X4].setLabelString(QString("X4")); + + dataWidget->coordinates()->axes[Y1].setLabelString(QString("Y1")); + dataWidget->coordinates()->axes[Y2].setLabelString(QString("Y2")); + dataWidget->coordinates()->axes[Y3].setLabelString(QString("Y3")); + dataWidget->coordinates()->axes[Y4].setLabelString(QString("Y4")); + + dataWidget->coordinates()->axes[Z1].setLabelString(QString("Z1")); + dataWidget->coordinates()->axes[Z2].setLabelString(QString("Z2")); + dataWidget->coordinates()->axes[Z3].setLabelString(QString("Z3")); + dataWidget->coordinates()->axes[Z4].setLabelString(QString("Z4")); + + pickCoordSystem(activeCoordSystem); +} + + +void Mesh2MainWindow::pickCoordSystem( QAction* action) +{ + if (!action || !dataWidget) + return; + + activeCoordSystem = action; + + dataWidget->setTitle("QwtPlot3D (Use Ctrl-Alt-Shift-LeftBtn-Wheel or keyboard)"); + + if (!dataWidget->hasData()) + { + double l = 0.6; + dataWidget->createCoordinateSystem(Triple(-l,-l,-l), Triple(l,l,l)); + for (unsigned i=0; i!=dataWidget->coordinates()->axes.size(); ++i) + { + dataWidget->coordinates()->axes[i].setMajors(4); + dataWidget->coordinates()->axes[i].setMinors(5); + } + } + + if (action == Box || action == Frame) + { + if (action == Box) + dataWidget->setCoordinateStyle(BOX); + if (action == Frame) + dataWidget->setCoordinateStyle(FRAME); + grids->setEnabled(true); + } + else if (action == None) + { + dataWidget->setTitle("QwtPlot3D (Use Ctrl-Alt-Shift-LeftBtn-Wheel or keyboard)"); + dataWidget->setCoordinateStyle(NOCOORD); + grids->setEnabled(false); + } +} + +void Mesh2MainWindow::pickPlotStyle( QAction* action ) +{ + if (!action || !dataWidget) + return; + + if (action == polygon) + { + dataWidget->setPlotStyle(FILLED); + } + else if (action == filledmesh) + { + dataWidget->setPlotStyle(FILLEDMESH); + } + else if (action == wireframe) + { + dataWidget->setPlotStyle(WIREFRAME); + } + else if (action == hiddenline) + { + dataWidget->setPlotStyle(HIDDENLINE); + } + else if (action == pointstyle) + { + + dataWidget->setPlotStyle(Qwt3D::POINTS); +// Cone d(len,32); +// CrossHair d(0.003,0,true,false); +// dataWidget->setPlotStyle(d); + } + else + { + dataWidget->setPlotStyle(NOPLOT); + } + dataWidget->updateData(); + dataWidget->updateGL(); +} + +void +Mesh2MainWindow::pickFloorStyle( QAction* action ) +{ + if (!action || !dataWidget) + return; + + if (action == floordata) + { + dataWidget->setFloorStyle(FLOORDATA); + } + else if (action == flooriso) + { + dataWidget->setFloorStyle(FLOORISO); + } + else + { + dataWidget->setFloorStyle(NOFLOOR); + } + + dataWidget->updateData(); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::setLeftGrid(bool b) +{ + setGrid(Qwt3D::LEFT,b); +} +void Mesh2MainWindow::setRightGrid(bool b) +{ + setGrid(Qwt3D::RIGHT,b); +} +void Mesh2MainWindow::setCeilGrid(bool b) +{ + setGrid(Qwt3D::CEIL,b); +} +void Mesh2MainWindow::setFloorGrid(bool b) +{ + setGrid(Qwt3D::FLOOR,b); +} +void Mesh2MainWindow::setFrontGrid(bool b) +{ + setGrid(Qwt3D::FRONT,b); +} +void Mesh2MainWindow::setBackGrid(bool b) +{ + setGrid(Qwt3D::BACK,b); +} + +void Mesh2MainWindow::setGrid(Qwt3D::SIDE s, bool b) +{ + if (!dataWidget) + return; + + int sum = dataWidget->coordinates()->grids(); + + if (b) + sum |= s; + else + sum &= ~s; + + dataWidget->coordinates()->setGridLines(sum!=Qwt3D::NOSIDEGRID, sum!=Qwt3D::NOSIDEGRID, sum); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::resetColors() +{ + if (!dataWidget) + return; + + const RGBA axc = RGBA(0,0,0,1); + const RGBA bgc = RGBA(1.0,1.0,1.0,1.0); + const RGBA msc = RGBA(0,0,0,1); + const RGBA nuc = RGBA(0,0,0,1); + const RGBA lbc = RGBA(0,0,0,1); + const RGBA tc = RGBA(0,0,0,1); + + dataWidget->coordinates()->setAxesColor(axc); + dataWidget->setBackgroundColor(bgc); + dataWidget->setMeshColor(msc); + dataWidget->updateData(); + dataWidget->coordinates()->setNumberColor(nuc); + dataWidget->coordinates()->setLabelColor(lbc); + dataWidget->setTitleColor(tc); + + col_ = new StandardColor(dataWidget); + dataWidget->setDataColor(col_); + dataWidget->updateData(); + dataWidget->updateNormals(); + dataWidget->updateGL(); +} + + +void Mesh2MainWindow::pickAxesColor() +{ + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->coordinates()->setAxesColor(rgb); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickBgColor() +{ + + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->setBackgroundColor(rgb); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickMeshColor() +{ + + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->setMeshColor(rgb); + dataWidget->updateData(); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickNumberColor() +{ + + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->coordinates()->setNumberColor(rgb); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickLabelColor() +{ + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->coordinates()->setLabelColor(rgb); + dataWidget->updateGL(); +} +void Mesh2MainWindow::pickTitleColor() +{ + QColor c = QColorDialog::getColor( Qt::white, this ); + if ( !c.isValid() ) + return; + RGBA rgb = Qt2GL(c); + dataWidget->setTitleColor(rgb); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickLighting() +{ + lightingdlg_->show(); +} + +void Mesh2MainWindow::pickDataColor() +{ +#if QT_VERSION < 0x040000 + datacolordlg_->show(); +#else + QString s = QFileDialog::getOpenFileName( this, "", "./../../data/colormaps", "Colormap files (*.map *.MAP)"); + adaptDataColors(s); +#endif +} + +void Mesh2MainWindow::adaptDataColors(const QString& fileName) +{ + ColorVector cv; + + if (!openColorMap(cv, fileName)) + return; + + col_ = new StandardColor(dataWidget); + col_->setColorVector(cv); + + dataWidget->setDataColor(col_); + dataWidget->updateData(); + dataWidget->updateNormals(); + dataWidget->showColorLegend(legend_); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::pickNumberFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, this ); + if ( !ok ) + { + return; + } + dataWidget->coordinates()->setNumberFont(font); + dataWidget->updateGL(); +} +void Mesh2MainWindow::pickLabelFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, this ); + if ( !ok ) + { + return; + } + dataWidget->coordinates()->setLabelFont(font); + dataWidget->updateGL(); +} +void Mesh2MainWindow::pickTitleFont() +{ + bool ok; + QFont font = QFontDialog::getFont(&ok, this ); + if ( !ok ) + { + return; + } + dataWidget->setTitleFont(font.family(), font.pointSize(), font.weight(), font.italic()); +} + +void Mesh2MainWindow::resetFonts() +{ + dataWidget->coordinates()->setNumberFont(QFont("Courier", 12)); + dataWidget->coordinates()->setLabelFont(QFont("Courier", 14, QFont::Bold)); + dataWidget->setTitleFont( "Arial", 14, QFont::Normal ); + dataWidget->updateGL(); +} + +void Mesh2MainWindow::setStandardView() +{ + dataWidget->setRotation(30,0,15); + dataWidget->setViewportShift(0.05,0); + dataWidget->setScale(1,1,1); + dataWidget->setZoom(0.95); +} + +void Mesh2MainWindow::dumpImage() +{ + static int counter = 0; + if (!dataWidget) + return; + QString name; + + name = QString("dump_") + QString::number(counter++) + "."; + + if (filetype_ == "PS_GZ") + name += "ps.gz"; + else if (filetype_ == "EPS_GZ") + name += "eps.gz"; + else + name += filetype_; + +#if QT_VERSION < 0x040000 + IO::save(dataWidget, name.lower(), filetype_); +#else + VectorWriter* vw = (VectorWriter*)IO::outputHandler("PDF"); + if (vw) + vw->setSortMode(VectorWriter::BSPSORT); + IO::save(dataWidget, name.toLower(), filetype_); +#endif +} + +/*! + Turns animation on or off +*/ +void Mesh2MainWindow::toggleAnimation(bool val) +{ + if ( val ) + { + timer->start( redrawWait ); // Wait this many msecs before redraw + } + else + { + timer->stop(); + } +} + +void Mesh2MainWindow::rotate() +{ + if (!dataWidget) + return; + + dataWidget->setRotation( + int(dataWidget->xRotation() + 1) % 360, + int(dataWidget->yRotation() + 1) % 360, + int(dataWidget->zRotation() + 1) % 360 + ); +} + +void +Mesh2MainWindow::toggleProjectionMode(bool val) +{ + dataWidget->setOrtho(val); +} + +void +Mesh2MainWindow::toggleColorLegend(bool val) +{ + legend_ = val; + dataWidget->showColorLegend(val); +} + +void +Mesh2MainWindow::toggleAutoScale(bool val) +{ + dataWidget->coordinates()->setAutoScale(val); + dataWidget->updateGL(); +} + +void +Mesh2MainWindow::toggleShader(bool val) +{ + if (val) + dataWidget->setShading(GOURAUD); + else + dataWidget->setShading(FLAT); +} + +void +Mesh2MainWindow::setPolygonOffset(int val) +{ + dataWidget->setPolygonOffset(val / 10.0); + dataWidget->updateData(); + dataWidget->updateGL(); +} + +void +Mesh2MainWindow::showRotate(double x, double y, double z) +{ + rotateLabel->setText(" Angles (" + QString::number(x,'g',3) + " ," + + QString::number(y,'g',3) + " ," + + QString::number(z,'g',3) + ")"); +} +void +Mesh2MainWindow::showShift(double x, double y) +{ + shiftLabel->setText(" Shifts (" + QString::number(x,'g',3) + " ," + + QString::number(y,'g',3) + " )" + ); +} +void +Mesh2MainWindow::showScale(double x, double y, double z) +{ + scaleLabel->setText(" Scales (" + QString::number(x,'g',3) + " ," + + QString::number(y,'g',3) + " ," + + QString::number(z,'g',3) + ")"); +} +void +Mesh2MainWindow::showZoom(double z) +{ + zoomLabel->setText(" Zoom " + QString::number(z,'g',3)); +} + +void Mesh2MainWindow::openMesh() +{ +#if QT_VERSION < 0x040000 + QString data(QFileDialog::getOpenFileName( "../../data", "nodes (*.nod)", this ) ); + QString edges( QFileDialog::getOpenFileName( "../../data", "connectivities (*.cel)", this ) ); +#else + QString data( QFileDialog::getOpenFileName( this, "", "../../data", "nodes (*.nod)") ); + QString edges( QFileDialog::getOpenFileName( this, "", "../../data", "connectivities (*.cel)") ); +#endif + + if ( data.isEmpty() || edges.isEmpty() || !dataWidget) + return; + + + TripleField vdata; + CellField vpoly; + + readNodes(vdata, QWT3DLOCAL8BIT(data), NodeFilter()); + readConnections(vpoly, QWT3DLOCAL8BIT(edges), CellFilter()); + + dataWidget->loadFromData(vdata, vpoly); + dimWidget->setText(QString("Cells ") + QString::number(dataWidget->facets().first)); + + for (unsigned i=0; i!=dataWidget->coordinates()->axes.size(); ++i) + { + dataWidget->coordinates()->axes[i].setMajors(4); + dataWidget->coordinates()->axes[i].setMinors(5); + dataWidget->coordinates()->axes[i].setLabelString(QString("")); + } + + updateColorLegend(4,5); + pickCoordSystem(activeCoordSystem); +} + +void +Mesh2MainWindow::showNormals(bool val) +{ + dataWidget->showNormals(val); + dataWidget->updateNormals(); + dataWidget->updateGL(); +} + +void +Mesh2MainWindow::setNormalLength(int val) +{ + dataWidget->setNormalLength(val / 400.); + dataWidget->updateNormals(); + dataWidget->updateGL(); +} + +void +Mesh2MainWindow::setNormalQuality(int val) +{ + dataWidget->setNormalQuality(val); + dataWidget->updateNormals(); + dataWidget->updateGL(); +} + +bool +Mesh2MainWindow::openColorMap(ColorVector& cv, QString fname) +{ + if (fname.isEmpty()) + return false; + + ifstream file(QWT3DLOCAL8BIT(fname)); + + if (!file) + return false; + + RGBA rgb; + cv.clear(); + + while ( file ) + { + file >> rgb.r >> rgb.g >> rgb.b; + file.ignore(1000,'\n'); + if (!file.good()) + break; + else + { + rgb.a = 1; + rgb.r /= 255; + rgb.g /= 255; + rgb.b /= 255; + cv.push_back(rgb); + } + } + + return true; +} + +void +Mesh2MainWindow::updateColorLegend(int majors, int minors) +{ + dataWidget->legend()->setMajors(majors); + dataWidget->legend()->setMinors(minors); + double start, stop; + dataWidget->coordinates()->axes[Z1].limits(start,stop); + dataWidget->legend()->setLimits(start, stop); +} + +void Mesh2MainWindow::setFileType(QString const& name) +{ + filetype_ = name; +} + +void Mesh2MainWindow::enableLighting(bool val) +{ + dataWidget->enableLighting(val); + dataWidget->illuminate(0); + dataWidget->updateGL(); +} diff --git a/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.h b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.h new file mode 100644 index 0000000..435a325 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindow.h @@ -0,0 +1,134 @@ +#ifndef mesh2mainwindow_h__2004_03_07_13_38_begin_guarded_code +#define mesh2mainwindow_h__2004_03_07_13_38_begin_guarded_code + +#include "../../../include/qwt3d_surfaceplot.h" + + +#if QT_VERSION < 0x040000 +#include "mesh2mainwindowbase.h" +#else +#include "ui_mesh2mainwindowbase4.h" +#include "designerworkaround.h" +#endif + + + +//MOC_SKIP_BEGIN +#if QT_VERSION < 0x040000 + class DummyBase : public Mesh2MainWindowBase + { + public: + DummyBase(QWidget* parent = 0) + : Mesh2MainWindowBase(parent) + { + } + }; +#else + class DummyBase : public QMainWindow, protected Ui::MainWindow, protected DesignerWorkaround + { + public: + DummyBase(QWidget* parent = 0) + : QMainWindow(parent) + { + } + }; +#endif +//MOC_SKIP_END + +class QLabel; +class QTimer; +class QAction; +class QFileDialog; +class LightingDlg; +class ColorMapPreview; + +class Mesh2MainWindow : public DummyBase +{ + Q_OBJECT +public: + Mesh2MainWindow( QWidget* parent = 0 ); + ~Mesh2MainWindow(); + + Qwt3D::SurfacePlot* dataWidget; + +public slots: + void open(); + void openMesh(); + + void createFunction(QString const& name); + void createPSurface(QString const& name); + void setFileType(QString const& name); + + void pickCoordSystem( QAction* ); + void pickPlotStyle( QAction* ); + void pickFloorStyle( QAction* ); + void pickAxesColor(); + void pickBgColor(); + void pickMeshColor(); + void pickNumberColor(); + void pickLabelColor(); + void pickTitleColor(); + void pickDataColor(); + void pickLighting(); + void resetColors(); + void pickNumberFont(); + void pickLabelFont(); + void pickTitleFont(); + void resetFonts(); + void setStandardView(); + void dumpImage(); + void toggleAnimation(bool); + void toggleProjectionMode(bool); + void toggleColorLegend(bool); + void toggleAutoScale(bool val); + void toggleShader(bool val); + void rotate(); + void setPolygonOffset(int); + + void showRotate(double x, double y, double z); + void showShift(double x, double y); + void showScale(double x, double y, double z); + void showZoom(double z); + void showNormals(bool val); + void setNormalQuality(int); + void setNormalLength(int); + bool openColorMap(Qwt3D::ColorVector& cv, QString fname); + void adaptDataColors(const QString&); + void updateColorLegend(int majors, int minors); + + void setLeftGrid( bool b ); + void setRightGrid( bool b ); + void setCeilGrid( bool b ); + void setFloorGrid( bool b ); + void setFrontGrid( bool b ); + void setBackGrid( bool b ); + void setGrid( Qwt3D::SIDE, bool ); + + void enableLighting(bool val); + +private: + QLabel *filenameWidget, *dimWidget, + *rotateLabel, *shiftLabel, *scaleLabel, *zoomLabel; + + QTimer* timer; + int redrawWait; + + QAction* activeCoordSystem; + + bool legend_; + Qwt3D::StandardColor* col_; + + QFileDialog* datacolordlg_; + LightingDlg* lightingdlg_; + QString filetype_; + + // convenience compatib. code + bool connectA (const QObject* sender, const char * slot); + bool connectAG (const QObject* sender, const char * slot); + +#if QT_VERSION < 0x040000 + ColorMapPreview* colormappv_; +#endif +}; + +#endif /* include guarded */ diff --git a/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase.ui b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase.ui new file mode 100644 index 0000000..49a2625 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase.ui @@ -0,0 +1,1728 @@ + +Mesh2MainWindowBase + + + Mesh2MainWindowBase + + + + 0 + 0 + 954 + 710 + + + + + 5 + 5 + 0 + 0 + + + + + 381 + 328 + + + + Mesh2 + + + false + + + + unnamed + + + 11 + + + 6 + + + + Spacer4 + + + Vertical + + + Fixed + + + + 16 + 50 + + + + + + Layout11 + + + + unnamed + + + 0 + + + 6 + + + + Layout9 + + + + unnamed + + + 0 + + + 6 + + + + projection + + + + 0 + 0 + 0 + 0 + + + + Ortho + + + true + + + + + colorlegend + + + true + + + + 0 + 0 + 0 + 0 + + + + Legend + + + + + autoscale + + + true + + + + 0 + 0 + 0 + 0 + + + + Autoscale + + + true + + + Autoscale axes + + + Autoscale axes + + + + + mouseinput + + + + 0 + 0 + 0 + 0 + + + + Mouse + + + true + + + Enable mouse input + + + + + shader + + + true + + + + 0 + 0 + 0 + 0 + + + + Shading + + + true + + + Checked means Gouraud (smooth) shading, flat else + + + Checked means Gouraud (smooth) shading, flat else + + + + + + + Layout7 + + + + unnamed + + + 0 + + + 6 + + + + Layout6 + + + + unnamed + + + 0 + + + 6 + + + + normalsquality + + + 3 + + + 32 + + + 4 + + + true + + + Vertical + + + Above + + + 1 + + + Quality (Roundness) + + + + + normalslength + + + 1 + + + 100 + + + 5 + + + 8 + + + true + + + Vertical + + + Above + + + 5 + + + Length + + + + + + + TextLabel1 + + + Normals + + + + + + + + + frame + + + StyledPanel + + + Sunken + + + + + Layout8 + + + + unnamed + + + 0 + + + 6 + + + + normButton + + + + 0 + 0 + 0 + 0 + + + + + 50 + 35 + + + + + 50 + 35 + + + + 0 + + + Std + + + Set standard view + + + + + lighting + + + false + + + + 0 + 0 + 0 + 0 + + + + + 60 + 35 + + + + + 80 + 35 + + + + 0 + + + Lighting + + + Calibrate Lighting + + + + + lightingswitch + + + + + + Turn Lighting on/off. + + + + + Layout10 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel2 + + + Polygon Offset + + + AlignCenter + + + + + offsSlider + + + + 0 + 25 + + + + 30 + + + 1 + + + 5 + + + 5 + + + Horizontal + + + Above + + + 2 + + + Increase surface quality by setting polygon offset (OpenGL specific) + + + + + + + Spacer5 + + + Horizontal + + + Preferred + + + + 41 + 16 + + + + + + Layout9 + + + + unnamed + + + 0 + + + 6 + + + + TextLabel1_2 + + + Resolution + + + AlignCenter + + + + + resSlider + + + + 0 + 25 + + + + 1 + + + 100 + + + 1 + + + Horizontal + + + Above + + + 5 + + + Set data resolution (no effect for nonrectangular data) + + + + + + + + + + + menubar + + + + + + + + + + + + + + + + + + + + + + + + + + + + Toolbar + + + true + + + 0 + + + false + + + false + + + false + + + Toolbar + + + + + + + + png + + + + + bmp + + + + + ppm + + + + + xpm + + + + filetypeCB + + + + + Spacer3 + + + Horizontal + + + Fixed + + + + 20 + 20 + + + + + + + --- + + + + + Hat + + + + + Rosenbrock + + + + + Saddle + + + + + Sombrero + + + + + Ripple + + + + functionCB + + + + 150 + 0 + + + + Display function + + + + + + --- + + + + + Torus + + + + + Seashell + + + + + Boy + + + + + Dini + + + + + Cone + + + + psurfaceCB + + + Display parametric surface. Turn Lighting on for better quality. + + + + + + + Toolbar_2 + + + true + + + 0 + + + false + + + false + + + false + + + false + + + Toolbar_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + openFile + + + image0 + + + Open File + + + &Open File + + + Open File + + + Ctrl+O + + + + + Exit + + + Exit + + + Exit + + + Exit + + + Ctrl+Q + + + + + coord + + + Coordinates + + + &Coord + + + Coordinates + + + false + + + + Box + + + true + + + image1 + + + Box + + + Box + + + Box + + + Box + + + A + + + + + Frame + + + true + + + image2 + + + Frame + + + &Frame + + + Frame + + + Frame + + + F + + + + + None + + + true + + + true + + + image3 + + + No Axes + + + No Axes + + + No Axes + + + No Axes + + + + + + animation + + + true + + + image4 + + + Animation + + + Animation + + + Animation + + + Ctrl+A + + + + + dump + + + image5 + + + Dump Content + + + Dump Content + + + Dump Content + + + Dump Content + + + + + plotstyle + + + Plot Style + + + Plot Style + + + Plot Style + + + false + + + + wireframe + + + true + + + true + + + image6 + + + Wireframe + + + Wireframe + + + Wireframe + + + Wireframe + + + + + hiddenline + + + true + + + true + + + image7 + + + Hidden Line + + + Hidden Line + + + Hidden Line (EXPERIMENTAL!) + + + Hidden Line (EXPERIMENTAL!) + + + + + polygon + + + true + + + true + + + image8 + + + Polygon only + + + Polygon only + + + Polygon only + + + Polygon only + + + + + filledmesh + + + true + + + true + + + image9 + + + Mesh & filled Polygons + + + Mesh & filled Polygons + + + Mesh & filled Polygons + + + Mesh & filled Polygons + + + + + nodata + + + true + + + false + + + image10 + + + No Data + + + No Data + + + No Data + + + No Data + + + + + pointstyle + + + true + + + image11 + + + Points + + + Points + + + Points + + + + + + color + + + Color + + + &Color + + + Color + + + Color + + + false + + + false + + + + axescolor + + + Axes + + + &Axes + + + Axes + + + Axes + + + + + backgroundcolor + + + Background + + + &Background + + + Background + + + Background + + + + + meshcolor + + + Mesh + + + &Mesh + + + Mesh + + + Mesh + + + + + numbercolor + + + Numbers + + + &Numbers + + + Numbers + + + Numbers + + + + + labelcolor + + + Label + + + &Label + + + Label + + + Label + + + + + titlecolor + + + Caption + + + Caption + + + Caption + + + Caption + + + + + datacolor + + + Data Color + + + Data Color + + + Data Color + + + + + resetcolor + + + Reset + + + &Reset + + + Reset + + + Reset + + + + + + font + + + Fonts + + + &Fonts + + + Fonts + + + false + + + false + + + + numberfont + + + Scale numbering + + + &Scale numbering + + + Scale numbering + + + Scale numbering + + + + + labelfont + + + Axis label + + + &Axis label + + + Axis label + + + Axis label + + + + + titlefont + + + Caption + + + &Caption + + + Caption + + + Caption + + + + + resetfont + + + Reset + + + &Reset + + + Reset + + + Reset + + + + + + floorstyle + + + Floor Style + + + Floor Style + + + Floor Style + + + false + + + + floordata + + + true + + + image12 + + + Floor Data Projection + + + Floor Data Projection + + + Floor Data Projection + + + Floor Data Projection + + + + + flooriso + + + true + + + image13 + + + Floor Isolines + + + Floor Isolines + + + Floor Isolines + + + Floor Isolines + + + + + floornone + + + true + + + true + + + image14 + + + Empty Floor + + + Empty Floor + + + Empty Floor + + + Empty Floor + + + + + + openMeshFile + + + image15 + + + Open FEM files + + + Open FEM files + + + + + normals + + + true + + + image16 + + + Show normal vectors + + + Show normal vectors + + + + + grids + + + true + + + grid + + + grid + + + grid + + + false + + + false + + + + front + + + true + + + image17 + + + Action + + + Action + + + Front Grid + + + + + + + + back + + + true + + + image18 + + + Action_2 + + + Action_2 + + + Back Grid + + + + + right + + + true + + + image19 + + + Action_3 + + + Action_3 + + + Right Grid + + + + + left + + + true + + + image20 + + + Action_4 + + + Action_4 + + + Left Grid + + + + + ceil + + + true + + + image21 + + + Action_5 + + + Action_5 + + + Ceiling Grid + + + + + floor + + + true + + + image22 + + + Action_6 + + + Action_6 + + + Floor Grid + + + + + + + 89504e470d0a1a0a0000000d49484452000000100000000d0806000000a0bbee240000009049444154789c9d92410ac4200c457f4ab65de4429e6c6018989365e1755cf40076a18106621503f2157d21ff23e59c31ab9452b5bdaad2f3ee588155956c5933535a99603491aa12cf461cc156c4ccb55c00500008e41cc351736ed260a0a05ce2cea6724ad8b48718435ee3ea16fce3371b030b1efe7ce7e0ffd732e916f660e091c10e0cf40c803dd83558a9e81fdc37d14cdbb2be9c140000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000009e49444154789c633c76ec1803b5010b2e09df88f7ff3f7efa4d9261ac2c8c0c5c5c2cd80db5f37af5ffd0363146121dc860e7f5eaff8f9f7f1998a869e0a16d628c3f7ffe4335945203617c265c12e41ac8c0008d283baf57ff79785818ecbc5efd27d5506c0e8147d4b6554264b9129b38464451038c1a3a6a2895002c7751cd50e4ec4a1543711628d43290810129ef9353983030e02950c829f2f00100bdf84c6a92a74e8d0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000006e49444154789c633c76ec1803b5011332c7ceebd57faa1b4a2d306ae8a8a1a3865203c0b239d50cb5f37af5ffd03631460c430f6d1363b4f37af59fd48205d94006060606167405304998c1c88a893110aba1a4188ecd40bc8612321c978144194a8acb493614dd707c8026891f00185139a40ba3f8e90000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000009f49444154789c633c76ec1803b501133e493baf57ff49a19dfd5eff6760606060c4e6523baf57ff0f6d136324c795ae816ffe6375293906c25cbb7bbd08231336097200cc21765eaf505d4a890b91cd801bea15f68ea44881d1e80eb1f37af59ff1d8b16364470c2e7d58639f12000f537223089bbe43dbc418475d3a925dca0463906328b23e640ba8e652640b2876293607a1b8941c9a2e799f81818101000a06a3357133957f0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af4000002cb49444154789ced97cd6b134118879f6d420ba5474f62ff0441410f2e054fb9d4a3207ab5a8d05341a95aa546a8c58f2a9e02d2f6e6492f82a41e7a119115f16040a490a326d9cb26fd486c63348c87cd6c6626b3695a68eba12f2c939979dff7f7cce76e1ccff33848eb3b50f54380ff0120a9565cd7153627cff39cdd0a6c97b34f75948d66e9baae884bd44d58c6d8f2ca3ec7f3bc48bc1baddad76d4654d16ed0b23f6906026432f0b7de7e7a496afac87a26038d5af84058de7dd6f6d7f6c0f3c7303109953c08113e08b877159abfedeb192b7c19ca43303eaefbdf3c0fd747e1e95258d700fccf61b99a87be7e48f4436220146f36f4c038e15c3605c08973cbb689eab05d1d4375c3aac2b96c8a522120bff22336b6d90807914ea72d00ad5a62009c44b804cd063c7c054fdee881ea7248e15221c02f06e4577e4629a5bfb4b9b7615bd4de7a1989743add5a71c4ed4b885b1788ea663f2072d994c8655302104b2f4e8ac5e961b1383d2c66c606c5ccd8a000c4dc7d3dd6cc0188e818c64d99464b7b8d4b850080d16b5f599c1ec62f96231fc771b8b3f08b0737e0eca911462e7ed472e6b229de7f5f6662d2d88452cc7c6cc27e3188e24c71c709af8946152ae58d28565aa910b0d50a8900c223988e4064298fa629ac8a4a6159aeaf8587fe4f0d2ac106c96442f3f58b01f58a01b055a68314e0dd87e5aec2e6a8a7e66b5adf6aa54ab3d93400cad4d70c807a251ce5d1634722c752a14d1a3762f95b0aabb7a5dc5836681c0b805f0ca85537239feac66604600aab0053f3b58e0bc9148a834faa8e7eb16ca7b5089b2336df7caeeb0ac7d19747cb65ce40ac393ac076c2aacdbe040898bd32a4b5abfb449b0193d416d48bb0ea17f70695edda45649202acafd578f47a67df04aad940d5b69e3e484cf25e846d10b63c8efc6362be5e6de54e857bb108208ed424de5380bdb433a78f8b4f5fbe750c62dffe17d8c4f71520ce0e01fe01ed94001160906df80000000049454e44ae426082 + + + 789cbdd45b4fdb301407f0f77e8a08bfa1e99034899d68da03f7fba5dc61da83e3246d81722db430edbbcfe76f070d08d39e963f48f9d5a7c6764e989b0d4ef7b683d9b9cec3588f872630037d1fcc968fa3d1f3f71fdf7e7666ba61607f940cba335f3a3334084c20425cf0269c71e01538e7c04f70c181e7d951cc81fb70c681c7b0e6c0d7ecaee4c0f7b0e2c0353bd61cf8929de0822b38e3c025ac396c71011749e1f76360c3c138be9f2669e2c70b1817bc066769e6c74fe03ccd9dc510d6a9f6e38b7091367faf0b9bd4784bb84a2bef295b86b239ef235849e5ad1b4b9c87c0fe64269bf5dcc2b9f4eba13d58cb663d5b70219bf59cc246faf508377f294b3f7e0857b259df315ccbda7bc256a16ad67b00472af2de8563157b4770a29af3dd8753957adfc0f6f2eec1996af627e09c03efc04619df8f195ca9caf59f183456158cfe437bb87e4960fb402337df066c0fd4f7e3f2abdd7ce8bface0605cc12633be5f5fe0322b5dbf0af4571e71301ec3499ec4eeefafc3b68162f7fd25d83ec0d8ede70ecef22c467fd2336c72e3fa5de03cf29283f190ad430e8c7ed74aab14fb134563edd647302ed4a770cd81cfd9789ddd7ce86ffbfa24caed27877120f0196c38f036db841c78158e38f0021c73e047981fa87bdf1f603e6037ff08ae38f0155c73d83dfc3f29933274f5bd3109d25490a1b22515d5d4a7416fec7a8b867441977445a3d65cd30dddd2c0bd87b6f28eeee981c62d79a4279ad0d4d716f44c2f344f0b9f6460b3e86b0d2dd132add02a3e7d1ff7e99aaf2d699d3668d37eda9e016db5d47e366f5bedff9a771bf958bbd33a2b6797f63ed4f6de659f0ee8d03e87897d6a7fafbdb1955b7464e73cb6bf27ffb886099dbe3eb7f6da333aa7107791adeefada8a624a5a6a535fdbb3bb93beb62645995ddfdbda5c9010b8e395376be85b4d847e5b2b0a2184c1fdb12845e56b07f64ca6fccd37b5b5e80b773f154371e16aed3bf4d909fc11fb0efdfadaf90db563e86f + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000036249444154789cad955f485b6718c67fc71c63625193e11facc6d6ceaca9b55d7ae18522bd50acb13427548d10e386462c0c7b212d2c92ad7485c2d04ba1174abb9be1dd50a8f462ea5a5c87b8ddc82a6a2f8a7fd0760612ab47433c9e846f17838d4e5775f4b97ebf1fcffb3eeff77dd2d4d4141f5a29c73d70f76ea10804be17efab918f0af3f97c229148c36e7fc2a9534edc6eb7906599919111e97f396d686810555555f4f77f8bc1f09a8a8acfe8ebeb2391481c587f28545114e1f178181c1c241c0e939efe07e1b0896bd7bc381c0e9a9a9af68de250a8244974767602303c3c8cc3616263432299cc201008b0b3b3733ca76eb75b9c3bf73977ee4c73fbf697cccfcf73f1621eba2e989d7d85d56ac566b3d1dcdcfc8edbf706959a6aa2ac2c84ae47989e7e84a669dcbbf70579795f110afd4c3cfe94643289d1683c9a534551c4f5eb01b6b63ec2ebb563b797e072b9387ffe6336379f70f3e6d74c4c4cd0d3d343341a3d1a5492242e5fbe81ae434e4e84999919aaababb15ab3387122055dcf233f3f9ff2f2720c06c3e150455144454525cbcbf99c3d0b2b2bbfa2aa2a4ea7134982e2e24f585e8664126c361bd9d9d98743f7f6f690652b53535bc8f2ef3c7b3641515111369b0d803367f2585b83adad04f1781c8bc582dfefff3b2ce9df77dfe3f188e2e262eedfff81070f72585fbfc1dada530c0603252525689a86c552425a5a3f66f337cccefec4f6f636aaaa323a3a2a1de854d334fc7e3f60c3e13071eb5623b1580c9fcf87dfef27232383a2222b261354567ae9eeeea6a5a5054dd3febbfddcdc5cae5ef5323e0e57ae08c6c646292b2b23140ae1f57a515595c64637a5a599a4a656d0dede4e6b6b2b66b3f960687d7dbde8e8e86075351f21e0f4e930939393288a4266662691488468344a4e4e36972ec1cb97a069505050406161213e9f4fbc03adabab1356ab95b1b15f78f8f00d172eacf2fcf98fa8aa4a4d4d0d009b9b9b689a86d168a4b414c261585901b3d94c5b5b1b1b1b1bff04e5f178444a4a0ac160909327ed3c7ebcca8b178fd8d98922cb32b5b5b5389d4ee6e6e6181f1fa7abab8bc5c57516173b494fff8db76fbf63696989dddd5d2c16cb5fd06030287a7b7bf7bd8b03030362616181582c0640229120994ca2eb3a0059599fa2eb7176775f3134342401b85c2eb16fa53e848efd9d1c457f02e3f74bd7fe3f92e00000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000032f49444154789ccd954b48aa6b14869f5fff3684110a6184a905890e0a0cb1081a841199a24245176c104917880641749b37e832286892831a3588a068e2406ad04428a22b5d402a68521405997929ed3f8320d8b4f7ae7d3883b3868bf53debfdd6fbf12d21140af15f87ec6f0f381c0ec9e9744a7faa11bf0b6b6d6d9592c924e9741abd5e8fcbe592445164757555f8574aebebeba5caca4a666767c9cacaa2a4a48489890952a9d42febbf84badd6ec9e3f1e0f7fbb9bdbd45ad5673717181c3e1c06432d1d8d8f869145f420541a0b3b313809595152c160bd7d7d7c4e3713a3a3a8846a37fa7d4e572494545450c0e0e323030c0c9c909656565bcbebeb2bfbf8f4aa542abd5d2d4d4f493da3f1a258a226363631c1d1db1b0b0403299647a7a9a4422417f7f3f0a8582743acd8f1f3fbea7d4ed764bcdcdcd545555d1d7d787c160c06eb7333f3f4f6e6e2e3d3d3dacafaf333c3cccfdfdfdf7a08220d0d5d5852008dcdcdcb0b7b787cd66c36ab5623018787c7c242f2f0fabd58a5c2eff1aea76bba58a8a0a0a0b0b01d8d9d921128960369b114511bd5ecff1f131a9540aad564b4e4eced7d0979717323232686b6b636969898d8d0d743a1d5aad1680d2d252c2e130f7f7f7c4e371944a255eaff7c3ac4f46793c1ec96432313636462010606a6a8aebeb6be472392d2d2de8f57aeeeeee8846a3f4f6f6120e87797a7a221289f05b683299c4ebf562341a311a8de8f57a7c3e1fdddddd188d4600a2d128e170188bc582d3e9e4fcfc9c999999df43d56a350d0d0d004892442010a0b8b898d1d151b2b3b33ff25b5b5b442211464646383b3bc3eff7ff7aa675757592cfe743a3d100707373c3e6e6266eb7fb0308ef2fc366b3b1bdbd4d2c1643a3d1909f9f4f6b6babf413b4b6b65652a954048341262727d9dddd25180c128944a8aeaefe64667979395757579c9d9d919999497b7b3b0f0f0fef4d43a1101e8f4792c9640c0d0d515050c0f2f232070707c462314451a4a6a606b3d94c4646c6c7f50f0f0f595b5b43a7d3a15028b8bcbc249148a0542adfa1434343d2f8f8f8a77f716e6e4e3a3d3de5f9f9f923f7f6f6462c167b37441449a552c864321617170500bbdd2e09ff8b75f29df8072ad2411c44a7ba050000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000001f149444154789ccd95bf6b5a5114c73fef298d20c14715b120e2f806e990ada34aab0ebe27a2832e85f817b410dedfe01808b45b978810a18180a393e1b5a1b482143a6490fe701031a9b4b12ae8ed906290e7cfd2a107ce70bff7dccffd9e33dc2b99a6c9bf0e79db03d96c56a45229b1aac6be292c97cb89c964422814c2e170904c2685dd6ee7f4f454fa2b683a9d16d16894e3e76f80cb3faa0bcf93fec2fab5ed6b9a26745de778ff037cdf994b5555c964329651ac756ab3d978f9f802ae772c7be7cf6e70edffb4e82ba19aa6897c3e0fd76f97d6288a62d156b66fb3d938f4376e5d2ec9482482aeeb732358eaf4cee5fb55f7f2eac125ca783ca72d854a92c4e1f01c862b99b38ed642354d13e17018ae3eae27021e8f676ebd70a6e3f19893de3bb8fab5512a8a42a15098cdd5e254d775a1aa2af43e6fe41260efd11ed56a75b6b64047a31117df3e6d0c0478715642b9b96bda02f57abdf0a5b51514e09eebfe62682291105ffb7d7e6c8d04bfdf4f2e9713e572599a4163b19870bbddf4fa8b1f8975f1bad1e0e1ee2e0092699ae8ba2e6459c6300c82c120954a8566b3492010c0e7f3e1743a797a743407393938a0d3e900d0ed7669b55a0c87431445b9851a86218ac5a2e55dacd7eba256abd16eb767da743a653018ccd5c9b24ca9549200e2f1b890fe8bef6493f80da5c2b9a2130355fd0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000002af49444154789ccd953d4c535118869f7b7b2929a505c34fd55aa988112126c41023098383290dd8de188146347132ea6270eaee62181c5c4c18d88418217670c1451773a3c60583160d52498c3f840a2df4f68a2dc7413dd814f9310e9ee44ddeefdcef3cf77cdfb93f8a6118fceba16e77416767a7e8eaea121be5685b855d8844c4c2b76fe4f3791af7ec410f8584aa69c46231e5afa017755d4c8ebb80121a3a05cf6e7f052af00452ebe66f5a7e5f28245edca986c552582ca5c2e391fef3dd5a7ababb8b5ab12934abaab0502ad5d2da4ad3f925192f2f2f6f6fa7a1504834eddbc7c99b2e58b0e3bd32c750db24e97c9ef1c7c7197f72029fcf476f6f6fc16e37eca9db66e361772900fdd7e7d12c8be61b694ccbe2522c46b5c3415e08ec767bc1ba3f42c3e1b0b81c08c0c22c00b51e0fb3915d0034c5e0d5a92a99bbe3d6e4d6ca7702d7caa72099856496b14f9fa46fdcbf5f7a9259ec36dbe6d070382c5adadae04b562abdb424fd3dc70c91d91a19f794956d0e5d5959a14c51389d3b085fb2f47b0354d5d515dce4e5bb77d2dbdc6ece9d3d2b0faba8a7baae8b63f5f58ccc3e05e068898f0f6363b8148533b6dd845329a69c4ed29939faca8f104f2448659749a7d3fc11aa59160fe6decaf819aff16654e2ce5578fff30d5a82fbce9d8c3c7f24f35c5fd79eaaa2f26babab61de94ba10eca1f9d0a18239e64d0eb7b616c4e50ec71ac4300c29afdb2dd250a0030d0d4573bf146a6f97fe6a7dbdf0d7d509c330d6caefe8e810355555247feb0d402e9522b9de69026f3e7e94d7aecccc30e47201a0188681aeeb425555a2d1287ebf9fd1d151262626304d13bba6313c3dbd2eb4d7efc7b7772f4ea7934422816559545656fe8046a35131303050f45d1c1c1c14f1789c4c2623e7565757314d13004dd3c8e572a8aacaf0f0b002100c0685f25ffc4eb632be03f01c3f1b679402620000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000025449444154789cad95bf4b725118809ffb71cda09f46dca1a5fe0169edd2108498e2d022414d91fd030d39b555343605d190181886e020b8b40971c5868c96a2200871b0a0522aaf50be0d1f5e3efbae7dfad1b31ddef33ee73de73d87a31886c14ff3abd3048fc7237ebf5f7e4cbabcbc2c9aa6e176bb191d1d6d296e5b3a313121b95c8e603048575717434343e8ba6e2b6e4baaebba288a42bd5ea756ab717777c7d3d3139148846030f897f89fd29b9b1ba9d56a00c4e3719e9f9f595f5fa7bbbb9bc1c1414cd3ecbcd2442241b95ca6582c128d46098542cccfcf53a954787878a0afaf8f4020d054edb7d2442221b1580c4dd3000887c3e8ba0ec0f1f1313b3b3bf4f7f7333232d294a77c774fabd5aa4c4f4fdbc63e3e3e787b7bc3e17090cfe795b6a4ad3adb8a6c366b895b6e3f9d4ed368d0fbfb3b22cd6b346276d84a2f2e2e646f6f8f72b90cc0fefe3ed168d48a9f9c9cb0b2b2c2ebeb6bfbd2a5a5250e0f0fd1348dfbfb7b76777771381c0098a6c9d1d111e3e3e3389dcef6a46b6b6b522a95e8e9e90160606080adad2d666666005055158fc783d7eb45555500cecfcf595d5db5ce47fd2a9d9b9bb384004ea7d31236a4b3b3b34d39bdbdbd140a05fb4a53a9942c2e2ee272b96cb7d58ab1b131dc6eb7bdf4f4f4d46a4e27a8aacac6c606979797bf8fc0300c0cc3c0344d7979799106f57a5d229188e4f3791111797c7c94838303b9bebeb6e65c5d5d492a95923f310c03756a6a4a32998c727676a67cad20994ccaeded2dd56a5501d8dede96c9c949161616acb99b9b9b323c3c6c8d7d3e9f7cfb4cff978ebf9376f80482fc1c4c4b56a72d0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000018b49444154789ca595c16ac2401086bf4421822028b2143df80a3dbaf8183ea78fa1b9f424f4d46bcd412c2156c1404c7a48679b351b6ddaff363bb3ffcc3f339b789bcd86b6582e7401b05a879ecbdf6d43a67549f6087e1b524194c3cb7bf47fd2f97c5e9c4e27263e4c7c188d468d95ff8a546b5d789e479ee7e62c8e63e36b4daab52ed2340560301810e5a5fc5eafd778e72ee972a18b890f4992b0dbed2cdff178b412b7aa1440290560fa09309bcd2cbb8abb2b15fdb490e9746af9aed72bd001200ced7d6dacd43500e92740a7d331f6afe44b900c28cbb29a54f1b9e0241539499200d0edd6bb140401e7f3d9495a8b9677fdf6794629c57ebf472965645f2e17b34e411000a24017f22d68ec69bfdf07e0f94931f1e1703898aaa5152e054ed22887d78fb816381e8f0da9eb4e75536a11699a321c0ead0b2e922ab22cb39259956aad0b194e1b484b641e5da80f4756a75a511cc79682bb49aac676bbfd7e19f632974986264918869e1412e5a5bd5adf90defe16c40e433929096e9f63d399f7977fd4237c01356dabc16040cf010000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000a949444154789cedd4210ec2301886e1b764084e0306f38969041804090acb1948b8010967d805309304fb131cc7014c512c7475ed1024fb64c59357fca93333badea073b1477f8216ed07493e07343317a10093c52609bcd715d02a95e4a7ab35f04a423f8b4a8bd13309ba5627cccc05a8245f6ee7e4560628c030b1f2723c37950d2ac9cf76259086b6d794a656d6fb5b50095048f2cbc31878e4e57dcd01d9c71ea1fd7ffa1fe81b2e1b2dcf4b906cbb0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000000b549444154789ced94210e843010456736bd018223ec1d8ac490705e120c92b90ba266cdcaa2a6197e0b0858b109dff1075eff6f1b5844e86ebd6e273ed09f401d1adefb780528229c4175609fabb68b611a4f3d0de4d05460d57629317e7ca62ca9c210d4f47524229a8785756edfb5811254cd008b20ace9eb68c1d8aa9814810a38d2fbfbd99c83b329f7aa63624c86da24b575c234f23c2c8cf5f1d4ed5e2668c9b4b2f54bd7a82426a2cb973d833effd3ff80aec3fb78ab235e84730000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000006049444154789ced94410a00310803a3ecabfc3ff9d6eea950aca79a1e169a63846110d148421d97132ff408f4c94544bc1d20495ba063b0031c429ecb5de01cd94e6721afca6e24a659c8abb29bb66925e46a4b003000ed635fa0f79ffe03fa017ed12c22088282610000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d49484452000000100000000d0806000000a0bbee24000000b449444154789c9d92b109c3301444ef9b0ba4c94a1ec08517c8162e3580cb6ce1055c6400155e47858a182cf8298284432c47e8e07302f18ee34bb22c0bfea91f1f1acfb319647fd794c0b319244e0c8b2e250d728d66330801a06ddb54d15a2b39700f470949edb68069f5b85f6f785e98858fc21b00099e568f6e0b70defd784e0d80049f795624d5bfbcf68ae4248be770076ac2d91e3fcb1b096bad084975de55c1c0ee156ae01400a00afe0a28d1d13f780395128c0ebcec51330000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000003d349444154789cad955d4c935718c77fefcb8b1d8375654851b4ad4416d88749759822ebdc3242305cf015207cc4cd091931123232b30e2f5d3243e2c7c55822178b81086431d130038b78e1dce21b8dcb00c900d18c0db715c720016d2994becf2eb05860cc64f19f9c9be79cffff3ce7fc9273145dd7791672166549ff455d01d0c285f06478623de5e5e589a2287477772faf8bf40328e14e9f165c515121f3f3f3f87c3e1c0e075eaf974d9aca2d2659ed53230be1e2ea9d8b8b8bc5ed76d3dcdc4c5c5c1c3b76ece0f467c7f8c878c8bcacf42e1f3f5291c18b4083f10285c5959c3c758ad6d656ac562b13f7ee92bfd1c4a449e168289efdab32d4d5a191e1374351442950535303c0850b17c8743aa9fce30eea8d6bdc79ef30edbed01aefbaa100e5626170fbeb7ce2f170e4c811868686c8c8c8e077037e2a39c8424616369b8d4365256b41ad07a9a8a8483a3b3b191c1ce4ecd9b3dcbf7f9fc4c4441e3c7880d96c263636965028446660862f03134f3ad4751d5dd7f12721e1a1eb3a5b3626487d7dbd1886218661486969a954555589aeeb929e9e2ec78f7f2e133775b95e53295713357914e1d5feadc3cd856fca2975036fb876a12c06f1fe3d455f5f1f8d8d8deccec8207fd34becedf91acb77177939c14a833c87e962effaf4014a0c0b1fa624937cee0c0b3f5c66f4d5ddcccecee2743ad114855da62886a682ec3ed38669f3566e65ee793aa8bb0b217aede9d4a91606141377bebf8add6ec766b381a6e12b3bc0c94706d30949cc2d04b199e3682d2f5ce6a2f8935801a9a0a040525252686b6ba3a7a7878e8e0ebc5e2f515151a4a6a6e27038989c9ca4bfbf1f97cbc56fa3a324cd4e73626e826455881663e5f1b71766496dc8c42bd97b49b3db486b68c0e170505d5d4d6d6d2d6969692082e997515efbf9470a1ffe49d28b0662183c3f67a0893ca11fa6766c638c746e35cbecbb4e0994e5c842739334969788dbed969999191111916050825f7d2157766e974b79efc8e2e56fe4dee56ef9d81a27df5a3788aeeb4b771a267f32b8815f0f7f4a5c470fdafb87f0dd1de1af1bd7c9cfcfc76c363f46aba11dac63bcee28a7032af3ee6cac7bdee2da96540ec56c5e092a373757e2e3e3e9edbdc289b6730c6c72d0b5f36d2ef943646767af81e972b9181f1f67646484989818f61ff880a9e9e92550baae53505020aaaae2f178d8b66d1be7cf9f67606000bfdf8fa669e4e4e4e0743a898e8e064044b87dfb365d5d5dd8ed76626363191b1b23100860b15896423d1e8f343535ad79435b5a5a647878189fcfb75c330c03bfdffff82634161717515595f6f6760560dfbe7da23cabef2452fff94afd5ffd032309c5843513f3e00000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000001d649444154789cad94bd6e13411485bf593b71a0c146c2a1020ccf00c52e72401148aca248502081441f3a9078803c000554d0d3514488c2a141518c3c083a1e00cc4f43369158689238b22f0d331acf4c420239cd68eedd337beeb9335769ad396c247b25db7921075967e7d70540c594b6f3426edf9a63e1ce7b75509557ae6f48f4d07f413b2fa4db692af0ca3765003c7d76417ce25e3007b6f3e2ff95ba0a0daa00833495fec4595a3b9ff85c39c599e157bb7eacb43837ec07f17ee534ade117ba5a2bff274a6bcd5a96cb74af6393db692635dd0b9ae4c77d9e4102d090722ca8109e3f3a1278aa180ff93ca3340128d5b12079f3dee65faf538cd7ed345515a02e3ff9955d9629d9b6c9eff377e5f8c6878034485301d85235eacef7aed2aaf963b3b7ac5ce2c9974f02a5833495c93f8d99048aec9a34234a13a3d447cc531f319ef5f487aa07c9fd781ae359a5b12ebe5afc26ae62b377d78694366f5ea0bda765362b0923a622c6ef862d55634442bdf73aa8a80a705436310d587a3892b9a58b76efc26f94b90946e1d84071bdb9f120d9f7b87379eefbb79e1aaf008654a287b8f1179716a521250b57df842f4f6bcdcacc7dc976ded9e1b1969c607ab46ef7bbc5df4e9c6766f57150d9a10d6917bf0149be09d8da731f230000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000022049444154789cbd544d6b1351143d379f6d864ea682465d48d322fe8350c6121424b571ef42a9086ebaf00f7415b7baa94217821604578a6e131a2c81e03c24bf40d1dae2424d049b843469c666ae8b38d397f9282d8a67f378e7bd7bdeb9e732434208fc6b44820e4c5de78fe1699c1f7cc666388d99c1165aa422c96d67bf1d3e87a9c11767dd8ca431b3bf05f2737a7bbec60f07f7a1bd794d32dfd72f725c188772f5b96b1cf273f96c3d4389ee370f4fe0402e9b6f30004c5a3b1811b50f00a0379ef27b2f10d5e22902802625fddb07803d7d8e4d8ac2faf36e0816e26ca24f315808814150b88b7d446086c610e65f600063dc3f709abffe9365b71d52a01a15baa13e85666c5041590681515096a1191b74537d829810c444d0de9669c2a8906a54a849c9a16836dfe0e2cb1324b731c11d0040b19426005829e788415829e7c8e6efccbf63f068ce1ab786a2b6908c9e72c613897b506bebb3e42edc21edc0a95b20b1fbd5376b19f7aebc62f74393dc0c1ed4eea5ab1c35db81825d1a47827b6090d3c11ec5612134fca2b2f906bb23889a6dc48418e14c5d679b8b01b89babf0834e010951753853d73930d3ae72f6f0de01ac962f7beafe7fa6ef6f3de2e94f2f503fad23f55de0472a8393f59ab3da7c4bbb8064f383b3af46f5a1a85fa647c1c2c236974a539e3a4fa68f9f67bc7f8d00c88272849e4c97166b47762cd7c9c61ca7c771280bf90dd971bab458732e1c67f59b45e0f4ff06bf01765c1564eeb8ff4b0000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000018b49444154789cad94bd4e02511085cf6c02283f020df8136da8b4a222e49290d068dc589b6882356fe05368a9f696da8a89da68e426121b5f4134c62d600984c8168c05b98bb8a0bb614f738bbd33fbcd99b943524af82dedaf8f45dd602fe76de9902d21982691167583f7f7765029d7c92d9d25040340478b616252afb284e00e45d198cf60a3f7325ebe2a0300cece73ec0c9f4e18e32eb277a764527c36524b087ed3966184d790edd6d1a330a2dc1d91eabb4d4f4d39d87a6600785d5847fee698340c30c75fe85074485ad40d7ea8a65c3745e9b3a073ba56256541435bc1eae07d483a29a11b4f936cc2286cdbf7328f1764527c98f4678394dc8c539f4288700f412909009a854d4e707b36d210f71191f776acf27426d21625008cc6ea434b23a6baefa7a72d4af8eba9fad1bfa4d3cecb238d43dcc753e90400d00b2fc112826b81bc3f730a8c7c0d4a490e52b76f5e95aa129a14b76d7078ea65dd9914b70953b56b3bce26f542a894e0369a5a72ac5163a495729dbc6e7a19c861f1f1ca51992f4bfab7be019433035af1a435310000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000001b749444154789cad944f4b1b4118879f775bb361ab348945db2248f150f00388cc4a3c94169b43a128bdf7de0fd4bb070f1e7a2901e9a12071ce822741d4937f626b23d8e82ed5d74399ed26ae66433a971766769ff799df0c23d65afef7f0b22663633436463f2c6c2940b5d6cc555fbd3b5100c9323d0e6b1a143c46be7f957e2d5fbfffa1b74c6363b4ac2dfce8b42f98b3fdf6e589744077e79614a060adb483677d41d7eb63e2e00934364627ae0f28582bcdf0ad16db477d19a6e19e03ee0dbd00a031ff494b7ac685041d3fdd559d61ba89586bd9ac7e544faf7979b58322146d432213aa6f37ee3da86aada9dd50808700d37fb639976104c5812e82a7f83db69e054c328dc4a7a897c9426c8c06edc31ec8db79ba461e80af1187de780204888aa33da1f79afe9212538dd5e48382b5e25ffe1cccb4ac2d4ec337c91d05683f7a3e986977a600c1ef83c14cd399c2df5cf7a71601f8bc3ca377d5f5fa9874cf27f7f438ace9f8465ddc21c1bf187a9966459064eac6f9c8642ea0db6aba4107b4258f39091714a0b2b692fbb94b83d20d3c80929ef160b89cdb300dca3a2c0fa031344b656d45f2bef0e99a9569e6cb3fe8b801fd070405ed1b07300000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a5960000018549444154789ced95414b024114c7ff6f152b08db223d98873282fc021dc6f21015e8a50f10de3dd457a83e46f7e8d6d98282c0720e42e782b02e5b9041b9218186be2eedb0ee4eb946dd7a97997d33fffffce6bd852129257e3bc2ba645b080680ebd01ce63b37782113e3dc402d3483d9ce9defdb191bc618ccaeed376d0bc18f460cb5c51d88f226188421b4109192d2005e33cb6cb28d371a41fafc800020fda933bb3676cd6d90fbfa0e2100300804f69ef965d81445ac724c3dd76f0bc1969140eae29000e0617d8b279f2e119192bc87ea728e61365f679252fa363f67d6388c77442b674aaccb79419c50a4f7e124a684e0dbd03452dc846524302c043b4d68191318ed3671b5b4c1aa3980cf5091aee42c3e3d4af62c0689d59cc5271a9d01003ac3bdfd85be5dd21966f375369c8977b158a8f625d7e9caa53819cee427a43add3f697fd2efc672294edebcfa4fb3f93aeb8c8390ea743ed220b574c2ad7397c257d320b5d419b90f50a48310ba8d74cd52a4c542556d1864d4d594fee28dfa001f1808dc614860130000000049454e44ae426082 + + + 89504e470d0a1a0a0000000d4948445200000015000000150806000000a917a596000001b349444154789ced94bf6b144114c73fb3b7779eec9122c64b90588414162a5888e244b7500cdc220111442336da68e79f23889585b6a6486171e081235af9a34825118c928c21a0b9c0b9c7f92c64c6cbdd1073674a1f2cb36fdebcef7ededbc728630c7b6dd14ec134b332c87a61eeab00a810699a5999bf7e893b375fab41292f5e5e97a0e8309666561a8b55053de5bb3200ee3f3a25bd893b99134c33fbefa4dd84ce3c69767563a09fe2d65e414f1afadab0949e3414d84d4f4379696625722fbdc1dd8c5328afb15855ff498727bd3bdb089206873fd75abe4c9ee7d04a1d3b7e9aeada2bb62a87499a9f589bd08caf1ab62a9324cd15ecc419aaab2ffdb9b7f131fae634d75a004ac6047db7d7a1c0e3f2156ed5eff59ddb469a6b2dadf218e5d6fadf2aa74d91226def6faa0a075e3cfb73a1d46a1fe5f3d9390118a92fa86eaa9231aafb71fb8979aeae8d3cf4a24ed08b3efd36cffe2461293e02809da9499ba2f79d6dcccc4a4bedf3ad78f2fd36363ab8ad350031c09bf8382736df532a4cfdee57344a51da942427d75a3e14a698ee2cf3231aa5f2b3c9d2b91b32dd59e65d7c94938d077d53b2679774b7fd0274cf01d1d4dbcbe90000000049454e44ae426082 + + + + + Exit + activated() + Mesh2MainWindowBase + close() + + + lightingswitch + toggled(bool) + lighting + setEnabled(bool) + + + + diff --git a/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase4.ui b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase4.ui new file mode 100644 index 0000000..7da1ef5 --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/mesh2mainwindowbase4.ui @@ -0,0 +1,479 @@ + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + Mesh2 + + + + + 8 + + + 8 + + + 8 + + + 8 + + + 6 + + + 6 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Std + + + + + + + false + + + Lighting + + + + + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Polygon Offset</p></body></html> + + + + + + + 30 + + + 5 + + + 5 + + + Qt::Horizontal + + + QSlider::TicksAbove + + + 2 + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Resolution</p></body></html> + + + + + + + 1 + + + 100 + + + Qt::Horizontal + + + QSlider::TicksAbove + + + 5 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 71 + 20 + + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Ortho + + + true + + + + + + + Legend + + + + + + + Autoscale + + + true + + + + + + + Mouse + + + true + + + + + + + Shading + + + true + + + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + <html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:MS Shell Dlg; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Normals</p></body></html> + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + 3 + + + 32 + + + 4 + + + 3 + + + Qt::Vertical + + + true + + + QSlider::TicksAbove + + + + + + + + 0 + 0 + + + + 1 + + + 100 + + + 5 + + + 8 + + + Qt::Vertical + + + true + + + QSlider::TicksAbove + + + + + + + + + + + + + + + + + + + + lightingswitch + toggled(bool) + lighting + setEnabled(bool) + + + 181 + 568 + + + 144 + 568 + + + + + diff --git a/lib/tqwtplot3d/examples/mesh2/src/thesis.tex b/lib/tqwtplot3d/examples/mesh2/src/thesis.tex new file mode 100644 index 0000000..cde629b --- /dev/null +++ b/lib/tqwtplot3d/examples/mesh2/src/thesis.tex @@ -0,0 +1,9 @@ +\documentclass{slides} +\usepackage[dvips]{color} +\usepackage{times} +\usepackage{graphicx} + +\begin{document} +\include{dump_0.pdf} +%\include{dump3b} +\end{document} -- cgit v1.2.3