mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0023442: Provide the access to the functionality of Geom2dHatch_Hacher via IntTools_Context
class IntTools_Context - the method: Geom2dHatch_Hatcher& IntTools_Context::Hatcher(const TopoDS_Face& aF) has been added. The method returns the reference to 2D hatcher for given face <aF> class IntTools_Context - the method: IntTools_Context::~IntTools_Context() has been modified in terms of I.1.
This commit is contained in:
parent
5df3a117e1
commit
3f52476587
@ -47,7 +47,8 @@ uses
|
|||||||
IntSurf,
|
IntSurf,
|
||||||
BRepClass3d,
|
BRepClass3d,
|
||||||
TColgp,
|
TColgp,
|
||||||
MMgt
|
MMgt,
|
||||||
|
Geom2dHatch
|
||||||
|
|
||||||
is
|
is
|
||||||
|
|
||||||
|
@ -47,7 +47,8 @@ uses
|
|||||||
IndexedDataMapOfTransientAddress from IntTools,
|
IndexedDataMapOfTransientAddress from IntTools,
|
||||||
FClass2d from IntTools,
|
FClass2d from IntTools,
|
||||||
SurfaceRangeLocalizeData from IntTools,
|
SurfaceRangeLocalizeData from IntTools,
|
||||||
Curve from IntTools
|
Curve from IntTools,
|
||||||
|
Hatcher from Geom2dHatch
|
||||||
|
|
||||||
--raises
|
--raises
|
||||||
|
|
||||||
@ -111,6 +112,18 @@ is
|
|||||||
--- Returns a reference to solid classifier
|
--- Returns a reference to solid classifier
|
||||||
--- for given solid
|
--- for given solid
|
||||||
---
|
---
|
||||||
|
--modified by NIZNHY-PKV Mon Sep 24 07:52:54 2012f
|
||||||
|
Hatcher(me: mutable;
|
||||||
|
aF: Face from TopoDS)
|
||||||
|
returns Hatcher from Geom2dHatch;
|
||||||
|
---C++: return &
|
||||||
|
---Purpose:
|
||||||
|
--- Returns a reference to 2D hatcher
|
||||||
|
--- for given face
|
||||||
|
---
|
||||||
|
--modified by NIZNHY-PKV Mon Sep 24 07:52:54 2012t
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- API Block
|
--- API Block
|
||||||
---
|
---
|
||||||
@ -294,12 +307,13 @@ is
|
|||||||
---
|
---
|
||||||
|
|
||||||
fields
|
fields
|
||||||
myFClass2dMap : IndexedDataMapOfShapeAddress from TopTools;
|
myFClass2dMap : IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
myProjPSMap : IndexedDataMapOfShapeAddress from TopTools;
|
myProjPSMap : IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
myProjPCMap : IndexedDataMapOfShapeAddress from TopTools;
|
myProjPCMap : IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
myProjPTMap : IndexedDataMapOfTransientAddress from IntTools;
|
myProjPTMap : IndexedDataMapOfTransientAddress from IntTools is protected;
|
||||||
mySClassMap : IndexedDataMapOfShapeAddress from TopTools;
|
mySClassMap : IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
myProjSDataMap: IndexedDataMapOfShapeAddress from TopTools;
|
myProjSDataMap: IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
|
myHatcherMap : IndexedDataMapOfShapeAddress from TopTools is protected;
|
||||||
|
|
||||||
end Context;
|
end Context;
|
||||||
|
|
||||||
|
@ -41,6 +41,14 @@
|
|||||||
#include <Extrema_LocateExtPC.hxx>
|
#include <Extrema_LocateExtPC.hxx>
|
||||||
|
|
||||||
#include <Geom2d_Curve.hxx>
|
#include <Geom2d_Curve.hxx>
|
||||||
|
//
|
||||||
|
#include <Geom2dHatch_Intersector.hxx>
|
||||||
|
#include <BRepTools.hxx>
|
||||||
|
#include <TopExp_Explorer.hxx>
|
||||||
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
|
#include <Geom2d_Curve.hxx>
|
||||||
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function :
|
//function :
|
||||||
@ -58,6 +66,18 @@ IntTools_Context::~IntTools_Context()
|
|||||||
Standard_Address anAdr;
|
Standard_Address anAdr;
|
||||||
Standard_Integer i, aNb;
|
Standard_Integer i, aNb;
|
||||||
//
|
//
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 24 08:01:03 2012f
|
||||||
|
Geom2dHatch_Hatcher* pHatcher;
|
||||||
|
aNb=myHatcherMap.Extent();
|
||||||
|
for (i=1; i<=aNb; ++i) {
|
||||||
|
anAdr=myHatcherMap(i);
|
||||||
|
pHatcher=(Geom2dHatch_Hatcher*)anAdr;
|
||||||
|
delete pHatcher;
|
||||||
|
}
|
||||||
|
myHatcherMap.Clear();
|
||||||
|
//
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 24 08:01:07 2012t
|
||||||
|
//
|
||||||
IntTools_FClass2d* pFClass2d;
|
IntTools_FClass2d* pFClass2d;
|
||||||
aNb=myFClass2dMap.Extent();
|
aNb=myFClass2dMap.Extent();
|
||||||
for (i=1; i<=aNb; ++i) {
|
for (i=1; i<=aNb; ++i) {
|
||||||
@ -114,6 +134,73 @@ IntTools_Context::~IntTools_Context()
|
|||||||
}
|
}
|
||||||
myProjSDataMap.Clear();
|
myProjSDataMap.Clear();
|
||||||
}
|
}
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 24 07:56:45 2012f
|
||||||
|
//=======================================================================
|
||||||
|
//function : Hatcher
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Geom2dHatch_Hatcher& IntTools_Context::Hatcher(const TopoDS_Face& aF)
|
||||||
|
{
|
||||||
|
Standard_Address anAdr;
|
||||||
|
Geom2dHatch_Hatcher* pHatcher;
|
||||||
|
//
|
||||||
|
anAdr=myHatcherMap.FindFromKey1(aF);
|
||||||
|
if (!anAdr) {
|
||||||
|
Standard_Real aTolArcIntr, aTolTangfIntr, aTolHatch2D, aTolHatch3D;
|
||||||
|
Standard_Real aUMin, aUMax, aVMin, aVMax, aU1, aU2, aEpsT;
|
||||||
|
TopAbs_Orientation aOrE;
|
||||||
|
Handle(Geom_Surface) aS;
|
||||||
|
Handle(Geom2d_Curve) aC2D;
|
||||||
|
Handle(Geom2d_TrimmedCurve) aCT2D;
|
||||||
|
TopoDS_Face aFF;
|
||||||
|
TopExp_Explorer aExp;
|
||||||
|
//
|
||||||
|
aTolHatch2D=1.e-8;
|
||||||
|
aTolHatch3D=1.e-8;
|
||||||
|
aTolArcIntr=1.e-10;
|
||||||
|
aTolTangfIntr=1.e-10;
|
||||||
|
aEpsT=Precision::PConfusion();
|
||||||
|
//
|
||||||
|
Geom2dHatch_Intersector aIntr(aTolArcIntr, aTolTangfIntr);
|
||||||
|
pHatcher=new Geom2dHatch_Hatcher(aIntr,
|
||||||
|
aTolHatch2D, aTolHatch3D,
|
||||||
|
Standard_True, Standard_False);
|
||||||
|
|
||||||
|
//
|
||||||
|
aFF=aF;
|
||||||
|
aFF.Orientation(TopAbs_FORWARD);
|
||||||
|
aS=BRep_Tool::Surface(aFF);
|
||||||
|
//BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
|
||||||
|
//
|
||||||
|
aExp.Init (aFF, TopAbs_EDGE);
|
||||||
|
for (; aExp.More() ; aExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE=*((TopoDS_Edge*)&aExp.Current());
|
||||||
|
aOrE=aE.Orientation();
|
||||||
|
//
|
||||||
|
aC2D=BRep_Tool::CurveOnSurface (aE, aFF, aU1, aU2);
|
||||||
|
if (aC2D.IsNull() ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (fabs(aU1-aU2) < aEpsT) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aCT2D=new Geom2d_TrimmedCurve(aC2D, aU1, aU2);
|
||||||
|
pHatcher->AddElement(aCT2D, aOrE);
|
||||||
|
}// for (; aExp.More() ; aExp.Next()) {
|
||||||
|
//
|
||||||
|
anAdr=(Standard_Address)pHatcher;
|
||||||
|
myHatcherMap.Add(aFF, anAdr);
|
||||||
|
}// if (!anAdr) {
|
||||||
|
//
|
||||||
|
else {
|
||||||
|
Standard_Address *pAdr=(Standard_Address *)anAdr;
|
||||||
|
pHatcher=(Geom2dHatch_Hatcher*)*pAdr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *pHatcher;
|
||||||
|
}
|
||||||
|
//modified by NIZNHY-PKV Mon Sep 24 07:56:45 2012t
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FClass2d
|
//function : FClass2d
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -319,12 +406,6 @@ IntTools_Context::~IntTools_Context()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//modified by NIZNHY-PKV Wed Jul 13 08:30:08 2011f
|
|
||||||
//if (!BRep_Tool::IsGeometric(aE2)) {
|
|
||||||
// return -2;
|
|
||||||
//}
|
|
||||||
//modified by NIZNHY-PKV Wed Jul 13 08:30:13 2011t
|
|
||||||
//
|
|
||||||
Standard_Real aTolV1, aTolE2, aTolSum, aTolVx;
|
Standard_Real aTolV1, aTolE2, aTolSum, aTolVx;
|
||||||
Standard_Integer aNbProj;
|
Standard_Integer aNbProj;
|
||||||
gp_Pnt aP;
|
gp_Pnt aP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user