From: eap Date: Wed, 7 Nov 2007 09:39:48 +0000 (+0000) Subject: PAL16202 (Propagation 1D on edges group) X-Git-Tag: V3_2_9rc1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bf20d9cff147ee0022ea683aa128b422043cc138;p=modules%2Fsmesh.git PAL16202 (Propagation 1D on edges group) remove useless includes --- diff --git a/src/SMESH/SMESH_2D_Algo.cxx b/src/SMESH/SMESH_2D_Algo.cxx index a2a18202a..ade8abfb7 100644 --- a/src/SMESH/SMESH_2D_Algo.cxx +++ b/src/SMESH/SMESH_2D_Algo.cxx @@ -29,10 +29,13 @@ using namespace std; #include "SMESH_2D_Algo.hxx" #include "SMESH_Gen.hxx" -#include #include "utilities.h" +#include +#include +#include + //============================================================================= /*! * diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index f3f25d9e2..323a0b864 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -29,6 +29,7 @@ #include "SMESH_Gen.hxx" #include "SMESH_subMesh.hxx" #include "SMESH_HypoFilter.hxx" +#include "SMESHDS_Document.hxx" #include "SMDS_MeshElement.hxx" #include "SMDS_MeshNode.hxx" @@ -301,7 +302,7 @@ static bool checkMissing(SMESH_Gen* aGen, int shapeDim = SMESH_Gen::GetShapeDim( aSubMesh->GetSubShape() ); if (aTopAlgoDim > shapeDim) { - INFOS( "ERROR: " << shapeDim << "D algorithm is missing" ); + MESSAGE( "ERROR: " << shapeDim << "D algorithm is missing" ); ret = false; theErrors.push_back( SMESH_Gen::TAlgoStateError() ); theErrors.back().Set( SMESH_Hypothesis::HYP_MISSING, shapeDim, true ); @@ -320,16 +321,16 @@ static bool checkMissing(SMESH_Gen* aGen, SMESH_Hypothesis::Hypothesis_Status status; algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status ); if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) { - INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ") - << "<" << algo->GetName() << "> has a bad parameter value"); + MESSAGE( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> has a bad parameter value"); errName = status; } else if ( status == SMESH_Hypothesis::HYP_BAD_GEOMETRY ) { - INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") - << "<" << algo->GetName() << "> assigned to mismatching geometry"); + MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> assigned to mismatching geometry"); errName = status; } else { - INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") - << "<" << algo->GetName() << "> misses some hypothesis"); + MESSAGE( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> misses some hypothesis"); } if (IsGlobalHypothesis) globalChecked[ algo->GetDim() ] = true; diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index e354d7e5d..994ee6aff 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -40,12 +40,12 @@ #include "SMESH_3D_Algo.hxx" #include "SMESH_Mesh.hxx" -#include "SMESHDS_Document.hxx" - #include #include +class SMESHDS_Document; + typedef SMESH_Hypothesis::Hypothesis_Status TAlgoStateErrorName; typedef struct studyContextStruct diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 54d446c98..79995e3e4 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -46,28 +46,31 @@ #include "utilities.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include #include #include +#include #include -#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -2715,8 +2718,8 @@ void SMESH_MeshEditor::Smooth (TIDSortedElemSet & theElems, // iNotSame is where prevNodes and nextNodes are different //======================================================================= -static bool isReverse(const SMDS_MeshNode* prevNodes[], - const SMDS_MeshNode* nextNodes[], +static bool isReverse(vector prevNodes, + vector nextNodes, const int nbNodes, const int iNotSame) { @@ -2753,16 +2756,16 @@ static void sweepElement(SMESHDS_Mesh* aMesh, // Loop on elem nodes: // find new nodes and detect same nodes indices int nbNodes = elem->NbNodes(); - //---PR - //list::const_iterator itNN[ nbNodes ]; - vector < list< const SMDS_MeshNode* >::const_iterator > itNN; - itNN.reserve(nbNodes); - //---PR - const SMDS_MeshNode* prevNod[ nbNodes ], *nextNod[ nbNodes ], *midlNod[ nbNodes ]; + vector < list< const SMDS_MeshNode* >::const_iterator > itNN( nbNodes ); + vector prevNod( nbNodes ); + vector nextNod( nbNodes ); + vector midlNod( nbNodes ); + int iNode, nbSame = 0, iNotSameNode = 0, iSameNode = 0; vector sames(nbNodes); - bool issimple[nbNodes]; + //bool issimple[nbNodes]; + vector issimple(nbNodes); for ( iNode = 0; iNode < nbNodes; iNode++ ) { TNodeOfNodeListMapItr nnIt = newNodesItVec[ iNode ]; @@ -4093,7 +4096,7 @@ void SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems, const_cast< SMDS_MeshNode* > ( node )->SetPosition ( SMDS_SpacePosition::originSpacePosition() ); } - nodeMap.insert( TNodeNodeMap::value_type( node, newNode )); + nodeMap.insert( make_pair( node, newNode )); // keep inverse elements if ( !theCopy && needReverse ) { @@ -4441,7 +4444,8 @@ int SMESH_MeshEditor::SimplifyFace (const vector faceNode set nodeSet; // get simple seq of nodes - const SMDS_MeshNode* simpleNodes[ nbNodes ]; + //const SMDS_MeshNode* simpleNodes[ nbNodes ]; + vector simpleNodes( nbNodes ); int iSimple = 0, nbUnique = 0; simpleNodes[iSimple++] = faceNodes[0]; @@ -4555,8 +4559,9 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) int aShapeId = FindShape( elem ); set nodeSet; - const SMDS_MeshNode* curNodes[ nbNodes ], *uniqueNodes[ nbNodes ]; - int iUnique = 0, iCur = 0, nbRepl = 0, iRepl [ nbNodes ]; + vector< const SMDS_MeshNode*> curNodes( nbNodes ), uniqueNodes( nbNodes ); + int iUnique = 0, iCur = 0, nbRepl = 0; + vector iRepl( nbNodes ); // get new seq of nodes SMDS_ElemIteratorPtr itN = elem->nodesIterator(); @@ -5032,7 +5037,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } else { // Change regular element or polygon - aMesh->ChangeElementNodes( elem, uniqueNodes, nbUniqueNodes ); + aMesh->ChangeElementNodes( elem, & uniqueNodes[0], nbUniqueNodes ); } } else { @@ -5210,7 +5215,9 @@ const SMDS_MeshElement* continue; // get face nodes and find index of n1 int i1, nbN = elem->NbNodes(), iNode = 0; - const SMDS_MeshNode* faceNodes[ nbN ], *n; + //const SMDS_MeshNode* faceNodes[ nbN ], *n; + vector faceNodes( nbN ); + const SMDS_MeshNode* n; SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); while ( nIt->more() ) { faceNodes[ iNode ] = static_cast( nIt->next() ); @@ -5327,7 +5334,9 @@ bool SMESH_MeshEditor::FindFreeBorder (const SMDS_MeshNode* theFirst if ( e == curElem || foundElems.insert( e ).second ) { // get nodes int iNode = 0, nbNodes = e->NbNodes(); - const SMDS_MeshNode* nodes[nbNodes+1]; + //const SMDS_MeshNode* nodes[nbNodes+1]; + vector nodes(nbNodes+1); + if(e->IsQuadratic()) { const SMDS_QuadraticFaceOfNodes* F = static_cast(e); @@ -5594,12 +5603,11 @@ SMESH_MeshEditor::Sew_Error const SMDS_MeshElement* elem = invElemIt->next(); // prepare data for a loop on links coming to prevSideNode, of a face or a volume int iPrevNode, iNode = 0, nbNodes = elem->NbNodes(); - const SMDS_MeshNode* faceNodes[ nbNodes ]; + vector< const SMDS_MeshNode* > faceNodes( nbNodes, (const SMDS_MeshNode*)0 ); bool isVolume = volume.Set( elem ); - const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : faceNodes; + const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : & faceNodes[0]; if ( isVolume ) // --volume hasVolumes = true; - //else if ( nbNodes > 2 ) { // --face else if ( elem->GetType()==SMDSAbs_Face ) { // --face // retrieve all face nodes and find iPrevNode - an index of the prevSideNode if(elem->IsQuadratic()) { @@ -5616,7 +5624,7 @@ SMESH_MeshEditor::Sew_Error else { SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); while ( nIt->more() ) { - nodes[ iNode ] = static_cast( nIt->next() ); + nodes[ iNode ] = cast2Node( nIt->next() ); if ( nodes[ iNode++ ] == prevSideNode ) iPrevNode = iNode - 1; } @@ -5648,7 +5656,7 @@ SMESH_MeshEditor::Sew_Error // test a link geometrically gp_XYZ nextXYZ ( n->X(), n->Y(), n->Z() ); bool linkIsBetter = false; - double dot, dist; + double dot = 0.0, dist = 0.0; if ( searchByDir ) { // choose most co-directed link dot = bordDir * ( nextXYZ - prevXYZ ).Normalized(); linkIsBetter = ( dot > maxDot ); @@ -5728,7 +5736,10 @@ SMESH_MeshEditor::Sew_Error // insert new nodes into the border and the side to get equal nb of segments // get normalized parameters of nodes on the borders - double param[ 2 ][ maxNbNodes ]; + //double param[ 2 ][ maxNbNodes ]; + double* param[ 2 ]; + param[0] = new double [ maxNbNodes ]; + param[1] = new double [ maxNbNodes ]; int iNode, iBord; for ( iBord = 0; iBord < 2; iBord++ ) { // loop on 2 borders list< const SMDS_MeshNode* >& nodes = nSide[ iBord ]; @@ -5889,6 +5900,8 @@ SMESH_MeshEditor::Sew_Error } } + delete param[0]; + delete param[1]; } // end: insert new nodes MergeNodes ( nodeGroupsToMerge ); @@ -5913,7 +5926,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, // find indices of 2 link nodes and of the rest nodes int iNode = 0, il1, il2, i3, i4; il1 = il2 = i3 = i4 = -1; - const SMDS_MeshNode* nodes[ theFace->NbNodes() ]; + //const SMDS_MeshNode* nodes[ theFace->NbNodes() ]; + vector nodes( theFace->NbNodes() ); if(theFace->IsQuadratic()) { const SMDS_QuadraticFaceOfNodes* F = @@ -6042,7 +6056,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, // put aNodesToInsert between theBetweenNode1 and theBetweenNode2 int nbLinkNodes = 2 + aNodesToInsert.size(); - const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; + //const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; + vector linkNodes( nbLinkNodes ); linkNodes[ 0 ] = nodes[ il1 ]; linkNodes[ nbLinkNodes - 1 ] = nodes[ il2 ]; list::iterator nIt = aNodesToInsert.begin(); @@ -6209,7 +6224,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, } // create needed triangles using n1,n2,n3 and inserted nodes int nbn = 2 + aNodesToInsert.size(); - const SMDS_MeshNode* aNodes[nbn]; + //const SMDS_MeshNode* aNodes[nbn]; + vector aNodes(nbn); aNodes[0] = nodes[n1]; aNodes[nbn-1] = nodes[n2]; list::iterator nIt = aNodesToInsert.begin(); diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 024a93e5d..e11844f19 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -35,11 +35,13 @@ #include #include #include +#include +#include #include +#include #include +#include #include -#include -#include #include #include diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index ebb96e21d..2c161abdf 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -44,14 +44,13 @@ #include #include #include -#include #include #include -#include -#include #include #include #include +#include +#include #include #include @@ -1907,8 +1906,9 @@ void SMESH_subMesh::SetEventListener(EventListener* listener, EventListenerData* map< EventListener*, EventListenerData* >::iterator l_d = myEventListeners.find( listener ); if ( l_d != myEventListeners.end() ) { - if ( l_d->second && l_d->second->IsDeletable() ) - delete l_d->second; + EventListenerData* curData = l_d->second; + if ( curData && curData != data && curData->IsDeletable() ) + delete curData; l_d->second = data; } else @@ -2009,13 +2009,17 @@ void SMESH_subMeshEventListener::ProcessEvent(const int event, eventType == SMESH_subMesh::COMPUTE_EVENT) { ASSERT( data->mySubMeshes.front() != subMesh ); + list::iterator smIt = data->mySubMeshes.begin(); + list::iterator smEnd = data->mySubMeshes.end(); switch ( event ) { case SMESH_subMesh::CLEAN: - data->mySubMeshes.front()->ComputeStateEngine( event ); + for ( ; smIt != smEnd; ++ smIt) + (*smIt)->ComputeStateEngine( event ); break; case SMESH_subMesh::COMPUTE: if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK ) - data->mySubMeshes.front()->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); + for ( ; smIt != smEnd; ++ smIt) + (*smIt)->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); break; default:; }