Salome HOME
Fix regressions
authoreap <eap@opencascade.com>
Thu, 19 May 2016 17:50:08 +0000 (20:50 +0300)
committereap <eap@opencascade.com>
Thu, 19 May 2016 17:50:08 +0000 (20:50 +0300)
1) 2D_mesh_QuadranglePreference_01/B5 ( StdMeshers_Quadrangle_2D.cxx )
2) viscous_layers_01/B2, B8 ( StdMeshers_ViscousLayers.cxx )

+ Fix compilation warning "variable may be used uninitialized"

30 files changed:
src/Controls/SMESH_Controls.cxx
src/MEDWrapper/Base/MED_Wrapper.cxx
src/MEDWrapper/V2_2/MED_V2_2_Wrapper.cxx
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_ScalarBarActor.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_Pattern.cxx
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx
src/SMESHGUI/SMESHGUI_ClippingDlg.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/SMESHGUI/SMESHGUI_SewingDlg.cxx
src/SMESHUtils/SMESH_Block.cxx
src/SMESHUtils/SMESH_MeshAlgos.cxx
src/SMESH_I/SMESH_Gen_i.cxx
src/SMESH_I/SMESH_Mesh_i.cxx
src/StdMeshers/StdMeshers_Cartesian_3D.cxx
src/StdMeshers/StdMeshers_Penta_3D.cxx
src/StdMeshers/StdMeshers_Prism_3D.cxx
src/StdMeshers/StdMeshers_Quadrangle_2D.cxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_ViscousLayers.cxx
src/StdMeshers/StdMeshers_ViscousLayers2D.cxx
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx
src/Tools/MeshCut/MeshCut_DC.cxx
src/Tools/MeshCut/MeshCut_Fonctions.cxx
src/Tools/MeshCut/MeshCut_Maillage.cxx
src/Tools/MeshCut/MeshCut_Utils.cxx

index 4ac7baab524f0951c37ca43843352b72d11232fb..e4efffe41c6dadb48bb69d664735b293289f60ee 100644 (file)
@@ -1832,10 +1832,10 @@ void Length2D::GetValues(TValues& theValues)
         dynamic_cast<const SMDS_VtkFace*>(anElem);
       // use special nodes iterator
       SMDS_ElemIteratorPtr anIter = F->interlacedNodesElemIterator();
-      long aNodeId[4];
+      long aNodeId[4] = { 0,0,0,0 };
       gp_Pnt P[4];
 
-      double aLength;
+      double aLength = 0;
       const SMDS_MeshElement* aNode;
       if(anIter->more()){
         aNode = anIter->next();
@@ -1957,7 +1957,7 @@ double MultiConnection2D::GetValue( long theElementId )
       SMDS_ElemIteratorPtr anIter = aFaceElem->nodesIterator();
       if (!anIter) break;
 
-      const SMDS_MeshNode *aNode, *aNode0;
+      const SMDS_MeshNode *aNode, *aNode0 = 0;
       TColStd_MapOfInteger aMap, aMapPrev;
 
       for (i = 0; i <= len; i++) {
@@ -2038,7 +2038,7 @@ void MultiConnection2D::GetValues(MValues& theValues)
         (anElem)->interlacedNodesElemIterator();
     else
       aNodesIter = anElem->nodesIterator();
-    long aNodeId[3];
+    long aNodeId[3] = {0,0,0};
 
     //int aNbConnects=0;
     const SMDS_MeshNode* aNode0;
@@ -2511,7 +2511,7 @@ void FreeEdges::GetBoreders(TBorders& theBorders)
         interlacedNodesElemIterator();
     else
       aNodesIter = anElem->nodesIterator();
-    long aNodeId[2];
+    long aNodeId[2] = {0,0};
     const SMDS_MeshElement* aNode;
     if(aNodesIter->more()){
       aNode = aNodesIter->next();
index ad1a4fd5292adaf0620bacf4d6eb7c33ddd2246c..74587222812cdd4f100144c4ce80a5f2ca74b52a 100644 (file)
@@ -644,7 +644,7 @@ namespace MED
       TIntVector aVec;
       aVec.resize(theMeshInfo->GetDim());
       for(int aAxe=0;aAxe<theMeshInfo->GetDim();aAxe++){
-        ETable aATable;
+        ETable aATable = eCOOR_IND1;
         switch(aAxe){
         case 0:
           aATable = eCOOR_IND1;
index 0bbfb214813dd4421ffe5f6b649c00c3cda9241e..934839742e4bb013a7fb8fb5854f2fa98d9a792a 100644 (file)
@@ -2739,7 +2739,7 @@ namespace MED
       }
 
       if(aMaillageType == eSTRUCTURE && aGrilleType != eGRILLE_STANDARD){
-        ETable aTable;
+        ETable aTable = eCOOR_IND1;
         for(med_int anAxis = 1; anAxis <= aMeshInfo.myDim; anAxis++){
           switch(anAxis){
           case 1 :
index 5dcaf64f85ba8c81b69629ebce7feed941b6e3a8..4520d93273d8de3912bc104d4cb2673795b42168 100644 (file)
@@ -311,7 +311,7 @@ SMESH_DeviceActor
     vtkIdType aNbCells = aGrid->GetNumberOfCells();
     aScalars->SetNumberOfComponents(1);
     aScalars->SetNumberOfTuples(aNbCells);
-    double* range;// = aScalars->GetRange();
+    double* range = 0;// = aScalars->GetRange();
     
     myVisualObj->UpdateFunctor(theFunctor);
 
index 7b5eb231ee6db07c51c3a42ddcf8972e843ff914..92a8a94b4d98a463b8c4fae8b133fa029b8df50d 100644 (file)
@@ -321,8 +321,8 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport)
     // rnv begin
     // Customization of the vtkScalarBarActor to show distribution histogram.
     bool distrVisibility =  (numColors == (int)this->myNbValues.size());
-    vtkPoints *distrPts;
-    vtkCellArray *distrPolys;
+    vtkPoints *distrPts = 0;
+    vtkCellArray *distrPolys = 0;
     vtkUnsignedCharArray *distColors = 0;
     int numDistrPts = 0, numPositiveVal=0, maxValue=0;
     if(!distrVisibility)
index 82e091890f5537e77acabd1980eddef0ff1ec6c2..e4f2bda0016f622017fc722f46e86d4370c17b7b 100644 (file)
@@ -1512,7 +1512,7 @@ void SMESH_MeshEditor::QuadTo4Tri (TIDSortedElemSet & theElems)
   gp_XY  uv [9]; uv[8] = gp_XY(0,0);
   gp_XYZ xyz[9];
   vector< const SMDS_MeshNode* > nodes;
-  SMESHDS_SubMesh*               subMeshDS;
+  SMESHDS_SubMesh*               subMeshDS = 0;
   TopoDS_Face                    F;
   Handle(Geom_Surface)           surface;
   TopLoc_Location                loc;
@@ -3249,7 +3249,7 @@ bool SMESH_MeshEditor::TriToQuad (TIDSortedElemSet &                   theElems,
       if ( startElem ) {
         // Get candidates to be fused
         const SMDS_MeshElement *tr1 = startElem, *tr2 = 0, *tr3 = 0;
-        const SMESH_TLink *link12, *link13;
+        const SMESH_TLink *link12 = 0, *link13 = 0;
         startElem = 0;
         ASSERT( mapEl_setLi.find( tr1 ) != mapEl_setLi.end() );
         set< SMESH_TLink >& setLi = mapEl_setLi[ tr1 ];
@@ -8203,7 +8203,7 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
     //const SMDS_MeshNode* faceNodes[ 4 ];
 
     const SMDS_MeshNode*    sideNode;
-    const SMDS_MeshElement* sideElem;
+    const SMDS_MeshElement* sideElem  = 0;
     const SMDS_MeshNode* prevSideNode = theSideFirstNode;
     const SMDS_MeshNode* prevBordNode = theBordFirstNode;
     nBordIt = bordNodes.begin();
@@ -8228,7 +8228,7 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode,
       {
         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();
+        int iPrevNode = 0, iNode = 0, nbNodes = elem->NbNodes();
         vector< const SMDS_MeshNode* > faceNodes( nbNodes, (const SMDS_MeshNode*)0 );
         bool isVolume = volume.Set( elem );
         const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : & faceNodes[0];
@@ -8776,7 +8776,7 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement*     theElemen
     }
     // decide how to split a quadrangle: compare possible variants
     // and choose which of splits to be a quadrangle
-    int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad;
+    int i1, i2, iSplit, nbSplits = nbLinkNodes - 1, iBestQuad = 0;
     if ( nbFaceNodes == 3 ) {
       iBestQuad = nbSplits;
       i4 = i3;
@@ -10410,7 +10410,7 @@ void SMESH_MeshEditor::DoubleElements( const TIDSortedElemSet& theElements )
 
   // get an element type and an iterator over elements
 
-  SMDSAbs_ElementType type;
+  SMDSAbs_ElementType type = SMDSAbs_All;
   SMDS_ElemIteratorPtr elemIt;
   vector< const SMDS_MeshElement* > allElems;
   if ( theElements.empty() )
index 913362e11fb3ac64601543b9a2e45161bf9f4e77..35973eb99f8a336ef77d6f1f1cfa402d6bd6976d 100644 (file)
@@ -1613,7 +1613,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1,
 
   // get type of shape for the new medium node
   int faceID = -1, edgeID = -1;
-  TopoDS_Edge E; double u [2];
+  TopoDS_Edge E; double u [2] = {0.,0.};
   TopoDS_Face F; gp_XY  uv[2];
   bool uvOK[2] = { true, true };
   const bool useCurSubShape = ( !myShape.IsNull() && myShape.ShapeType() == TopAbs_EDGE );
index 0a50cd9dd7b9d1a4a463f6559a5a58d23421ca83..f38622a34e046e9a36e9b9d507179c36a702acca 100644 (file)
@@ -499,7 +499,7 @@ static gp_XY project (const SMDS_MeshNode* theNode,
     MESSAGE( "SMESH_Pattern: point projection FAILED");
     return gp_XY(0.,0.);
   }
-  double u, v, minVal = DBL_MAX;
+  double u =0, v =0, minVal = DBL_MAX;
   for ( int i = theProjectorPS.NbExt(); i > 0; i-- )
     if ( theProjectorPS.SquareDistance( i ) < minVal ) {
       minVal = theProjectorPS.SquareDistance( i );
@@ -2339,7 +2339,7 @@ bool SMESH_Pattern::sortSameSizeWires (TListOfEdgesList &                theWire
 //   " \t vertex: " << vGcVec[iW].X() << " " << vGcVec[iW].Y() << endl;
     double minDist = DBL_MAX;
     gp_XY & wGc = vGcVec[ iW ];
-    int bIndex;
+    int bIndex = 0;
     for ( int iB = 0; iB < nbWires; iB++ ) {
       if ( bndFound[ iB ] ) continue;
       double dist = ( wGc - gcVec[ iB ] ).SquareModulus();
index fc3c33c04fe25b90746c4f17d0af9f809c6c9a6c..d696c0ba2bfdc609e9e38eade8b530f1b04553bf 100644 (file)
@@ -608,7 +608,7 @@ namespace
     // Get parameters of export operation
 
     QString            aFilename;
-    SMESH::MED_VERSION aFormat;
+    SMESH::MED_VERSION aFormat = SMESH::MED_V2_2;
     // Init the parameters with the default values
     bool aIsASCII_STL   = true;
     bool toCreateGroups = false;
@@ -6047,6 +6047,12 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
         continue;
 
       TPlaneData aPlaneData;
+      aPlaneData.AbsoluteOrientation = false;
+      aPlaneData.RelativeOrientation = 0;
+      aPlaneData.Distance = aPlaneData.Angle[0] = aPlaneData.Angle[1] = 0;
+      aPlaneData.X = aPlaneData.Y = aPlaneData.Z = 0;
+      aPlaneData.Dx = aPlaneData.Dy = aPlaneData.Dz = 0;
+
       aPlaneData.Id = aClippingPlaneId;
 
       ok = false;
index 97075dd5f0298e55e2329e2e05225a611acc20f7..c24dbc4b3eac838cee465990b0267b74649f2dd1 100644 (file)
@@ -537,7 +537,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
   myNbMidFaceNodes = 0;
   myNbCenterNodes = 0;
 
-  int aNumRows;
+  int aNumRows = 0;
 
   switch (myGeomType) {
   case SMDSEntity_Quad_Edge:
@@ -768,7 +768,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
     }
   }
 
-  SMESH::ElementType anElementType;
+  SMESH::ElementType anElementType = SMESH::ALL;
   long anElemId = -1, nbElemsBefore = 0;
   SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
   switch (myGeomType) {
@@ -1055,7 +1055,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
 
   // process groups
   if ( !myMesh->_is_nil() && myEntry != aCurrentEntry ) {
-    SMESH::ElementType anElementType;
+    SMESH::ElementType anElementType = SMESH::ALL;
     switch ( myGeomType ) {
     case SMDSEntity_Quad_Edge:
       anElementType = SMESH::EDGE; break;
@@ -1371,8 +1371,8 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
     for ( int row = 0; row < myTable->rowCount(); row++ )
       myTable->item( row, 1 )->setText("");
 
-    int* aFirstColIds;
-    int* aLastColIds;
+    int* aFirstColIds = 0;
+    int* aLastColIds  = 0;
 
     switch (myGeomType) {
     case SMDSEntity_Quad_Edge:
index 371a0582afdf70bef7c17937c271688c85a4503b..e1047b87489258ec013457495d0d002c7a92a340 100644 (file)
@@ -766,7 +766,7 @@ bool SMESHGUI_ClippingDlg::AddPlane ( SMESH::TActorList       theActorList,
   double aDir[2][3] = {{0, 0, 0}, {0, 0, 0}};
   static double aCoeff = vtkMath::Pi()/180.0;
 
-  int anOrientation;
+  int anOrientation = 0;
   if ( thePlane->PlaneMode == SMESH::Absolute )
     anOrientation = thePlane->myAbsoluteOrientation;
   else if ( thePlane->PlaneMode == SMESH::Relative )
@@ -1436,7 +1436,7 @@ void SMESHGUI_ClippingDlg::SetCurrentPlaneParam()
   static double aCoeff = vtkMath::Pi()/180.0;
 
   double aRot[2] = { getRotation1(), getRotation2() };
-  int anOrient;
+  int anOrient = 0;
   if ( aPlane->PlaneMode == SMESH::Absolute )
     anOrient = CBAbsoluteOrientation->currentIndex();
   else if ( aPlane->PlaneMode == SMESH::Relative )
@@ -1623,8 +1623,8 @@ void SMESHGUI_ClippingDlg::absolutePlaneToRelative ( double theOrigin[3], double
   double eps = 0.0001;
 
   int anOrientation = CBRelativeOrientation->currentIndex();
-  double aDirection[3];
-  double aRotation1, aRotation2;
+  double aDirection[3] = { 0.,0.,0. };
+  double aRotation1 = 0, aRotation2 = 0;
   switch( anOrientation ) {
   case 0:
     aDirection[0] = theDir[0] + eps;
index d954febb218bd9efec7febb09696ec8d10259bbd..ea5c5fe03781907c56d462672127e189e23070cf 100644 (file)
@@ -936,7 +936,7 @@ bool SMESHGUI_GroupDlg::onApply()
   QStringList anEntryList;
 
   SMESH::SMESH_GroupBase_var resultGroup;
-  bool isCreation, isConversion = false;
+  bool isCreation = false, isConversion = false;
     
   SUIT_OverrideCursor wc;
 
index 1a55c37c1e4f13b3e958584df7fd3ea4ca3debc3..27b0c85d1e5870f6daadd9341515a6da59043e99 100644 (file)
@@ -1227,7 +1227,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
           int shapeID = pos->shapeID;
           if ( shapeID > 0 ) {
             QString shapeType;
-            double u, v;
+            double u = 0, v = 0;
             switch ( pos->shapeType ) {
             case GEOM::EDGE:
               shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
@@ -1747,7 +1747,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
           int shapeID = pos->shapeID;
           if ( shapeID > 0 ) {
             QString shapeType;
-            double u, v;
+            double u = 0, v = 0;
             switch ( pos->shapeType ) {
             case GEOM::EDGE:
               shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
index 458e930669cc94b64b46a2f3448ac8499f52c210..22253c4d69caec10655af62a565c787b09d98365 100644 (file)
@@ -1308,7 +1308,7 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
 
       int aConstructorId = GetConstructorId();
-      SMESH::SMESH_MeshEditor::Sew_Error anError;
+      SMESH::SMESH_MeshEditor::Sew_Error anError = SMESH::SMESH_MeshEditor::SEW_OK;
 
       if (aConstructorId == 0)
       {
index 986d55aeae2d1a6a666eb9710c0e1684b898ae07..90bd9bce65db5a18b5a9f9cc02d526287948bf65 100644 (file)
@@ -930,6 +930,7 @@ void SMESH_Block::refineParametersOnFace( const gp_Pnt& thePoint,
 {
   // find UV of thePoint on the FACE
   Standard_Real U,V;
+  U=V=0;
 
   const TFace& tface = myFace[ theFaceID - ID_FirstF ];
   if ( !tface.Surface() ) return;
@@ -1778,7 +1779,7 @@ bool SMESH_Block::FindBlockShapes(const TopoDS_Shell&         theShell,
 
   if ( V000.IsNull() ) {
     // find vertex 000 - the one with smallest coordinates
-    double minVal = DBL_MAX, minX, val;
+    double minVal = DBL_MAX, minX = DBL_MAX, val;
     for ( int i = 1; i <= 8; i++ ) {
       const TopoDS_Vertex& v = TopoDS::Vertex( vfMap.FindKey( i ));
       gp_Pnt P = BRep_Tool::Pnt( v );
@@ -1822,7 +1823,7 @@ bool SMESH_Block::FindBlockShapes(const TopoDS_Shell&         theShell,
     return false;
   }
   TopTools_ListIteratorOfListOfShape f001It, f000It ( f000List );
-  int i, j, iFound1, iFound2;
+  int i, j, iFound1=0, iFound2=0;
   for ( j = 0; f000It.More(); f000It.Next(), j++ )
   {
     if ( NB_FACES_BY_VERTEX == 6 && j % 2 ) continue; // each face encounters twice
index dfdaf42d9a1a366242844707a5e4c01f5e384576..a9ad04af523c96f0c8f9f26c5025c397276fb4af 100644 (file)
@@ -1194,7 +1194,7 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
     dist.back() = dist.front();
     // find the closest intersection
     int    iClosest = -1;
-    double rClosest, distClosest = 1e100;;
+    double rClosest = 0, distClosest = 1e100;;
     gp_Pnt pClosest;
     for ( i = 0; i < nbNodes; ++i )
     {
index 32c05839a89fd24d07c29ac0d1f85fc14c6df4c9..a279a4ada6df344848925daad936a7045094e4e8 100644 (file)
@@ -4485,7 +4485,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
 
       // --> try to find SUB-MESHES containers for each type of submesh
       for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) {
-        const char* name_meshgroup;
+        const char* name_meshgroup = 0;
         if ( j == GetSubMeshOnVertexTag() )
           name_meshgroup = "SubMeshes On Vertex";
         else if ( j == GetSubMeshOnEdgeTag() )
index 625537a1c948fdc5b2e7fe243b979aef41e2d87d..05043f6f280e79bf53a2a6506355623c447721c9 100644 (file)
@@ -4076,7 +4076,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodesId()
 SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem )
   throw (SALOME::SALOME_Exception)
 {
-  SMESH::ElementType type;
+  SMESH::ElementType type = SMESH::ALL;
   SMESH_TRY;
 
   if ( _preMeshInfo )
@@ -4224,7 +4224,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID,
 SMESH::ElementType SMESH_Mesh_i::GetSubMeshElementType(const CORBA::Long ShapeID)
   throw (SALOME::SALOME_Exception)
 {
-  SMESH::ElementType type;
+  SMESH::ElementType type = SMESH::ALL;
 
   SMESH_TRY;
   if ( _preMeshInfo )
index 749236780869080a8152e511ce775ceac856c21f..adbeb5021b88d5a77407593c25436a747905f983 100644 (file)
@@ -3050,7 +3050,7 @@ namespace
     _Node*  orderNodes   [20];
     TGeomID orderShapeIDs[20];
     size_t nbN = 0;
-    TGeomID id, *pID;
+    TGeomID id, *pID = 0;
     for ( e = edges.begin(); e != edges.end(); ++e )
     {
       if (( id = _grid->_shapes.FindIndex( SMESH_MesherHelper::IthVertex( 0, *e ))) &&
index 69485a746eadeef7daf42fe8cceec2970b74ed44..8a852edb9af21ab99a2ccf99c84e66e8353cee4a 100644 (file)
@@ -1367,7 +1367,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
 
   // find the other edges of theFace and orientation of e1
   TopoDS_Edge e1, e2, eTop;
-  bool rev1, CumOri = false;
+  bool rev1 = false, CumOri = false;
   TopExp_Explorer exp( theFace, TopAbs_EDGE );
   int nbEdges = 0;
   for ( ; exp.More(); exp.Next() ) {
index d60f1397e9d3ee62ab209b2c9d57cd49b1700628..d0c4410e76ab8f081d72cf25f81872b8d6aadaa7 100644 (file)
@@ -3155,7 +3155,7 @@ bool StdMeshers_Prism_3D::initPrism(Prism_3D::TPrismTopo& thePrism,
 
   // find vertex 000 - the one with smallest coordinates (for easy DEBUG :-)
   TopoDS_Vertex V000;
-  double minVal = DBL_MAX, minX, val;
+  double minVal = DBL_MAX, minX = 0, val;
   for ( TopExp_Explorer exp( botSM->GetSubShape(), TopAbs_VERTEX );
         exp.More(); exp.Next() )
   {
index 989a2d50138e93d527ca830c79420a78ea5526e6..955fc11473dab13d350b0d50d1efa403ef267674 100644 (file)
@@ -519,7 +519,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh&         aMesh,
     // for each node of the down edge find nearest node
     // in the first row of the regular grid and link them
     for (i = 0; i < stop; i++) {
-      const SMDS_MeshNode *a, *b, *c, *d;
+      const SMDS_MeshNode *a, *b, *c=0, *d;
       a = uv_e0[i].node;
       b = uv_e0[i + 1].node;
       gp_Pnt pb (b->X(), b->Y(), b->Z());
@@ -533,6 +533,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh&         aMesh,
       }
       else {
         // find in the grid node c, nearest to the b
+        c = 0;
         double mind = RealLast();
         for (int k = g; k <= iup; k++) {
           
@@ -734,6 +735,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadDominant(SMESH_Mesh&         aMesh,
       gp_Pnt pb (b->X(), b->Y(), b->Z());
 
       // find node c in the grid, nearest to the b
+      c = 0;
       int near = g;
       if (i == stop - 1) { // up bondary reached
         c = quad->uv_grid[nbhoriz*(jup + 1) - 2].node;
@@ -2138,7 +2140,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
     npl.Append(uv_el[i].normParam);
   }
 
-  int dl,dr;
+  int dl = 0, dr = 0;
   if (OldVersion) {
     // add some params to right and left after the first param
     // insert to right
@@ -2380,7 +2382,7 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh &        aMesh,
         TColgp_SequenceOfXY UVtmp;
         double drparam = npr.Value(nr) - npr.Value(nnn-1);
         double dlparam = npl.Value(nnn) - npl.Value(nnn-1);
-        double y0,y1;
+        double y0 = 0, y1 = 0;
         for (i=1; i<=drl; i++) {
           // add existed nodes from right edge
           NodesC.SetValue(nb,i+1,uv_er[nnn+i-2].node);
@@ -3296,7 +3298,11 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh &        aMesh,
 
     vector<UVPtStruct> curr_base = uv_eb, next_base;
 
-    UVPtStruct nullUVPtStruct; nullUVPtStruct.node = 0;
+    UVPtStruct nullUVPtStruct;
+    nullUVPtStruct.node = 0;
+    nullUVPtStruct.x = nullUVPtStruct.y = nullUVPtStruct.u = nullUVPtStruct.y = 0;
+    nullUVPtStruct.param = 0;
+    
 
     int curr_base_len = nb;
     int next_base_len = 0;
@@ -4108,7 +4114,7 @@ bool StdMeshers_Quadrangle_2D::check()
     StdMeshers_FaceSidePtr wire = wireVec[0];
 
     // find a right angle VERTEX
-    int iVertex;
+    int     iVertex = 0;
     double maxAngle = -1e100;
     for ( int i = 0; i < wire->NbEdges(); ++i )
     {
@@ -5145,6 +5151,8 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side&  side,
         for ( iS = 0; iS < q->side.size(); ++iS )
           if ( side.grid == q->side[ iS ].grid )
             break;
+        if ( iS == q->side.size() )
+          continue;
         bool isOut;
         if ( !q->side[ iS ].IsReversed() )
           isOut = ( q->side[ iS ].from > iCur || q->side[ iS ].to-1 <= iCur );
index 7118e0a2160c9973c10c5ab2f747810daa275ada..7025642b3b9bbdc5c5c53b93e171fd6a00a24de8 100644 (file)
@@ -931,7 +931,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh &     theMesh,
 
   case GEOMETRIC_1D:
   {
-    double a1 = _value[ BEG_LENGTH_IND ], an;
+    double a1 = _value[ BEG_LENGTH_IND ], an = 0;
     double q  = _value[ END_LENGTH_IND ];
 
     double U1 = theReverse ? l : f;
index acb0a56404894fe3b4587200eac20c788f8689c5..1b4e6ab04f25408466f1f7018a60571a60a1b11d 100644 (file)
@@ -94,7 +94,7 @@
 #include <string>
 
 #ifdef _DEBUG_
-//#define __myDEBUG
+#define __myDEBUG
 //#define __NOT_INVALIDATE_BAD_SMOOTH
 #endif
 
@@ -2890,7 +2890,7 @@ bool _ViscousBuilder::findShapesToSmooth( _SolidData& data )
     {
       TGeomID iV = getMeshDS()->ShapeToIndex( vIt.Value() );
       vector<_LayerEdge*>& eV = edgesByGeom[ iV ]._edges;
-      if ( eV.empty() ) continue;
+      if ( eV.empty() || eV[0]->Is( _LayerEdge::MULTI_NORMAL )) continue;
       gp_Vec  eDir    = getEdgeDir( E, TopoDS::Vertex( vIt.Value() ));
       double angle    = eDir.Angle( eV[0]->_normal );
       double cosin    = Cos( angle );
@@ -4727,39 +4727,42 @@ bool _ViscousBuilder::smoothAndCheck(_SolidData& data,
         continue;
       if ( eos._edges[i]->FindIntersection( *searcher, dist, data._epsilon, eos, &intFace ))
       {
+        return false;
+        // commented due to "Illegal hash-positionPosition" error in NETGEN
+        // on Debian60 on viscous_layers_01/B2 case
         // Collision; try to deflate _LayerEdge's causing it
-        badEdges.clear();
-        badEdges.push_back( eos._edges[i] );
-        eosC1[0] = & eos;
-        int nbBad = invalidateBadSmooth( data, helper, badEdges, eosC1, infStep );
-        if ( nbBad > 0 )
-          return false;
+        // badEdges.clear();
+        // badEdges.push_back( eos._edges[i] );
+        // eosC1[0] = & eos;
+        // int nbBad = invalidateBadSmooth( data, helper, badEdges, eosC1, infStep );
+        // if ( nbBad > 0 )
+        //   return false;
 
-        badEdges.clear();
-        if ( _EdgesOnShape* eof = data.GetShapeEdges( intFace->getshapeId() ))
-        {
-          if ( const _TmpMeshFace* f = dynamic_cast< const _TmpMeshFace*>( intFace ))
-          {
-            const SMDS_MeshElement* srcFace =
-              eof->_subMesh->GetSubMeshDS()->GetElement( f->getIdInShape() );
-            SMDS_ElemIteratorPtr nIt = srcFace->nodesIterator();
-            while ( nIt->more() )
-            {
-              const SMDS_MeshNode* srcNode = static_cast<const SMDS_MeshNode*>( nIt->next() );
-              TNode2Edge::iterator n2e = data._n2eMap.find( srcNode );
-              if ( n2e != data._n2eMap.end() )
-                badEdges.push_back( n2e->second );
-            }
-            eosC1[0] = eof;
-            nbBad = invalidateBadSmooth( data, helper, badEdges, eosC1, infStep );
-            if ( nbBad > 0 )
-              return false;
-          }
-        }
-        if ( eos._edges[i]->FindIntersection( *searcher, dist, data._epsilon, eos, &intFace ))
-          return false;
-        else
-          continue;
+        // badEdges.clear();
+        // if ( _EdgesOnShape* eof = data.GetShapeEdges( intFace->getshapeId() ))
+        // {
+        //   if ( const _TmpMeshFace* f = dynamic_cast< const _TmpMeshFace*>( intFace ))
+        //   {
+        //     const SMDS_MeshElement* srcFace =
+        //       eof->_subMesh->GetSubMeshDS()->GetElement( f->getIdInShape() );
+        //     SMDS_ElemIteratorPtr nIt = srcFace->nodesIterator();
+        //     while ( nIt->more() )
+        //     {
+        //       const SMDS_MeshNode* srcNode = static_cast<const SMDS_MeshNode*>( nIt->next() );
+        //       TNode2Edge::iterator n2e = data._n2eMap.find( srcNode );
+        //       if ( n2e != data._n2eMap.end() )
+        //         badEdges.push_back( n2e->second );
+        //     }
+        //     eosC1[0] = eof;
+        //     nbBad = invalidateBadSmooth( data, helper, badEdges, eosC1, infStep );
+        //     if ( nbBad > 0 )
+        //       return false;
+        //   }
+        // }
+        // if ( eos._edges[i]->FindIntersection( *searcher, dist, data._epsilon, eos, &intFace ))
+        //   return false;
+        // else
+        //   continue;
       }
       if ( !intFace )
       {
@@ -5387,7 +5390,7 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
     _offPoints[i]._len  = avgLen;
   }
 
-  double fTol;
+  double fTol = 0;
   if ( !surface.IsNull() ) // project _offPoints to the FACE
   {
     fTol = 100 * BRep_Tool::Tolerance( F );
@@ -5414,7 +5417,7 @@ bool _Smoother1D::smoothComplexEdge( _SolidData&                    data,
     int  i = _iSeg[ is2nd ];
     int di = is2nd ? -1 : +1;
     bool projected = false;
-    double uOnSeg, uOnSegDiff, uOnSegBestDiff = Precision::Infinite(), uOnSegPrevDiff;
+    double uOnSeg, uOnSegDiff, uOnSegBestDiff = Precision::Infinite(), uOnSegPrevDiff = 0;
     int nbWorse = 0;
     do {
       gp_Vec v0p( _offPoints[i]._xyz, pExtreme[ is2nd ]    );
@@ -8844,7 +8847,7 @@ bool _ViscousBuilder::refine(_SolidData& data)
   TopoDS_Edge geomEdge;
   TopoDS_Face geomFace;
   TopLoc_Location loc;
-  double f,l, u;
+  double f,l, u = 0;
   gp_XY uv;
   vector< gp_XYZ > pos3D;
   bool isOnEdge;
index 111ea47cb5a2a02dd870b91e10469dd5eed744b9..4e78b7157b52a5b3eb869b48ef60cdee994ae9f3 100644 (file)
@@ -300,6 +300,8 @@ namespace VISCOUS_2D
     double   _D;               // _vec1.Crossed( _vec2 )
     double   _param1, _param2; // intersection param on _seg1 and _seg2
 
+    _SegmentIntersection(): _param1(0), _param2(0), _D(0) {}
+
     bool Compute(const _Segment& seg1, const _Segment& seg2, bool seg2IsRay = false )
     {
       // !!! If seg2IsRay, returns true at any _param2 !!!
@@ -1819,7 +1821,7 @@ bool _ViscousBuilder2D::shrink()
     //  x-x-x-x-----x-----x----
     //  | | | |  e1    e2    e3
 
-    int isRShrinkedForAdjacent;
+    int isRShrinkedForAdjacent = 0;
     UVPtStructVec nodeDataForAdjacent;
     for ( int isR = 0; isR < 2; ++isR )
     {
index 8b1aa911bd6c5d5e246e61ac2f7aeae32bbc37e9..e6aaa288954c561904f524a93d9495c6ce955db5 100644 (file)
@@ -293,7 +293,7 @@ void StdMeshersGUI_DistrPreview::update()
 
   int size = graph.length()/2;
   double* x = new double[size], *y = new double[size];
-  double min_x, max_x, min_y, max_y;
+  double min_x = 0, max_x = 0, min_y = 0, max_y = 0;
   for( int i=0; i<size; i++ )
   {
     x[i] = graph[2*i];
index ccc45655ad2f66abe5992a4b58982c6dd6e5d01c..1639f0bdc6939a93836cd1aacc43423a44409760 100644 (file)
@@ -72,13 +72,13 @@ int main(int argc, char *argv[])
   debug = false;
   string ficMEDin;
   string ficMEDout;
-  float xNormal;
-  float yNormal;
-  float zNormal;
-  float xm;
-  float ym;
-  float zm;
-  float tolerance;
+  float xNormal = 0;
+  float yNormal = 0;
+  float zNormal = 0;
+  float xm = 0;
+  float ym = 0;
+  float zm = 0;
+  float tolerance = 0;
   try
     {
       if (argc != 13)
index bd6a8df027a32b7e493169d8735e72bfee4f82fd..f55361325a2ea399ac6f2640b96e47c702f31d98 100644 (file)
@@ -84,7 +84,7 @@ int MESHCUT::positionNoeudPlan(int indiceNoeud)
 int MESHCUT::intersectionSegmentPlan(int it4, int na)
 {
 
-  int ngA, ngB; // Numéros des noeuds extrémités AB
+  int ngA = -1, ngB = -1; // Numéros des noeuds extrémités AB
   float lambda, ps; //, ab; // ab = longueur AB
   float A[3], B[3];
 
index fd6ceabb072aabdbd638e176a99c76c9214943d9..1c7726730694d5cd8eb1c9c360ebcd713ca85ef2 100644 (file)
@@ -204,7 +204,7 @@ float Maillage::distanceNoeudMaille(int ngnoeud, int imaille, TYPE_MAILLE tm)
 int Maillage::noeudVoisin(int ngnoeud, int imaille, TYPE_MAILLE tm)
 {
   float x, y, z;
-  int ngv;
+  int ngv = -1;
   float x0 = XX[ngnoeud - 1];
   float y0 = YY[ngnoeud - 1];
   float z0 = ZZ[ngnoeud - 1];
@@ -557,13 +557,13 @@ void Maillage::inputMED(std::string fichierMED)
   ostringstream OSCOORD;
 
   med_int nnoe = 0; // Nbre de noeuds
-  med_float *coo1; // Table des coordonnées
+  med_float *coo1 = 0; // Table des coordonnées
   //  char nomcoo[mdim * MED_SNAME_SIZE + 1]; // Table des noms des coordonnées
   //  char unicoo[mdim * MED_SNAME_SIZE + 1]; // Table des unités des coordonnées
-  char *nomnoe;
+  char *nomnoe = 0;
 
-  med_int *numnoe;
-  med_int *nufano;
+  med_int *numnoe = 0;
+  med_int *nufano = 0;
   //  med_grid_type rep;
   //  med_bool inonoe, inunoe;
   //  med_int profil[2] = { 2, 3 };
@@ -1133,7 +1133,7 @@ void Maillage::outputMED(std::string fichierMED)
   //  float x, y, z;
 
   med_int nnoe = nombreNoeudsMaillage; // Nombre de noeuds
-  med_float *coo; // Table des coordonnées
+  med_float *coo = 0; // Table des coordonnées
 
   // Noms des coordonnées (variable nomcoo)
   char* nomcoo = new char[mdim * MED_SNAME_SIZE + 1];
@@ -1169,9 +1169,9 @@ void Maillage::outputMED(std::string fichierMED)
 
   // Tables des noms, numeros, numeros de familles des noeuds
   //    autant d'elements que de noeuds - les noms ont pout longueur MED_SNAME_SIZE
-  char *nomnoe;
+  char *nomnoe = 0;
   med_int *numnoe = NULL;
-  med_int *nufano;
+  med_int *nufano = NULL;
   med_bool inonoe = MED_FALSE;
   med_bool inunoe = MED_FALSE;
 
@@ -1580,7 +1580,7 @@ int Maillage::NGLOBAL(TYPE_MAILLE typeMaille, int nlocal)
 TYPE_MAILLE Maillage::TYPE(int nglobal)
 {
   // Attention, les num. globaux commencent à 1, les num. locaux à 0
-  TYPE_MAILLE resultat;
+  TYPE_MAILLE resultat = (TYPE_MAILLE)-1;
   int cpt = 0;
   for (int itm = (int) POI1; itm <= (int) HEXA20; itm++)
     {
index 26c1995d51fe8a6dc1c659a0d786ac7965df8e1e..b17e2b4d759e114d60b80699805101acc280c609 100644 (file)
@@ -534,7 +534,7 @@ int MESHCUT::copieFichier(std::string source, std::string cible)
 
 med_geometry_type MESHCUT::InstanceMGE(TYPE_MAILLE TYPE)
 {
-  med_geometry_type typeBanaliseMED;
+  med_geometry_type typeBanaliseMED = MED_NONE;
 
   switch (TYPE)
   {