From 28da494fe36b0e2d22e22f74726f15afdc98342e Mon Sep 17 00:00:00 2001 From: nicopietroni Date: Tue, 1 Feb 2005 18:07:14 +0000 Subject: [PATCH] minor changes --- .../test/segmentation3d/collision_detection.h | 39 ++- apps/test/segmentation3d/main.cpp | 8 +- apps/test/segmentation3d/segmentation3d.pro | 157 ++++++++++ apps/test/segmentation3d/segmentator.h | 156 +++++++--- apps/test/segmentation3d/segmentform.ui | 277 ++++++++++-------- apps/test/segmentation3d/simpleglwidget.cpp | 105 +++++-- apps/test/segmentation3d/simpleglwidget.h | 32 +- 7 files changed, 576 insertions(+), 198 deletions(-) diff --git a/apps/test/segmentation3d/collision_detection.h b/apps/test/segmentation3d/collision_detection.h index 0fe55e03..60c5eb78 100644 --- a/apps/test/segmentation3d/collision_detection.h +++ b/apps/test/segmentation3d/collision_detection.h @@ -61,7 +61,7 @@ public: bool TestRealIntersection(SimplexType *f0,SimplexType *f1) { - if ((!f0->IsActive())&&(!f1->IsActive())) + if (((!f0->IsActive())&&(!f1->IsActive()))||(f0->IsD())||(f1->IsD())) return false; //no adiacent faces if ((f0!=f1)&& (!ShareEdge(f0,f1)) @@ -70,25 +70,51 @@ public: return false; } - ///refresh the elemnt of spatial hashing table + ///refresh all the elements of spatial hashing table + ///this function must called sometimes void RefreshElements() { HTable->Clear(); - + vactive.clear();///new for (SimplexIterator si=_simplex.begin();si<_simplex.end();++si) { if ((!(*si).IsD())&&(!(*si).IsActive())) HTable->addSimplex(&*si); + ///new now + else + { + std::vector cells=HTable->addSimplex(&*si); + for(std::vector::iterator it=cells.begin();it cells=HTable->addSimplex(&*si); + // for(std::vector::iterator it=cells.begin();it + void UpdateStep(Container_Type &simplex) { vactive.clear(); - for (SimplexIterator si=_simplex.begin();si<_simplex.end();++si) + for (Container_Type::iterator si=simplex.begin();si computeSelfIntersection() { diff --git a/apps/test/segmentation3d/main.cpp b/apps/test/segmentation3d/main.cpp index e10ef473..94645878 100644 --- a/apps/test/segmentation3d/main.cpp +++ b/apps/test/segmentation3d/main.cpp @@ -1,15 +1,17 @@ #include #include #include -#include +//#include #include #include #include #include + Segmentator *s; QTimer *timer; + int main( int argc, char ** argv ) { s=new Segmentator(); @@ -25,6 +27,7 @@ int main( int argc, char ** argv ) //assign pointer to pricipal form w.simpleGLWidget1->w=&w; + #ifdef _TORUS w.simpleGLWidget1->SetExtractionParameters(); @@ -32,7 +35,8 @@ int main( int argc, char ** argv ) s->BBox().max=Point3f(300.f,300.f,300.f); s->InitSegmentation(Point3f(0.f,100.f,0.f)); #endif - + + /*s=new Segmentator();*/ //s->LoadFromDir("./venacava/","prova.txt");//to chANGE diff --git a/apps/test/segmentation3d/segmentation3d.pro b/apps/test/segmentation3d/segmentation3d.pro index 79c3d097..6591ac66 100644 --- a/apps/test/segmentation3d/segmentation3d.pro +++ b/apps/test/segmentation3d/segmentation3d.pro @@ -3,7 +3,16 @@ LANGUAGE = C++ CONFIG += qt warn_on release +win32:LIBS += qt-mt332.lib qtmain.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib imm32.lib winmm.lib wsock32.lib winspool.lib delayimp.lib opengl32.lib glu32.lib glew32.lib +DEFINES += QT_NO_DEBUG _WINDOWS UNICODE WIN32 QT_DLL QT_THREAD_SUPPORT _TORUS01 _EXTENDED_MARCH1 +win32:DEFINES += QT_NO_DEBUG _WINDOWS UNICODE WIN32 QT_DLL QT_THREAD_SUPPORT _TORUS01 _EXTENDED_MARCH1 +win32:INCLUDEPATH += "$(QTDIR)\include" . "C:\Qt\3.3.2\mkspecs\win32-msvc.net" D:\sf\apps\test\segmentation3d D:\sf +SOURCES += D:/sf/wrap/gui/trackmode.cpp \ + D:/sf/wrap/gui/trackball.cpp \ + D:/sf/wrap/ply/plylib.cpp \ + simpleglwidget.cpp \ + main.cpp FORMS = segmentform.ui @@ -20,6 +29,154 @@ FORMS = segmentform.ui + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + unix { UI_DIR = .ui MOC_DIR = .moc diff --git a/apps/test/segmentation3d/segmentator.h b/apps/test/segmentation3d/segmentator.h index 504b9820..fe370cf6 100644 --- a/apps/test/segmentation3d/segmentator.h +++ b/apps/test/segmentation3d/segmentator.h @@ -1,11 +1,15 @@ -#ifndef SEGMENTATOR -#define SEGMENTATOR +#ifndef __SEGMENTATOR +#define __SEGMENTATOR -//#include -//#include -#include -#include +///need vertex-face topology in case of extended marching cubes +#ifdef _EXTENDED_MARCH + #include + #include +#else + #include + #include +#endif #include #include @@ -15,13 +19,26 @@ #include #include #include +#include +#include #include -#include +#include #include //#include +///marching cubes + +//#include +#include + +//#ifdef _EXTENDED_MARCH +// #include +//#else +// #include +//#endif + #include #include @@ -34,6 +51,10 @@ #include #include +///debugghe +#include +///debugghe + class Segmentator{ public: @@ -42,7 +63,11 @@ struct DummyEdge; struct DummyTetra; struct MyFace; -struct MyVertex: public ParticleBasic > +#ifdef _EXTENDED_MARCH + struct MyVertex: public ParticleBasic > +#else + struct MyVertex: public ParticleBasic > +#endif { public: @@ -55,6 +80,7 @@ public: stopped=false; Acc()=Point3f(0,0,0); Vel()=Point3f(0,0,0); + ClearFlags(); //neeed call of the super class } @@ -82,7 +108,7 @@ public: }; ///this class implements the deformable triangle in a mass spring system -struct MyFace : public TriangleMassSpring< vcg::FaceAF > +struct MyFace : public TriangleMassSpring< vcg::FaceAFAVFNFMRT > { public: bool intersected; @@ -163,11 +189,25 @@ typedef PDEIntegrator myIntegrat typedef Collision_Detector > Collision; +////typedef Walker MyWalk; +// +//#ifdef _EXTENDED_MARCH +// typedef vcg::tri::ExtendedMarchingCubes MarchingCubes; +//#else +// typedef vcg::tri::MarchingCubes MarchingCubes; +//#endif + + public: Point3f scale; //VolumetricDataset d; - MyTriMesh m; + /*MyTriMesh m; + MyTriMesh new_m;*/ + + MyTriMesh *m; + MyTriMesh *new_m; + Part_FaceContainer P_Faces; Part_VertexContainer P_Vertex; Part_VertexContainer V_Stopped; @@ -206,7 +246,29 @@ public: Segmentator() { - CollDet=new Collision(m.face); + m=new MyTriMesh(); + CollDet=new Collision(m->face); + //m=NULL; + + //scale=Point3f(5.f,5.f,5.f); + //InitialBarycenter=Point3f(20.f,20.f,20.f); + //InitMesh(m); + //vcg::tri::UpdateNormals::PerFaceNormalized(m); + //vcg::tri::UpdateBounding::Box(m); + //vcg::tri::UpdateEdges::Set(m); + ///////debugghe + //edge_precision=4.f; + ////edge_precision=1.f; + //float rx=this->m.bbox.DimX()/edge_precision; + //float ry=this->m.bbox.DimY()/edge_precision; + //float rz=this->m.bbox.DimZ()/edge_precision; + //Point3i res=Point3i((int)ceil(rx),(int)ceil(ry),(int)ceil(rz)); + //// EXTENDED MARCHING CUBES + //MyWalk walker(m.bbox,res); + //MarchingCubes emc(new_m, walker); + //walker.BuildMesh(m,new_m,emc); + + //vcg::tri::io::ExporterPLY::Save(new_m,"D:/lillo.ply"); } ~Segmentator() @@ -384,33 +446,34 @@ private: ///re-set physical pararmeters on the mesh void InitPhysParam(float k_elanst,float mass,float k_dihedral) { - for (unsigned int i=0;iface.size();i++) { - m.face[i].Init(k_elanst,mass,k_dihedral); + m->face[i].Init(k_elanst,mass,k_dihedral); } } ///set the initial mesh of deformable object -void InitMesh(MyTriMesh &m) +void InitMesh(MyTriMesh *m) { - m.Clear(); + m->Clear(); - vcg::tri::Icosahedron(m); + vcg::tri::Icosahedron(*m); - vcg::tri::UpdateTopology::FaceFace(m); + vcg::tri::UpdateTopology::FaceFace(*m); /* P_Vertex.clear(); P_Faces.clear();*/ - for (unsigned int i=0;ivert.size();i++) { - m.vert[i].P()+=InitialBarycenter; - m.vert[i].P()=UnScale(m.vert[i].P()); + m->vert[i].P()=UnScale(m->vert[i].P());///last change + m->vert[i].P()+=InitialBarycenter; +// m.vert[i].P()=UnScale(m.vert[i].P()); // P_Vertex.push_back(&m.vert[i]); } - vcg::tri::UpdateNormals::PerVertexNormalized(m); + vcg::tri::UpdateNormals::PerVertexNormalized(*m); } @@ -490,7 +553,7 @@ void Reinit_PVectors() P_Vertex.clear(); MyTriMesh::VertexIterator vi; - for (vi=m.vert.begin();vivert.begin();vivert.end();vi++) { if ((!vi->IsD())&&(!vi->blocked)) P_Vertex.push_back(&(*vi)); @@ -500,7 +563,7 @@ void Reinit_PVectors() P_Faces.clear(); MyTriMesh::FaceIterator fi; - for (fi=m.face.begin();fiface.begin();fiface.end();fi++) { //if ((!fi->IsBlocked())) if ((!fi->IsD())&&(!fi->IsBlocked())) @@ -516,7 +579,7 @@ void Refresh_PVectors() P_FacesAux.clear(); P_VertexAux.clear(); - int i=0; + unsigned int i=0; for (i=0;iblocked) @@ -539,13 +602,13 @@ void Refresh_PVectors() ///add the new elements on partial vectors when allocate space for new vertices void AddNewElements(MyTriMesh::VertexIterator vi,MyTriMesh::FaceIterator fi) { - while (vi!=m.vert.end()) + while (vi!=m->vert.end()) { if (!(*vi).IsD()) P_Vertex.push_back(&(*vi)); vi++; } - while (fi!=m.face.end()) + while (fi!=m->face.end()) { if (!(*fi).IsD()) P_Faces.push_back(&(*fi)); @@ -597,24 +660,24 @@ bool TimeSelfIntersection() ///refine the mesh and re-update eventually void RefineStep(float _edge_size) { - MyTriMesh::VertexIterator vinit=m.vert.begin(); - MyTriMesh::FaceIterator finit=m.face.begin(); - MyTriMesh::VertexIterator vend=m.vert.end(); - MyTriMesh::FaceIterator fend=m.face.end(); + MyTriMesh::VertexIterator vinit=m->vert.begin(); + MyTriMesh::FaceIterator finit=m->face.begin(); + MyTriMesh::VertexIterator vend=m->vert.end(); + MyTriMesh::FaceIterator fend=m->face.end(); - refined=vcg::Refine(m,MidPoint(),_edge_size); + refined=vcg::Refine(*m,MidPoint(),_edge_size); if (refined) { - MyTriMesh::VertexIterator vinit2=m.vert.begin(); - MyTriMesh::FaceIterator finit2=m.face.begin(); + MyTriMesh::VertexIterator vinit2=m->vert.begin(); + MyTriMesh::FaceIterator finit2=m->face.begin(); if ((vinit2!=vinit)||(finit2!=finit)) Reinit_PVectors(); else AddNewElements(vend,fend); - vcg::tri::UpdateNormals::PerVertexNormalized(m); + vcg::tri::UpdateNormals::PerVertexNormalized(*m); CollDet->RefreshElements(); } } @@ -648,7 +711,8 @@ void ClearStopped() ///do one step of controls for self collision detetction void CollisionDetection() { - CollDet->UpdateStep(); + //CollDet->UpdateStep(); + CollDet->UpdateStep(P_Faces); std::vector coll=CollDet->computeSelfIntersection(); for (std::vector::iterator it=coll.begin();it BBox() ///one step of moving for the deformable object void Step(float t,float _edge_size) { - if (m.face.size()!=0) + if (m->face.size()!=0) { AddExtForces(); TrINT->Step(t); @@ -755,7 +819,7 @@ void Step(float t,float _edge_size) void Smooth() { - ScaleLaplacianSmooth(m,1,0.5); + ScaleLaplacianSmooth(*m,1,0.5); } void AutoStep() @@ -763,7 +827,7 @@ void AutoStep() refined=false; Step(time_stamp,edge_size); //test on 80% of the vertex blocked - if ((((float)P_Vertex.size()/(float)m.vn)<0.2)&&(end_loop)&&(!refined)&&(edge_size>edge_precision)) + if ((((float)P_Vertex.size()/(float)m->vn)<0.2)&&(end_loop)&&(!refined)&&(edge_size>edge_precision)) { edge_size/=2.f; if (edge_size::Resample(*m,*new_m, + Point3i((int) edge_precision,(int) edge_precision,(int) edge_precision)); + + delete(m); + + m=new_m; + Reinit_PVectors(); + ReinitPhysicMesh(); + + CollDet->Init(bbox.min,bbox.max,5.f); +} + }; #endif \ No newline at end of file diff --git a/apps/test/segmentation3d/segmentform.ui b/apps/test/segmentation3d/segmentform.ui index 296cb3c2..ecd06015 100644 --- a/apps/test/segmentation3d/segmentform.ui +++ b/apps/test/segmentation3d/segmentform.ui @@ -234,6 +234,12 @@ 10 + + LineEditPanel + + + Sunken + 0.2 @@ -361,117 +367,6 @@ mass of particles - - - ClearButton - - - - 30 - 700 - 141 - 31 - - - - - 10 - - - - Clear - - - - - SaveButton - - - - 30 - 660 - 140 - 31 - - - - - 10 - - - - SavePly - - - - - SmoothButton - - - - 30 - 620 - 140 - 30 - - - - - 10 - - - - 1 - - - Smooth - - - - - SegmentButton - - - - 30 - 580 - 141 - 31 - - - - - 10 - - - - Extract - - - true - - - - - ApplyButton - - - - 30 - 540 - 141 - 31 - - - - - 10 - - - - Apply - - textLabel1_2_2_2_3 @@ -691,6 +586,141 @@ 3 + + + SmoothButton + + + + 30 + 660 + 140 + 30 + + + + + 10 + + + + 0 + + + Smooth + + + + + SaveButton + + + + 30 + 700 + 140 + 31 + + + + + 10 + + + + SavePly + + + + + SegmentButton + + + + 30 + 580 + 141 + 31 + + + + + 10 + + + + Extract + + + true + + + + + ClearButton + + + + 30 + 740 + 140 + 30 + + + + + 10 + + + + 0 + + + ClearMesh + + + + + Marching_Cubes + + + + 30 + 619 + 141 + 31 + + + + + 10 + + + + Marching Cube + + + + + ApplyButton + + + + 30 + 540 + 141 + 31 + + + + + 10 + + + + Apply + + @@ -746,9 +776,9 @@ SavePly() Extract() Apply() - Clear() - slot() Open() + CleanMesh() + Clear() @@ -895,12 +925,6 @@ simpleGLWidget1 Apply() - - ClearButton - pressed() - simpleGLWidget1 - Clear() - fileOpenAction activated() @@ -913,7 +937,22 @@ simpleGLWidget1 SavePly() + + Marching_Cubes + pressed() + simpleGLWidget1 + CleanMesh() + + + ClearButton + pressed() + simpleGLWidget1 + Clear() + + + simpleglwidget.h + diff --git a/apps/test/segmentation3d/simpleglwidget.cpp b/apps/test/segmentation3d/simpleglwidget.cpp index 09a17e54..34df73db 100644 --- a/apps/test/segmentation3d/simpleglwidget.cpp +++ b/apps/test/segmentation3d/simpleglwidget.cpp @@ -20,11 +20,22 @@ QGLWidget(parent, name) resultForces=false; continue_int=false; _numslide=0; - Track.center=Point3f(0,0,0); - Track.Reset(); - Track.radius= 100; + + TrackM.center=Point3f(0,0,0); + TrackM.Reset(); + TrackM.radius= 100.f; + + TrackS.center=Point3f(0,0,0); + TrackS.Reset(); + TrackS.radius= 100.f; + zoom=1; path=""; + /*s=new Segmentator();*/ + //timer = new QTimer(this ); + //QTimer::connect( timer, SIGNAL(timeout()), this, SLOT(Update()) ); + // timer->start(0); // 2 seconds single-shot timer + } void SimpleGLWidget::SaveMatrix() @@ -185,7 +196,7 @@ void SimpleGLWidget::Save() if (filename!=NULL) { const char *path_save=filename.ascii(); - vcg::tri::io::ExporterPLY::Save(s->m,path_save); + vcg::tri::io::ExporterPLY::Save((*s->m),path_save); } } @@ -267,27 +278,29 @@ void SimpleGLWidget::glDraw(){ if (_showslides) { vcg::Point3f p=Point3f((float)s->BBox().Center().V(0),(float)s->BBox().Center().V(1),(float)s->BBox().Center().V(2)); - Track.radius=s->BBox().Diag(); - Track.GetView(); - Track.Apply(); - Track.Draw(); + TrackS.radius=s->BBox().Diag(); + TrackS.GetView(); + TrackS.Apply(); + TrackS.Draw(); glScalef(1.f/s->BBox().Diag(),1.f/s->BBox().Diag(),1.f/s->BBox().Diag()); - glScalef(GLfloat(zoom),GLfloat(zoom),GLfloat(zoom)); + //glScalef(GLfloat(zoom),GLfloat(zoom),GLfloat(zoom)); glTranslate(-p); //save transformation matrixes SaveMatrix(); } else { - vcg::tri::UpdateBounding::Box(s->m); - vcg::Point3f p=s->m.bbox.Center(); - Track.radius=s->m.bbox.Diag(); - Track.GetView(); - Track.Apply(); - Track.Draw(); - glScalef(1/s->m.bbox.Diag(),1/s->m.bbox.Diag(),1/s->m.bbox.Diag()); - glScalef(GLfloat(zoom),GLfloat(zoom),GLfloat(zoom)); - glTranslate(-p); + if (s->m!=NULL) + { + //vcg::tri::UpdateBounding::Box(*(s->m)); + vcg::Point3f p=s->m->bbox.Center(); + TrackM.GetView(); + TrackM.Apply(); + TrackM.Draw(); + glScalef(1.f/s->m->bbox.Diag(),1.f/s->m->bbox.Diag(),1.f/s->m->bbox.Diag()); + glTranslate(-p); + //glScalef(1.f/s->m->bbox.Diag(),1.f/s->m->bbox.Diag(),1.f/s->m->bbox.Diag()); + } } glEnable(GL_NORMALIZE); @@ -324,9 +337,11 @@ void SimpleGLWidget::glDraw(){ glPolygonMode(GL_FRONT,GL_FILL); int i=0; - glBegin(GL_TRIANGLES); - for (fi=s->m.face.begin();fim.face.end();fi++) + if (s->m!=NULL) { + glBegin(GL_TRIANGLES); + for (fi=s->m->face.begin();fim->face.end();fi++) + { glColor3d(0.4,0.8,0.8); if (fi->intersected) glColor3d(1.f,0,0); @@ -343,7 +358,7 @@ void SimpleGLWidget::glDraw(){ } } glEnd(); - + } glPopMatrix(); //WriteInfo(); @@ -390,15 +405,32 @@ void SimpleGLWidget::resizeGL( int w, int h ) void SimpleGLWidget::ClearMesh() { - s->m.Clear(); + s->m->Clear(); repaint(); } +void SimpleGLWidget::UpdateBBMesh() +{ + vcg::tri::UpdateBounding::Box(*(s->m)); +} void SimpleGLWidget::mousePressEvent ( QMouseEvent * e ) { if (e->button()==Qt::LeftButton ) - Track.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + { + + if ((!_showslides)&&(s->m!=NULL)) + { + /*vcg::tri::UpdateBounding::Box(*(s->m)); + TrackM.radius=s->m->bbox.Diag(); + TrackM.center=s->m->bbox.Center(); + */ + UpdateBBMesh(); + TrackM.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + } + else if (_showslides) + TrackS.MouseDown(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + } else //test mass spring model if ((e->button()==Qt::RightButton)&&(_showslides)) @@ -417,6 +449,8 @@ void SimpleGLWidget::mousePressEvent ( QMouseEvent * e ) //s->SetInitialBarycenter(Point3f(x,y,_numslide)); //s->InitSegmentation(Point3f(x,y,_numslide)); s->InitSegmentation(Point3f(x,y,z)); + UpdateBBMesh(); + //vcg::tri::UpdateBounding::Box(*(s->m)); repaint(); } //vcg::tri::UpdateBounding::Box(s->m); @@ -426,7 +460,9 @@ void SimpleGLWidget::wheelEvent(QWheelEvent *e) { if (!_showslides) { - zoom+=e->delta()/120.f; + /* zoom+=e->delta()/120.f; + repaint();*/ + TrackM.MouseWheel(e->delta()/120.f); repaint(); } else @@ -446,7 +482,11 @@ void SimpleGLWidget::wheelEvent(QWheelEvent *e) void SimpleGLWidget::mouseReleaseEvent(QMouseEvent * e ) { - Track.MouseUp(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + if (!_showslides) + TrackM.MouseUp(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + else + TrackS.MouseUp(e->x(),_H-e->y(),vcg::Trackball::BUTTON_LEFT); + repaint(); } @@ -459,6 +499,15 @@ void SimpleGLWidget::Step() } } +void SimpleGLWidget::MarchingCube() +{ + if (s->m->fn>0) + s->Resample(); + + //vcg::tri::io::ExporterPLY::Save((*s->new_m),"d:/march.ply"); + //vcg::tri::io::ExporterPLY::Save((*s->m),"d:/march.ply"); +} + void SimpleGLWidget::SetExtractionParameters() { float mass=atof(w->M_particles->text()); @@ -476,7 +525,11 @@ void SimpleGLWidget::SetExtractionParameters() void SimpleGLWidget::mouseMoveEvent ( QMouseEvent * e ) { - Track.MouseMove(e->x(),_H-e->y()); + if (_showslides) + TrackS.MouseMove(e->x(),_H-e->y()); + else + TrackM.MouseMove(e->x(),_H-e->y()); + repaint(); } diff --git a/apps/test/segmentation3d/simpleglwidget.h b/apps/test/segmentation3d/simpleglwidget.h index 09b2a156..f3ace1dc 100644 --- a/apps/test/segmentation3d/simpleglwidget.h +++ b/apps/test/segmentation3d/simpleglwidget.h @@ -1,14 +1,14 @@ -#include +#include #include -#include -#include +#include +#include #include #include #include -#include #include #include #include +#include class SimpleGLWidget: public QGLWidget{ @@ -17,7 +17,8 @@ Q_OBJECT private : int _H; int _W; - vcg::Trackball Track; + vcg::Trackball TrackM; + vcg::Trackball TrackS; double zoom; GLdouble projection[16]; GLdouble modelMatrix[16]; @@ -31,7 +32,8 @@ private : bool resultForces; bool continue_int; GLuint texName; - + //Segmentator *s; + //QTimer *timer; //vcg::GlTrimesh *Wrap; public: @@ -59,7 +61,8 @@ public: void WriteInfo(); void ClearMesh(); void OpenDirectory(); - + void MarchingCube(); + void UpdateBBMesh(); //virtual void keyPressEvent(QKeyEvent *qk); @@ -73,6 +76,7 @@ public: void ShowSlides() { _showslides=!_showslides; + UpdateBBMesh(); repaint(); } @@ -124,17 +128,21 @@ public: void Extract() { + UpdateBBMesh(); continue_int=!continue_int; if (continue_int) { _showslides=false; w->SlidesButton->setOn(false); + //((SegmentForm *)this->parent())->SlidesButton->setOn(false); } else { _showslides=true; w->SlidesButton->setOn(true); + //((SegmentForm *)this->parent())->SlidesButton->setOn(true); } + repaint(); } void Update() @@ -142,8 +150,18 @@ public: Step(); } + void Clear() { ClearMesh(); + repaint(); } + + void CleanMesh() + { + MarchingCube(); + UpdateBBMesh(); + repaint(); + } + }; \ No newline at end of file