//int _precadMergeEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADMergeEdges();
int _precadRemoveTinyUVEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveTinyUVEdges();
//int _precadRemoveDuplicateCADFaces = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveDuplicateCADFaces();
- int _precadProcess3DTopology = BLSURFPlugin_Hypothesis::GetDefaultPreCADProcess3DTopology();
+ //int _precadProcess3DTopology = BLSURFPlugin_Hypothesis::GetDefaultPreCADProcess3DTopology();
//int _precadDiscardInput = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput();
//_precadMergeEdges = hyp->GetPreCADMergeEdges();
_precadRemoveTinyUVEdges = hyp->GetPreCADRemoveTinyUVEdges();
//_precadRemoveDuplicateCADFaces = hyp->GetPreCADRemoveDuplicateCADFaces();
- _precadProcess3DTopology = hyp->GetPreCADProcess3DTopology();
+ //_precadProcess3DTopology = hyp->GetPreCADProcess3DTopology();
//_precadDiscardInput = hyp->GetPreCADDiscardInput();
const BLSURFPlugin_Hypothesis::TOptionValues& opts = hyp->GetOptionValues();
}
}
+ if ( BLSURFPlugin_Hypothesis::HasPreCADOptions( hyp ))
+ {
+ cadsurf_set_param(css, "use_precad", "yes" ); // for young versions
+ }
// PreProcessor (formerly PreCAD) -- commented params are preCADoptions (since 0023307)
//set_param(css, "merge_edges", _precadMergeEdges ? "yes" : "no");
set_param(css, "remove_tiny_uv_edges", _precadRemoveTinyUVEdges ? "yes" : "no");
//set_param(css, "remove_duplicate_cad_faces", _precadRemoveDuplicateCADFaces ? "yes" : "no");
- set_param(css, "process_3d_topology", _precadProcess3DTopology ? "1" : "0");
+ //set_param(css, "process_3d_topology", _precadProcess3DTopology ? "1" : "0");
//set_param(css, "discard_input_topology", _precadDiscardInput ? "1" : "0");
//set_param(css, "max_number_of_points_per_patch", "1000000");
const char * option_value)
{
status_t status = cadsurf_set_param(css, option_name, option_value );
+
+ if ( _hypothesis && _hypothesis->GetVerbosity() > _hypothesis->GetDefaultVerbosity() )
+ cout << option_name << " = " << option_value << endl;
+
if ( status != MESHGEMS_STATUS_OK )
{
if ( status == MESHGEMS_STATUS_UNKNOWN_PARAMETER ) {
// Remove free nodes that can appear e.g. if "remove tiny edges"(IPAL53235)
for(int iv=1;iv<=nv;iv++)
- if ( tags[iv] && nodes[iv] && nodes[iv]->NbInverseElements() == 0 )
+ if ( nodes[iv] && nodes[iv]->NbInverseElements() == 0 )
meshDS->RemoveFreeNode( nodes[iv], 0, /*fromGroups=*/false );
if (theVal != _preCADProcess3DTopology) {
// SetTopology(PreCAD);
_preCADProcess3DTopology = theVal;
+ AddPreCADOption("process_3d_topology", theVal ? "yes" : "no" );
NotifySubMeshesHypothesisModification();
}
}
}
}
+//=============================================================================
+// Return true if any PreCAD option is activated
+bool BLSURFPlugin_Hypothesis::HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp)
+{
+ if ( !hyp )
+ {
+ return false;
+ }
+ bool orDefault, isOk;
+ return ( ToBool( hyp->GetPreCADOptionValue("closed_geometry" , &orDefault )) ||
+ ToBool( hyp->GetPreCADOptionValue("discard_input_topology" , &orDefault )) ||
+ ToBool( hyp->GetPreCADOptionValue("merge_edges" , &orDefault )) ||
+ ToBool( hyp->GetPreCADOptionValue("remove_duplicate_cad_faces", &orDefault )) ||
+ ToBool( hyp->GetPreCADOption ("process_3d_topology") , &isOk ) ||
+ ToBool( hyp->GetPreCADOption ("manifold_geometry") , &isOk ) ||
+ hyp->GetPreCADOptionValue("sewing_tolerance") != "5e-4*D" ||
+ hyp->GetPreCADProcess3DTopology() );
+}
+
//=============================================================================
// void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName, bool isBinary)
void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName)
}
//=============================================================================
-std::string BLSURFPlugin_Hypothesis::GetOption(const std::string& optionName)
+std::string BLSURFPlugin_Hypothesis::GetOption(const std::string& optionName) const
{
- TOptionValues::iterator op_val = _customOption2value.find(optionName);
+ TOptionValues::const_iterator op_val = _customOption2value.find(optionName);
if (op_val != _customOption2value.end())
return op_val->second;
else
}
//=============================================================================
-std::string BLSURFPlugin_Hypothesis::GetPreCADOption(const std::string& optionName)
+std::string BLSURFPlugin_Hypothesis::GetPreCADOption(const std::string& optionName) const
{
- TOptionValues::iterator op_val = _customOption2value.find(optionName);
+ TOptionValues::const_iterator op_val = _customOption2value.find(optionName);
if (op_val != _customOption2value.end())
return op_val->second;
else
void SetPreCADDiscardInput(bool theVal);
bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
+
+ static bool HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp);
typedef std::map<std::string,std::string> TSizeMap;
void AddOption(const std::string& optionName, const std::string& optionValue);
void AddPreCADOption(const std::string& optionName, const std::string& optionValue);
- std::string GetOption(const std::string& optionName);
- std::string GetPreCADOption(const std::string& optionName);
+ std::string GetOption(const std::string& optionName) const;
+ std::string GetPreCADOption(const std::string& optionName) const;
static bool ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
nodes = list(set(nodes))
-Mesh_1.MakeGroupByIds("nodes", SMESH.NODE, nodes)
+nodesGroup = Mesh_1.MakeGroupByIds("nodes", SMESH.NODE, nodes)
-assert(len(nodes) == 1)
+assert nodesGroup.Size() == 1, nodesGroup.GetIDs()
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)