From 12c889c3f6d2909bd1fb19e09ff9441662c018a0 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 17 Sep 2012 10:18:07 +0000 Subject: [PATCH] 0020982: EDF 1547 SMESH: Creation of non-conformal quadratic pyramids Returns description of an error/warning occured during the last mesh edition --- src/SMESH/SMESH_Gen.cxx | 4 +++- src/SMESH/SMESH_MeshEditor.cxx | 4 ++-- src/SMESH/SMESH_MeshEditor.hxx | 32 ++++++++++++++------------------ src/SMESH/SMESH_MesherHelper.hxx | 3 ++- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 29faef596..ba02a6828 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -375,7 +375,9 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh, { SMESH_MesherHelper aHelper( aMesh ); if ( aHelper.IsQuadraticMesh() != SMESH_MesherHelper::LINEAR ) - aHelper.FixQuadraticElements(); + { + aHelper.FixQuadraticElements( sm->GetComputeError() ); + } } return ret; } diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 87784b2d7..2110a9132 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -9635,7 +9635,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d) if ( !theForce3d ) { // setenv NO_FixQuadraticElements to know if FixQuadraticElements() is guilty of bad conversion aHelper.SetSubShape(0); // apply FixQuadraticElements() to the whole mesh - aHelper.FixQuadraticElements(); + aHelper.FixQuadraticElements(myError); } } @@ -9775,7 +9775,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, if ( !theForce3d && !getenv("NO_FixQuadraticElements")) { // setenv NO_FixQuadraticElements to know if FixQuadraticElements() is guilty of bad conversion helper.SetSubShape(0); // apply FixQuadraticElements() to the whole mesh - helper.FixQuadraticElements(); + helper.FixQuadraticElements( myError ); } } diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index d2d06adeb..1874360a7 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -34,6 +34,7 @@ #include "SMESH_Controls.hxx" #include "SMESH_Mesh.hxx" #include "SMESH_TypeDefs.hxx" +#include "SMESH_ComputeError.hxx" #include @@ -110,6 +111,14 @@ public: SMESH_MeshEditor( SMESH_Mesh* theMesh ); + SMESH_Mesh * GetMesh() { return myMesh; } + SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); } + + const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; } + const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; } + + SMESH_ComputeErrorPtr & GetError() { return myError; } + /*! * \brief Add element */ @@ -561,14 +570,6 @@ public: // Return an index of the shape theElem is on // or zero if a shape not found - SMESH_Mesh * GetMesh() { return myMesh; } - - SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); } - - const SMESH_SequenceOfElemPtr& GetLastCreatedNodes() const { return myLastCreatedNodes; } - - const SMESH_SequenceOfElemPtr& GetLastCreatedElems() const { return myLastCreatedElems; } - bool DoubleNodes( const std::list< int >& theListOfNodes, const std::list< int >& theListOfModifiedElems ); @@ -721,18 +722,13 @@ public: private: - SMESH_Mesh * myMesh; - - /*! - * Sequence for keeping nodes created during last operation - */ - SMESH_SequenceOfElemPtr myLastCreatedNodes; + SMESH_Mesh * myMesh; - /*! - * Sequence for keeping elements created during last operation - */ - SMESH_SequenceOfElemPtr myLastCreatedElems; + // Nodes and elements created during last operation + SMESH_SequenceOfElemPtr myLastCreatedNodes, myLastCreatedElems; + // Description of error/warning occured during last operation + SMESH_ComputeErrorPtr myError; }; #endif diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index faffe5b7a..da6cfcbfb 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -195,9 +195,10 @@ public: /*! * \brief Move medium nodes of faces and volumes to fix distorted elements + * \param error - container of fixed distorted elements * \param volumeOnly - fix nodes on geom faces or not if the shape is solid */ - void FixQuadraticElements(bool volumeOnly=true); + void FixQuadraticElements(SMESH_ComputeErrorPtr& error, bool volumeOnly=true); /*! * \brief To set created elements on the shape set by IsQuadraticSubMesh() -- 2.39.2