]> OCCT Git - occt-copy.git/commitdiff
0028873: Optimization of HLR CR28873
authorisn <isn@opencascade.com>
Tue, 20 Jun 2017 17:25:11 +0000 (20:25 +0300)
committerisn <isn@opencascade.com>
Tue, 27 Jun 2017 14:45:28 +0000 (17:45 +0300)
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.

14 files changed:
src/AIS/AIS_Shape.cxx
src/BRepTopAdaptor/BRepTopAdaptor_Tool.cxx
src/BRepTopAdaptor/BRepTopAdaptor_Tool.hxx
src/Contap/Contap_ArcFunction.cxx
src/Contap/Contap_HContTool.cxx
src/Contap/Contap_HContTool.hxx
src/Contap/Contap_SurfFunction.cxx
src/HLRBRep/HLRBRep_FaceData.cxx
src/HLRBRep/HLRBRep_FaceData.hxx
src/HLRBRep/HLRBRep_ShapeToHLR.cxx
src/HLRBRep/HLRBRep_ShapeToHLR.hxx
src/HLRTopoBRep/HLRTopoBRep_DSFiller.cxx
src/HLRTopoBRep/HLRTopoBRep_DSFiller.hxx
src/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx

index 1d3cdfc023f9ed7a9472b3e749ac5bb26dd09118..eece0554f9cb610a000b8e01597b273fa3265688 100644 (file)
@@ -286,7 +286,13 @@ void AIS_Shape::Compute(const Handle(Prs3d_Projector)& aProjector,
       OCC_CATCH_SIGNALS
       switch (TypeOfHLR()) {
         case Prs3d_TOH_Algo:
-          StdPrs_HLRShape::Add (aPresentation, SH, myDrawer, aProjector);
+          {
+            OSD_Timer tt;
+            tt.Start();
+            StdPrs_HLRShape::Add (aPresentation, SH, myDrawer, aProjector);
+            tt.Stop();
+            tt.Show();
+          }
           break;
         case Prs3d_TOH_PolyAlgo:
         default:
index 80b7d1432aa383cda62995b9b8ae45071e166396..e717d711b3de09f465683bde997aecd753fa4ca3 100644 (file)
@@ -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);
   }
index a824fbf5bd3fc915fecf0261cbff55ef970d77cc..1535c7f71f3b68e6ebff85f49d9f46cbc46688f2 100644 (file)
@@ -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()
index df4ef249e1527c75490df8b47ba98bb7f1884e4d..48b97428a9626e0f84e5e3e8bfdcf6302eed5a05 100644 (file)
@@ -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);
index 9589cce59f3d2ad79d28963e20b10c47f471683c..94a420a4985817fb195cca6e416d3253b35838ca 100644 (file)
@@ -24,8 +24,6 @@
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 
-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;
index 6868bc7e0ef49f1c29ac270b2f29e06825b5be63..df9ab2904d40be45d29edae1e61676e6184346b5 100644 (file)
@@ -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.
index 6645815fb3e2499788a719a3d1840dd424bd64ee..2b0994bc67b744a76c89a5ea005496509f9844f3 100644 (file)
@@ -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);
index d3610aa8ac9e2789bb3800e65efb66b36b1d02c0..1a3b6afe440aec54c4f7d1d7adedb6b4ea445034 100644 (file)
@@ -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);
index 89acfd2c30e68b067dad0165a92ed0768e80c5d9..4a7cbf3b0c31614bbbd5cbfc34e32f35e2672143 100644 (file)
@@ -46,7 +46,7 @@ public:
   //! if the face  belongs to a  closed  volume. <NW> 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 <NE> the number  of  edges of the wire  number
   //! <WI>.
index fd33f6477346b66f15f071aa6ebc38f8b84d8eed..ae8f4af5f2a1df4055beeeabd799cf8f02903857 100644 (file)
@@ -39,6 +39,7 @@
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
+#include <OSD_Parallel.hxx>
 
 //=======================================================================
 // Function : Load
@@ -173,7 +174,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,
@@ -193,7 +194,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()) {
@@ -234,15 +235,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 (); 
@@ -276,7 +309,7 @@ HLRBRep_ShapeToHLR::ExploreShape (const Handle(HLRTopoBRep_OutLiner)& S,
       delete [] flag;
       flag = NULL;
     }
-      
+
     for (exface.Init(exshell.Current(), TopAbs_FACE);
         exface.More(); 
         exface.Next()) {
index 2bf844c6fc9ff7b81ee157bd887f3521f644642f..150d206bdb779453a5fc8cbffddea07eeda40df2 100644 (file)
@@ -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);
 
 
 
index d07d2d8f7976ffbdd99442ef123b040b0c3e3d54..ccb2c74235ba65900cc3bb465c95e4ec77e8378d 100644 (file)
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <HLRAlgo_Projector.hxx>
+#include <Adaptor3d_HSurface.hxx>
+#include <NCollection_Handle.hxx>
+#include <BRepAdaptor_HSurface.hxx>
+#include <OSD_Parallel.hxx>
+
+struct ContourSurfInfo
+{
+  ContourSurfInfo() : myDomain(NULL), mySurface(NULL)
+  {};
+
+  ContourSurfInfo(NCollection_Handle<Contap_Contour> 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<Contap_Contour> 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<ContourSurfInfo>& 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<ContourSurfInfo>& myContourSurfInfo; 
+};
+
+
+class ParallelBRTInitFunctor
+{
+public:
+
+  ParallelBRTInitFunctor(NCollection_Array1<BRTInfo>& 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<BRTInfo>& 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<ContourSurfInfo> ContourSurfInfoList;
+  NCollection_List<BRTInfo> 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<Contap_Contour> 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<BRTInfo>::Iterator itBRTIt(nonInitBRTs);
+  NCollection_Array1<BRTInfo> 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<ContourSurfInfo>::Iterator itCS(ContourSurfInfoList);
+  int nbC = ContourSurfInfoList.Extent();  
+  f = 1;
+  NCollection_Array1<ContourSurfInfo> 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)
 {
index 1b1227d0cbef4863f79f003457ea50b5fe2bc563..fd09408632e7ab2b1b33c421bdd4b83561e51751 100644 (file)
@@ -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 <DS> the outlines of  <S> using the current
   //! outliner and stores the isolines in <DS> 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 <DS> the outlines of  <F> 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 <P>and
   //! store it in the data structure <DS>.
index ee010a730aa20c1941b837290f78fa8798a563e3..8b154b9a0c1d49eaa0793ad49a88ceb93dc7a3f7 100644 (file)
@@ -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);
     }
   }