diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index a117394b9..1e048ffd8 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -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( 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, diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 45c9547f8..87dca725d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -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));; diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 8e605ab92..e5e558bee 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -275,7 +275,7 @@ public: typedef TNodeOfNodeListMap::iterator TNodeOfNodeListMapItr; typedef std::vector TVecOfNnlmiMap; typedef std::map TElemOfVecOfNnlmiMap; - typedef std::auto_ptr< std::list > PGroupIDs; + typedef std::unique_ptr< std::list< int > > PGroupIDs; PGroupIDs RotationSweep (TIDSortedElemSet theElements[2], const gp_Ax1& theAxis, diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index 95617d10a..a06fde495 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -1025,7 +1025,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) if ( !myElemSearcher ) myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); - SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); + SMESH_ElementSearcher* searcher = const_cast( myElemSearcher ); SMESHUtils::Deleter 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] ) diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx index aac2bfa41..157ba9e89 100644 --- a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx @@ -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 helperDeleter( myHelper ); + std::unique_ptr helperDeleter( myHelper ); // get 2 shells TopoDS_Solid solid = TopoDS::Solid( aShape );