From: prascle Date: Tue, 30 Nov 2010 22:35:24 +0000 (+0000) Subject: PR: correct some warnings X-Git-Tag: V6_2_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e16ca1281e91b049388105e138619bfdb5d571f;p=modules%2Fsmesh.git PR: correct some warnings --- diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 198ea8da4..677f467de 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -2588,8 +2588,8 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) while ( aMinStr.Search( "-" ) != -1 ) aMinStr.RemoveAll( '-' ); while ( aMaxStr.Search( "-" ) != -1 ) aMaxStr.RemoveAll( '-' ); - if ( !aMinStr.IsEmpty() && !aMinStr.IsIntegerValue() || - !aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue() ) + if ( (!aMinStr.IsEmpty() && !aMinStr.IsIntegerValue()) || + (!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) ) return false; myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); @@ -2635,7 +2635,7 @@ bool RangeOfIds::IsSatisfy( long theId ) else { const SMDS_MeshElement* anElem = myMesh->FindElement( theId ); - if ( anElem == 0 || myType != anElem->GetType() && myType != SMDSAbs_All ) + if ( anElem == 0 || (myType != anElem->GetType() && myType != SMDSAbs_All )) return false; } @@ -2826,8 +2826,8 @@ bool LogicalOR::IsSatisfy( long theId ) return myPredicate1 && myPredicate2 && - myPredicate1->IsSatisfy( theId ) || - myPredicate2->IsSatisfy( theId ); + (myPredicate1->IsSatisfy( theId ) || + myPredicate2->IsSatisfy( theId )); } diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index cbd619696..e203707c5 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -384,13 +384,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane aMeshDimension = 3; // PAL18941(a saved study with a mesh belong Z is opened and the mesh is belong X) - if ( aMeshDimension == 1 && !anIsXDimension ) // 1D only if mesh is along OX + if ( aMeshDimension == 1 && !anIsXDimension ) {// 1D only if mesh is along OX if ( anIsYDimension ) { aMeshDimension = 2; anIsXDimension = true; } else { aMeshDimension = 3; } + } } SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(/*idInceasingOrder=*/true); @@ -430,7 +431,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() int myFacesDefaultFamilyId = 0; int myVolumesDefaultFamilyId = 0; int nbNodes = myMesh->NbNodes(); - int nb0DElements = myMesh->Nb0DElements(); + //int nb0DElements = myMesh->Nb0DElements(); int nbEdges = myMesh->NbEdges(); int nbFaces = myMesh->NbFaces(); int nbVolumes = myMesh->NbVolumes(); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 709847e9c..31a21fef1 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -540,7 +540,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, int nbNodes = anElem->NbNodes(); - if ( theEdgeNum < 0 || theEdgeNum > 3 || nbNodes != 3 && nbNodes != 4 || theEdgeNum > nbNodes ) + if ( theEdgeNum < 0 || theEdgeNum > 3 || (nbNodes != 3 && nbNodes != 4) || theEdgeNum > nbNodes ) return false; vector anIds( nbNodes ); @@ -642,6 +642,7 @@ bool SMESH_MeshObj::NulData() myEmptyGrid->BuildLinks(); } myGrid->ShallowCopy(myEmptyGrid); + return true; } //================================================================================= // function : GetElemDimension diff --git a/src/SMDS/SMDS_Downward.cxx b/src/SMDS/SMDS_Downward.cxx index f735c820a..67a31ff1f 100644 --- a/src/SMDS/SMDS_Downward.cxx +++ b/src/SMDS/SMDS_Downward.cxx @@ -420,7 +420,7 @@ int SMDS_Down1D::computeFaces(int* pts, int* vtkIds, int nbcells, int* downFaces { int volId = _grid->CellIdToDownId(vtkId); SMDS_Downward * downvol = _grid->getDownArray(vtkType); - const int *downIds = downvol->getDownCells(volId); + //const int *downIds = downvol->getDownCells(volId); const unsigned char* downTypesVol = downvol->getDownTypes(volId); int nbFaces = downvol->getNumberOfDownCells(volId); const int* faceIds = downvol->getDownCells(volId); diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index d6f7e1813..5660a566d 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -269,7 +269,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int I //MESSAGE("Add0DElementWithID" << ID) SMDS_Mesh0DElement * el0d = new SMDS_Mesh0DElement(n); if (myElementIDFactory->BindID(ID, el0d)) { - SMDS_MeshNode *node = const_cast(n); + //SMDS_MeshNode *node = const_cast(n); //node->AddInverseElement(el0d);// --- fait avec BindID adjustmyCellsCapacity(ID); myCells[ID] = el0d; @@ -2988,8 +2988,10 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, //MESSAGE("SMDS_Mesh::RemoveElement " << elem->getVtkId() << " " << removenodes); // get finite elements built on elem set * s1; - if (elem->GetType() == SMDSAbs_0DElement || elem->GetType() == SMDSAbs_Edge && !hasConstructionEdges() - || elem->GetType() == SMDSAbs_Face && !hasConstructionFaces() || elem->GetType() == SMDSAbs_Volume) + if ( (elem->GetType() == SMDSAbs_0DElement) + || ((elem->GetType() == SMDSAbs_Edge) && !hasConstructionEdges()) + || ((elem->GetType() == SMDSAbs_Face) && !hasConstructionFaces()) + || (elem->GetType() == SMDSAbs_Volume) ) { s1 = new set (); s1->insert(elem); diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index c574b8671..de0f10e3e 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -32,10 +32,6 @@ #include "SMDS_Mesh.hxx" #include -#define protected public -#include -#define protected protected - #include "utilities.h" #include "Utils_SALOME_Exception.hxx" #include @@ -73,12 +69,13 @@ void SMDS_MeshNode::init(int id, int meshId, int shapeId, double x, double y, do myIdInShape = -1; //MESSAGE("Node " << myID << " " << myVtkID << " (" << x << ", " << y << ", " << z << ")"); SMDS_Mesh* mesh = SMDS_Mesh::_meshList[myMeshId]; - vtkUnstructuredGrid * grid = mesh->getGrid(); + SMDS_UnstructuredGrid * grid = mesh->getGrid(); vtkPoints *points = grid->GetPoints(); points->InsertPoint(myVtkID, x, y, z); - vtkCellLinks *cellLinks = grid->GetCellLinks(); - if (myVtkID >=cellLinks->Size) - cellLinks->Resize(myVtkID+SMDS_Mesh::chunkSize); + SMDS_CellLinks *cellLinks = dynamic_cast(grid->GetCellLinks()); + assert(cellLinks); + if (myVtkID >= cellLinks->GetLinksSize()) + cellLinks->ResizeL(myVtkID+SMDS_Mesh::chunkSize); } SMDS_MeshNode::~SMDS_MeshNode() diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 7b65dfdb9..bbe371c8d 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -15,6 +15,31 @@ using namespace std; +SMDS_CellLinks* SMDS_CellLinks::New() +{ + MESSAGE("SMDS_CellLinks::New"); + return new SMDS_CellLinks(); +} + +vtkCellLinks::Link* SMDS_CellLinks::ResizeL(vtkIdType sz) +{ + return vtkCellLinks::Resize(sz); +} + +vtkIdType SMDS_CellLinks::GetLinksSize() +{ + return this->Size; +} + +SMDS_CellLinks::SMDS_CellLinks() : + vtkCellLinks() +{ +} + +SMDS_CellLinks::~SMDS_CellLinks() +{ +} + SMDS_UnstructuredGrid* SMDS_UnstructuredGrid::New() { MESSAGE("SMDS_UnstructuredGrid::New"); @@ -697,7 +722,7 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool withEdges) int faceId2 = downFaces[idf]; int faceType = downTypes[idf]; //ASSERT(_downArray[faceType]); - SMDS_Down2D* downFace2 = static_cast (_downArray[faceType]); + //SMDS_Down2D* downFace2 = static_cast (_downArray[faceType]); _downArray[vtkEdgeType]->addUpCell(connEdgeId, faceId2, faceType); _downArray[faceType]->addDownCell(faceId2, connEdgeId, vtkEdgeType); // MESSAGE(" From face t:" << vtkFaceType << " " << faceId << @@ -839,3 +864,17 @@ int SMDS_UnstructuredGrid::getOrderedNodesOfFace(int vtkVolId, std::vector& return orderedNodes.size(); } +void SMDS_UnstructuredGrid::BuildLinks() +{ + // Remove the old links if they are already built + if (this->Links) + { + this->Links->UnRegister(this); + } + + this->Links = SMDS_CellLinks::New(); + this->Links->Allocate(this->GetNumberOfPoints()); + this->Links->Register(this); + this->Links->BuildLinks(this, this->Connectivity); + this->Links->Delete(); +} diff --git a/src/SMDS/SMDS_UnstructuredGrid.hxx b/src/SMDS/SMDS_UnstructuredGrid.hxx index 808a4edf5..2d5025ca1 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.hxx +++ b/src/SMDS/SMDS_UnstructuredGrid.hxx @@ -9,6 +9,7 @@ #define _SMDS_UNSTRUCTUREDGRID_HXX #include +#include #include "chrono.hxx" #include @@ -30,6 +31,17 @@ class SMDS_Downward; class SMDS_Mesh; +class SMDS_CellLinks: public vtkCellLinks +{ +public: + vtkCellLinks::Link* ResizeL(vtkIdType sz); + vtkIdType GetLinksSize(); + static SMDS_CellLinks* New(); +protected: + SMDS_CellLinks(); + ~SMDS_CellLinks(); +}; + class SMDS_UnstructuredGrid: public vtkUnstructuredGrid { public: @@ -53,6 +65,7 @@ public: void GetNodeIds(std::set& nodeSet, int downId, unsigned char downType); void ModifyCellNodes(int vtkVolId, std::map localClonedNodeIds); int getOrderedNodesOfFace(int vtkVolId, std::vector& orderedNodes); + void BuildLinks(); vtkCellLinks* GetLinks() { return Links; diff --git a/src/SMDS/SMDS_VtkVolume.cxx b/src/SMDS/SMDS_VtkVolume.cxx index 45c61be31..b76fe9d65 100644 --- a/src/SMDS/SMDS_VtkVolume.cxx +++ b/src/SMDS/SMDS_VtkVolume.cxx @@ -171,6 +171,7 @@ bool SMDS_VtkVolume::vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes) default: break; } + return true; } SMDS_VtkVolume::~SMDS_VtkVolume() @@ -355,7 +356,7 @@ const SMDS_MeshNode* SMDS_VtkVolume::GetFaceNode(const int face_ind, const int n /*! polyhedron only, * return number of nodes for each face */ -const std::vector & SMDS_VtkVolume::GetQuantities() const +const std::vector SMDS_VtkVolume::GetQuantities() const { vector quantities; quantities.clear(); diff --git a/src/SMDS/SMDS_VtkVolume.hxx b/src/SMDS/SMDS_VtkVolume.hxx index b43c73edf..8b714e233 100644 --- a/src/SMDS/SMDS_VtkVolume.hxx +++ b/src/SMDS/SMDS_VtkVolume.hxx @@ -45,7 +45,7 @@ public: static bool isForward(double* a,double* b,double* c,double* d); int NbUniqueNodes() const; SMDS_ElemIteratorPtr uniqueNodesIterator() const; - const std::vector & GetQuantities() const; + const std::vector GetQuantities() const; virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const; virtual SMDS_ElemIteratorPtr nodesIteratorToUNV() const; diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index a5740a0d2..828f83db4 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -133,36 +133,43 @@ SMESH_MeshEditor::AddElement(const vector & node, SMESHDS_Mesh* mesh = GetMeshDS(); switch ( type ) { case SMDSAbs_0DElement: - if ( nbnode == 1 ) + if ( nbnode == 1 ) { if ( ID >= 0 ) e = mesh->Add0DElementWithID(node[0], ID); else e = mesh->Add0DElement (node[0] ); + } break; case SMDSAbs_Edge: - if ( nbnode == 2 ) + if ( nbnode == 2 ) { if ( ID >= 0 ) e = mesh->AddEdgeWithID(node[0], node[1], ID); else e = mesh->AddEdge (node[0], node[1] ); - else if ( nbnode == 3 ) + } + else if ( nbnode == 3 ) { if ( ID >= 0 ) e = mesh->AddEdgeWithID(node[0], node[1], node[2], ID); else e = mesh->AddEdge (node[0], node[1], node[2] ); + } break; case SMDSAbs_Face: if ( !isPoly ) { - if (nbnode == 3) + if (nbnode == 3) { if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], ID); else e = mesh->AddFace (node[0], node[1], node[2] ); - else if (nbnode == 4) + } + else if (nbnode == 4) { if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3], ID); else e = mesh->AddFace (node[0], node[1], node[2], node[3] ); - else if (nbnode == 6) + } + else if (nbnode == 6) { if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3], node[4], node[5], ID); else e = mesh->AddFace (node[0], node[1], node[2], node[3], node[4], node[5] ); - else if (nbnode == 8) + } + else if (nbnode == 8) { if ( ID >= 0 ) e = mesh->AddFaceWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], ID); else e = mesh->AddFace (node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7] ); + } } else { if ( ID >= 0 ) e = mesh->AddPolygonalFaceWithID(node, ID); else e = mesh->AddPolygonalFace (node ); @@ -170,32 +177,37 @@ SMESH_MeshEditor::AddElement(const vector & node, break; case SMDSAbs_Volume: if ( !isPoly ) { - if (nbnode == 4) + if (nbnode == 4) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], ID); else e = mesh->AddVolume (node[0], node[1], node[2], node[3] ); - else if (nbnode == 5) + } + else if (nbnode == 5) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], ID); else e = mesh->AddVolume (node[0], node[1], node[2], node[3], node[4] ); - else if (nbnode == 6) + } + else if (nbnode == 6) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], ID); else e = mesh->AddVolume (node[0], node[1], node[2], node[3], node[4], node[5] ); - else if (nbnode == 8) + } + else if (nbnode == 8) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], ID); else e = mesh->AddVolume (node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7] ); - else if (nbnode == 10) + } + else if (nbnode == 10) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], node[8], node[9], ID); else e = mesh->AddVolume (node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], node[8], node[9] ); - else if (nbnode == 13) + } + else if (nbnode == 13) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], node[8], node[9], node[10],node[11], @@ -204,7 +216,8 @@ SMESH_MeshEditor::AddElement(const vector & node, node[4], node[5], node[6], node[7], node[8], node[9], node[10],node[11], node[12] ); - else if (nbnode == 15) + } + else if (nbnode == 15) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], node[8], node[9], node[10],node[11], @@ -213,7 +226,8 @@ SMESH_MeshEditor::AddElement(const vector & node, node[4], node[5], node[6], node[7], node[8], node[9], node[10],node[11], node[12],node[13],node[14] ); - else if (nbnode == 20) + } + else if (nbnode == 20) { if ( ID >= 0 ) e = mesh->AddVolumeWithID(node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7], node[8], node[9], node[10],node[11], @@ -224,6 +238,7 @@ SMESH_MeshEditor::AddElement(const vector & node, node[8], node[9], node[10],node[11], node[12],node[13],node[14],node[15], node[16],node[17],node[18],node[19] ); + } } } if ( e ) myLastCreatedElems.Append( e ); @@ -531,12 +546,14 @@ bool SMESH_MeshEditor::InverseDiag (const SMDS_MeshElement * theTria1, // find indices of 1,2 and of A,B in theTria1 int iA = 0, iB = 0, i1 = 0, i2 = 0; for ( i = 0; i < 6; i++ ) { - if ( sameInd [ i ] == 0 ) + if ( sameInd [ i ] == 0 ) { if ( i < 3 ) i1 = i; else i2 = i; - else if (i < 3) + } + else if (i < 3) { if ( iA ) iB = i; else iA = i; + } } // nodes 1 and 2 should not be the same if ( aNodes[ i1 ] == aNodes[ i2 ] ) @@ -623,7 +640,7 @@ static bool findTriangles(const SMDS_MeshNode * theNode1, it = theNode2->GetInverseElementIterator(SMDSAbs_Face); while (it->more()) { const SMDS_MeshElement* elem = it->next(); - if ( emap.find( elem ) != emap.end() ) + if ( emap.find( elem ) != emap.end() ) { if ( theTria1 ) { // theTria1 must be element with minimum ID if( theTria1->GetID() < elem->GetID() ) { @@ -638,6 +655,7 @@ static bool findTriangles(const SMDS_MeshNode * theNode1, else { theTria1 = elem; } + } } return ( theTria1 && theTria2 ); } @@ -1998,7 +2016,7 @@ double getAngle(const SMDS_MeshElement * tr1, int i = 0, iDiag = -1; while ( it->more()) { const SMDS_MeshElement *n = it->next(); - if ( n == n1 || n == n2 ) + if ( n == n1 || n == n2 ) { if ( iDiag < 0) iDiag = i; else { @@ -2008,6 +2026,7 @@ double getAngle(const SMDS_MeshElement * tr1, nFirst[ t ] = n; break; } + } i++; } } @@ -5535,12 +5554,12 @@ SMESH_MeshEditor::Transform (TIDSortedElemSet & theElems, // Regular elements int* i = index[ FORWARD ]; - if ( needReverse && nbNodes > 2) // reverse mirrored faces and volumes + if ( needReverse && nbNodes > 2) {// reverse mirrored faces and volumes if ( elemType == SMDSAbs_Face ) i = index[ REV_FACE ]; else i = index[ nbNodes - 4 ]; - + } if(elem->IsQuadratic()) { static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}; i = anIds; @@ -7024,12 +7043,12 @@ bool SMESH_MeshEditor::isOut( const SMDS_MeshElement* element, const gp_Pnt& poi vector nodeList; SMDS_ElemIteratorPtr nodeIt = element->nodesIterator(); - if ( element->IsQuadratic() ) + if ( element->IsQuadratic() ) { if (const SMDS_VtkFace* f=dynamic_cast(element)) nodeIt = f->interlacedNodesElemIterator(); else if (const SMDS_VtkEdge* e =dynamic_cast(element)) nodeIt = e->interlacedNodesElemIterator(); - + } while ( nodeIt->more() ) { const SMDS_MeshNode* node = cast2Node( nodeIt->next() ); @@ -7826,7 +7845,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) } } else { - int elemId = elem->GetID(); + //int elemId = elem->GetID(); //MESSAGE("Change regular element or polygon " << elemId); SMDSAbs_ElementType etyp = elem->GetType(); uniqueNodes.resize(nbUniqueNodes); diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index bcdd2096a..3c3433548 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -860,12 +860,14 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1, { if ( uvOK[0] && uvOK[1] ) { - if ( IsDegenShape( n1->getshapeId() )) + if ( IsDegenShape( n1->getshapeId() )) { if ( myParIndex & U_periodic ) uv[0].SetCoord( 1, uv[1].Coord( 1 )); else uv[0].SetCoord( 2, uv[1].Coord( 2 )); - else if ( IsDegenShape( n2->getshapeId() )) + } + else if ( IsDegenShape( n2->getshapeId() )) { if ( myParIndex & U_periodic ) uv[1].SetCoord( 1, uv[0].Coord( 1 )); else uv[1].SetCoord( 2, uv[0].Coord( 2 )); + } TopLoc_Location loc; Handle(Geom_Surface) S = BRep_Tool::Surface(F,loc); @@ -1586,7 +1588,7 @@ bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMes return aMesh->GetMeshDS()->ShapeToIndex( shape ) || // PAL16202 - shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape ); + (shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( shape )); } //================================================================================ @@ -1954,7 +1956,7 @@ namespace { // Structures used by FixQuadraticElements() // propagate from quadrangle to neighbour faces if ( link->MediumPos() >= pos ) { int nbLinkFaces = link->_faces.size(); - if ( nbLinkFaces == 4 || nbLinkFaces < 4 && link->OnBoundary()) { + if ( nbLinkFaces == 4 || (nbLinkFaces < 4 && link->OnBoundary())) { // hexahedral mesh or boundary quadrangles - goto a continous face if ( const QFace* f = link->GetContinuesFace( this )) return f->GetLinkChain( *chLink, chain, pos, error ); diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 69b33a94c..a02800b05 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1529,11 +1529,12 @@ bool SMESH_subMesh::ComputeStateEngine(int event) ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE ); break; case CHECK_COMPUTE_STATE: - if ( !IsMeshComputed() ) + if ( !IsMeshComputed() ) { if (_algoState == HYP_OK) _computeState = READY_TO_COMPUTE; else _computeState = NOT_READY; + } break; default: ASSERT(0); diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx index aad0ee4f2..7382330db 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx @@ -66,13 +66,14 @@ class MyIterator: public SMDS_ElemIterator MyIterator(SMDSAbs_ElementType type, const SMESHDS_SubMesh* subMesh) : myType(type), myElem(0) { - if ( subMesh ) + if ( subMesh ) { if ( myType == SMDSAbs_Node ) myNodeIt = subMesh->GetNodes(); else { myElemIt = subMesh->GetElements(); next(); } + } } bool more() { diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 93a428be3..2b6fde92f 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -1065,10 +1065,12 @@ void SMESHDS_Mesh::UnSetMeshElementOnShape(const SMDS_MeshElement * elem, map::iterator it = myShapeIndexToSubMesh.find( Index ); if ( it != myShapeIndexToSubMesh.end() ) - if ( elem->GetType() == SMDSAbs_Node ) - it->second->RemoveNode( static_cast( elem ), /*deleted=*/false ); - else - it->second->RemoveElement( elem, /*deleted=*/false ); + { + if (elem->GetType() == SMDSAbs_Node) + it->second->RemoveNode(static_cast (elem), /*deleted=*/false); + else + it->second->RemoveElement(elem, /*deleted=*/false); + } } //======================================================================= diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index aa85c9c96..58f29ea4e 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -140,7 +140,7 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N, bool isNodeDeleted) // if (!isNodeDeleted) // alive node has valid ID and can be found // { int idInSubShape = N->getIdInShape(); - int shapeId = N->getshapeId(); + //int shapeId = N->getshapeId(); //MESSAGE("in "<< myIndex << " RemoveNode " << shapeId << " " << idInSubShape << " " << N->GetID()); SMDS_MeshNode* node = (SMDS_MeshNode*) (N); node->setShapeId(0); diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 4701c050d..210a543b8 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -1026,7 +1026,7 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad, VB = quad.side[0]->LastVertex(); int a1, b1, c1, a2, b2, c2; - if (VA.IsSame(V0)) + if (VA.IsSame(V0)) { if (VB.IsSame(V1)) { a1 = 1; @@ -1046,7 +1046,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad, b2 = 0; c2 = 0; // x } - if (VA.IsSame(V1)) + } + if (VA.IsSame(V1)) { if (VB.IsSame(V2)) { a1 = 0; @@ -1066,7 +1067,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad, b2 = 1; c2 = 0; // y } - if (VA.IsSame(V2)) + } + if (VA.IsSame(V2)) { if (VB.IsSame(V3)) { a1 = -1; @@ -1086,7 +1088,8 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad, b2 = 0; c2 = 1; // 1-x } - if (VA.IsSame(V3)) + } + if (VA.IsSame(V3)) { if (VB.IsSame(V0)) { a1 = 0; @@ -1106,6 +1109,7 @@ void StdMeshers_Hexa_3D::GetConv2DCoefs(const faceQuadStruct & quad, b2 = -1; c2 = 1; // 1-y } + } // MESSAGE("X = " << c1 << "+ " << a1 << "*x + " << b1 << "*y"); // MESSAGE("Y = " << c2 << "+ " << a2 << "*x + " << b2 << "*y"); conv.a1 = a1; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index cbf6f5692..9e0dffc66 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -1000,13 +1000,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt& } if ( hyp1D ) // try to compute with hyp1D { - if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions,p1,p2,*mesh,hyp1D )) + if ( !TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions,p1,p2,*mesh,hyp1D )) { if ( myDistributionHypo ) { // bad hyp assigned return error( TNodeDistributor::GetDistributor(*mesh)->GetComputeError() ); } else { // bad hyp found, its Ok, lets try with default nb of segnents } + } } if ( myLayerPositions.empty() ) // try to use nb of layers