23630: EDF 18157 - Problem of meshing

+ replace deprecated std::auto_ptr
This commit is contained in:
eap 2018-11-19 17:14:59 +03:00
parent 7abad597ce
commit fb97845ce9
5 changed files with 20 additions and 14 deletions

View 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,

View 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));;

View 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,

View 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] )

View 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 );