From 7e92063ab2024af367743c6db1761069f0b4ff98 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Thu, 15 Sep 2022 11:52:50 +0200 Subject: [PATCH] spns #28893 : add split_overconstrained_surface_edges MGCADSurf option in advanced panel --- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 17 +++++++++++++++++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 3 +++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx | 14 ++++++++++++++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx | 3 +++ src/GUI/BLSURFPlugin_msg_en.ts | 4 ++++ src/GUI/BLSURFPlugin_msg_fr.ts | 4 ++++ src/GUI/BLSURFPlugin_msg_ja.ts | 4 ++++ 7 files changed, 49 insertions(+) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 427b255..4d4248e 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -166,6 +166,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, boo // but it is useful that the user can change it to disable all preprocessing options "remove_tiny_uv_edges", // default = 1 "compute_ridges", // true + "split_overconstrained_surface_edges", // default = 0 "" // mark of end }; const char* preCADintOptionNames[] = { // "manifold_geometry", // default = 0 @@ -249,6 +250,7 @@ BLSURFPlugin_Hypothesis::BLSURFPlugin_Hypothesis(int hypId, SMESH_Gen * gen, boo _defaultOptionValues["remove_tiny_uv_edges" ] = "no"; _defaultOptionValues["required_entities" ] = "respect"; _defaultOptionValues["sewing_tolerance" ] = "5e-4*D"; + _defaultOptionValues["split_overconstrained_surface_edges" ] = "no"; _defaultOptionValues["tags" ] = "respect"; _defaultOptionValues["compute_ridges" ] = "yes"; } @@ -830,8 +832,23 @@ CORBA::Double BLSURFPlugin_Hypothesis::GetSewingTolerance() { return ToDbl( GetPreCADOptionValue("sewing_tolerance", GET_DEFAULT())); } + +//============================================================================= +void BLSURFPlugin_Hypothesis::SetSplitOverConstrainedSurfaceEdges( bool isOverConstrained ) +{ + if ( GetSplitOverConstrainedSurfaceEdges() != isOverConstrained ) + { + SetPreCADOptionValue("split_overconstrained_surface_edges", isOverConstrained ? "yes" : "no" ); + NotifySubMeshesHypothesisModification(); + } +} //============================================================================= +bool BLSURFPlugin_Hypothesis::GetSplitOverConstrainedSurfaceEdges() +{ + return ToBool( GetPreCADOptionValue("split_overconstrained_surface_edges", GET_DEFAULT())); +} +//============================================================================= void BLSURFPlugin_Hypothesis::SetTags( const std::string& howToTreat ) { if ( howToTreat != "respect" && howToTreat != "ignore" && howToTreat != "clear" ) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index a11f284..982d1b7 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -220,6 +220,9 @@ public: void SetSewingTolerance( double tol ); double GetSewingTolerance(); + void SetSplitOverConstrainedSurfaceEdges( bool isOverConstrained ); + bool GetSplitOverConstrainedSurfaceEdges(); + void SetTags( const std::string& howToTreat ); std::string GetTags(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index a38fb1e..342f76e 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -1411,6 +1411,20 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetSewingTolerance() return -1; } //============================================================================= +void BLSURFPlugin_Hypothesis_i::SetSplitOverConstrainedSurfaceEdges( CORBA::Boolean isOverConstrained ) +{ + if ( GetSplitOverConstrainedSurfaceEdges() != isOverConstrained ) + { + this->GetImpl()->SetSplitOverConstrainedSurfaceEdges(isOverConstrained); + SMESH::TPythonDump() << _this() << ".SetSplitOverConstrainedSurfaceEdges( " << isOverConstrained << " )"; + } +} +//============================================================================= +CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetSplitOverConstrainedSurfaceEdges() +{ + return this->GetImpl()->GetSplitOverConstrainedSurfaceEdges(); +} +//============================================================================= void BLSURFPlugin_Hypothesis_i::SetTags( const char* howToTreat ) { diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index a8333f3..1d8d2cd 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -218,6 +218,9 @@ public: void SetSewingTolerance( CORBA::Double tol ); CORBA::Double GetSewingTolerance(); + void SetSplitOverConstrainedSurfaceEdges( CORBA::Boolean isClosed ); + CORBA::Boolean GetSplitOverConstrainedSurfaceEdges(); + void SetTags( const char* howToTreat ); char* GetTags(); diff --git a/src/GUI/BLSURFPlugin_msg_en.ts b/src/GUI/BLSURFPlugin_msg_en.ts index 537e927..1bb5ed9 100644 --- a/src/GUI/BLSURFPlugin_msg_en.ts +++ b/src/GUI/BLSURFPlugin_msg_en.ts @@ -804,6 +804,10 @@ The smaller this distance is, the closer the mesh is to the exact surface (only sewing_tolerance Sewing tolerance + + split_overconstrained_surface_edges + Split triangles at edges + tags Tags diff --git a/src/GUI/BLSURFPlugin_msg_fr.ts b/src/GUI/BLSURFPlugin_msg_fr.ts index 8bff081..d9b8553 100644 --- a/src/GUI/BLSURFPlugin_msg_fr.ts +++ b/src/GUI/BLSURFPlugin_msg_fr.ts @@ -773,6 +773,10 @@ Plus la distance est petite, plus le maillage sera proche de la surface (disponi sewing_tolerance Tolérance de fusion + + split_overconstrained_surface_edges + Division triangles au bord + tags Etiquettes diff --git a/src/GUI/BLSURFPlugin_msg_ja.ts b/src/GUI/BLSURFPlugin_msg_ja.ts index 3fb6a31..92f61a8 100644 --- a/src/GUI/BLSURFPlugin_msg_ja.ts +++ b/src/GUI/BLSURFPlugin_msg_ja.ts @@ -694,6 +694,10 @@ sewing_tolerance 繕いのトレランス + + split_overconstrained_surface_edges + 三角形を分割する + tags タグ -- 2.39.2