From aae0e72c350c31c43d151132f0c7e302a6b79ad2 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 19 Apr 2021 17:06:39 +0300 Subject: [PATCH] bos #24194: EDF - SplitHexahedraIntoPrisms --- src/SMESH/SMESH_MeshEditor.cxx | 32 ++++++++++++++------------ src/StdMeshersGUI/StdMeshers_msg_en.ts | 16 +++++++++++++ 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index de20777e9..42d7ab0a8 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -1808,17 +1808,17 @@ namespace TSplitMethod( int nbTet=0, const int* conn=0, bool addNode=false) : _nbSplits(nbTet), _nbCorners(4), _connectivity(conn), _baryNode(addNode), _ownConn(false) {} ~TSplitMethod() { if ( _ownConn ) delete [] _connectivity; _connectivity = 0; } - TSplitMethod(const TSplitMethod &splitMethod) - : _nbSplits(splitMethod._nbSplits), - _nbCorners(splitMethod._nbCorners), - _baryNode(splitMethod._baryNode), - _ownConn(splitMethod._ownConn), - _faceBaryNode(splitMethod._faceBaryNode) - { - _connectivity = splitMethod._connectivity; - const_cast(splitMethod)._connectivity = nullptr; - const_cast(splitMethod)._ownConn = false; - } + TSplitMethod(const TSplitMethod &splitMethod) + : _nbSplits(splitMethod._nbSplits), + _nbCorners(splitMethod._nbCorners), + _baryNode(splitMethod._baryNode), + _ownConn(splitMethod._ownConn), + _faceBaryNode(splitMethod._faceBaryNode) + { + _connectivity = splitMethod._connectivity; + const_cast(splitMethod)._connectivity = nullptr; + const_cast(splitMethod)._ownConn = false; + } bool hasFacet( const TTriangleFacet& facet ) const { if ( _nbCorners == 4 ) @@ -2069,6 +2069,8 @@ namespace const int methodFlags, const int facetToSplit) { + TSplitMethod method; + // order of facets in HEX according to SMDS_VolumeTool::Hexa_F : // B, T, L, B, R, F const int iF = ( facetToSplit < 2 ) ? 0 : 1 + ( facetToSplit-2 ) % 2; // [0,1,2] @@ -2099,12 +2101,12 @@ namespace to4methods[iF]._nbSplits = 4; to4methods[iF]._nbCorners = 6; } - return to4methods[iF]; + method = to4methods[iF]; + to4methods[iF]._connectivity = method._connectivity; // as copy ctor resets _connectivity + return method; } // else if ( methodFlags == HEXA_TO_2_PRISMS ) - TSplitMethod method; - const int iQ = vol.Element()->IsQuadratic() ? 2 : 1; const int nbVariants = 2, nbSplits = 2; @@ -2276,7 +2278,7 @@ void SMESH_MeshEditor::SplitVolumes (const TFacetOfElem & theElems, TSplitMethod splitMethod = ( facetToSplit < 0 ? getTetraSplitMethod( volTool, theMethodFlags ) : getPrismSplitMethod( volTool, theMethodFlags, facetToSplit )); - if ( splitMethod._nbSplits < 1 ) continue; + if ( splitMethod._nbSplits < 1 ) continue; // find submesh to add new tetras to if ( !subMesh || !subMesh->Contains( elem )) diff --git a/src/StdMeshersGUI/StdMeshers_msg_en.ts b/src/StdMeshersGUI/StdMeshers_msg_en.ts index b0df747b1..1bc267a67 100644 --- a/src/StdMeshersGUI/StdMeshers_msg_en.ts +++ b/src/StdMeshersGUI/StdMeshers_msg_en.ts @@ -354,6 +354,22 @@ Consider creating another hypothesis instead of using this one for this mesh/sub SMESH_IMPORT_SOURCE_2D_TITLE Hypothesis Construction + + SMESH_PROJECTION_SOURCE_2D_HYPOTHESIS + Source faces + + + SMESH_PROJECTION_SOURCE_2D_TITLE + Hypothesis Construction + + + SMESH_PROJECTION_SOURCE_1D_HYPOTHESIS + Source edges + + + SMESH_PROJECTION_SOURCE_1D_TITLE + Hypothesis Construction + SMESH_REMOVE_ROW Remove row