From afc883bfc132d3109654b7b1ebfc2132e61ee386 Mon Sep 17 00:00:00 2001 From: ganovelli Date: Fri, 19 Oct 2012 15:08:37 +0000 Subject: [PATCH] removed --- apps/unsupported/tetra_decimator/main.cpp | 76 --- .../tetra_decimator/tetra_decimator.vcproj | 145 ---- apps/unsupported/tetraviewer/MainFrame.ui | 619 ------------------ apps/unsupported/tetraviewer/main.cpp | 64 -- apps/unsupported/tetraviewer/mainframe.cpp | 258 -------- apps/unsupported/tetraviewer/mainframe.h | 92 --- apps/unsupported/tetraviewer/mainframe.ui.h | 82 --- .../unsupported/tetraviewer/moc_mainframe.cpp | 128 ---- .../tetraviewer/moc_myglwidget.cpp | 134 ---- apps/unsupported/tetraviewer/myclasses.h | 13 - apps/unsupported/tetraviewer/myglwidget.cpp | 394 ----------- apps/unsupported/tetraviewer/myglwidget.h | 151 ----- .../tetraviewer/qmake_image_collection.cpp | 27 - apps/unsupported/tetraviewer/tetrastats.h | 74 --- 14 files changed, 2257 deletions(-) delete mode 100644 apps/unsupported/tetra_decimator/main.cpp delete mode 100644 apps/unsupported/tetra_decimator/tetra_decimator/tetra_decimator.vcproj delete mode 100644 apps/unsupported/tetraviewer/MainFrame.ui delete mode 100644 apps/unsupported/tetraviewer/main.cpp delete mode 100644 apps/unsupported/tetraviewer/mainframe.cpp delete mode 100644 apps/unsupported/tetraviewer/mainframe.h delete mode 100644 apps/unsupported/tetraviewer/mainframe.ui.h delete mode 100644 apps/unsupported/tetraviewer/moc_mainframe.cpp delete mode 100644 apps/unsupported/tetraviewer/moc_myglwidget.cpp delete mode 100644 apps/unsupported/tetraviewer/myclasses.h delete mode 100644 apps/unsupported/tetraviewer/myglwidget.cpp delete mode 100644 apps/unsupported/tetraviewer/myglwidget.h delete mode 100644 apps/unsupported/tetraviewer/qmake_image_collection.cpp delete mode 100644 apps/unsupported/tetraviewer/tetrastats.h diff --git a/apps/unsupported/tetra_decimator/main.cpp b/apps/unsupported/tetra_decimator/main.cpp deleted file mode 100644 index d1376cf1..00000000 --- a/apps/unsupported/tetra_decimator/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ - - -#include - -// stuff to define the mesh -#include -#include -#include - -// io -#include -#include -#include - - -class MyEdge; -class MyTetrahedron; -class MyFace; -class MyVertex:public vcg::VertexATVMVNf{} ; -class MyTetrahedron : public vcg::TetraATAVTQ{}; - -class MyTMesh: public vcg::tetra::Tetramesh< std::vector, std::vector >{}; - - -#include -#include - - -vcg::LocalOptimization *loc; -//vcg::tetra::TetraEdgeCollapse c; -MyTMesh mesh; - -int main(int,char**argv,int num_op){ - loc=new vcg::LocalOptimization(mesh); - - vcg::tetra::io::ImporterTS::Open(mesh,argv[1]); - //vcg::tetra::io::ImporterTS::Open(mesh,"d:/sphere.ts"); - printf("mesh loaded %d %d \n",mesh.vn,mesh.tn); - - /*vcg::tetra::TetraEdgeCollapse *_ ; - bool res;*/ - - vcg::tetra::UpdateTetraTopology - ::VTTopology(mesh.vert,mesh.tetra); - - vcg::tetra::UpdateTetraTopology - ::TTTopology(mesh.vert,mesh.tetra); - - vcg::tetra::UpdateTetraTopology - ::setExternalVertices(mesh.vert,mesh.tetra); - - vcg::tetra::TetraEdgeCollapse::Init(mesh,loc->h); - - bool res; - do{ - loc->SetTargetOperations(num_op); - - res = loc->DoOptimization(); - - printf("ood %d\n bor %d\n vol %d \n lkv %d \n lke %d \n lkf %d \n", - FAIL::OFD(), - FAIL::BOR(), - FAIL::VOL(), - FAIL::LKV(), - FAIL::LKE(), - FAIL::LKF() - ); - printf("mesh %d %d \n",mesh.vn,mesh.tn); - }while(!res); - - - vcg::tetra::io::ExporterPLY::Save(mesh,"out.ply"); - - return 0; - -} diff --git a/apps/unsupported/tetra_decimator/tetra_decimator/tetra_decimator.vcproj b/apps/unsupported/tetra_decimator/tetra_decimator/tetra_decimator.vcproj deleted file mode 100644 index 05ccdf2d..00000000 --- a/apps/unsupported/tetra_decimator/tetra_decimator/tetra_decimator.vcproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/unsupported/tetraviewer/MainFrame.ui b/apps/unsupported/tetraviewer/MainFrame.ui deleted file mode 100644 index eb3c2f3b..00000000 --- a/apps/unsupported/tetraviewer/MainFrame.ui +++ /dev/null @@ -1,619 +0,0 @@ - -MainFrame - - - MainFrame - - - - 0 - 0 - 908 - 846 - - - - TetraView - - - - file - - - - 70 - 0 - 90 - 80 - - - - - - - - OpenButton - - - - 10 - 10 - 70 - 60 - - - - - - - - - - buttonGroup1 - - - - 160 - 0 - 470 - 80 - - - - - - - true - - - - BoxButton - - - - 10 - 30 - 51 - 31 - - - - box - - - true - - - - - WireButton - - - - 80 - 30 - 40 - 30 - - - - Wire - - - true - - - - - HiddenButton - - - - 130 - 30 - 60 - 31 - - - - Hidden - - - true - - - - - FlatWireButton - - - - 260 - 30 - 61 - 31 - - - - FlatWire - - - true - - - - - SmoothButton - - - - 330 - 30 - 50 - 30 - - - - Smooth - - - true - - - - - SmallTetraButton - - - - 390 - 30 - 60 - 30 - - - - SmallTetra - - - true - - - - - FlatButton - - - - 200 - 30 - 50 - 30 - - - - Flat - - - true - - - true - - - false - - - false - - - - - - buttonGroup2 - - - - 630 - 0 - 230 - 80 - - - - - - - true - - - - TrackButton - - - - 140 - 20 - 61 - 31 - - - - Trackball - - - true - - - true - - - false - - - - - SectionButton - - - - 40 - 20 - 71 - 31 - - - - Section - - - true - - - - - - myGLWidget - - - - 70 - 70 - 790 - 720 - - - - - - - MenuBar - - - - - - - - - - - - - - - - - - - - - - - - - MyGLWidget -
D:/sf/apps/tetraviewer/myglwidget.h
- - -1 - -1 - - 0 - - 5 - 5 - 0 - 0 - - image0 - signal() - setBox() - setWire() - setHidden() - setFlat() - setFlatWire() - setSmallTetra() - setSmooth() - TrackMouseModality() - SectionMouseModality() - slot() - slot() - SwitchTextSimplex() - slot() - SwitchTextPhysics() - slot() - SwitchTextQuality() -
-
- - - - fileOpenAction - - - false - - - false - - - - - - Open - - - &Open... - - - Ctrl+O - - - - - fileExitAction - - - Exit - - - E&xit - - - - - - - - helpContentsAction - - - Contents - - - &Contents... - - - - - - - - helpIndexAction - - - Index - - - &Index... - - - - - - - - helpAboutAction - - - About - - - &About - - - - - - - - new_menunew_itemAction - - - - - - - - - - - infoSimplexAction - - - true - - - true - - - Simplex - - - Simplex - - - - - infoQualityAction - - - true - - - Quality - - - Quality - - - - - infoPhysicsAction - - - true - - - Physics - - - Physics - - - - - - 89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b000003b149444154789cad94514c5b5518c77fe7dc4b7b4b6150bb96324418ca32358bee6192609c51d883892ce083f1718b3ebb185f8dc91e972cf39d2d6a78d0b027b3cd07d9e68c81c625a6c139408a4384f416100aed6d4b7bdb7b8e0fc0921a70c6ed7b3ae7e43bbff3fffedfc927e2f138bbd1dbdbab7902118fc785d8058f8d8de9aeae2e72b91cb66de338ce7f82e47239666767492412b8aefbf0dcdc553a323242f4501d918e2d3a8f15a9784584100809a609526eafd1a0f54e6142e029c5c21f3ef41583bb77a805efbe1ce9d86279e32619678eaab7853fa0f02a16abb64166ad0cdac75307eb3874b84cb0a14aa5a24108cc0688c48c9a4a1e826ddbe6f0b12219678e8ace610502ccdfafe3f68d3c33bf6c01c59dcc209d472c4e0d35d2f3ba81d205d06005e4de60c77170bd2255af80150870f70e8c0eaf009260a349577714e913a4175d16925b5cbe50607931cc3b677c68ca28a5f7066f5b26f00760febec9e8f032a0e81b68a17fc0201415989647a9d8c4c498cbe8f05f5cff3a4d4bac8bfe210b290b35e01afd428257b1b875cd01aaf4bd1de5dd0fea688e1530ad1c1bab16b7af17393558cf997311c0e49bafd670d6258621f6576c9ab09a3248fe5ae6c08103f49f36517213d33070369bf8e2529ee9c90ceb2b2eef7f14617c2c48722a4b7226845143fa87622905ebeb6514253a9eb5084504a66950c88618bee0303d99217cb09e9ed71a09369538fa523d00e9a50a42eed3bc6d8f41281fa0903e8561796cac86f8f2b33c33930ea0f0fb4d5adbeb30ad22866ffbbad226d2a805d7ee0484220208925aaa50deaa67e27b97e9c90ccdcdf5c462cdd8a94d2e7e62f3603244ea410989a4ed191f52a8fd156b056d9d553a9e0bf0e7ef45c6bf7339fd5e90ec7a88575e6d20d6e6e7e2a755ec854dce7fb8885b2cd014f6f3c2714d3a550bae55ac35c1068fb7061b00b87a7995899b25ce9e0b73e24d8fae97b37c7cbe9370b499fce6066eb54adf6098f6ee2a9a7ff9c70841a5023d270deca510d746537c7e29cdf8ad20475fb4307c82d4fc324ec6859d66fdfc6381e44014b36e9fe6e572393ca54068aa22cfd0598b686b3737aeae90bc9725796f0350802414b6e81b7c9a9f7e70708a2e6e5991cfeee3f1ecec2c0b0b3e8c068142a2a8d23728397132c6dc6f2e2b8b0a8da4b5ddc7f3c735ed47146f0cb4502983693a4c25ca7b83138904fa8a412466e00f48b4271086c2901263676c4a6990b615b6ade15b85694af239984a94585bf6f606bbae5b334f1f37e4a3531e031c8fc7c5a312ff17f849c3e3f1b8f81b8be6900aca9b61c90000000049454e44ae426082 - - - - - fileOpenAction - activated() - MainFrame - fileOpen() - - - helpAboutAction - activated() - MainFrame - helpAbout() - - - helpContentsAction - activated() - MainFrame - helpContents() - - - helpIndexAction - activated() - MainFrame - helpIndex() - - - BoxButton - pressed() - myGLWidget - setBox() - - - WireButton - pressed() - myGLWidget - setWire() - - - HiddenButton - pressed() - myGLWidget - setHidden() - - - FlatButton - pressed() - myGLWidget - setFlat() - - - FlatWireButton - pressed() - myGLWidget - setFlatWire() - - - SmoothButton - pressed() - myGLWidget - setSmooth() - - - SmallTetraButton - pressed() - myGLWidget - setSmallTetra() - - - OpenButton - clicked() - MainFrame - fileOpen() - - - SectionButton - pressed() - myGLWidget - SectionMouseModality() - - - TrackButton - pressed() - myGLWidget - TrackMouseModality() - - - infoPhysicsAction - activated() - myGLWidget - SwitchTextPhysics() - - - infoQualityAction - activated() - myGLWidget - SwitchTextQuality() - - - infoSimplexAction - activated() - myGLWidget - SwitchTextSimplex() - - - fileExitAction - activated() - MainFrame - close() - - - - MainFrame.ui.h - - - fileNew() - fileOpen() - fileSave() - fileSaveAs() - fileExit() - helpIndex() - helpContents() - helpAbout() - setWire() - - - - - myglwidget.h - -
diff --git a/apps/unsupported/tetraviewer/main.cpp b/apps/unsupported/tetraviewer/main.cpp deleted file mode 100644 index de12cc38..00000000 --- a/apps/unsupported/tetraviewer/main.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include "mainframe.h" - -#include -#include -#include -#include -#include - - -//#include -#include "myglwidget.h" - - -MyTetraMesh TM; -MyTetraMesh *tm; -TetraStats Stats; -typedef vcg::tetra::io::ImporterTS ImpTS; -typedef vcg::tetra::UpdateTetraTopology UT; -typedef vcg::tetra::UpdateNormals UN; -typedef vcg::tetra::UpdateBounding UB; - - -//MainFrame *wp; - -void openTetraMesh(const char* filename) -{ -//opening the tetrahedral mesh - QString path=QString(filename); - QString ext =path.right(3); - TM=MyTetraMesh(); - - if (ext==".ts") - ImpTS::Open(TM,filename); - else - vcg::tetra::io::ImporterPLY ::Open(TM,filename); - - UT::TTTopology(TM.vert,TM.tetra); - UT::ClearVTTopology(TM.vert,TM.tetra); - UT::VTTopology(TM.vert,TM.tetra); - UN::PerVertex(TM); - UB::Box(TM); - tm=&TM; - Stats.SetTetraMesh(tm); - Stats.Update(); -} - - - -int main( int argc, char ** argv ) -{ - - tm=0; - - QApplication a( argc, argv ); - MainFrame w; -// wp=&w; - w.show(); - - a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) ); - - return a.exec(); -} - diff --git a/apps/unsupported/tetraviewer/mainframe.cpp b/apps/unsupported/tetraviewer/mainframe.cpp deleted file mode 100644 index ecfb43dc..00000000 --- a/apps/unsupported/tetraviewer/mainframe.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'MainFrame.ui' -** -** Created: Mon Oct 4 19:00:57 2004 -** by: The User Interface Compiler ($Id: mainframe.cpp,v 1.2 2004-10-04 18:45:48 ganovelli Exp $) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ - -#include "mainframe.h" - -#include -#include "myglwidget.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "MainFrame.ui.h" -/* - * Constructs a MainFrame as a child of 'parent', with the - * name 'name' and widget flags set to 'f'. - * - */ -MainFrame::MainFrame( QWidget* parent, const char* name, WFlags fl ) - : QMainWindow( parent, name, fl ) -{ - (void)statusBar(); - if ( !name ) - setName( "MainFrame" ); - setCentralWidget( new QWidget( this, "qt_central_widget" ) ); - - file = new QGroupBox( centralWidget(), "file" ); - file->setGeometry( QRect( 70, 0, 90, 80 ) ); - - OpenButton = new QPushButton( file, "OpenButton" ); - OpenButton->setGeometry( QRect( 10, 10, 70, 60 ) ); - OpenButton->setPixmap( QPixmap::fromMimeSource( "Open64.png" ) ); - - buttonGroup1 = new QButtonGroup( centralWidget(), "buttonGroup1" ); - buttonGroup1->setGeometry( QRect( 160, 0, 470, 80 ) ); - buttonGroup1->setExclusive( TRUE ); - - BoxButton = new QPushButton( buttonGroup1, "BoxButton" ); - BoxButton->setGeometry( QRect( 10, 30, 51, 31 ) ); - BoxButton->setToggleButton( TRUE ); - - WireButton = new QPushButton( buttonGroup1, "WireButton" ); - WireButton->setGeometry( QRect( 80, 30, 40, 30 ) ); - WireButton->setToggleButton( TRUE ); - - HiddenButton = new QPushButton( buttonGroup1, "HiddenButton" ); - HiddenButton->setGeometry( QRect( 130, 30, 60, 31 ) ); - HiddenButton->setToggleButton( TRUE ); - - FlatWireButton = new QPushButton( buttonGroup1, "FlatWireButton" ); - FlatWireButton->setGeometry( QRect( 260, 30, 61, 31 ) ); - FlatWireButton->setToggleButton( TRUE ); - - SmoothButton = new QPushButton( buttonGroup1, "SmoothButton" ); - SmoothButton->setGeometry( QRect( 330, 30, 50, 30 ) ); - SmoothButton->setToggleButton( TRUE ); - - SmallTetraButton = new QPushButton( buttonGroup1, "SmallTetraButton" ); - SmallTetraButton->setGeometry( QRect( 390, 30, 60, 30 ) ); - SmallTetraButton->setToggleButton( TRUE ); - - FlatButton = new QPushButton( buttonGroup1, "FlatButton" ); - FlatButton->setGeometry( QRect( 200, 30, 50, 30 ) ); - FlatButton->setToggleButton( TRUE ); - FlatButton->setOn( TRUE ); - FlatButton->setAutoDefault( FALSE ); - FlatButton->setDefault( FALSE ); - - myGLWidget = new MyGLWidget( centralWidget(), "myGLWidget" ); - myGLWidget->setGeometry( QRect( 70, 80, 790, 720 ) ); - - buttonGroup2 = new QButtonGroup( centralWidget(), "buttonGroup2" ); - buttonGroup2->setGeometry( QRect( 630, 0, 230, 80 ) ); - buttonGroup2->setExclusive( TRUE ); - - TrackButton = new QPushButton( buttonGroup2, "TrackButton" ); - TrackButton->setGeometry( QRect( 140, 20, 61, 31 ) ); - TrackButton->setToggleButton( TRUE ); - TrackButton->setOn( TRUE ); - TrackButton->setDefault( FALSE ); - - SectionButton = new QPushButton( buttonGroup2, "SectionButton" ); - SectionButton->setGeometry( QRect( 40, 20, 71, 31 ) ); - SectionButton->setToggleButton( TRUE ); - - // actions - fileNewAction = new QAction( this, "fileNewAction" ); - fileNewAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "" ) ) ); - fileOpenAction = new QAction( this, "fileOpenAction" ); - fileOpenAction->setToggleAction( FALSE ); - fileOpenAction->setOn( FALSE ); - fileOpenAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "" ) ) ); - fileSaveAction = new QAction( this, "fileSaveAction" ); - fileSaveAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "" ) ) ); - fileSaveAsAction = new QAction( this, "fileSaveAsAction" ); - filePrintAction = new QAction( this, "filePrintAction" ); - filePrintAction->setIconSet( QIconSet( QPixmap::fromMimeSource( "" ) ) ); - fileExitAction = new QAction( this, "fileExitAction" ); - helpContentsAction = new QAction( this, "helpContentsAction" ); - helpIndexAction = new QAction( this, "helpIndexAction" ); - helpAboutAction = new QAction( this, "helpAboutAction" ); - new_menunew_itemAction = new QAction( this, "new_menunew_itemAction" ); - infonew_itemAction = new QAction( this, "infonew_itemAction" ); - infoSimplexAction = new QAction( this, "infoSimplexAction" ); - infoSimplexAction->setToggleAction( TRUE ); - infoSimplexAction->setOn( TRUE ); - infoQualityAction = new QAction( this, "infoQualityAction" ); - infoQualityAction->setToggleAction( TRUE ); - infoPhysicsAction = new QAction( this, "infoPhysicsAction" ); - infoPhysicsAction->setToggleAction( TRUE ); - - - // toolbars - - - // menubar - MenuBar = new QMenuBar( this, "MenuBar" ); - - - File = new QPopupMenu( this ); - fileNewAction->addTo( File ); - fileOpenAction->addTo( File ); - fileSaveAction->addTo( File ); - fileSaveAsAction->addTo( File ); - File->insertSeparator(); - filePrintAction->addTo( File ); - File->insertSeparator(); - fileExitAction->addTo( File ); - MenuBar->insertItem( QString(""), File, 1 ); - - Help = new QPopupMenu( this ); - helpContentsAction->addTo( Help ); - helpIndexAction->addTo( Help ); - Help->insertSeparator(); - helpAboutAction->addTo( Help ); - MenuBar->insertItem( QString(""), Help, 2 ); - - Info_2 = new QPopupMenu( this ); - new_menunew_itemAction->addTo( Info_2 ); - infoSimplexAction->addTo( Info_2 ); - infoQualityAction->addTo( Info_2 ); - infoPhysicsAction->addTo( Info_2 ); - MenuBar->insertItem( QString(""), Info_2, 3 ); - - languageChange(); - resize( QSize(908, 846).expandedTo(minimumSizeHint()) ); - clearWState( WState_Polished ); - - // signals and slots connections - connect( fileNewAction, SIGNAL( activated() ), this, SLOT( fileNew() ) ); - connect( fileOpenAction, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); - connect( fileSaveAction, SIGNAL( activated() ), this, SLOT( fileSave() ) ); - connect( fileSaveAsAction, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) ); - connect( helpAboutAction, SIGNAL( activated() ), this, SLOT( helpAbout() ) ); - connect( helpContentsAction, SIGNAL( activated() ), this, SLOT( helpContents() ) ); - connect( helpIndexAction, SIGNAL( activated() ), this, SLOT( helpIndex() ) ); - connect( BoxButton, SIGNAL( pressed() ), myGLWidget, SLOT( setBox() ) ); - connect( WireButton, SIGNAL( pressed() ), myGLWidget, SLOT( setWire() ) ); - connect( HiddenButton, SIGNAL( pressed() ), myGLWidget, SLOT( setHidden() ) ); - connect( FlatButton, SIGNAL( pressed() ), myGLWidget, SLOT( setFlat() ) ); - connect( FlatWireButton, SIGNAL( pressed() ), myGLWidget, SLOT( setFlatWire() ) ); - connect( SmoothButton, SIGNAL( pressed() ), myGLWidget, SLOT( setSmooth() ) ); - connect( SmallTetraButton, SIGNAL( pressed() ), myGLWidget, SLOT( setSmallTetra() ) ); - connect( OpenButton, SIGNAL( clicked() ), this, SLOT( fileOpen() ) ); - connect( SectionButton, SIGNAL( pressed() ), myGLWidget, SLOT( SectionMouseModality() ) ); - connect( TrackButton, SIGNAL( pressed() ), myGLWidget, SLOT( TrackMouseModality() ) ); - connect( infoPhysicsAction, SIGNAL( activated() ), myGLWidget, SLOT( SwitchTextPhysics() ) ); - connect( infoQualityAction, SIGNAL( activated() ), myGLWidget, SLOT( SwitchTextQuality() ) ); - connect( infoSimplexAction, SIGNAL( activated() ), myGLWidget, SLOT( SwitchTextSimplex() ) ); -} - -/* - * Destroys the object and frees any allocated resources - */ -MainFrame::~MainFrame() -{ - // no need to delete child widgets, Qt does it all for us -} - -/* - * Sets the strings of the subwidgets using the current - * language. - */ -void MainFrame::languageChange() -{ - setCaption( tr( "TetraView" ) ); - file->setTitle( QString::null ); - OpenButton->setText( QString::null ); - buttonGroup1->setTitle( QString::null ); - BoxButton->setText( tr( "box" ) ); - WireButton->setText( tr( "Wire" ) ); - HiddenButton->setText( tr( "Hidden" ) ); - FlatWireButton->setText( tr( "FlatWire" ) ); - SmoothButton->setText( tr( "Smooth" ) ); - SmallTetraButton->setText( tr( "SmallTetra" ) ); - FlatButton->setText( tr( "Flat" ) ); - buttonGroup2->setTitle( QString::null ); - TrackButton->setText( tr( "Trackball" ) ); - SectionButton->setText( tr( "Section" ) ); - fileNewAction->setText( tr( "New" ) ); - fileNewAction->setMenuText( tr( "&New" ) ); - fileNewAction->setAccel( tr( "Ctrl+N" ) ); - fileOpenAction->setText( tr( "Open" ) ); - fileOpenAction->setMenuText( tr( "&Open..." ) ); - fileOpenAction->setAccel( tr( "Ctrl+O" ) ); - fileSaveAction->setText( tr( "Save" ) ); - fileSaveAction->setMenuText( tr( "&Save" ) ); - fileSaveAction->setAccel( tr( "Ctrl+S" ) ); - fileSaveAsAction->setText( tr( "Save As" ) ); - fileSaveAsAction->setMenuText( tr( "Save &As..." ) ); - fileSaveAsAction->setAccel( QString::null ); - filePrintAction->setText( tr( "Print" ) ); - filePrintAction->setMenuText( tr( "&Print..." ) ); - filePrintAction->setAccel( tr( "Ctrl+P" ) ); - fileExitAction->setText( tr( "Exit" ) ); - fileExitAction->setMenuText( tr( "E&xit" ) ); - fileExitAction->setAccel( QString::null ); - helpContentsAction->setText( tr( "Contents" ) ); - helpContentsAction->setMenuText( tr( "&Contents..." ) ); - helpContentsAction->setAccel( QString::null ); - helpIndexAction->setText( tr( "Index" ) ); - helpIndexAction->setMenuText( tr( "&Index..." ) ); - helpIndexAction->setAccel( QString::null ); - helpAboutAction->setText( tr( "About" ) ); - helpAboutAction->setMenuText( tr( "&About" ) ); - helpAboutAction->setAccel( QString::null ); - new_menunew_itemAction->setText( QString::null ); - new_menunew_itemAction->setMenuText( QString::null ); - infonew_itemAction->setText( tr( "new item" ) ); - infonew_itemAction->setMenuText( tr( "new item" ) ); - infoSimplexAction->setText( tr( "Simplex" ) ); - infoSimplexAction->setMenuText( tr( "Simplex" ) ); - infoQualityAction->setText( tr( "Quality" ) ); - infoQualityAction->setMenuText( tr( "Quality" ) ); - infoPhysicsAction->setText( tr( "Physics" ) ); - infoPhysicsAction->setMenuText( tr( "Physics" ) ); - if (MenuBar->findItem(1)) - MenuBar->findItem(1)->setText( tr( "&File" ) ); - if (MenuBar->findItem(2)) - MenuBar->findItem(2)->setText( tr( "&Help" ) ); - if (MenuBar->findItem(3)) - MenuBar->findItem(3)->setText( tr( "Info" ) ); -} - diff --git a/apps/unsupported/tetraviewer/mainframe.h b/apps/unsupported/tetraviewer/mainframe.h deleted file mode 100644 index 5134271c..00000000 --- a/apps/unsupported/tetraviewer/mainframe.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** Form interface generated from reading ui file 'MainFrame.ui' -** -** Created: Mon Oct 4 19:00:57 2004 -** by: The User Interface Compiler ($Id: mainframe.h,v 1.1 2004-10-04 18:01:36 ganovelli Exp $) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ - -#ifndef MAINFRAME_H -#define MAINFRAME_H - -#include -#include -#include - -class QVBoxLayout; -class QHBoxLayout; -class QGridLayout; -class QSpacerItem; -class QAction; -class QActionGroup; -class QToolBar; -class QPopupMenu; -class MyGLWidget; -class QGroupBox; -class QPushButton; -class QButtonGroup; - -class MainFrame : public QMainWindow -{ - Q_OBJECT - -public: - MainFrame( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel ); - ~MainFrame(); - - QGroupBox* file; - QPushButton* OpenButton; - QButtonGroup* buttonGroup1; - QPushButton* BoxButton; - QPushButton* WireButton; - QPushButton* HiddenButton; - QPushButton* FlatWireButton; - QPushButton* SmoothButton; - QPushButton* SmallTetraButton; - QPushButton* FlatButton; - MyGLWidget* myGLWidget; - QButtonGroup* buttonGroup2; - QPushButton* TrackButton; - QPushButton* SectionButton; - QMenuBar *MenuBar; - QPopupMenu *File; - QPopupMenu *Help; - QPopupMenu *Info_2; - QAction* fileNewAction; - QAction* fileOpenAction; - QAction* fileSaveAction; - QAction* fileSaveAsAction; - QAction* filePrintAction; - QAction* fileExitAction; - QAction* helpContentsAction; - QAction* helpIndexAction; - QAction* helpAboutAction; - QAction* new_menunew_itemAction; - QAction* infonew_itemAction; - QAction* infoSimplexAction; - QAction* infoQualityAction; - QAction* infoPhysicsAction; - -public slots: - virtual void fileNew(); - virtual void fileOpen(); - virtual void fileSave(); - virtual void fileSaveAs(); - virtual void fileExit(); - virtual void helpIndex(); - virtual void helpContents(); - virtual void helpAbout(); - void setWire(); - -protected: - -protected slots: - virtual void languageChange(); - -private: - QPixmap image0; - -}; - -#endif // MAINFRAME_H diff --git a/apps/unsupported/tetraviewer/mainframe.ui.h b/apps/unsupported/tetraviewer/mainframe.ui.h deleted file mode 100644 index ac83a54c..00000000 --- a/apps/unsupported/tetraviewer/mainframe.ui.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** ui.h extension file, included from the uic-generated form implementation. -** -** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. -** -** You should not define a constructor or destructor in this file. -** Instead, write your code in functions called init() and destroy(). -** These will automatically be called by the form's constructor and -** destructor. -*****************************************************************************/ - - -#include -#include -#include - -extern void openTetraMesh(const char *); - -void MainFrame::fileNew() -{ - -} - - -void MainFrame::fileOpen() -{ - QString filename = QFileDialog::getOpenFileName( - "", - "Tetrahedral Meshes File (*.ts *.ply)", - this, - "open file dialog" - "Choose a TS Tetrahedral mesh file" ); - if (filename!=NULL) - { - const char *path=filename.ascii(); - openTetraMesh(path); - } -} - - -void MainFrame::fileSave() -{ - -} - - -void MainFrame::fileSaveAs() -{ - -} - - - -void MainFrame::fileExit() -{ - -} - - -void MainFrame::helpIndex() -{ - -} - - -void MainFrame::helpContents() -{ - -} - - -void MainFrame::helpAbout() -{ - -} - - -void MainFrame::setWire() -{ - -} diff --git a/apps/unsupported/tetraviewer/moc_mainframe.cpp b/apps/unsupported/tetraviewer/moc_mainframe.cpp deleted file mode 100644 index d0513441..00000000 --- a/apps/unsupported/tetraviewer/moc_mainframe.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************\ -** MainFrame meta object code from reading C++ file 'mainframe.h' -** -** Created: Mon Oct 4 19:00:57 2004 -** by: The Qt MOC ($Id: moc_mainframe.cpp,v 1.1 2004-10-04 18:01:36 ganovelli Exp $) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#undef QT_NO_COMPAT -#include "mainframe.h" -#include -#include - -#include -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.2. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -const char *MainFrame::className() const -{ - return "MainFrame"; -} - -QMetaObject *MainFrame::metaObj = 0; -static QMetaObjectCleanUp cleanUp_MainFrame( "MainFrame", &MainFrame::staticMetaObject ); - -#ifndef QT_NO_TRANSLATION -QString MainFrame::tr( const char *s, const char *c ) -{ - if ( qApp ) - return qApp->translate( "MainFrame", s, c, QApplication::DefaultCodec ); - else - return QString::fromLatin1( s ); -} -#ifndef QT_NO_TRANSLATION_UTF8 -QString MainFrame::trUtf8( const char *s, const char *c ) -{ - if ( qApp ) - return qApp->translate( "MainFrame", s, c, QApplication::UnicodeUTF8 ); - else - return QString::fromUtf8( s ); -} -#endif // QT_NO_TRANSLATION_UTF8 - -#endif // QT_NO_TRANSLATION - -QMetaObject* MainFrame::staticMetaObject() -{ - if ( metaObj ) - return metaObj; - QMetaObject* parentObject = QMainWindow::staticMetaObject(); - static const QUMethod slot_0 = {"fileNew", 0, 0 }; - static const QUMethod slot_1 = {"fileOpen", 0, 0 }; - static const QUMethod slot_2 = {"fileSave", 0, 0 }; - static const QUMethod slot_3 = {"fileSaveAs", 0, 0 }; - static const QUMethod slot_4 = {"fileExit", 0, 0 }; - static const QUMethod slot_5 = {"helpIndex", 0, 0 }; - static const QUMethod slot_6 = {"helpContents", 0, 0 }; - static const QUMethod slot_7 = {"helpAbout", 0, 0 }; - static const QUMethod slot_8 = {"setWire", 0, 0 }; - static const QUMethod slot_9 = {"languageChange", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "fileNew()", &slot_0, QMetaData::Public }, - { "fileOpen()", &slot_1, QMetaData::Public }, - { "fileSave()", &slot_2, QMetaData::Public }, - { "fileSaveAs()", &slot_3, QMetaData::Public }, - { "fileExit()", &slot_4, QMetaData::Public }, - { "helpIndex()", &slot_5, QMetaData::Public }, - { "helpContents()", &slot_6, QMetaData::Public }, - { "helpAbout()", &slot_7, QMetaData::Public }, - { "setWire()", &slot_8, QMetaData::Public }, - { "languageChange()", &slot_9, QMetaData::Protected } - }; - metaObj = QMetaObject::new_metaobject( - "MainFrame", parentObject, - slot_tbl, 10, - 0, 0, -#ifndef QT_NO_PROPERTIES - 0, 0, - 0, 0, -#endif // QT_NO_PROPERTIES - 0, 0 ); - cleanUp_MainFrame.setMetaObject( metaObj ); - return metaObj; -} - -void* MainFrame::qt_cast( const char* clname ) -{ - if ( !qstrcmp( clname, "MainFrame" ) ) - return this; - return QMainWindow::qt_cast( clname ); -} - -bool MainFrame::qt_invoke( int _id, QUObject* _o ) -{ - switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: fileNew(); break; - case 1: fileOpen(); break; - case 2: fileSave(); break; - case 3: fileSaveAs(); break; - case 4: fileExit(); break; - case 5: helpIndex(); break; - case 6: helpContents(); break; - case 7: helpAbout(); break; - case 8: setWire(); break; - case 9: languageChange(); break; - default: - return QMainWindow::qt_invoke( _id, _o ); - } - return TRUE; -} - -bool MainFrame::qt_emit( int _id, QUObject* _o ) -{ - return QMainWindow::qt_emit(_id,_o); -} -#ifndef QT_NO_PROPERTIES - -bool MainFrame::qt_property( int id, int f, QVariant* v) -{ - return QMainWindow::qt_property( id, f, v); -} - -bool MainFrame::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES diff --git a/apps/unsupported/tetraviewer/moc_myglwidget.cpp b/apps/unsupported/tetraviewer/moc_myglwidget.cpp deleted file mode 100644 index ecee3ab7..00000000 --- a/apps/unsupported/tetraviewer/moc_myglwidget.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** MyGLWidget meta object code from reading C++ file 'myglwidget.h' -** -** Created: Mon Oct 4 19:00:57 2004 -** by: The Qt MOC ($Id: moc_myglwidget.cpp,v 1.1 2004-10-04 18:01:36 ganovelli Exp $) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ - -#undef QT_NO_COMPAT -#include "myglwidget.h" -#include -#include - -#include -#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26) -#error "This file was generated using the moc from 3.3.2. It" -#error "cannot be used with the include files from this version of Qt." -#error "(The moc has changed too much.)" -#endif - -const char *MyGLWidget::className() const -{ - return "MyGLWidget"; -} - -QMetaObject *MyGLWidget::metaObj = 0; -static QMetaObjectCleanUp cleanUp_MyGLWidget( "MyGLWidget", &MyGLWidget::staticMetaObject ); - -#ifndef QT_NO_TRANSLATION -QString MyGLWidget::tr( const char *s, const char *c ) -{ - if ( qApp ) - return qApp->translate( "MyGLWidget", s, c, QApplication::DefaultCodec ); - else - return QString::fromLatin1( s ); -} -#ifndef QT_NO_TRANSLATION_UTF8 -QString MyGLWidget::trUtf8( const char *s, const char *c ) -{ - if ( qApp ) - return qApp->translate( "MyGLWidget", s, c, QApplication::UnicodeUTF8 ); - else - return QString::fromUtf8( s ); -} -#endif // QT_NO_TRANSLATION_UTF8 - -#endif // QT_NO_TRANSLATION - -QMetaObject* MyGLWidget::staticMetaObject() -{ - if ( metaObj ) - return metaObj; - QMetaObject* parentObject = QGLWidget::staticMetaObject(); - static const QUMethod slot_0 = {"setBox", 0, 0 }; - static const QUMethod slot_1 = {"setWire", 0, 0 }; - static const QUMethod slot_2 = {"setHidden", 0, 0 }; - static const QUMethod slot_3 = {"setFlat", 0, 0 }; - static const QUMethod slot_4 = {"setFlatWire", 0, 0 }; - static const QUMethod slot_5 = {"setSmooth", 0, 0 }; - static const QUMethod slot_6 = {"setSmallTetra", 0, 0 }; - static const QUMethod slot_7 = {"TrackMouseModality", 0, 0 }; - static const QUMethod slot_8 = {"SectionMouseModality", 0, 0 }; - static const QUMethod slot_9 = {"SwitchTextSimplex", 0, 0 }; - static const QUMethod slot_10 = {"SwitchTextPhysics", 0, 0 }; - static const QUMethod slot_11 = {"SwitchTextQuality", 0, 0 }; - static const QMetaData slot_tbl[] = { - { "setBox()", &slot_0, QMetaData::Public }, - { "setWire()", &slot_1, QMetaData::Public }, - { "setHidden()", &slot_2, QMetaData::Public }, - { "setFlat()", &slot_3, QMetaData::Public }, - { "setFlatWire()", &slot_4, QMetaData::Public }, - { "setSmooth()", &slot_5, QMetaData::Public }, - { "setSmallTetra()", &slot_6, QMetaData::Public }, - { "TrackMouseModality()", &slot_7, QMetaData::Public }, - { "SectionMouseModality()", &slot_8, QMetaData::Public }, - { "SwitchTextSimplex()", &slot_9, QMetaData::Public }, - { "SwitchTextPhysics()", &slot_10, QMetaData::Public }, - { "SwitchTextQuality()", &slot_11, QMetaData::Public } - }; - metaObj = QMetaObject::new_metaobject( - "MyGLWidget", parentObject, - slot_tbl, 12, - 0, 0, -#ifndef QT_NO_PROPERTIES - 0, 0, - 0, 0, -#endif // QT_NO_PROPERTIES - 0, 0 ); - cleanUp_MyGLWidget.setMetaObject( metaObj ); - return metaObj; -} - -void* MyGLWidget::qt_cast( const char* clname ) -{ - if ( !qstrcmp( clname, "MyGLWidget" ) ) - return this; - return QGLWidget::qt_cast( clname ); -} - -bool MyGLWidget::qt_invoke( int _id, QUObject* _o ) -{ - switch ( _id - staticMetaObject()->slotOffset() ) { - case 0: setBox(); break; - case 1: setWire(); break; - case 2: setHidden(); break; - case 3: setFlat(); break; - case 4: setFlatWire(); break; - case 5: setSmooth(); break; - case 6: setSmallTetra(); break; - case 7: TrackMouseModality(); break; - case 8: SectionMouseModality(); break; - case 9: SwitchTextSimplex(); break; - case 10: SwitchTextPhysics(); break; - case 11: SwitchTextQuality(); break; - default: - return QGLWidget::qt_invoke( _id, _o ); - } - return TRUE; -} - -bool MyGLWidget::qt_emit( int _id, QUObject* _o ) -{ - return QGLWidget::qt_emit(_id,_o); -} -#ifndef QT_NO_PROPERTIES - -bool MyGLWidget::qt_property( int id, int f, QVariant* v) -{ - return QGLWidget::qt_property( id, f, v); -} - -bool MyGLWidget::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; } -#endif // QT_NO_PROPERTIES diff --git a/apps/unsupported/tetraviewer/myclasses.h b/apps/unsupported/tetraviewer/myclasses.h deleted file mode 100644 index 1808be19..00000000 --- a/apps/unsupported/tetraviewer/myclasses.h +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include - -class MyTetrahedron; -class DUMMYEDGETYPE; -class DUMMYFACETYPE; - -class MyVertex: public vcg::VertexATVNd{}; - -class MyTetrahedron: public vcg::TetraATAV{}; - -typedef vcg::tetra::Tetramesh< std::vector ,std::vector > MyTetraMesh; diff --git a/apps/unsupported/tetraviewer/myglwidget.cpp b/apps/unsupported/tetraviewer/myglwidget.cpp deleted file mode 100644 index eb634b9d..00000000 --- a/apps/unsupported/tetraviewer/myglwidget.cpp +++ /dev/null @@ -1,394 +0,0 @@ -#include "myglwidget.h" -#include -#include -#include "mainframe.h" - -extern MyTetraMesh *tm; -extern TetraStats Stats; -//extern MainFrame *wp; - -bool MyGLWidget::ShowTextSimplex() -{ - return (_ShowBar & SIMPLEX); -} - -bool MyGLWidget::ShowTextPhysics() -{ - return (_ShowBar & PHYSICS); -} - -bool MyGLWidget::ShowTextQuality() -{ - return (_ShowBar & QUALITY); -} - - -MyGLWidget::MyGLWidget( QWidget * parent, const char * name, const QGLWidget * shareWidget, WFlags f ): -QGLWidget(parent, name) -{ - Track.Reset(); - Track.radius= 1; - WT=0; - modality=3; - mouse_modality=MMTrackball; - _ShowBar=SIMPLEX; - grabKeyboard(); -} - - -void MyGLWidget::DrawTextInfo() - { - glPushAttrib(0xffffffff); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); - glEnable(GL_LIGHTING); - glEnable(GL_NORMALIZE); - glEnable(GL_COLOR_MATERIAL); - glDisable(GL_CLIP_PLANE0); - glColor4d(0.7,0,0.7,0.6); - - glDepthRange(0.0,0.1); - - glBegin(GL_QUADS); - glVertex3d(-0.5,-0.5,0); - glVertex3d(-0.5,-0.3,0); - glVertex3d(0.5,-0.3,0); - glVertex3d(0.5,-0.5,0); - glEnd(); - - if (Stats.TCurrent()!=0) - { - glBegin(GL_QUADS); - glVertex3d(0.25,0.5,0); - glVertex3d(0.5,0.5,0); - glVertex3d(0.5,0.2,0); - glVertex3d(0.25,0.2,0); - glEnd(); - } - - - renderText( (width() - 10) / 2, 15, "a" ); - - QFont f( "arial", 12 ); - QFontMetrics fmc( f ); - glColor3d(1,1,1); - - QString str=""; - int level=0; - - glDisable( GL_LIGHTING ); - glDisable( GL_TEXTURE_2D ); - - if (ShowTextSimplex()) - { - level++; - str.sprintf( "Tetrahedrons : %i Vertex: %i ",tm->tn,tm->vn); - renderText( 20, height() - level*20, str, f ); - } - if (ShowTextPhysics()) - { - level++; - str.sprintf( "Volume : %03f ",Stats.volume); - renderText( 20, height() - level*20, str, f ); - } - if (ShowTextQuality()) - { - level++; - str.sprintf( "Aspect Ratio : %03f ",Stats.ratio); - renderText( 20, height() - level*20, str, f ); - } - - //at the end i draw the window for informations about a tretrahedron - if (Stats.TCurrent()!=0) - { - str=""; - str.sprintf( "Volume : %03f ",Stats.TCurrent()->ComputeVolume()); - renderText( width()-150, 30, str, f ); - str.sprintf( "Aspect Ratio : %03f ",Stats.TCurrent()->AspectRatio()); - renderText( width()-150, 50, str, f ); - - LoadMatrix(); - glColor3d(1,0,0); - - glDisable(GL_BLEND); - //write values of the tetrahedron - for (int i=0;i<4;i++) - { - double x=Stats.TCurrent()->V(i)->P().V(0);//x value of vertex - double y=Stats.TCurrent()->V(i)->P().V(1);//y value of vertex - double z=Stats.TCurrent()->V(i)->P().V(2);//z value of vertex - str.sprintf("%i",i); - renderText(x,y,z,str,f); - } - Stats.TCurrent()->SetS(); - } - glPopAttrib(); - } - - -void MyGLWidget::DrawBox() -{ - glPushAttrib(0xffffffff); - glDisable(GL_COLOR_MATERIAL); - glDisable(GL_LIGHT0); - glDisable(GL_LIGHTING); - glDisable(GL_NORMALIZE); - glColor3d(1,1,1); - - glBegin(GL_LINE_LOOP); - glVertex(tm->bbox.P(0)); - glVertex(tm->bbox.P(1)); - glVertex(tm->bbox.P(3)); - glVertex(tm->bbox.P(2)); - glEnd(); - - glBegin(GL_LINE_LOOP); - glVertex(tm->bbox.P(4)); - glVertex(tm->bbox.P(5)); - glVertex(tm->bbox.P(7)); - glVertex(tm->bbox.P(6)); - glEnd(); - - glBegin(GL_LINE_LOOP); - glVertex(tm->bbox.P(0)); - glVertex(tm->bbox.P(1)); - glVertex(tm->bbox.P(5)); - glVertex(tm->bbox.P(4)); - glEnd(); - - glBegin(GL_LINE_LOOP); - glVertex(tm->bbox.P(3)); - glVertex(tm->bbox.P(2)); - glVertex(tm->bbox.P(6)); - glVertex(tm->bbox.P(7)); - glEnd(); - - glPopAttrib(); -} - -void MyGLWidget::DrawTetraMesh() -{ - -switch (modality) -{ - case 0:DrawBox();break; - case 1:WT->Draw();break; - case 2:WT->Draw();break; - case 3:WT->Draw();break; - case 4:WT->Draw();break; - case 5:WT->Draw();break; - case 6:WT->Draw();break; -} -} - -void MyGLWidget::SaveMatrix() -{ - glGetDoublev(GL_PROJECTION_MATRIX ,projection); - glGetDoublev(GL_MODELVIEW_MATRIX ,modelMatrix); -} - -void MyGLWidget::LoadMatrix() -{ - glMatrixMode(GL_PROJECTION); - glLoadMatrixd(projection); - glMatrixMode(GL_MODELVIEW); - glLoadMatrixd(modelMatrix); -} - -void MyGLWidget::glDraw(){ - - glClearColor(0.2,0.2,0.2,1); - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(45,1,0.01,20); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0,0,1,0,0,0,0,10,0); - - if (tm!=0){ - glPushMatrix(); - - glScalef(1/tm->bbox.Diag(),1/tm->bbox.Diag(),1/tm->bbox.Diag()); - - Track.GetView(); - Track.Apply(); - Track.Draw(); - - vcg::Point3d p=tm->bbox.Center(); - glTranslate(-p); - - - //if not exist crete an instance of wrapper - if (WT==0) - { - WT= new vcg::GLWrapTetra >(tm->tetra); - WT->SetHint(vcg::GLW::HShrinkFactor, 0.8); - } - - /*glGetDoublev(GL_PROJECTION_MATRIX,proj); - glGetDoublev(GL_mode_MATRIX,mod); - glGetDoublev(GL_PROJECTION_MATRIX,);*/ - SaveMatrix(); - DrawTetraMesh(); - glPopMatrix(); - DrawTextInfo(); - } - QGLWidget::glDraw(); -} - -void MyGLWidget::resizeGL( int w, int h ) - { - // setup viewport, projection etc.: - glMatrixMode (GL_PROJECTION); - glLoadIdentity (); - float ratio=(float)w/(float)h; - gluPerspective(45,ratio,1,20); - _W=w; - _H=h; - glViewport (0, 0, (GLsizei) w, (GLsizei) h); - glMatrixMode (GL_MODELVIEW); - repaint(); - - } - -void MyGLWidget::mousePressEvent ( QMouseEvent * e ) -{ -if (e->button()==Qt::LeftButton) -{ - MyTetraMesh::TetraIterator ti; - int face; - switch(mouse_modality) - { - case MMTrackball: - Track.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); - break; - - case MMSection: - LoadMatrix(); - vcg::GLPickTetra::PickNearestTetraFace(e->x(),_H-e->y(),*tm,ti,face); - if (ti!=0) - { - ///find external face - - /*while (!ti->IsBorderF(face)) - face++;*/ - /*ti->SetS();*/ - vcg::Point3d p0=ti->V(vcg::Tetra::VofF(face,0))->P(); - vcg::Point3d p1=ti->V(vcg::Tetra::VofF(face,1))->P(); - vcg::Point3d p2=ti->V(vcg::Tetra::VofF(face,2))->P(); - - //put the trackball on the barycenter of the face - MyTetraMesh::VertexType::CoordType b=(p0+p1+p2)/3.f; - - WT->AddClipSection(p0,p1,p2); - TrackClip.Reset(); - TrackClip.radius=1; - TrackClip.center.V(0)=(float)b.V(0); - TrackClip.center.V(1)=(float)b.V(1); - TrackClip.center.V(2)=(float)b.V(2); - mouse_modality=MMNavigateSection; - TrackClip.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); - } - break; - - case MMNavigateSection: - TrackClip.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); - break; - - } -} - -else if (e->button()==Qt::RightButton) -{ - MyTetraMesh::TetraIterator ti; - LoadMatrix(); - WT->section.GlClip(); - vcg::GLPickTetra::PickNearestTetra(e->x(),_H-e->y(),*tm,ti); - if (ti!=0) - { - Stats.SetTetraInfo(&*ti); - } -} - -repaint(); -} - -void MyGLWidget::mouseReleaseEvent(QMouseEvent * e ) - { - Track.MouseUp(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); - repaint(); - } - -void MyGLWidget::mouseMoveEvent ( QMouseEvent * e ) - { - if (mouse_modality==MMTrackball) - { - Track.MouseMove(e->x(),_H-e->y()); - repaint(); - } - else - if ((mouse_modality==MMNavigateSection)&&(e->state() & Qt::LeftButton)) - { - LoadMatrix(); - TrackClip.MouseMove(e->x(),_H-e->y()); - TrackClip.GetView(); - TrackClip.Apply(); - WT->section.Transform(TrackClip.track.Matrix()); - repaint(); - } - } - -void MyGLWidget::wheelEvent ( QWheelEvent * e ){ - /* - if (mouse_modality==MMTrackball) - { - const int WHEEL_DELTA =120; - Track.MouseWheel( e->delta()/ float(WHEEL_DELTA) ); - repaint(); - }else*/ - if (mouse_modality==MMNavigateSection) - { - const int WHEEL_DELTA =120; - float delta= e->delta()/ float(WHEEL_DELTA); - WT->section.Translate(delta/10); - - ///for casting from double to float - TrackClip.center.V(0)=(float)WT->section.P.V(0); - TrackClip.center.V(1)=(float)WT->section.P.V(1); - TrackClip.center.V(2)=(float)WT->section.P.V(2); - - repaint(); - } - } - - -void MyGLWidget::keyPressEvent(QKeyEvent *k) -{ - if (k->key()==Qt::Key_Escape)//&&((mouse_modality==MMNavigateSection)||(mouse_modality==MMSection))) - { - mouse_modality=MMTrackball; - WT->ClearClipSection(); - } -} - -void MyGLWidget::initializeGL(){ - - GLfloat f[4]={0.2,0.2,0.2,1.f}; - GLfloat p[4]={3,3,5,0}; - glLightfv(GL_LIGHT0, GL_AMBIENT,f); - glLightfv(GL_LIGHT1, GL_POSITION,p); - glLightfv(GL_LIGHT1, GL_DIFFUSE,f); - glLightfv(GL_LIGHT1, GL_SPECULAR,f); - - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - glEnable(GL_LIGHTING); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LESS); - glPolygonMode(GL_FRONT,GL_FILL); - glEnable(GL_BACK); - glCullFace(GL_BACK); - - } diff --git a/apps/unsupported/tetraviewer/myglwidget.h b/apps/unsupported/tetraviewer/myglwidget.h deleted file mode 100644 index 8cb4b45e..00000000 --- a/apps/unsupported/tetraviewer/myglwidget.h +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include "myclasses.h" -#include "tetrastats.h" - - - -class MyGLWidget: public QGLWidget{ - -Q_OBJECT - -private : - int _H; - int _W; - vcg::Trackball Track; - vcg::GLWrapTetra *WT; - - GLdouble projection[16]; - GLdouble modelMatrix[16]; - GLint viewport[4]; - - - int modality;//rendering modality - enum mousemod {MMTrackball, MMSection,MMNavigateSection};//modality of using mouse - mousemod mouse_modality; - - - vcg::Trackball TrackClip; - -/// This are the flags pf info of the mesh that we want to show - int _ShowBar; - - enum { - SIMPLEX = 0x00000001, // show vertex number and tetrahedrons number - PHYSICS = 0x00000002, // show also physical information about the mesh - QUALITY = 0x00000004, // show informations about aspect ratio - }; - - -public: - - MyGLWidget( QWidget * parent = 0, const char * name = 0, const QGLWidget * shareWidget = 0, WFlags f = 0 ); - - virtual void glDraw(); - void resizeGL( int w, int h ); - virtual void mousePressEvent ( QMouseEvent * e ); - virtual void mouseReleaseEvent(QMouseEvent * e ); - virtual void mouseMoveEvent ( QMouseEvent * e ); - virtual void wheelEvent ( QWheelEvent * e ); - virtual void keyPressEvent(QKeyEvent *k); - virtual void initializeGL(); - virtual void SaveMatrix(); - void DrawTetraMesh(); - void DrawBox(); - bool ShowTextSimplex(); - bool ShowTextPhysics(); - bool ShowTextQuality(); - void DrawTextInfo(); - void LoadMatrix(); - -public slots: - - ///bounding box visualization modality - void setBox(){ - modality=0; - repaint(); - }; - - ///wireframe modality - void setWire(){ - modality=1; - repaint(); - }; - - ///hiddenlines modality - void setHidden(){ - modality=2; - repaint(); - }; - - ///alternate wire visualization - void setFlat(){ - modality=3; - repaint(); - }; - - ///alternate wire visualization - void setFlatWire(){ - modality=4; - repaint(); - }; - - ///alternate wire visualization - void setSmooth(){ - modality=5; - repaint(); - }; - - ///alternate wire visualization - void setSmallTetra() - { - modality=6; - repaint(); - }; - - //set trackball modality - void TrackMouseModality() - { - mouse_modality=MMTrackball; - }; - - //set trackball modality - void SectionMouseModality() - { - mouse_modality=MMSection; - }; - - ///switching to modality of viewing txt info on simplex - void SwitchTextSimplex() - { - if (ShowTextSimplex()) - _ShowBar&=~SIMPLEX; - else - _ShowBar|=SIMPLEX; - repaint(); - }; - - ///switching to modality of viewing txt info on physics - void SwitchTextPhysics() - { - if (ShowTextPhysics()) - _ShowBar&=~PHYSICS; - else - _ShowBar|=PHYSICS; - repaint(); - }; - - ///switching to modality of viewing txt info on quality - void SwitchTextQuality() - { - if (ShowTextQuality()) - _ShowBar&=~QUALITY; - else - _ShowBar|=QUALITY; - repaint(); - }; - -}; \ No newline at end of file diff --git a/apps/unsupported/tetraviewer/qmake_image_collection.cpp b/apps/unsupported/tetraviewer/qmake_image_collection.cpp deleted file mode 100644 index e89a5768..00000000 --- a/apps/unsupported/tetraviewer/qmake_image_collection.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** Image collection for project 'TetraView'. -** -** Generated from reading image files: -** images/editcopy -** images/editcut -** images/editpaste -** images/filenew -** images/fileopen -** images/filesave -** images/print -** images/redo -** images/searchfind -** images/undo -** images/Open64.png -** -** Created: Mon Oct 4 19:00:57 2004 -** by: The User Interface Compiler ($Id: qmake_image_collection.cpp,v 1.3 2004-10-04 18:01:36 ganovelli Exp $) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ - -#include -#include -#include -#include - diff --git a/apps/unsupported/tetraviewer/tetrastats.h b/apps/unsupported/tetraviewer/tetrastats.h deleted file mode 100644 index 5021885b..00000000 --- a/apps/unsupported/tetraviewer/tetrastats.h +++ /dev/null @@ -1,74 +0,0 @@ - -template -class TetraStats -{ -typedef typename TETRA_MESH_TYPE::TetraType TetraType; - -TETRA_MESH_TYPE * Tetra; -TetraType* T; - -public: -double volume; -double ratio; - -TetraStats(){T=0;} - -~TetraStats(){} - -static double ComputeVolume(TETRA_MESH_TYPE *tm) -{ - - double total=0.f; - TETRA_MESH_TYPE::TetraIterator ti; - for (ti=tm->tetra.begin();titetra.end();ti++) - { - if (!ti->IsD()) - total+=ti->ComputeVolume(); - } - return total; -} - -static double ComputeRatioMedia(TETRA_MESH_TYPE *tm) -{ - double total=0.f; - TETRA_MESH_TYPE::TetraIterator ti; - int i=0; - for (ti=tm->tetra.begin();titetra.end();ti++) - { - if (!ti->IsD()) - { - total+=ti->AspectRatio(); - i++; - } - } - return (total/i); -} - -void SetTetraMesh(TETRA_MESH_TYPE* T) -{ - Tetra=T; -} - -void Update() -{ - ratio=ComputeRatioMedia(Tetra); - volume=ComputeVolume(Tetra); -} - -void SetTetraInfo(TetraType *Te) -{ - if (T!=0) - T->ClearS(); - T=Te; -} - -void ClearTetraInfo(TetraType *Te) -{ - T=0; -} - -TetraType * TCurrent() -{ - return T; -} -};