#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
+#include <BRepBndLib.hxx>
#include <IntTools_Tools.hxx>
#include <IntTools_FClass2d.hxx>
myProjPTMap(100, myAllocator),
myHatcherMap(100, myAllocator),
myProjSDataMap(100, myAllocator),
+ myBndBoxDataMap(100, myAllocator),
myCreateFlag(0)
{
}
myProjPTMap(100, myAllocator),
myHatcherMap(100, myAllocator),
myProjSDataMap(100, myAllocator),
+ myBndBoxDataMap(100, myAllocator),
myCreateFlag(1)
{
}
myAllocator->Free(anAdr);
}
myProjSDataMap.Clear();
+ //
+ Bnd_Box* pBox;
+ aIt.Initialize(myBndBoxDataMap);
+ for (; aIt.More(); aIt.Next()) {
+ anAdr=aIt.Value();
+ pBox=(Bnd_Box*)anAdr;
+ (*pBox).~Bnd_Box();
+ myAllocator->Free(anAdr);
+ }
+ myBndBoxDataMap.Clear();
+}
+//=======================================================================
+//function : BndBox
+//purpose :
+//=======================================================================
+Bnd_Box& IntTools_Context::BndBox(const TopoDS_Shape& aS)
+{
+ Standard_Address anAdr;
+ Bnd_Box* pBox;
+ //
+ if (!myBndBoxDataMap.IsBound(aS)) {
+ //
+ pBox=(Bnd_Box*)myAllocator->Allocate(sizeof(Bnd_Box));
+ new (pBox) Bnd_Box();
+ //
+ Bnd_Box &aBox=*pBox;
+ BRepBndLib::Add(aS, aBox);
+ //
+ anAdr=(Standard_Address)pBox;
+ myBndBoxDataMap.Bind(aS, anAdr);
+ }
+ else {
+ anAdr=myBndBoxDataMap.Find(aS);
+ pBox=(Bnd_Box*)anAdr;
+ }
+ return *pBox;
+}
+//=======================================================================
+//function : IsInfiniteFace
+//purpose :
+//=======================================================================
+Standard_Boolean IntTools_Context::IsInfiniteFace
+ (const TopoDS_Face& aFace)
+{
+ Standard_Boolean bRet;
+ Standard_Integer i;
+ Standard_Real aX[6];
+ //
+ bRet=Standard_False;
+ //
+ if (!BRep_Tool::NaturalRestriction(aFace)) {
+ return bRet;
+ }
+ //
+ Bnd_Box& aBox=BndBox(aFace);
+ //
+ aBox.Get(aX[0], aX[1], aX[2], aX[3], aX[4], aX[5]);
+ //
+ for (i=0; (i<6) && (!bRet); ++i) {
+ bRet=Precision::IsInfinite(aX[i]);
+ }
+ //
+ return bRet;
}
//=======================================================================
//function : FClass2d