From 2f6b0a28871f526e0e04512b3acffbb29a2352cb Mon Sep 17 00:00:00 2001 From: gdd Date: Mon, 22 Aug 2011 16:01:41 +0000 Subject: [PATCH] Add/Modify PreCAD usage and options. The most significant options have dedicated methods: SetPreCADMergeEdges(bool) SetPreCADRemoveNanoEdges(bool) SetPreCADEpsNano(double) SetPreCADDiscardInput(bool) The others options can be set using the method SetOption. In this later case the names should be prepend by "PRECAD_". --- idl/BLSURFPlugin_Algorithm.idl | 23 +- src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 204 +++++++++++++++--- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 61 ++++-- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 26 +-- .../BLSURFPlugin_Hypothesis_i.cxx | 76 +++---- .../BLSURFPlugin_Hypothesis_i.hxx | 14 +- src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx | 103 +++++---- src/GUI/BLSURFPluginGUI_HypothesisCreator.h | 8 +- src/GUI/BLSURFPlugin_msg_en.ts | 16 +- src/GUI/BLSURFPlugin_msg_fr.ts | 16 +- 10 files changed, 355 insertions(+), 192 deletions(-) diff --git a/idl/BLSURFPlugin_Algorithm.idl b/idl/BLSURFPlugin_Algorithm.idl index b77fcd4..83750ea 100644 --- a/idl/BLSURFPlugin_Algorithm.idl +++ b/idl/BLSURFPlugin_Algorithm.idl @@ -212,10 +212,16 @@ module BLSURFPlugin short GetVerbosity(); /*! - * To optimize the CAD (merges edges and removes nano edges). + * To optimize merges edges. */ - void SetPreCADOptimCAD(in boolean toOptimizeCAD); - boolean GetPreCADOptimCAD(); + void SetPreCADMergeEdges(in boolean toMergeEdges); + boolean GetPreCADMergeEdges(); + + /*! + * To remove nano edges. + */ + void SetPreCADRemoveNanoEdges(in boolean toRemoveNanoEdges); + boolean GetPreCADRemoveNanoEdges(); /*! * To compute topology from scratch @@ -227,15 +233,8 @@ module BLSURFPlugin * To help PreCAD treat some very dirty cases. * If the treated object is manifold. */ - void SetPreCADManifoldGeom(in boolean manifold); - boolean GetPreCADManifoldGeom(); - - /*! - * To help PreCAD treat some very dirty cases. - * If the object is also closed (imagine a shell). - */ - void SetPreCADClosedGeom(in boolean closed); - boolean GetPreCADClosedGeom(); + void SetPreCADEpsNano(in double epsNano); + boolean GetPreCADEpsNano(); /*! * Sets advanced option value diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index a2ac186..340cc17 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -373,6 +373,12 @@ inline std::string to_string(int i) } double _smp_phy_size; +// #if BLSURF_VERSION_LONG >= "3.1.1" +// // sizemap_t *geo_sizemap_e, *geo_sizemap_f; +// sizemap_t *iso_sizemap_p, *iso_sizemap_e, *iso_sizemap_f; +// // sizemap_t *clean_geo_sizemap_e, *clean_geo_sizemap_f; +// sizemap_t *clean_iso_sizemap_p, *clean_iso_sizemap_e, *clean_iso_sizemap_f; +// #endif status_t size_on_surface(integer face_id, real *uv, real *size, void *user_data); status_t size_on_edge(integer edge_id, real t, real *size, void *user_data); status_t size_on_vertex(integer vertex_id, real *size, void *user_data); @@ -664,7 +670,11 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction ///////////////////////////////////////////////////////// -void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, +void BLSURFPlugin_BLSURF::SetParameters( +// #if BLSURF_VERSION_LONG >= "3.1.1" +// cad_t * c, +// #endif + const BLSURFPlugin_Hypothesis* hyp, blsurf_session_t * bls, precad_session_t * pcs, SMESH_Mesh& mesh, @@ -683,10 +693,10 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, int _verb = BLSURFPlugin_Hypothesis::GetDefaultVerbosity(); // PreCAD - int _precadOptimCad = BLSURFPlugin_Hypothesis::GetDefaultPreCADOptimCAD(); - int _precadDiscardInput = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput(); - int _precadManifoldGeom = BLSURFPlugin_Hypothesis::GetDefaultPreCADManifoldGeom(); - int _precadClosedGeom = BLSURFPlugin_Hypothesis::GetDefaultPreCADClosedGeom(); + int _precadMergeEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADMergeEdges(); + int _precadRemoveNanoEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveNanoEdges(); + int _precadDiscardInput = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput(); + double _precadEpsNano = BLSURFPlugin_Hypothesis::GetDefaultMinSize(); if (hyp) { @@ -712,17 +722,27 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, const BLSURFPlugin_Hypothesis::TOptionValues & opts = hyp->GetOptionValues(); BLSURFPlugin_Hypothesis::TOptionValues::const_iterator opIt; + std::string preCADOptName; + size_t preCADstr_found; for ( opIt = opts.begin(); opIt != opts.end(); ++opIt ) if ( !opIt->second.empty() ) { - MESSAGE("blsurf_set_param(): " << opIt->first << " = " << opIt->second); - blsurf_set_param(bls, opIt->first.c_str(), opIt->second.c_str()); + preCADstr_found = opIt->first.find("PRECAD_"); + if (preCADstr_found !=std::string::npos && int(preCADstr_found) == 0 && _topology == BLSURFPlugin_Hypothesis::PreCAD) { + preCADOptName = opIt->first.substr(preCADstr_found+7); + MESSAGE("precad_set_param(): " << preCADOptName << " = " << opIt->second); + blsurf_set_param(bls, preCADOptName.c_str(), opIt->second.c_str()); + } + else { + MESSAGE("blsurf_set_param(): " << opIt->first << " = " << opIt->second); + blsurf_set_param(bls, opIt->first.c_str(), opIt->second.c_str()); + } } // PreCAD - _precadOptimCad = hyp->GetPreCADOptimCAD(); + _precadMergeEdges = hyp->GetPreCADMergeEdges(); + _precadRemoveNanoEdges = hyp->GetPreCADRemoveNanoEdges(); _precadDiscardInput = hyp->GetPreCADDiscardInput(); - _precadManifoldGeom = hyp->GetPreCADManifoldGeom(); - _precadClosedGeom = hyp->GetPreCADClosedGeom(); + _precadEpsNano = hyp->GetPreCADEpsNano(); } else { //0020968: EDF1545 SMESH: Problem in the creation of a mesh group on geometry @@ -735,12 +755,11 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, if (_topology == BLSURFPlugin_Hypothesis::PreCAD) { *use_precad = true; precad_set_param(pcs, "verbose", to_string(_verb).c_str()); - - precad_set_param(pcs, "merge_edges", _precadOptimCad > 0 ? "1" : "0"); - precad_set_param(pcs, "remove_nano_edges", _precadOptimCad > 0 ? "1" : "0"); + precad_set_param(pcs, "merge_edges", _precadMergeEdges ? "1" : "0"); + precad_set_param(pcs, "remove_nano_edges", _precadRemoveNanoEdges ? "1" : "0"); precad_set_param(pcs, "discard_input_topology", _precadDiscardInput ? "1" : "0"); - precad_set_param(pcs, "manifold_geometry", _precadManifoldGeom ? "1" : "0"); - precad_set_param(pcs, "closed_geometry", _precadClosedGeom ? "1" : "0"); + if ( _precadEpsNano != ::BLSURFPlugin_Hypothesis::undefinedDouble() ) + precad_set_param(pcs, "eps_nano", to_string(_precadEpsNano).c_str()); } _smp_phy_size = _phySize; @@ -750,7 +769,16 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, blsurf_set_param(bls, "clean_boundary", _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0"); blsurf_set_param(bls, "close_boundary", _topology == BLSURFPlugin_Hypothesis::Process2 ? "1" : "0"); blsurf_set_param(bls, "hphy_flag", to_string(_physicalMesh).c_str()); - + blsurf_set_param(bls, "hphydef", to_string(_phySize).c_str()); + blsurf_set_param(bls, "hgeo_flag", to_string(_geometricMesh).c_str()); + blsurf_set_param(bls, "relax_size", _decimesh ? "0": to_string(_geometricMesh).c_str()); + blsurf_set_param(bls, "angle_meshs", to_string(_angleMeshS).c_str()); + blsurf_set_param(bls, "angle_meshc", to_string(_angleMeshC).c_str()); + blsurf_set_param(bls, "gradation", to_string(_gradation).c_str()); + blsurf_set_param(bls, "patch_independent", _decimesh ? "1" : "0"); + blsurf_set_param(bls, "element", _quadAllowed ? "q1.0" : "p1"); + blsurf_set_param(bls, "verb", to_string(_verb).c_str()); + if (_physicalMesh == BLSURFPlugin_Hypothesis::SizeMap){ TopoDS_Shape GeomShape; TopoDS_Shape AttShape; @@ -980,33 +1008,39 @@ void BLSURFPlugin_BLSURF::SetParameters(const BLSURFPlugin_Hypothesis* hyp, } } -// if (HasSizeMapOnFace){ - // In all size map cases (hphy_flag = 2), at least map on face must be defined MESSAGE("Setting Size Map on FACES "); +// #if BLSURF_VERSION_LONG < "3.1.1" blsurf_data_set_sizemap_iso_cad_face(bls, size_on_surface, &_smp_phy_size); -// } +// #else +// if (*use_precad) +// iso_sizemap_f = sizemap_new(c, distene_sizemap_type_iso_cad_face, (void *)size_on_surface, NULL); +// else +// clean_iso_sizemap_f = sizemap_new(c, distene_sizemap_type_iso_cad_face, (void *)size_on_surface, NULL); +// #endif if (HasSizeMapOnEdge){ MESSAGE("Setting Size Map on EDGES "); +// #if BLSURF_VERSION_LONG < "3.1.1" blsurf_data_set_sizemap_iso_cad_edge(bls, size_on_edge, &_smp_phy_size); +// #else +// if (*use_precad) +// iso_sizemap_e = sizemap_new(c, distene_sizemap_type_iso_cad_edge, (void *)size_on_edge, NULL); +// else +// clean_iso_sizemap_e = sizemap_new(c, distene_sizemap_type_iso_cad_edge, (void *)size_on_edge, NULL); +// #endif } if (HasSizeMapOnVertex){ MESSAGE("Setting Size Map on VERTICES "); +// #if BLSURF_VERSION_LONG < "3.1.1" blsurf_data_set_sizemap_iso_cad_point(bls, size_on_vertex, &_smp_phy_size); +// #else +// if (*use_precad) +// iso_sizemap_p = sizemap_new(c, distene_sizemap_type_iso_cad_point, (void *)size_on_vertex, NULL); +// else +// clean_iso_sizemap_p = sizemap_new(c, distene_sizemap_type_iso_cad_point, (void *)size_on_vertex, NULL); +// #endif } } - blsurf_set_param(bls, "hphydef", to_string(_phySize).c_str()); - blsurf_set_param(bls, "hgeo_flag", to_string(_geometricMesh).c_str()); - blsurf_set_param(bls, "relax_size", _decimesh ? "0": to_string(_geometricMesh).c_str()); - blsurf_set_param(bls, "angle_meshs", to_string(_angleMeshS).c_str()); - blsurf_set_param(bls, "angle_meshc", to_string(_angleMeshC).c_str()); - blsurf_set_param(bls, "gradation", to_string(_gradation).c_str()); - blsurf_set_param(bls, "patch_independent", _decimesh ? "1" : "0"); - blsurf_set_param(bls, "element", _quadAllowed ? "q1.0" : "p1"); - blsurf_set_param(bls, "verb", to_string(_verb).c_str()); -// #ifdef _DEBUG_ -// blsurf_set_param(bls, "debug", "1"); -// #endif } status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data); @@ -1077,7 +1111,11 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) MESSAGE("BEGIN SetParameters"); bool use_precad = false; - SetParameters(_hypothesis, bls, pcs, aMesh, &use_precad); + SetParameters( +// #if BLSURF_VERSION_LONG >= "3.1.1" +// c, +// #endif + _hypothesis, bls, pcs, aMesh, &use_precad); MESSAGE("END SetParameters"); // needed to prevent the opencascade memory managmement from freeing things @@ -1408,7 +1446,26 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) cout << "Unable to retrieve PreCAD result \n"; } cout << "PreCAD processing successfull \n"; - // Now we can delete the PreCAD session + +// #if BLSURF_VERSION_LONG >= "3.1.1" +// /* We can now get the updated sizemaps (if any) */ +// // if(geo_sizemap_e) +// // clean_geo_sizemap_e = precad_new_sizemap(pcs, geo_sizemap_e); +// // +// // if(geo_sizemap_f) +// // clean_geo_sizemap_f = precad_new_sizemap(pcs, geo_sizemap_f); +// +// if(iso_sizemap_p) +// clean_iso_sizemap_p = precad_new_sizemap(pcs, iso_sizemap_p); +// +// if(iso_sizemap_e) +// clean_iso_sizemap_e = precad_new_sizemap(pcs, iso_sizemap_e); +// +// if(iso_sizemap_f) +// clean_iso_sizemap_f = precad_new_sizemap(pcs, iso_sizemap_f); +// #endif + + // Now we can delete the PreCAD session precad_session_delete(pcs); } } @@ -1422,6 +1479,12 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) blsurf_data_set_cad(bls, c); } +// #if BLSURF_VERSION_LONG >= "3.1.1" +// blsurf_data_set_sizemap(bls, clean_iso_sizemap_p); +// blsurf_data_set_sizemap(bls, clean_iso_sizemap_e); +// blsurf_data_set_sizemap(bls, clean_iso_sizemap_f); +// #endif + std::cout << std::endl; std::cout << "Beginning of Surface Mesh generation" << std::endl; std::cout << std::endl; @@ -1455,6 +1518,31 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) if ( status != STATUS_OK) { // There was an error while meshing blsurf_session_delete(bls); + +// #if BLSURF_VERSION_LONG >= "3.1.1" +// // if(geo_sizemap_e) +// // distene_sizemap_delete(geo_sizemap_e); +// // if(geo_sizemap_f) +// // distene_sizemap_delete(geo_sizemap_f); +// if(iso_sizemap_p) +// distene_sizemap_delete(iso_sizemap_p); +// if(iso_sizemap_e) +// distene_sizemap_delete(iso_sizemap_e); +// if(iso_sizemap_f) +// distene_sizemap_delete(iso_sizemap_f); +// +// // if(clean_geo_sizemap_e) +// // distene_sizemap_delete(clean_geo_sizemap_e); +// // if(clean_geo_sizemap_f) +// // distene_sizemap_delete(clean_geo_sizemap_f); +// if(clean_iso_sizemap_p) +// distene_sizemap_delete(clean_iso_sizemap_p); +// if(clean_iso_sizemap_e) +// distene_sizemap_delete(clean_iso_sizemap_e); +// if(clean_iso_sizemap_f) +// distene_sizemap_delete(clean_iso_sizemap_f); +// #endif + cad_delete(c); context_delete(ctx); @@ -1472,6 +1560,31 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) blsurf_data_regain_mesh(bls, msh); /* clean up everything */ blsurf_session_delete(bls); + +// #if BLSURF_VERSION_LONG >= "3.1.1" +// // if(geo_sizemap_e) +// // distene_sizemap_delete(geo_sizemap_e); +// // if(geo_sizemap_f) +// // distene_sizemap_delete(geo_sizemap_f); +// if(iso_sizemap_p) +// distene_sizemap_delete(iso_sizemap_p); +// if(iso_sizemap_e) +// distene_sizemap_delete(iso_sizemap_e); +// if(iso_sizemap_f) +// distene_sizemap_delete(iso_sizemap_f); +// +// // if(clean_geo_sizemap_e) +// // distene_sizemap_delete(clean_geo_sizemap_e); +// // if(clean_geo_sizemap_f) +// // distene_sizemap_delete(clean_geo_sizemap_f); +// if(clean_iso_sizemap_p) +// distene_sizemap_delete(clean_iso_sizemap_p); +// if(clean_iso_sizemap_e) +// distene_sizemap_delete(clean_iso_sizemap_e); +// if(clean_iso_sizemap_f) +// distene_sizemap_delete(clean_iso_sizemap_f); +// #endif + cad_delete(c); context_delete(ctx); @@ -1675,6 +1788,31 @@ bool BLSURFPlugin_BLSURF::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) /* clean up everything */ blsurf_session_delete(bls); + +// #if BLSURF_VERSION_LONG >= "3.1.1" +// // if(geo_sizemap_e) +// // distene_sizemap_delete(geo_sizemap_e); +// // if(geo_sizemap_f) +// // distene_sizemap_delete(geo_sizemap_f); +// if(iso_sizemap_p) +// distene_sizemap_delete(iso_sizemap_p); +// if(iso_sizemap_e) +// distene_sizemap_delete(iso_sizemap_e); +// if(iso_sizemap_f) +// distene_sizemap_delete(iso_sizemap_f); +// +// // if(clean_geo_sizemap_e) +// // distene_sizemap_delete(clean_geo_sizemap_e); +// // if(clean_geo_sizemap_f) +// // distene_sizemap_delete(clean_geo_sizemap_f); +// if(clean_iso_sizemap_p) +// distene_sizemap_delete(clean_iso_sizemap_p); +// if(clean_iso_sizemap_e) +// distene_sizemap_delete(clean_iso_sizemap_e); +// if(clean_iso_sizemap_f) +// distene_sizemap_delete(clean_iso_sizemap_f); +// #endif + cad_delete(c); context_delete(ctx); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 838d435..0daa17a 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -55,10 +55,10 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G _quadAllowed(GetDefaultQuadAllowed()), _decimesh(GetDefaultDecimesh()), _verb(GetDefaultVerbosity()), - _preCADOptimCAD(GetDefaultPreCADOptimCAD()), + _preCADMergeEdges(GetDefaultPreCADMergeEdges()), + _preCADRemoveNanoEdges(GetDefaultPreCADRemoveNanoEdges()), _preCADDiscardInput(GetDefaultPreCADDiscardInput()), - _preCADManifoldGeom(GetDefaultPreCADManifoldGeom()), - _preCADClosedGeom(GetDefaultPreCADClosedGeom()), + _preCADEpsNano(GetDefaultMinSize()), _sizeMap(GetDefaultSizeMap()), _attractors(GetDefaultSizeMap()), _classAttractors(GetDefaultAttractorMap()), @@ -95,7 +95,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G }; const char* charOptionNames[] = { "export_format", "export_option", "import_option", "prefix", "" // mark of end }; - + int i = 0; while (intOptionNames[i][0]) _option2value[intOptionNames[i++]].clear(); @@ -111,6 +111,23 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, int studyId, SMESH_G _option2value[charOptionNames[i++]].clear(); } + // PreCAD advanced options + const char* preCADintOptionNames[] = { "PRECAD_closed_geometry", "PRECAD_debug", "PRECAD_manifold_geometry", "PRECAD_create_tag_on_collision","" // mark of end + }; + const char* preCADdoubleOptionNames[] = { "PRECAD_eps_nano_relative", "PRECAD_eps_sewing", "PRECAD_eps_sewing_relative", "PRECAD_periodic_tolerance", + "PRECAD_periodic_tolerance_relative", "PRECAD_periodic_split_tolerance", "PRECAD_periodic_split_tolerance_relative", "" // mark of end + }; + + i = 0; + while (preCADintOptionNames[i][0]) + _option2value[preCADintOptionNames[i++]].clear(); + + i = 0; + while (preCADdoubleOptionNames[i][0]) { + _doubleOptions.insert(preCADdoubleOptionNames[i]); + _option2value[preCADdoubleOptionNames[i++]].clear(); + } + _sizeMap.clear(); _attractors.clear(); _faceEntryEnfVertexListMap.clear(); @@ -269,37 +286,37 @@ void BLSURFPlugin_Hypothesis::SetVerbosity(int theVal) { } //============================================================================= -void BLSURFPlugin_Hypothesis::SetPreCADOptimCAD(bool theVal) { - if (theVal != _preCADOptimCAD) { +void BLSURFPlugin_Hypothesis::SetPreCADMergeEdges(bool theVal) { + if (theVal != _preCADMergeEdges) { SetTopology(PreCAD); - _preCADOptimCAD = theVal; + _preCADMergeEdges = theVal; NotifySubMeshesHypothesisModification(); } } //============================================================================= -void BLSURFPlugin_Hypothesis::SetPreCADDiscardInput(bool theVal) { - if (theVal != _preCADDiscardInput) { +void BLSURFPlugin_Hypothesis::SetPreCADRemoveNanoEdges(bool theVal) { + if (theVal != _preCADRemoveNanoEdges) { SetTopology(PreCAD); - _preCADDiscardInput = theVal; + _preCADRemoveNanoEdges = theVal; NotifySubMeshesHypothesisModification(); } } //============================================================================= -void BLSURFPlugin_Hypothesis::SetPreCADManifoldGeom(bool theVal) { - if (theVal != _preCADManifoldGeom) { +void BLSURFPlugin_Hypothesis::SetPreCADDiscardInput(bool theVal) { + if (theVal != _preCADDiscardInput) { SetTopology(PreCAD); - _preCADManifoldGeom = theVal; + _preCADDiscardInput = theVal; NotifySubMeshesHypothesisModification(); } } //============================================================================= -void BLSURFPlugin_Hypothesis::SetPreCADClosedGeom(bool theVal) { - if (theVal != _preCADClosedGeom) { +void BLSURFPlugin_Hypothesis::SetPreCADEpsNano(double theVal) { + if (theVal != _preCADEpsNano) { SetTopology(PreCAD); - _preCADClosedGeom = theVal; + _preCADEpsNano = theVal; NotifySubMeshesHypothesisModification(); } } @@ -971,7 +988,7 @@ std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) { save << " " << (int) _topology << " " << (int) _physicalMesh << " " << (int) _geometricMesh << " " << _phySize << " " << _angleMeshS << " " << _gradation << " " << (int) _quadAllowed << " " << (int) _decimesh; save << " " << _phyMin << " " << _phyMax << " " << _angleMeshC << " " << _hgeoMin << " " << _hgeoMax << " " << _verb; - save << " " << (int) _preCADOptimCAD << " " << (int) _preCADDiscardInput << " " << (int) _preCADManifoldGeom << " " << (int) _preCADClosedGeom; + save << " " << (int) _preCADMergeEdges << " " << (int) _preCADRemoveNanoEdges << " " << (int) _preCADDiscardInput << " " << _preCADEpsNano ; TOptionValues::iterator op_val = _option2value.begin(); if (op_val != _option2value.end()) { @@ -1161,25 +1178,25 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) { isOK = (load >> i); if (isOK) - _preCADOptimCAD = (bool) i; + _preCADMergeEdges = (bool) i; else load.clear(std::ios::badbit | load.rdstate()); isOK = (load >> i); if (isOK) - _preCADDiscardInput = (bool) i; + _preCADRemoveNanoEdges = (bool) i; else load.clear(std::ios::badbit | load.rdstate()); isOK = (load >> i); if (isOK) - _preCADManifoldGeom = (bool) i; + _preCADDiscardInput = (bool) i; else load.clear(std::ios::badbit | load.rdstate()); - isOK = (load >> i); + isOK = (load >> val); if (isOK) - _preCADClosedGeom = (bool) i; + _preCADEpsNano = val; else load.clear(std::ios::badbit | load.rdstate()); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index 493c18b..b6ffd4b 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -110,17 +110,17 @@ public: void ClearEntry(const std::string& entry); void ClearSizeMaps(); - void SetPreCADOptimCAD(bool theVal); - bool GetPreCADOptimCAD() const { return _preCADOptimCAD; } + void SetPreCADMergeEdges(bool theVal); + bool GetPreCADMergeEdges() const { return _preCADMergeEdges; } + + void SetPreCADRemoveNanoEdges(bool theVal); + bool GetPreCADRemoveNanoEdges() const { return _preCADRemoveNanoEdges; } void SetPreCADDiscardInput(bool theVal); bool GetPreCADDiscardInput() const { return _preCADDiscardInput; } - void SetPreCADManifoldGeom(bool theVal); - bool GetPreCADManifoldGeom() const { return _preCADManifoldGeom; } - - void SetPreCADClosedGeom(bool theVal); - bool GetPreCADClosedGeom() const { return _preCADClosedGeom; } + void SetPreCADEpsNano(double theVal); + double GetPreCADEpsNano() const { return _preCADEpsNano; } typedef std::map TSizeMap; @@ -286,10 +286,10 @@ public: static bool GetDefaultDecimesh(); static int GetDefaultVerbosity() { return 10; } // PreCAD - static bool GetDefaultPreCADOptimCAD() { return true; } + static bool GetDefaultPreCADMergeEdges() { return true; } + static bool GetDefaultPreCADRemoveNanoEdges() { return true; } static bool GetDefaultPreCADDiscardInput() { return false; } - static bool GetDefaultPreCADManifoldGeom() { return false; } - static bool GetDefaultPreCADClosedGeom() { return false; } +// static double GetDefaultPreCADEpsNano() { return undefinedDouble(); } static TSizeMap GetDefaultSizeMap() { return TSizeMap();} static TAttractorMap GetDefaultAttractorMap() { return TAttractorMap(); } @@ -358,10 +358,10 @@ private: bool _decimesh; int _verb; - bool _preCADOptimCAD; + bool _preCADMergeEdges; + bool _preCADRemoveNanoEdges; bool _preCADDiscardInput; - bool _preCADManifoldGeom; - bool _preCADClosedGeom; + bool _preCADEpsNano; TOptionValues _option2value; TOptionNames _doubleOptions, _charOptions; diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index 48c353d..4555fca 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -372,110 +372,110 @@ CORBA::Short BLSURFPlugin_Hypothesis_i::GetVerbosity() { //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD + * BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges * * Set true or false */ //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD(CORBA::Boolean theValue) { - // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADOptimCAD"); +void BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADMergeEdges"); ASSERT(myBaseImpl); - this->GetImpl()->SetPreCADOptimCAD(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADOptimCAD( " << theValue << " )"; + this->GetImpl()->SetPreCADMergeEdges(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADMergeEdges( " << theValue << " )"; } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD + * BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges * * Get true or false */ //============================================================================= -CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD() { - // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADOptimCAD"); +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADMergeEdges"); ASSERT(myBaseImpl); - return this->GetImpl()->GetPreCADOptimCAD(); + return this->GetImpl()->GetPreCADMergeEdges(); } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput + * BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges * * Set true or false */ //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) { - // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput"); +void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveNanoEdges"); ASSERT(myBaseImpl); - this->GetImpl()->SetPreCADDiscardInput(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValue << " )"; + this->GetImpl()->SetPreCADRemoveNanoEdges(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADRemoveNanoEdges( " << theValue << " )"; } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput + * BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges * * Get true or false */ //============================================================================= -CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() { - // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput"); +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveNanoEdges"); ASSERT(myBaseImpl); - return this->GetImpl()->GetPreCADDiscardInput(); + return this->GetImpl()->GetPreCADRemoveNanoEdges(); } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom + * BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput * * Set true or false */ //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom(CORBA::Boolean theValue) { - // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADManifoldGeom"); +void BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput(CORBA::Boolean theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADDiscardInput"); ASSERT(myBaseImpl); - this->GetImpl()->SetPreCADManifoldGeom(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADManifoldGeom( " << theValue << " )"; + this->GetImpl()->SetPreCADDiscardInput(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADDiscardInput( " << theValue << " )"; } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom + * BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput * * Get true or false */ //============================================================================= -CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom() { - // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADManifoldGeom"); +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput"); ASSERT(myBaseImpl); - return this->GetImpl()->GetPreCADManifoldGeom(); + return this->GetImpl()->GetPreCADDiscardInput(); } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom + * BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano * - * Set true or false + * Set length for nano edges */ //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom(CORBA::Boolean theValue) { - // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADClosedGeom"); +void BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano(CORBA::Double theValue) { + // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADEpsNano"); ASSERT(myBaseImpl); - this->GetImpl()->SetPreCADClosedGeom(theValue); - SMESH::TPythonDump() << _this() << ".SetPreCADClosedGeom( " << theValue << " )"; + this->GetImpl()->SetPreCADEpsNano(theValue); + SMESH::TPythonDump() << _this() << ".SetPreCADEpsNano( " << theValue << " )"; } //============================================================================= /*! - * BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom + * BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano * - * Get true or false + * Get length of nano edges */ //============================================================================= -CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom() { - // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADClosedGeom"); +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano() { + // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADEpsNano"); ASSERT(myBaseImpl); - return this->GetImpl()->GetPreCADClosedGeom(); + return this->GetImpl()->GetPreCADEpsNano(); } //============================================================================= diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index 9fd864f..73e12d9 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -87,17 +87,17 @@ public: void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception); CORBA::Short GetVerbosity(); - void SetPreCADOptimCAD(CORBA::Boolean theValue); - CORBA::Boolean GetPreCADOptimCAD(); + void SetPreCADMergeEdges(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADMergeEdges(); + + void SetPreCADRemoveNanoEdges(CORBA::Boolean theValue); + CORBA::Boolean GetPreCADRemoveNanoEdges(); void SetPreCADDiscardInput(CORBA::Boolean theValue); CORBA::Boolean GetPreCADDiscardInput(); - void SetPreCADManifoldGeom(CORBA::Boolean theValue); - CORBA::Boolean GetPreCADManifoldGeom(); - - void SetPreCADClosedGeom(CORBA::Boolean theValue); - CORBA::Boolean GetPreCADClosedGeom(); + void SetPreCADEpsNano(CORBA::Double theValue); + CORBA::Boolean GetPreCADEpsNano(); void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception); char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception); diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index f954a3c..a334094 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -776,15 +776,19 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() myPreCADGroupBox = new QGroupBox(tr("BLSURF_PRECAD_GROUP"), myAdvGroup ); myPreCADGroupBox->setEnabled(false); QGridLayout* aPreCADGroupLayout = new QGridLayout(myPreCADGroupBox); - myPreCADOptimCAD = new QCheckBox(tr("BLSURF_PRECAD_OPTIM_CAD"),myPreCADGroupBox); - myPreCADOptimCAD->setChecked(true); - aPreCADGroupLayout->addWidget(myPreCADOptimCAD); + myPreCADMergeEdges = new QCheckBox(tr("BLSURF_PRECAD_MERGE_EDGES"),myPreCADGroupBox); + myPreCADMergeEdges->setChecked(true); + aPreCADGroupLayout->addWidget(myPreCADMergeEdges,0,0,1,2); + myPreCADRemoveNanoEdges = new QCheckBox(tr("BLSURF_PRECAD_REMOVE_NANO_EDGES"),myPreCADGroupBox); + myPreCADRemoveNanoEdges->setChecked(true); + aPreCADGroupLayout->addWidget(myPreCADRemoveNanoEdges,1,0,1,2); + myPreCADEpsNano = new SMESHGUI_SpinBox(myPreCADGroupBox); + myPreCADEpsNano->RangeStepAndValidator(0, COORD_MAX, 10.0, "length_precision"); + myPreCADEpsNano->setText(""); + aPreCADGroupLayout->addWidget( new QLabel( tr( "BLSURF_PRECAD_EPS_NANO" ), myPreCADGroupBox ), 2, 0, 1, 1 ); + aPreCADGroupLayout->addWidget(myPreCADEpsNano, 2, 1, 1, 1 ); myPreCADDiscardInput = new QCheckBox(tr("BLSURF_PRECAD_DISCARD_INPUT"),myPreCADGroupBox); - aPreCADGroupLayout->addWidget(myPreCADDiscardInput); - myPreCADManifoldGeom = new QCheckBox(tr("BLSURF_PRECAD_MANIFOLD_GEOM"),myPreCADGroupBox); - aPreCADGroupLayout->addWidget(myPreCADManifoldGeom); - myPreCADClosedGeom = new QCheckBox(tr("BLSURF_PRECAD_CLOSED_GEOM"),myPreCADGroupBox); - aPreCADGroupLayout->addWidget(myPreCADClosedGeom); + aPreCADGroupLayout->addWidget(myPreCADDiscardInput, 3, 0, 1, 2); QPushButton* chooseGMFBtn = new QPushButton( tr( "BLSURF_GMF_FILE" ), myAdvGroup ); myGMFFileName = new QLineEdit(myAdvGroup); @@ -1472,10 +1476,14 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const } myTopology->setCurrentIndex( data.myTopology ); myPreCADGroupBox->setEnabled(data.myTopology == PreCAD); - myPreCADOptimCAD->setChecked( data.myPreCADOptimCAD ); + myPreCADMergeEdges->setChecked( data.myPreCADMergeEdges ); + myPreCADRemoveNanoEdges->setChecked( data.myPreCADRemoveNanoEdges ); myPreCADDiscardInput->setChecked( data.myPreCADDiscardInput ); - myPreCADManifoldGeom->setChecked( data.myPreCADManifoldGeom ); - myPreCADClosedGeom->setChecked( data.myPreCADClosedGeom ); + MESSAGE("data.myPreCADEpsNano: "<setText(""); + else + myPreCADEpsNano->SetValue( data.myPreCADEpsNano ); myPhysicalMesh->setCurrentIndex( data.myPhysicalMesh ); myPhySize->SetValue( data.myPhySize ); #ifdef WITH_SIZE_BOUNDARIES @@ -1650,10 +1658,11 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData h_data.myAllowQuadrangles = h->GetQuadAllowed(); h_data.myDecimesh = h->GetDecimesh(); h_data.myVerbosity = h->GetVerbosity(); - h_data.myPreCADOptimCAD = h->GetPreCADOptimCAD(); + h_data.myPreCADMergeEdges = h->GetPreCADMergeEdges(); + h_data.myPreCADRemoveNanoEdges = h->GetPreCADRemoveNanoEdges(); h_data.myPreCADDiscardInput = h->GetPreCADDiscardInput(); - h_data.myPreCADManifoldGeom = h->GetPreCADManifoldGeom(); - h_data.myPreCADClosedGeom = h->GetPreCADClosedGeom(); + double EpsNano = h->GetPreCADEpsNano(); + h_data.myPreCADEpsNano = EpsNano > 0 ? EpsNano : -1.0; #ifdef WITH_SIZE_BOUNDARIES double PhyMin = h->GetPhyMin(); @@ -1742,7 +1751,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData } // attractor new version - MESSAGE("retriveParams, Attractors") + MESSAGE("retrieveParams, Attractors") BLSURFPlugin::TAttParamsMap_var allMyAttractorParams = h->GetAttractorParams(); for ( int i = 0;ilength(); ++i ) { BLSURFPlugin::TAttractorParams myAttractorParams = allMyAttractorParams[i]; @@ -1835,14 +1844,14 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->SetDecimesh( h_data.myDecimesh ); if ( h->GetVerbosity() != h_data.myVerbosity ) h->SetVerbosity( h_data.myVerbosity ); - if ( h->GetPreCADOptimCAD() != h_data.myPreCADOptimCAD ) - h->SetPreCADOptimCAD( h_data.myPreCADOptimCAD ); + if ( h->GetPreCADMergeEdges() != h_data.myPreCADMergeEdges ) + h->SetPreCADMergeEdges( h_data.myPreCADMergeEdges ); + if ( h->GetPreCADRemoveNanoEdges() != h_data.myPreCADRemoveNanoEdges ) + h->SetPreCADRemoveNanoEdges( h_data.myPreCADRemoveNanoEdges ); if ( h->GetPreCADDiscardInput() != h_data.myPreCADDiscardInput ) h->SetPreCADDiscardInput( h_data.myPreCADDiscardInput ); - if ( h->GetPreCADManifoldGeom() != h_data.myPreCADManifoldGeom ) - h->SetPreCADManifoldGeom( h_data.myPreCADManifoldGeom ); - if ( h->GetPreCADClosedGeom() != h_data.myPreCADClosedGeom ) - h->SetPreCADClosedGeom( h_data.myPreCADClosedGeom ); + if ( h->GetPreCADEpsNano() != h_data.myPreCADEpsNano && h_data.myPreCADEpsNano > 0) + h->SetPreCADEpsNano( h_data.myPreCADEpsNano ); if( ((int) h_data.myPhysicalMesh == PhysicalUserDefined)||((int) h_data.myPhysicalMesh == SizeMap) ) { if ( h->GetPhySize() != h_data.myPhySize ) @@ -1855,13 +1864,13 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->SetAngleMeshC( h_data.myAngleMeshC ); } #ifdef WITH_SIZE_BOUNDARIES - if (h_data.myPhyMin > 0) + if (h->GetPhyMin() != h_data.myPhyMin && h_data.myPhyMin > 0) h->SetPhyMin( h_data.myPhyMin ); - if (h_data.myPhyMax > 0) + if (h->GetPhyMax() != h_data.myPhyMax && h_data.myPhyMax > 0) h->SetPhyMax( h_data.myPhyMax ); - if (h_data.myGeoMin > 0) + if (h->GetGeoMin() != h_data.myGeoMin && h_data.myGeoMin > 0) h->SetGeoMin( h_data.myGeoMin ); - if (h_data.myGeoMax > 0) + if (h->GetGeoMax() != h_data.myGeoMax && h_data.myGeoMax > 0) h->SetGeoMax( h_data.myGeoMax ); #endif @@ -1971,27 +1980,27 @@ Stores the widgets content to the hypothesis data. QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothesisData& h_data ) const { MESSAGE("BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets"); - h_data.myName = myName ? myName->text() : ""; - h_data.myTopology = myTopology->currentIndex(); - h_data.myPhysicalMesh = myPhysicalMesh->currentIndex(); - h_data.myPhySize = myPhySize->GetValue(); + h_data.myName = myName ? myName->text() : ""; + h_data.myTopology = myTopology->currentIndex(); + h_data.myPhysicalMesh = myPhysicalMesh->currentIndex(); + h_data.myPhySize = myPhySize->GetValue(); #ifdef WITH_SIZE_BOUNDARIES - h_data.myPhyMin = myPhyMin->GetValue(); - h_data.myPhyMax = myPhyMax->GetValue(); - h_data.myGeoMin = myGeoMin->GetValue(); - h_data.myGeoMax = myGeoMax->GetValue(); + h_data.myPhyMin = myPhyMin->GetValue(); + h_data.myPhyMax = myPhyMax->GetValue(); + h_data.myGeoMin = myGeoMin->GetValue(); + h_data.myGeoMax = myGeoMax->GetValue(); #endif - h_data.myGeometricMesh = myGeometricMesh->currentIndex(); - h_data.myAngleMeshS = myAngleMeshS->GetValue(); - h_data.myAngleMeshC = myAngleMeshC->GetValue(); - h_data.myGradation = myGradation->GetValue(); - h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked(); - h_data.myDecimesh = myDecimesh->isChecked(); - h_data.myVerbosity = myVerbosity->value(); - h_data.myPreCADOptimCAD = myPreCADOptimCAD->isChecked(); - h_data.myPreCADDiscardInput = myPreCADDiscardInput->isChecked(); - h_data.myPreCADManifoldGeom = myPreCADManifoldGeom->isChecked(); - h_data.myPreCADClosedGeom = myPreCADClosedGeom->isChecked(); + h_data.myGeometricMesh = myGeometricMesh->currentIndex(); + h_data.myAngleMeshS = myAngleMeshS->GetValue(); + h_data.myAngleMeshC = myAngleMeshC->GetValue(); + h_data.myGradation = myGradation->GetValue(); + h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked(); + h_data.myDecimesh = myDecimesh->isChecked(); + h_data.myVerbosity = myVerbosity->value(); + h_data.myPreCADMergeEdges = myPreCADMergeEdges->isChecked(); + h_data.myPreCADRemoveNanoEdges = myPreCADRemoveNanoEdges->isChecked(); + h_data.myPreCADDiscardInput = myPreCADDiscardInput->isChecked(); + h_data.myPreCADEpsNano = myPreCADEpsNano->GetValue(); QString guiHyp; guiHyp += tr("BLSURF_TOPOLOGY") + " = " + QString::number( h_data.myTopology ) + "; "; @@ -2008,10 +2017,10 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes guiHyp += "hgeomin = " + QString::number( h_data.myGeoMin ) + "; "; guiHyp += "hgeomax = " + QString::number( h_data.myGeoMax ) + "; "; #endif - guiHyp += tr("BLSURF_PRECAD_OPTIM_CAD") + " = " + QString(h_data.myPreCADOptimCAD ? "yes" : "no") + "; "; + guiHyp += tr("BLSURF_PRECAD_MERGE_EDGES") + " = " + QString(h_data.myPreCADMergeEdges ? "yes" : "no") + "; "; + guiHyp += tr("BLSURF_PRECAD_REMOVE_NANO_EDGES") + " = " + QString(h_data.myPreCADRemoveNanoEdges ? "yes" : "no") + "; "; guiHyp += tr("BLSURF_PRECAD_DISCARD_INPUT") + " = " + QString(h_data.myPreCADDiscardInput ? "yes" : "no") + "; "; - guiHyp += tr("BLSURF_PRECAD_MANIFOLD_GEOM") + " = " + QString(h_data.myPreCADManifoldGeom ? "yes" : "no") + "; "; - guiHyp += tr("BLSURF_PRECAD_CLOSED_GEOM") + " = " + QString(h_data.myPreCADClosedGeom ? "yes" : "no") + "; "; + guiHyp += tr("BLSURF_PRECAD_EPS_NANO") + " = " + QString::number( h_data.myPreCADEpsNano ) + "; "; BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; int row = 0, nbRows = myOptionTable->rowCount(); diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index 38a6bfa..a2d6267 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -125,7 +125,7 @@ typedef struct double myAngleMeshS, myAngleMeshC, myGradation; double myPhySize, myGeoMin, myGeoMax, myPhyMin,myPhyMax; bool myAllowQuadrangles, myDecimesh,mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex; - bool myPreCADOptimCAD, myPreCADDiscardInput, myPreCADManifoldGeom, myPreCADClosedGeom; + bool myPreCADMergeEdges, myPreCADRemoveNanoEdges, myPreCADDiscardInput, myPreCADEpsNano; // bool myGMFFileMode; std::string myGMFFileName; TEnfVertexList enfVertexList; @@ -245,10 +245,10 @@ private: QWidget* myAdvGroup; QComboBox* myTopology; QGroupBox* myPreCADGroupBox; - QCheckBox* myPreCADOptimCAD; + QCheckBox* myPreCADMergeEdges; + QCheckBox* myPreCADRemoveNanoEdges; QCheckBox* myPreCADDiscardInput; - QCheckBox* myPreCADManifoldGeom; - QCheckBox* myPreCADClosedGeom; + SMESHGUI_SpinBox* myPreCADEpsNano; QSpinBox* myVerbosity; QTableWidget* myOptionTable; QLineEdit* myGMFFileName; diff --git a/src/GUI/BLSURFPlugin_msg_en.ts b/src/GUI/BLSURFPlugin_msg_en.ts index a29405c..5984638 100644 --- a/src/GUI/BLSURFPlugin_msg_en.ts +++ b/src/GUI/BLSURFPlugin_msg_en.ts @@ -144,20 +144,20 @@ PreCAD options - BLSURF_PRECAD_OPTIM_CAD - Optimize CAD + BLSURF_PRECAD_MERGE_EDGES + Merge edges - BLSURF_PRECAD_DISCARD_INPUT - Discard input topology + BLSURF_PRECAD_REMOVE_NANO_EDGES + Remove nano edges - BLSURF_PRECAD_MANIFOLD_GEOM - Manifold geometry + BLSURF_PRECAD_DISCARD_INPUT + Discard input topology - BLSURF_PRECAD_CLOSED_GEOM - Closed geometry + BLSURF_PRECAD_EPS_NANO + Nano edge length BLSURF_SIZE_MAP diff --git a/src/GUI/BLSURFPlugin_msg_fr.ts b/src/GUI/BLSURFPlugin_msg_fr.ts index 95cdb9d..02358d1 100755 --- a/src/GUI/BLSURFPlugin_msg_fr.ts +++ b/src/GUI/BLSURFPlugin_msg_fr.ts @@ -144,20 +144,20 @@ Options PreCAD - BLSURF_PRECAD_OPTIM_CAD - Optimiser la CAO + BLSURF_PRECAD_MERGE_EDGES + Fusionner des arêtes - BLSURF_PRECAD_DISCARD_INPUT - Ignorer la topologie + BLSURF_PRECAD_REMOVE_NANO_EDGES + Supprimer les petites arêtes - BLSURF_PRECAD_MANIFOLD_GEOM - Géometrie manifolde + BLSURF_PRECAD_DISCARD_INPUT + Ignorer la topologie - BLSURF_PRECAD_CLOSED_GEOM - Géometrie fermée + BLSURF_PRECAD_EPS_NANO + Longueur max des petites arêtes BLSURF_SIZE_MAP -- 2.39.2