From 1f0ed7b17a637019355f5810afab5cca2a4a55d8 Mon Sep 17 00:00:00 2001 From: Mike Taverne Date: Tue, 7 Apr 2009 13:43:57 +0200 Subject: [PATCH] -Removed deprecated spinboxes to set density per vertex type -Added DebugLevel + maxiter_density in GUI --- createspecialmapping.cpp | 5 +-- createspecialmapping.h | 11 ++--- guismoothsurface.cpp | 16 +++++-- guismoothsurface.ui | 106 +++++++++++++++++------------------------------ 4 files changed, 57 insertions(+), 81 deletions(-) diff --git a/createspecialmapping.cpp b/createspecialmapping.cpp index 3567a28..7271005 100644 --- a/createspecialmapping.cpp +++ b/createspecialmapping.cpp @@ -160,7 +160,6 @@ int CreateSpecialMapping::UpdateDesiredMeshDensity() if(DebugLevel>3) cout<<"before loop: diff="<2) cout<<"--->diff="<2) cout<<"======>"<Convergence_meshdensity && !first && iterConvergence_meshdensity && !first && iter=maxiter_density) cout<<"WARNING: Desired convergence factor has not been reached!"< hitlist;//Elements to be terminated (0=keep alive, 1=field agent to eliminate, 2=border agent to eliminate) QVector offset;//offset caused by terminated elements - double SV_value; +/* double SV_value; double FV_value; double FEV_value; - double BEV_value; + double BEV_value;*/ QVector VMDvector;//Vertices of Mass destruction @@ -76,10 +77,10 @@ class CreateSpecialMapping : public Operation { void SetVertexMeshDensityVector(QVector a_VMDvector){VMDvector=a_VMDvector;}; - void Set_SV_value(double V){SV_value=V;}; +/* void Set_SV_value(double V){SV_value=V;}; void Set_FV_value(double V){FV_value=V;}; void Set_FEV_value(double V){FEV_value=V;}; - void Set_BEV_value(double V){BEV_value=V;}; + void Set_BEV_value(double V){BEV_value=V;};*/ void SetConvergence_meshdensity(double C){Convergence_meshdensity=C;}; void Set_insert_FP(bool B){insert_FP=B;}; diff --git a/guismoothsurface.cpp b/guismoothsurface.cpp index cab1e84..d2306ec 100644 --- a/guismoothsurface.cpp +++ b/guismoothsurface.cpp @@ -96,6 +96,9 @@ int GuiSmoothSurface::readSettings() current_filename=local_qset->value("Filename", "").toString(); ui.SmoothMethod->setCurrentIndex(local_qset->value("Method", 0).toInt()); ui.spinBox_NumberOfSmoothIterations->setValue(local_qset->value("NumberOfSmoothIterations", 20).toInt()); + ui.spinBox_maxiter_density->setValue(local_qset->value("maxiter_density", 1000).toInt()); + ui.spinBox_DebugLevel->setValue(local_qset->value("DebugLevel", 0).toInt()); + ui.doubleSpinBox_Convergence_meshdensity->setValue(local_qset->value("Convergence_meshdensity", 0.000001).toDouble()); ui.checkBox_insert_FP->setCheckState(int2CheckState(local_qset->value("insert_FP", 2).toInt())); ui.checkBox_insert_EP->setCheckState(int2CheckState(local_qset->value("insert_EP", 2).toInt())); @@ -135,12 +138,15 @@ int GuiSmoothSurface::readSettings() } return(0); } + int GuiSmoothSurface::writeSettings() { local_qset=new QSettings("enGits","enGrid_smoothsurface"); local_qset->setValue("Filename", current_filename); local_qset->setValue("Method", ui.SmoothMethod->currentIndex()); local_qset->setValue("NumberOfSmoothIterations", ui.spinBox_NumberOfSmoothIterations->value()); + local_qset->setValue("maxiter_density", ui.spinBox_maxiter_density->value()); + local_qset->setValue("DebugLevel", ui.spinBox_DebugLevel->value()); local_qset->setValue("Convergence_meshdensity", ui.doubleSpinBox_Convergence_meshdensity->value()); local_qset->setValue("insert_FP", ui.checkBox_insert_FP->checkState()); local_qset->setValue("insert_EP", ui.checkBox_insert_EP->checkState()); @@ -238,10 +244,10 @@ void GuiSmoothSurface::before() ui.checkBox_GenerateErrorScalars->setCheckState(int2CheckState(2)); ui.checkBox_GenerateErrorVectors->setCheckState(int2CheckState(2)); - ui.doubleSpinBox_VTK_SIMPLE_VERTEX->setValue(-1); +/* ui.doubleSpinBox_VTK_SIMPLE_VERTEX->setValue(-1); ui.doubleSpinBox_VTK_FIXED_VERTEX->setValue(-1); ui.doubleSpinBox_VTK_FEATURE_EDGE_VERTEX->setValue(-1); - ui.doubleSpinBox_VTK_BOUNDARY_EDGE_VERTEX->setValue(-1); + ui.doubleSpinBox_VTK_BOUNDARY_EDGE_VERTEX->setValue(-1);*/ int row=0; int column=0; @@ -1181,10 +1187,10 @@ void GuiSmoothSurface::operate() toto.SetGenerateErrorScalars (ui.checkBox_GenerateErrorScalars->checkState()); toto.SetGenerateErrorVectors (ui.checkBox_GenerateErrorVectors->checkState()); - toto.Set_SV_value(ui.doubleSpinBox_VTK_SIMPLE_VERTEX->value()); +/* toto.Set_SV_value(ui.doubleSpinBox_VTK_SIMPLE_VERTEX->value()); toto.Set_FV_value(ui.doubleSpinBox_VTK_FIXED_VERTEX->value()); toto.Set_FEV_value(ui.doubleSpinBox_VTK_FEATURE_EDGE_VERTEX->value()); - toto.Set_BEV_value(ui.doubleSpinBox_VTK_BOUNDARY_EDGE_VERTEX->value()); + toto.Set_BEV_value(ui.doubleSpinBox_VTK_BOUNDARY_EDGE_VERTEX->value());*/ toto.SetConvergence_meshdensity(ui.doubleSpinBox_Convergence_meshdensity->value()); @@ -1196,6 +1202,8 @@ void GuiSmoothSurface::operate() toto.DoLaplaceSmoothing=ui.checkBox_LaplaceSmoothing->checkState(); toto.N_SmoothIterations=ui.spinBox_NumberOfSmoothIterations->value(); + toto.maxiter_density=ui.spinBox_maxiter_density->value(); + DebugLevel=ui.spinBox_DebugLevel->value(); toto.Process(); diff --git a/guismoothsurface.ui b/guismoothsurface.ui index 6845eae..aec7e5e 100644 --- a/guismoothsurface.ui +++ b/guismoothsurface.ui @@ -288,69 +288,13 @@ - - - VTK_SIMPLE_VERTEX : - - - - - - - -1.000000000000000 - - - - - - - VTK_FIXED_VERTEX : - - - - - - - VTK_FEATURE_EDGE_VERTEX : - - - - - - - VTK_BOUNDARY_EDGE_VERTEX : - - - - - - - -1.000000000000000 - - - - - - - -1.000000000000000 - - - - - - - -1.000000000000000 - - - - Convergence_meshdensity : - + 6 @@ -360,7 +304,7 @@ - + @@ -373,51 +317,75 @@ - - + + - Remove field points + Insert edge points - - + + - Insert edge points + Remove field points - + Remove edge points - + NumberOfSmoothIterations : - + - + Swap - + Laplace smoothing + + + + DebugLevel : + + + + + + + + + + Maxiter for density calculation : + + + + + + + 1000 + + + -- 2.11.4.GIT