]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
23630: EDF 18157 - Problem of meshing
authoreap <eap@opencascade.com>
Mon, 19 Nov 2018 14:14:59 +0000 (17:14 +0300)
committereap <eap@opencascade.com>
Mon, 19 Nov 2018 14:14:59 +0000 (17:14 +0300)
+ replace deprecated std::auto_ptr

src/SMDS/SMDS_Mesh.cxx
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MeshEditor.hxx
src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx
src/StdMeshers/StdMeshers_RadialPrism_3D.cxx

index a117394b97b6184a957ae21c9622fc836441c2ef..1e048ffd8eae1d7c9dff026cc037672cb957689e 100644 (file)
@@ -1542,8 +1542,9 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const
 
 SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const
 {
+  int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
   return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ),
-                                                          myInfo.NbElements( type ));
+                                                          nbElems);
 }
 
 SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) const
@@ -1552,8 +1553,9 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c
   {
     return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter );
   }
+  int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
   return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ),
-                                                        myInfo.NbElements( type ));
+                                                        nbElems);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1571,8 +1573,9 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
     return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
 
   default:
+    int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
     return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ),
-                                                    myInfo.NbElements( type ));
+                                                    nbElems);
   }
   return SMDS_ElemIteratorPtr();
 }
@@ -1584,8 +1587,9 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
 SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
 {
   typedef SMDS_EdgeIterator TIterator;
+  int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges();
   return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ),
-                                                  myInfo.NbEdges());
+                                                  nbElems);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1595,8 +1599,9 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
 SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
 {
   typedef SMDS_FaceIterator TIterator;
+  int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces();
   return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ),
-                                                  myInfo.NbFaces());
+                                                  nbElems);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1606,9 +1611,10 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
 SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
 {
   typedef SMDS_VolumeIterator TIterator;
+  int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
   return
     myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
-                                             myInfo.NbVolumes());
+                                             nbElems );
 }
 
 SMDS_NodeIteratorPtr SMDS_Mesh::shapeNodesIterator(int                  shapeID,
index 45c9547f88956cd173c56f1557d2ee1086c7cb56..87dca725d4442d67fc84b1944b920326f14e24df 100644 (file)
@@ -11227,8 +11227,8 @@ bool SMESH_MeshEditor::AffectedElemGroupsInRegion( const TIDSortedElemSet& theEl
   else
   {
     const double aTol = Precision::Confusion();
-    auto_ptr< BRepClass3d_SolidClassifier> bsc3d;
-    auto_ptr<_FaceClassifier>              aFaceClassifier;
+    std::unique_ptr< BRepClass3d_SolidClassifier> bsc3d;
+    std::unique_ptr<_FaceClassifier>              aFaceClassifier;
     if ( theShape.ShapeType() == TopAbs_SOLID )
     {
       bsc3d.reset( new BRepClass3d_SolidClassifier(theShape));;
index 8e605ab9294f43ebb94a88e69554620dc3c40714..e5e558bee84e2694b1ce18653d3b9c3a63c52c29 100644 (file)
@@ -275,7 +275,7 @@ public:
   typedef TNodeOfNodeListMap::iterator                                     TNodeOfNodeListMapItr;
   typedef std::vector<TNodeOfNodeListMapItr>                               TVecOfNnlmiMap;
   typedef std::map<const SMDS_MeshElement*, TVecOfNnlmiMap, TElemSort >    TElemOfVecOfNnlmiMap;
-  typedef std::auto_ptr< std::list<int> > PGroupIDs;
+  typedef std::unique_ptr< std::list< int > >                              PGroupIDs;
 
   PGroupIDs RotationSweep (TIDSortedElemSet   theElements[2],
                            const gp_Ax1&      theAxis,
index 95617d10a6979ea00e6ffe0f33946fd4e7fffb80..a06fde4952fab068e6da774cedde2a2c3cc27fa9 100644 (file)
@@ -1025,7 +1025,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
 
   if ( !myElemSearcher )
     myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS );
-  SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>(myElemSearcher);
+  SMESH_ElementSearcher* searcher = const_cast<SMESH_ElementSearcher*>( myElemSearcher );
   SMESHUtils::Deleter<SMESH_ElementSearcher>
     volSearcher( SMESH_MeshAlgos::GetElementSearcher( *meshDS ));
   vector< const SMDS_MeshElement* > suspectFaces, foundVolumes;
@@ -1044,7 +1044,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
     gp_Pnt PC;
     gp_Vec VNorm;
     const SMDS_MeshElement* volumes[2];
-    int what = Preparation(face, PN, VN, FNodes, PC, VNorm, volumes);
+    int what = Preparation( face, PN, VN, FNodes, PC, VNorm, volumes );
     if ( what == NOT_QUAD )
       continue;
     if ( volumes[0] && volumes[1] )
@@ -1163,7 +1163,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
 
     if ( toFindVolumes && 0 ) // non-conformal mesh is not suitable for any mesher so far
     {
-      // there are volumes in the mesh, in a non-conformal mesh an neighbor
+      // there are volumes in the mesh, in a non-conformal mesh a neighbor
       // volume can be not found yet
       for ( int isRev = 0; isRev < 2; ++isRev )
       {
@@ -1192,7 +1192,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh)
       gp_Pnt intP;
       for ( int isRev = 0; isRev < 2; ++isRev )
       {
-        if( !volumes[isRev] && HasIntersection(farPnt[isRev], PC, intP, aContour) )
+        if( !volumes[isRev] && HasIntersection( farPnt[isRev], PC, intP, aContour ))
         {
           double d = PC.Distance( intP );
           if ( d < dist2int[isRev] )
index aac2bfa4171b2db4fd451753185ebbd008428a82..157ba9e8981f449e334627b6f219986a1ca09e55 100644 (file)
@@ -159,7 +159,7 @@ bool StdMeshers_RadialPrism_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& a
   myHelper = new SMESH_MesherHelper( aMesh );
   myHelper->IsQuadraticSubMesh( aShape );
   // to delete helper at exit from Compute()
-  std::auto_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
+  std::unique_ptr<SMESH_MesherHelper> helperDeleter( myHelper );
 
   // get 2 shells
   TopoDS_Solid solid = TopoDS::Solid( aShape );