Salome HOME
PR: correct some warnings
authorprascle <prascle>
Tue, 30 Nov 2010 22:35:24 +0000 (22:35 +0000)
committerprascle <prascle>
Tue, 30 Nov 2010 22:35:24 +0000 (22:35 +0000)
18 files changed:
src/Controls/SMESH_Controls.cxx
src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
src/OBJECT/SMESH_Object.cxx
src/SMDS/SMDS_Downward.cxx
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_MeshNode.cxx
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMDS/SMDS_UnstructuredGrid.hxx
src/SMDS/SMDS_VtkVolume.cxx
src/SMDS/SMDS_VtkVolume.hxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_subMesh.cxx
src/SMESHDS/SMESHDS_GroupOnGeom.cxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_SubMesh.cxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx

index 198ea8da423e4742a3197bc86f5c27fedac1b6e6..677f467de9fa18915f173c5dd0f974e8b438cf52 100644 (file)
@@ -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 ));
 }
 
 
index cbd619696da068d29553a0ede1b8be789a883c85..e203707c539483e9cd67e0253424512a9eee03cb 100644 (file)
@@ -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();
index 709847e9c34cf51738456857e9e203c62293beb6..31a21fef1d800a3fc50d7ebf07abc98ce20ff803 100644 (file)
@@ -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<int> anIds( nbNodes );
@@ -642,6 +642,7 @@ bool SMESH_MeshObj::NulData()
          myEmptyGrid->BuildLinks();
        }
        myGrid->ShallowCopy(myEmptyGrid);
+       return true;
 }
 //=================================================================================
 // function : GetElemDimension
index f735c820aba60c33f90d211572fe426eac10d06a..67a31ff1f04aa3849e8b2ac9ae84f60178a51b4b 100644 (file)
@@ -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);
index d6f7e1813f23d8b5d56944b27b7e4cc3ccfdcb3a..5660a566d642907460a9d40b165cf4e9afca890d 100644 (file)
@@ -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<SMDS_MeshNode*>(n);
+    //SMDS_MeshNode *node = const_cast<SMDS_MeshNode*>(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<const SMDS_MeshElement*> * 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<const SMDS_MeshElement*> ();
       s1->insert(elem);
index c574b867121dcd51d2a894d22dac859e6a12869b..de0f10e3e42c7e173ede193e5ecb0f4f2f31ea3b 100644 (file)
 #include "SMDS_Mesh.hxx"
 #include <vtkUnstructuredGrid.h>
 
-#define protected public
-#include <vtkCellLinks.h>
-#define protected protected
-
 #include "utilities.h"
 #include "Utils_SALOME_Exception.hxx"
 #include <cassert>
@@ -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<SMDS_CellLinks*>(grid->GetCellLinks());
+  assert(cellLinks);
+  if (myVtkID >= cellLinks->GetLinksSize())
+         cellLinks->ResizeL(myVtkID+SMDS_Mesh::chunkSize);
 }
 
 SMDS_MeshNode::~SMDS_MeshNode()
index 7b65dfdb9159b61ae5c222464c422a11021eb667..bbe371c8dd0450e156b4e25aa71568f8a38a2535 100644 (file)
 
 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<SMDS_Down2D*> (_downArray[faceType]);
+                  //SMDS_Down2D* downFace2 = static_cast<SMDS_Down2D*> (_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<int>&
   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();
+}
index 808a4edf563aa3104722af94d999e23ecfe13a05..2d5025ca18f11bbaacbda0a4775074adc7c6b213 100644 (file)
@@ -9,6 +9,7 @@
 #define        _SMDS_UNSTRUCTUREDGRID_HXX
 
 #include <vtkUnstructuredGrid.h>
+#include <vtkCellLinks.h>
 #include "chrono.hxx"
 
 #include <vector>
 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<int>& nodeSet, int downId, unsigned char downType);
   void ModifyCellNodes(int vtkVolId, std::map<int, int> localClonedNodeIds);
   int getOrderedNodesOfFace(int vtkVolId, std::vector<int>& orderedNodes);
+  void BuildLinks();
   vtkCellLinks* GetLinks()
   {
     return Links;
index 45c61be31c0a5877e99cefded937d49482cfee12..b76fe9d65bbc2e0d2ed2d9ee3d8306a25d0e4375 100644 (file)
@@ -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<int> SMDS_VtkVolume::GetQuantities() const
+const std::vector<int> SMDS_VtkVolume::GetQuantities() const
 {
   vector<int> quantities;
   quantities.clear();
index b43c73edf8443caf96b67b5894db0081c335ec39..8b714e233b47490a1cba2140a8421d172030b684 100644 (file)
@@ -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<int> GetQuantities() const;
+  const std::vector<int> GetQuantities() const;
 
   virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
   virtual SMDS_ElemIteratorPtr nodesIteratorToUNV() const;
index a5740a0d27f92e971bef2f980e6e21a69e5b77e2..828f83db4357b380e42bba2ec444c417688f3d84 100644 (file)
@@ -133,36 +133,43 @@ SMESH_MeshEditor::AddElement(const vector<const SMDS_MeshNode*> & 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<const SMDS_MeshNode*> & 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<const SMDS_MeshNode*> & 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<const SMDS_MeshNode*> & 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<const SMDS_MeshNode*> & 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<const SMDS_MeshNode*> nodeList;
 
   SMDS_ElemIteratorPtr nodeIt = element->nodesIterator();
-  if ( element->IsQuadratic() )
+  if ( element->IsQuadratic() ) {
     if (const SMDS_VtkFace* f=dynamic_cast<const SMDS_VtkFace*>(element))
       nodeIt = f->interlacedNodesElemIterator();
     else if (const SMDS_VtkEdge*  e =dynamic_cast<const SMDS_VtkEdge*>(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);
index bcdd2096a0e5f22528ef9bec48357005c07124e7..3c343354857ef31003a273fbba3cc4115a90b77e 100644 (file)
@@ -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 );
index 69b33a94c85ad2861a6576b10c4a08d373140705..a02800b056c0f7d6ab7afafb4ab0073badbf2044 100644 (file)
@@ -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);
index aad0ee4f2508e9340be9ad3450fe3a1d26278e7a..7382330dbe7f3cd6403ba34cb54ba2e7136a06a4 100644 (file)
@@ -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()
   {
index 93a428be3fd1dcd856fbc3be1ec9f2cb16068826..2b6fde92fd2235a4cbd726170b8d5f4495e6cf76 100644 (file)
@@ -1065,10 +1065,12 @@ void SMESHDS_Mesh::UnSetMeshElementOnShape(const SMDS_MeshElement * elem,
 
   map<int,SMESHDS_SubMesh*>::iterator it = myShapeIndexToSubMesh.find( Index );
   if ( it != myShapeIndexToSubMesh.end() )
-    if ( elem->GetType() == SMDSAbs_Node )
-      it->second->RemoveNode( static_cast<const SMDS_MeshNode* >( elem ), /*deleted=*/false );
-    else
-      it->second->RemoveElement( elem, /*deleted=*/false );
+    {
+      if (elem->GetType() == SMDSAbs_Node)
+        it->second->RemoveNode(static_cast<const SMDS_MeshNode*> (elem), /*deleted=*/false);
+      else
+        it->second->RemoveElement(elem, /*deleted=*/false);
+    }
 }
 
 //=======================================================================
index aa85c9c96136940bedb952ebe519e8ff02d1076a..58f29ea4e422efd0cbe95ee64ed346b90aaa4c54 100644 (file)
@@ -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);
index 4701c050d0d13472d68147104fdd1ebad40ab0d6..210a543b8495ea838c2b6bd47b72656d12948402 100644 (file)
@@ -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;
index cbf6f569235f126c2f6fad1fe1cda5fe89bc51fa..9e0dffc66a4fa0a117f75899b5556ffb23f042b8 100644 (file)
@@ -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