-// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
double tolerance)
:SMESH_Octree( new LimitAndPool() )
{
- int nbElems = mesh.GetMeshInfo().NbElements( elemType );
+ smIdType nbElems = mesh.GetMeshInfo().NbElements( elemType );
_elements.reserve( nbElems );
TElementBoxPool& elBoPool = getLimitAndPool()->_elBoPool;
{
delete _ebbTree[i]; _ebbTree[i] = NULL;
}
- if ( _nodeSearcher ) delete _nodeSearcher; _nodeSearcher = 0;
+ if ( _nodeSearcher ) delete _nodeSearcher;
+ _nodeSearcher = 0;
}
virtual int FindElementsByPoint(const gp_Pnt& point,
SMDSAbs_ElementType type,
GC_MakeSegment edge( SMESH_TNodeXYZ( face->GetNode( i )),
SMESH_TNodeXYZ( face->GetNode( (i+1)%nbNodes) ));
anExtCC.Init( lineCurve, edge.Value() );
+ if ( !anExtCC.Extrema().IsDone() ||
+ anExtCC.Extrema().IsParallel() )
+ continue;
if ( anExtCC.NbExtrema() > 0 && anExtCC.LowerDistance() <= tol)
{
Standard_Real pl, pe;
try {
tgtCS = gp_Ax3( xyz[0], OZ, OX );
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure& ) {
return badDistance;
}
trsf.SetTransformation( tgtCS );
typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium;
typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap;
- TLinkSharpMap linkIsSharp( theMesh->NbFaces() );
+ TLinkSharpMap linkIsSharp;
+ Standard_Integer nbBuckets = FromSmIdType<Standard_Integer>( theMesh->NbFaces() );
+ if ( nbBuckets > 0 )
+ linkIsSharp.ReSize( nbBuckets );
+
TIsSharpAndMedium sharpMedium( true, 0 );
bool & isSharp = sharpMedium.first;
const SMDS_MeshNode* & nMedium = sharpMedium.second;
typedef std::vector< const SMDS_MeshElement* > TFaceVec;
typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks;
- TFacesByLinks facesByLink( theMesh->NbFaces() );
+ TFacesByLinks facesByLink;
+ Standard_Integer nbBuckets = FromSmIdType<Standard_Integer>( theMesh->NbFaces() );
+ if ( nbBuckets > 0 )
+ facesByLink.ReSize( nbBuckets );
std::vector< const SMDS_MeshNode* > faceNodes;
for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); )