mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0026390: IntTools_Context should provide possibility to set tolerance used by PointOnSurf projector instead using of strict value 1.e-12
New method SetPOnSProjectionTolerance to set projection tolerance has been added IntTools_Context. By default it is set to 1.e-12
This commit is contained in:
parent
0f04f1e11d
commit
b285c9fed2
@ -315,6 +315,15 @@ is
|
|||||||
---Purpose: Returns true if the solid <theFace> has
|
---Purpose: Returns true if the solid <theFace> has
|
||||||
-- infinite bounds
|
-- infinite bounds
|
||||||
|
|
||||||
|
SetPOnSProjectionTolerance(me:mutable; theValue: Real from Standard);
|
||||||
|
---Purpose: Sets tolerance to be used for projection of point on surface.
|
||||||
|
-- Clears map of already cached projectors in order to maintain
|
||||||
|
-- correct value for all projectors
|
||||||
|
|
||||||
|
clearCachedPOnSProjectors(me: mutable)
|
||||||
|
is private;
|
||||||
|
---Purpose: Clears map of already cached projectors.
|
||||||
|
|
||||||
fields
|
fields
|
||||||
myAllocator : BaseAllocator from BOPCol is protected;
|
myAllocator : BaseAllocator from BOPCol is protected;
|
||||||
myFClass2dMap:DataMapOfShapeAddress from BOPCol is protected;
|
myFClass2dMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||||
@ -326,6 +335,7 @@ fields
|
|||||||
myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
myProjSDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||||
myBndBoxDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
myBndBoxDataMap:DataMapOfShapeAddress from BOPCol is protected;
|
||||||
myCreateFlag :Integer from Standard is protected;
|
myCreateFlag :Integer from Standard is protected;
|
||||||
|
myPOnSTolerance :Real from Standard is protected;
|
||||||
|
|
||||||
end Context;
|
end Context;
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ IntTools_Context::IntTools_Context()
|
|||||||
myHatcherMap(100, myAllocator),
|
myHatcherMap(100, myAllocator),
|
||||||
myProjSDataMap(100, myAllocator),
|
myProjSDataMap(100, myAllocator),
|
||||||
myBndBoxDataMap(100, myAllocator),
|
myBndBoxDataMap(100, myAllocator),
|
||||||
myCreateFlag(0)
|
myCreateFlag(0),
|
||||||
|
myPOnSTolerance(1.e-12)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -77,7 +78,8 @@ IntTools_Context::IntTools_Context
|
|||||||
myHatcherMap(100, myAllocator),
|
myHatcherMap(100, myAllocator),
|
||||||
myProjSDataMap(100, myAllocator),
|
myProjSDataMap(100, myAllocator),
|
||||||
myBndBoxDataMap(100, myAllocator),
|
myBndBoxDataMap(100, myAllocator),
|
||||||
myCreateFlag(1)
|
myCreateFlag(1),
|
||||||
|
myPOnSTolerance(1.e-12)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -101,15 +103,7 @@ IntTools_Context::~IntTools_Context()
|
|||||||
}
|
}
|
||||||
myFClass2dMap.Clear();
|
myFClass2dMap.Clear();
|
||||||
//
|
//
|
||||||
GeomAPI_ProjectPointOnSurf* pProjPS;
|
clearCachedPOnSProjectors();
|
||||||
aIt.Initialize(myProjPSMap);
|
|
||||||
for (; aIt.More(); aIt.Next()) {
|
|
||||||
anAdr=aIt.Value();
|
|
||||||
pProjPS=(GeomAPI_ProjectPointOnSurf*)anAdr;
|
|
||||||
(*pProjPS).~GeomAPI_ProjectPointOnSurf();
|
|
||||||
myAllocator->Free(anAdr);
|
|
||||||
}
|
|
||||||
myProjPSMap.Clear();
|
|
||||||
//
|
//
|
||||||
GeomAPI_ProjectPointOnCurve* pProjPC;
|
GeomAPI_ProjectPointOnCurve* pProjPC;
|
||||||
aIt.Initialize(myProjPCMap);
|
aIt.Initialize(myProjPCMap);
|
||||||
@ -264,7 +258,7 @@ GeomAPI_ProjectPointOnSurf& IntTools_Context::ProjPS(const TopoDS_Face& aF)
|
|||||||
GeomAPI_ProjectPointOnSurf* pProjPS;
|
GeomAPI_ProjectPointOnSurf* pProjPS;
|
||||||
|
|
||||||
if (!myProjPSMap.IsBound(aF)) {
|
if (!myProjPSMap.IsBound(aF)) {
|
||||||
Standard_Real Umin, Usup, Vmin, Vsup, anEpsT=1.e-12 ;
|
Standard_Real Umin, Usup, Vmin, Vsup;
|
||||||
BRepAdaptor_Surface aBAS;
|
BRepAdaptor_Surface aBAS;
|
||||||
//
|
//
|
||||||
const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF);
|
const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF);
|
||||||
@ -277,7 +271,7 @@ GeomAPI_ProjectPointOnSurf& IntTools_Context::ProjPS(const TopoDS_Face& aF)
|
|||||||
//
|
//
|
||||||
pProjPS=(GeomAPI_ProjectPointOnSurf*)myAllocator->Allocate(sizeof(GeomAPI_ProjectPointOnSurf));
|
pProjPS=(GeomAPI_ProjectPointOnSurf*)myAllocator->Allocate(sizeof(GeomAPI_ProjectPointOnSurf));
|
||||||
new (pProjPS) GeomAPI_ProjectPointOnSurf();
|
new (pProjPS) GeomAPI_ProjectPointOnSurf();
|
||||||
pProjPS->Init(aS ,Umin, Usup, Vmin, Vsup, anEpsT/*, Extrema_ExtAlgo_Tree*/);
|
pProjPS->Init(aS ,Umin, Usup, Vmin, Vsup, myPOnSTolerance/*, Extrema_ExtAlgo_Tree*/);
|
||||||
Extrema_ExtPS& anExtAlgo = const_cast<Extrema_ExtPS&>(pProjPS->Extrema());
|
Extrema_ExtPS& anExtAlgo = const_cast<Extrema_ExtPS&>(pProjPS->Extrema());
|
||||||
anExtAlgo.SetFlag(Extrema_ExtFlag_MIN);
|
anExtAlgo.SetFlag(Extrema_ExtFlag_MIN);
|
||||||
//
|
//
|
||||||
@ -940,3 +934,29 @@ Standard_Boolean IntTools_Context::ProjectPointOnEdge
|
|||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetPOnSProjectionTolerance
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void IntTools_Context::SetPOnSProjectionTolerance(const Standard_Real theValue)
|
||||||
|
{
|
||||||
|
myPOnSTolerance = theValue;
|
||||||
|
clearCachedPOnSProjectors();
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : clearCachedPOnSProjectors
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void IntTools_Context::clearCachedPOnSProjectors()
|
||||||
|
{
|
||||||
|
GeomAPI_ProjectPointOnSurf* pProjPS;
|
||||||
|
BOPCol_DataMapIteratorOfDataMapOfShapeAddress aIt(myProjPSMap);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
Standard_Address anAdr=aIt.Value();
|
||||||
|
pProjPS=(GeomAPI_ProjectPointOnSurf*)anAdr;
|
||||||
|
(*pProjPS).~GeomAPI_ProjectPointOnSurf();
|
||||||
|
myAllocator->Free(anAdr);
|
||||||
|
}
|
||||||
|
myProjPSMap.Clear();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user