From a27278885fede4df1eac74656885d6362caad577 Mon Sep 17 00:00:00 2001 From: isn Date: Tue, 20 Jun 2017 20:25:11 +0300 Subject: [PATCH] 0028873: Optimization of HLR draft version. Parallelization of: 1) contour's building, 2) BRep-adaptor creation of original shapes, 3) BRep-adaptor creation of outlined shapes Also, some code re-factoring/re-design to provide the thread-safety of Contap functions. --- src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx | 4 +- src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx | 4 +- src/Contap/Contap_ArcFunction.cxx | 5 +- src/Contap/Contap_HContTool.cxx | 10 +- src/Contap/Contap_HContTool.hxx | 5 +- src/Contap/Contap_SurfFunction.cxx | 5 +- src/HLRBRep/HLRBRep_FaceData.cxx | 6 +- src/HLRBRep/HLRBRep_FaceData.hxx | 2 +- src/HLRBRep/HLRBRep_ShapeToHLR.cxx | 43 ++++- src/HLRBRep/HLRBRep_ShapeToHLR.hxx | 4 +- src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx | 193 ++++++++++++++++++--- src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx | 5 +- src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx | 12 +- 13 files changed, 236 insertions(+), 62 deletions(-) diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx index 80b7d1432a..e717d711b3 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx @@ -67,7 +67,7 @@ void BRepTopAdaptor_Tool::Init(const Handle(Adaptor3d_HSurface)& surface, myloaded=Standard_True; } -Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() { +Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() const{ if(myloaded) { return(myTopolTool); } @@ -79,7 +79,7 @@ Handle(BRepTopAdaptor_TopolTool) BRepTopAdaptor_Tool::GetTopolTool() { } } -Handle(Adaptor3d_HSurface) BRepTopAdaptor_Tool::GetSurface() { +Handle(Adaptor3d_HSurface) BRepTopAdaptor_Tool::GetSurface() const{ if(myloaded) { return(myHSurface); } diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx index a824fbf5bd..1535c7f71f 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx @@ -46,11 +46,11 @@ public: Standard_EXPORT void Init (const Handle(Adaptor3d_HSurface)& Surface, const Standard_Real Tol2d); - Standard_EXPORT Handle(BRepTopAdaptor_TopolTool) GetTopolTool(); + Standard_EXPORT Handle(BRepTopAdaptor_TopolTool) GetTopolTool() const; Standard_EXPORT void SetTopolTool (const Handle(BRepTopAdaptor_TopolTool)& TT); - Standard_EXPORT Handle(Adaptor3d_HSurface) GetSurface(); + Standard_EXPORT Handle(Adaptor3d_HSurface) GetSurface() const; Standard_EXPORT void Destroy(); ~BRepTopAdaptor_Tool() diff --git a/src/Contap/Contap_ArcFunction.cxx b/src/Contap/Contap_ArcFunction.cxx index df4ef249e1..48b97428a9 100644 --- a/src/Contap/Contap_ArcFunction.cxx +++ b/src/Contap/Contap_ArcFunction.cxx @@ -36,14 +36,15 @@ void Contap_ArcFunction::Set(const Handle(Adaptor3d_HSurface)& S) { mySurf = S; Standard_Integer i; - Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S); + Standard_Real uinf, vinf, usup, vsup; + Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S, uinf, vinf, usup, vsup); Standard_Real U,V; // gp_Vec d1u,d1v; gp_Vec norm; if (nbs > 0) { myMean = 0.; for (i = 1; i <= nbs; i++) { - Contap_HContTool::SamplePoint(S,i,U,V); + Contap_HContTool::SamplePoint(S,i,U,V, uinf, vinf, usup, vsup); // Adaptor3d_HSurfaceTool::D1(S,U,V,solpt,d1u,d1v); // myMean = myMean + d1u.Crossed(d1v).Magnitude(); Contap_SurfProps::Normale(S,U,V,solpt,norm); diff --git a/src/Contap/Contap_HContTool.cxx b/src/Contap/Contap_HContTool.cxx index 9589cce59f..94a420a498 100644 --- a/src/Contap/Contap_HContTool.cxx +++ b/src/Contap/Contap_HContTool.cxx @@ -24,8 +24,6 @@ #include #include -static Standard_Real uinf,vinf,usup,vsup; - Standard_Integer Contap_HContTool::NbSamplesV (const Handle(Adaptor3d_HSurface)& S, const Standard_Real , @@ -125,7 +123,7 @@ Standard_Integer Contap_HContTool::NbSamplesU } Standard_Integer Contap_HContTool::NbSamplePoints -(const Handle(Adaptor3d_HSurface)& S) +(const Handle(Adaptor3d_HSurface)& S, Standard_Real& uinf, Standard_Real& vinf, Standard_Real& usup, Standard_Real& vsup) { uinf = S->FirstUParameter(); usup = S->LastUParameter(); @@ -175,7 +173,11 @@ Standard_Integer Contap_HContTool::NbSamplePoints void Contap_HContTool::SamplePoint (const Handle(Adaptor3d_HSurface)& S, const Standard_Integer Index, Standard_Real& U, - Standard_Real& V ) + Standard_Real& V, + const Standard_Real& uinf, + const Standard_Real& vinf, + const Standard_Real& usup, + const Standard_Real& vsup) { if(S->GetType() == GeomAbs_BSplineSurface) { Standard_Integer nbIntU = NbSamplesU(S,uinf,usup)/3; diff --git a/src/Contap/Contap_HContTool.hxx b/src/Contap/Contap_HContTool.hxx index 6868bc7e0e..df9ab2904d 100644 --- a/src/Contap/Contap_HContTool.hxx +++ b/src/Contap/Contap_HContTool.hxx @@ -44,9 +44,10 @@ public: Standard_EXPORT static Standard_Integer NbSamplesV (const Handle(Adaptor3d_HSurface)& S, const Standard_Real v1, const Standard_Real v2); - Standard_EXPORT static Standard_Integer NbSamplePoints (const Handle(Adaptor3d_HSurface)& S); + Standard_EXPORT static Standard_Integer NbSamplePoints (const Handle(Adaptor3d_HSurface)& S, Standard_Real& uinf, Standard_Real& vinf, Standard_Real& usup, Standard_Real& vsup); - Standard_EXPORT static void SamplePoint (const Handle(Adaptor3d_HSurface)& S, const Standard_Integer Index, Standard_Real& U, Standard_Real& V); + Standard_EXPORT static void SamplePoint (const Handle(Adaptor3d_HSurface)& S, const Standard_Integer Index, Standard_Real& U, Standard_Real& V, + const Standard_Real& uinf, const Standard_Real& vinf, const Standard_Real& usup, const Standard_Real& vsup); //! Returns True if all the intersection point and edges //! are known on the Arc. diff --git a/src/Contap/Contap_SurfFunction.cxx b/src/Contap/Contap_SurfFunction.cxx index 6645815fb3..2b0994bc67 100644 --- a/src/Contap/Contap_SurfFunction.cxx +++ b/src/Contap/Contap_SurfFunction.cxx @@ -42,13 +42,14 @@ void Contap_SurfFunction::Set(const Handle(Adaptor3d_HSurface)& S) { mySurf = S; Standard_Integer i; - Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S); + Standard_Real uinf,vinf,usup,vsup; + Standard_Integer nbs = Contap_HContTool::NbSamplePoints(S,uinf,vinf,usup,vsup); Standard_Real U,V; gp_Vec norm; if (nbs > 0) { myMean = 0.; for (i = 1; i <= nbs; i++) { - Contap_HContTool::SamplePoint(S,i,U,V); + Contap_HContTool::SamplePoint(S,i,U,V,uinf,vinf,usup,vsup); // Adaptor3d_HSurfaceTool::D1(S,U,V,solpt,d1u,d1v); // myMean = myMean + d1u.Crossed(d1v).Magnitude(); Contap_SurfProps::Normale(S,U,V,solpt,norm); diff --git a/src/HLRBRep/HLRBRep_FaceData.cxx b/src/HLRBRep/HLRBRep_FaceData.cxx index d3610aa8ac..1a3b6afe44 100644 --- a/src/HLRBRep/HLRBRep_FaceData.cxx +++ b/src/HLRBRep/HLRBRep_FaceData.cxx @@ -38,10 +38,12 @@ myFlags(0),mySize(0) void HLRBRep_FaceData::Set (const TopoDS_Face& FG, const TopAbs_Orientation Or, const Standard_Boolean Cl, - const Standard_Integer NW) + const Standard_Integer NW, + const Standard_Boolean isInitSurf) //TODO isInitSurf can be deleted { Closed(Cl); - Geometry().Surface(FG); + if (isInitSurf) + Geometry().Surface(FG); myTolerance = (Standard_ShortReal)(BRep_Tool::Tolerance(FG)); Orientation(Or); Wires() = new HLRAlgo_WiresBlock(NW); diff --git a/src/HLRBRep/HLRBRep_FaceData.hxx b/src/HLRBRep/HLRBRep_FaceData.hxx index 89acfd2c30..4a7cbf3b0c 100644 --- a/src/HLRBRep/HLRBRep_FaceData.hxx +++ b/src/HLRBRep/HLRBRep_FaceData.hxx @@ -46,7 +46,7 @@ public: //! if the face belongs to a closed volume. is //! the number of wires ( or block of edges ) of the //! face. - Standard_EXPORT void Set (const TopoDS_Face& FG, const TopAbs_Orientation Or, const Standard_Boolean Cl, const Standard_Integer NW); + Standard_EXPORT void Set (const TopoDS_Face& FG, const TopAbs_Orientation Or, const Standard_Boolean Cl, const Standard_Integer NW, const Standard_Boolean isInitSurf); //! Set the number of edges of the wire number //! . diff --git a/src/HLRBRep/HLRBRep_ShapeToHLR.cxx b/src/HLRBRep/HLRBRep_ShapeToHLR.cxx index 052579682c..465f1a51b4 100644 --- a/src/HLRBRep/HLRBRep_ShapeToHLR.cxx +++ b/src/HLRBRep/HLRBRep_ShapeToHLR.cxx @@ -38,6 +38,7 @@ #include #include #include +#include //======================================================================= // Function : Load @@ -172,7 +173,7 @@ HLRBRep_ShapeToHLR::Load(const Handle(HLRTopoBRep_OutLiner)& S, void HLRBRep_ShapeToHLR::ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S, - const Handle(HLRBRep_Data)& DS, + Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM, Standard_Integer& i, @@ -192,7 +193,7 @@ HLRBRep_ShapeToHLR::ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S, for (Ex1.Init(theFace, TopAbs_WIRE); Ex1.More(); Ex1.Next()) nw++; - fd.Set (theFace, orient, closed, nw); + fd.Set (theFace, orient, closed, nw, Standard_False); nw = 0; for (Ex1.Init(theFace, TopAbs_WIRE); Ex1.More(); Ex1.Next()) { @@ -233,15 +234,47 @@ HLRBRep_ShapeToHLR::ExploreFace(const Handle(HLRTopoBRep_OutLiner)& S, //purpose : //======================================================================= + +class ParallelSurfInitFunctor +{ +public: + + ParallelSurfInitFunctor(HLRBRep_Array1OfFData& theFaceDataArr, const TopTools_IndexedMapOfShape& theFM) + : myFaceDataArr (theFaceDataArr), myFM (theFM) + { + } + + void operator() (const Standard_Integer theIndex) const + { + const TopoDS_Face& aF = TopoDS::Face(myFM(theIndex)); + HLRBRep_FaceData& fd = myFaceDataArr.ChangeValue(theIndex); + fd.Geometry().Surface( TopoDS::Face(aF.Oriented (TopAbs_FORWARD))); + } + +private: + ParallelSurfInitFunctor( const ParallelSurfInitFunctor& ); + ParallelSurfInitFunctor& operator =( ParallelSurfInitFunctor& ); + +private: + HLRBRep_Array1OfFData& myFaceDataArr; + const TopTools_IndexedMapOfShape& myFM; +}; + + void HLRBRep_ShapeToHLR::ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, - const Handle(HLRBRep_Data)& DS, + Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM) { TopTools_MapOfShape ShapeMap; TopExp_Explorer exshell, exface, exedge; - Standard_Integer i = 0; + Standard_Integer i = 1; + + ParallelSurfInitFunctor aFunctor2(DS->FDataArray(), FM); + OSD_Parallel::For(1, FM.Extent() + 1, aFunctor2, false); + + i = 0; for (exshell.Init (S->OriginalShape(), TopAbs_SHELL); exshell.More (); @@ -275,7 +308,7 @@ HLRBRep_ShapeToHLR::ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, delete [] flag; flag = NULL; } - + for (exface.Init(exshell.Current(), TopAbs_FACE); exface.More(); exface.Next()) { diff --git a/src/HLRBRep/HLRBRep_ShapeToHLR.hxx b/src/HLRBRep/HLRBRep_ShapeToHLR.hxx index 2bf844c6fc..150d206bdb 100644 --- a/src/HLRBRep/HLRBRep_ShapeToHLR.hxx +++ b/src/HLRBRep/HLRBRep_ShapeToHLR.hxx @@ -57,9 +57,9 @@ protected: private: - Standard_EXPORT static void ExploreFace (const Handle(HLRTopoBRep_OutLiner)& S, const Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM, Standard_Integer& i, const TopoDS_Face& F, const Standard_Boolean closed); + Standard_EXPORT static void ExploreFace (const Handle(HLRTopoBRep_OutLiner)& S, Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM, Standard_Integer& i, const TopoDS_Face& F, const Standard_Boolean closed); - Standard_EXPORT static void ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, const Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM); + Standard_EXPORT static void ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S, Handle(HLRBRep_Data)& DS, const TopTools_IndexedMapOfShape& FM, const TopTools_IndexedMapOfShape& EM); diff --git a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx index d07d2d8f79..ccb2c74235 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx @@ -62,14 +62,106 @@ #include #include #include +#include +#include +#include +#include +#include + +struct ContourSurfInfo +{ + ContourSurfInfo() : myDomain(NULL), mySurface(NULL) + {}; + + ContourSurfInfo(NCollection_Handle theHFO, + const Handle(BRepTopAdaptor_TopolTool)& theDomain, + const Handle(Adaptor3d_HSurface) theSurface) : + myHFO(theHFO), myDomain (theDomain.get()), mySurface (theSurface.get()) + {}; + + ContourSurfInfo& operator=( const ContourSurfInfo& otherSurfInfo) + { + myHFO = otherSurfInfo.myHFO; + myDomain = otherSurfInfo.myDomain; + mySurface = otherSurfInfo.mySurface; + return *this; + }; + + NCollection_Handle myHFO; + const BRepTopAdaptor_TopolTool* myDomain; + const Adaptor3d_HSurface* mySurface; +}; + +struct BRTInfo +{ + BRTInfo() + {}; + + BRTInfo(BRepTopAdaptor_Tool* thepBRT, ContourSurfInfo* theCSI, const TopoDS_Face& theF ) + : mypBRT (thepBRT), myCSI (theCSI), myF (theF) + {}; + + BRepTopAdaptor_Tool* mypBRT; + ContourSurfInfo* myCSI; + TopoDS_Face myF; +}; + +class ParallelContourFunctor +{ +public: + + ParallelContourFunctor(NCollection_Array1& theContourSurfInfo) + : myContourSurfInfo (theContourSurfInfo) + { + } + + void operator() (const Standard_Integer theIndex) const + { + ContourSurfInfo& aCSInfo = myContourSurfInfo(theIndex); + aCSInfo.myHFO->Perform(aCSInfo.mySurface, aCSInfo.myDomain); + } + +private: + ParallelContourFunctor( const ParallelContourFunctor& ); + ParallelContourFunctor& operator =( ParallelContourFunctor& ); + +private: + NCollection_Array1& myContourSurfInfo; +}; + + +class ParallelBRTInitFunctor +{ +public: + + ParallelBRTInitFunctor(NCollection_Array1& theBRTInfo) + : myBRTInfo (theBRTInfo) + { + } + + void operator() (const Standard_Integer theIndex) const + { + BRTInfo& BI = myBRTInfo(theIndex); + BI.mypBRT->Init(BI.myF,Precision::PConfusion()); + BI.myCSI->myDomain = BI.mypBRT->GetTopolTool().get(); + BI.myCSI->mySurface = BI.mypBRT->GetSurface().get(); + } + +private: + ParallelBRTInitFunctor( const ParallelBRTInitFunctor& ); + ParallelBRTInitFunctor& operator =( ParallelBRTInitFunctor& ); + +private: + NCollection_Array1& myBRTInfo; +}; //======================================================================= //function : Insert //purpose : explore the faces and insert them //======================================================================= - void HLRTopoBRep_DSFiller::Insert (const TopoDS_Shape& S, - Contap_Contour& FO, + const HLRAlgo_Projector& P, + const gp_Vec& Vecz, HLRTopoBRep_Data& DS, BRepTopAdaptor_MapOfShapeTool& MST, const Standard_Integer nbIso) @@ -78,35 +170,86 @@ void HLRTopoBRep_DSFiller::Insert (const TopoDS_Shape& S, TopExp_Explorer ex(S,TopAbs_FACE); DS.Clear(); Standard_Boolean withPCurve = Standard_True; // instead of nbIso != 0; - Standard_Integer f = 0; - - while (ex.More()) { - if (ShapeMap.Add(ex.Current())) { - f++; + + gp_Pnt Eye; + gp_Dir DirZ; + if (P.Perspective ()) + Eye.SetXYZ (P.Focus ()*Vecz.XYZ ()); + else + DirZ = Vecz; + + NCollection_List ContourSurfInfoList; + NCollection_List nonInitBRTs; + + while (ex.More()) + { + if (ShapeMap.Add(ex.Current())) + { TopoDS_Face S1 = TopoDS::Face(ex.Current()); S1.Orientation(TopAbs_FORWARD); - Handle(BRepTopAdaptor_TopolTool) Domain; - Handle(Adaptor3d_HSurface) Surface; - if(MST.IsBound(S1)) { - BRepTopAdaptor_Tool& BRT = MST.ChangeFind(S1); - Domain = BRT.GetTopolTool(); - Surface = BRT.GetSurface(); - } - else { - BRepTopAdaptor_Tool BRT(S1,Precision::PConfusion()); - MST.Bind(S1,BRT); - Domain = BRT.GetTopolTool(); - Surface = BRT.GetSurface(); + // + NCollection_Handle HFO = new Contap_Contour(); + if (P.Perspective ()) + HFO->Init(Eye); + else + HFO->Init(DirZ); + // + BRepTopAdaptor_Tool* pBRT = MST.ChangeSeek(S1); + if(pBRT) + { + ContourSurfInfo CSInfo(HFO, pBRT->GetTopolTool(), pBRT->GetSurface()); + ContourSurfInfoList.Append(CSInfo); } - FO.Perform(Surface, Domain); - if (FO.IsDone()) { - if (!FO.IsEmpty()) - InsertFace(f,S1,FO,DS,withPCurve); + else + { + pBRT = MST.Bound(S1,BRepTopAdaptor_Tool()); + BRTInfo& brtI = nonInitBRTs.Append(BRTInfo()); + brtI.mypBRT = pBRT; + brtI.myCSI = &ContourSurfInfoList.Append(ContourSurfInfo(HFO, NULL, NULL)); + brtI.myF = S1; } - if (nbIso != 0) HLRTopoBRep_FaceIsoLiner::Perform(f,S1,DS,nbIso); } ex.Next(); } + + // + NCollection_List::Iterator itBRTIt(nonInitBRTs); + NCollection_Array1 nonInitBRTArr(1, nonInitBRTs.Extent()); + Standard_Integer f = 1; + for (;itBRTIt.More();itBRTIt.Next(), f++) + nonInitBRTArr(f) = itBRTIt.Value(); + + ParallelBRTInitFunctor aFunctor1(nonInitBRTArr); + OSD_Parallel::For(nonInitBRTArr.Lower(), nonInitBRTArr.Upper() + 1, aFunctor1, false); + // + + // + NCollection_List::Iterator itCS(ContourSurfInfoList); + int nbC = ContourSurfInfoList.Extent(); + f = 1; + NCollection_Array1 aContourSurfInfoArray(1, nbC); + for (;itCS.More();itCS.Next(), f++) + aContourSurfInfoArray(f) = itCS.Value(); + + // + ParallelContourFunctor aFunctor(aContourSurfInfoArray); + OSD_Parallel::For(aContourSurfInfoArray.Lower(), aContourSurfInfoArray.Upper() + 1, aFunctor, false); + // + + for (f = aContourSurfInfoArray.Lower(); f <= aContourSurfInfoArray.Upper(); f++) + { + ContourSurfInfo& CSInfo = aContourSurfInfoArray(f); + Handle(BRepAdaptor_HSurface) BrepSurf = Handle(BRepAdaptor_HSurface)::DownCast(CSInfo.mySurface); + const TopoDS_Face& S1 = BrepSurf->ChangeSurface().Face(); + if (CSInfo.myHFO->IsDone()) + if (!CSInfo.myHFO->IsEmpty()) + InsertFace(f,S1,*CSInfo.myHFO,DS,withPCurve); + + if (nbIso != 0) + HLRTopoBRep_FaceIsoLiner::Perform(f,S1,DS,nbIso); + } + + // ProcessEdges(DS); } @@ -117,7 +260,7 @@ void HLRTopoBRep_DSFiller::Insert (const TopoDS_Shape& S, void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/, const TopoDS_Face& F, - Contap_Contour& FO, + const Contap_Contour& FO, HLRTopoBRep_Data& DS, const Standard_Boolean withPCurve) { diff --git a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx index 1b1227d0cb..fd09408632 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx +++ b/src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx @@ -32,6 +32,7 @@ class TopoDS_Face; class TopoDS_Vertex; class Contap_Point; class TopoDS_Edge; +class HLRAlgo_Projector; //! Provides methods to fill a HLRTopoBRep_Data. @@ -44,7 +45,7 @@ public: //! Stores in the outlines of using the current //! outliner and stores the isolines in using a Hatcher. - Standard_EXPORT static void Insert (const TopoDS_Shape& S, Contap_Contour& FO, HLRTopoBRep_Data& DS, BRepTopAdaptor_MapOfShapeTool& MST, const Standard_Integer nbIso); + Standard_EXPORT static void Insert (const TopoDS_Shape& S,const HLRAlgo_Projector& P, const gp_Vec& Vecz, HLRTopoBRep_Data& DS, BRepTopAdaptor_MapOfShapeTool& MST, const Standard_Integer nbIso); @@ -60,7 +61,7 @@ private: //! Stores in the outlines of using the current //! outliner. - Standard_EXPORT static void InsertFace (const Standard_Integer FI, const TopoDS_Face& F, Contap_Contour& FO, HLRTopoBRep_Data& DS, const Standard_Boolean withPCurve); + Standard_EXPORT static void InsertFace (const Standard_Integer FI, const TopoDS_Face& F, const Contap_Contour& FO, HLRTopoBRep_Data& DS, const Standard_Boolean withPCurve); //! Make a vertex from an intersection point

and //! store it in the data structure . diff --git a/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx b/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx index 73bd04fcd2..62d979ae6a 100644 --- a/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx +++ b/src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx @@ -82,17 +82,7 @@ void HLRTopoBRep_OutLiner::Fill(const HLRAlgo_Projector& P, gp_Trsf Tr (P.Transformation ()); Tr.Invert (); Vecz.Transform (Tr); - Contap_Contour FO; - if (P.Perspective ()) { - gp_Pnt Eye; - Eye.SetXYZ (P.Focus ()*Vecz.XYZ ()); - FO.Init(Eye); - } - else { - gp_Dir DirZ(Vecz); - FO.Init(DirZ); - } - HLRTopoBRep_DSFiller::Insert(myOriginalShape,FO,myDS,MST,nbIso); + HLRTopoBRep_DSFiller::Insert(myOriginalShape,P,Vecz,myDS,MST,nbIso); BuildShape(MST); } } -- 2.39.5