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
* 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
}
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);
/////////////////////////////////////////////////////////
-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,
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) {
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
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;
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;
}
}
-// 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);
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
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);
}
}
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;
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);
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);
/* 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);
_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()),
};
const char* charOptionNames[] = { "export_format", "export_option", "import_option", "prefix", "" // mark of end
};
-
+
int i = 0;
while (intOptionNames[i][0])
_option2value[intOptionNames[i++]].clear();
_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();
}
//=============================================================================
-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();
}
}
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()) {
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());
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<std::string,std::string> TSizeMap;
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(); }
bool _decimesh;
int _verb;
- bool _preCADOptimCAD;
+ bool _preCADMergeEdges;
+ bool _preCADRemoveNanoEdges;
bool _preCADDiscardInput;
- bool _preCADManifoldGeom;
- bool _preCADClosedGeom;
+ bool _preCADEpsNano;
TOptionValues _option2value;
TOptionNames _doubleOptions, _charOptions;
//=============================================================================
/*!
- * 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();
}
//=============================================================================
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);
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);
}
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: "<<data.myPreCADEpsNano)
+ if (data.myPreCADEpsNano < 0)
+ myPreCADEpsNano->setText("");
+ else
+ myPreCADEpsNano->SetValue( data.myPreCADEpsNano );
myPhysicalMesh->setCurrentIndex( data.myPhysicalMesh );
myPhySize->SetValue( data.myPhySize );
#ifdef WITH_SIZE_BOUNDARIES
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();
}
// attractor new version
- MESSAGE("retriveParams, Attractors")
+ MESSAGE("retrieveParams, Attractors")
BLSURFPlugin::TAttParamsMap_var allMyAttractorParams = h->GetAttractorParams();
for ( int i = 0;i<allMyAttractorParams->length(); ++i ) {
BLSURFPlugin::TAttractorParams myAttractorParams = allMyAttractorParams[i];
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 )
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
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 ) + "; ";
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();
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;
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;
<translation>PreCAD options</translation>
</message>
<message>
- <source>BLSURF_PRECAD_OPTIM_CAD</source>
- <translation>Optimize CAD</translation>
+ <source>BLSURF_PRECAD_MERGE_EDGES</source>
+ <translation>Merge edges</translation>
</message>
<message>
- <source>BLSURF_PRECAD_DISCARD_INPUT</source>
- <translation>Discard input topology</translation>
+ <source>BLSURF_PRECAD_REMOVE_NANO_EDGES</source>
+ <translation>Remove nano edges</translation>
</message>
<message>
- <source>BLSURF_PRECAD_MANIFOLD_GEOM</source>
- <translation>Manifold geometry</translation>
+ <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+ <translation>Discard input topology</translation>
</message>
<message>
- <source>BLSURF_PRECAD_CLOSED_GEOM</source>
- <translation>Closed geometry</translation>
+ <source>BLSURF_PRECAD_EPS_NANO</source>
+ <translation>Nano edge length</translation>
</message>
<message>
<source>BLSURF_SIZE_MAP</source>
<translation>Options PreCAD</translation>
</message>
<message>
- <source>BLSURF_PRECAD_OPTIM_CAD</source>
- <translation>Optimiser la CAO</translation>
+ <source>BLSURF_PRECAD_MERGE_EDGES</source>
+ <translation>Fusionner des arêtes</translation>
</message>
<message>
- <source>BLSURF_PRECAD_DISCARD_INPUT</source>
- <translation>Ignorer la topologie</translation>
+ <source>BLSURF_PRECAD_REMOVE_NANO_EDGES</source>
+ <translation>Supprimer les petites arêtes</translation>
</message>
<message>
- <source>BLSURF_PRECAD_MANIFOLD_GEOM</source>
- <translation>Géometrie manifolde</translation>
+ <source>BLSURF_PRECAD_DISCARD_INPUT</source>
+ <translation>Ignorer la topologie</translation>
</message>
<message>
- <source>BLSURF_PRECAD_CLOSED_GEOM</source>
- <translation>Géometrie fermée</translation>
+ <source>BLSURF_PRECAD_EPS_NANO</source>
+ <translation>Longueur max des petites arêtes</translation>
</message>
<message>
<source>BLSURF_SIZE_MAP</source>