00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include <QtGui>
00032
00033 #include "glwidget.h"
00034 #include "window.h"
00035 #include "mesh_type.h"
00036
00037
00038 Window::Window()
00039 {
00040 glWidget = new GLWidget;
00041
00042 fvButton = createButton("FlipV()",SLOT(flipV( )));
00043 feButton = createButton("FlipE()",SLOT(flipE( )));
00044 ffButton = createButton("FlipF()",SLOT(flipF( )));
00045 neButton = createButton("NextE() {FlipE() + FlipF() }",SLOT(nextE( )));
00046 nbButton = createButton("NextB() ",SLOT(nextB( )));
00047 ldButton = createButton("Load TriMesh",SLOT(OpenFile( )));
00048 vfButton = createButton("++()",SLOT(nextVfite()));
00049
00050 QVBoxLayout *mainLayout = new QVBoxLayout;
00051 mainLayout->addWidget(glWidget);
00052 mainLayout->addWidget(fvButton);
00053 mainLayout->addWidget(feButton);
00054 mainLayout->addWidget(ffButton);
00055 mainLayout->addWidget(neButton);
00056 mainLayout->addWidget(nbButton);
00057 mainLayout->addWidget(vfButton);
00058 mainLayout->addWidget(ldButton);
00059 setLayout(mainLayout);
00060
00061 glWidget->glWrap.m = &glWidget->mesh;
00062
00063 setWindowTitle(tr("TriMesh Pos Demo"));
00064 }
00065
00066
00067 QPushButton *Window::createButton(const char *text, const char *setterSlot)
00068 {
00069 QPushButton *button = new QPushButton( text,0);
00070 button-> resize ( 50, 20 );
00071
00072 if(!connect(button, SIGNAL(clicked()), glWidget, setterSlot))
00073 exit(0);
00074 return button;
00075 }