Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:20:05

0001 // Created on: 1992-02-18
0002 // Created by: Christophe MARION
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _HLRBRep_PolyAlgo_HeaderFile
0018 #define _HLRBRep_PolyAlgo_HeaderFile
0019 
0020 #include <BRepAdaptor_Surface.hxx>
0021 #include <BRepAdaptor_Curve.hxx>
0022 #include <BRepAdaptor_Curve2d.hxx>
0023 #include <GeomAbs_Shape.hxx>
0024 #include <HLRAlgo_TriangleData.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <HLRAlgo_PolyInternalSegment.hxx>
0027 #include <HLRAlgo_PolyInternalNode.hxx>
0028 #include <HLRAlgo_BiPoint.hxx>
0029 #include <NCollection_List.hxx>
0030 #include <HLRAlgo_PolyAlgo.hxx>
0031 #include <HLRAlgo_Projector.hxx>
0032 #include <Standard_Integer.hxx>
0033 #include <TopTools_ShapeMapHasher.hxx>
0034 #include <NCollection_IndexedMap.hxx>
0035 #include <TopoDS_Shape.hxx>
0036 #include <NCollection_Map.hxx>
0037 #include <NCollection_Sequence.hxx>
0038 
0039 class Geom_Surface;
0040 class TopoDS_Edge;
0041 class HLRAlgo_PolyInternalData;
0042 class HLRAlgo_EdgeStatus;
0043 struct HLRAlgo_TriangleData;
0044 
0045 //! to remove Hidden lines on Shapes with Triangulations.
0046 //! A framework to compute the shape as seen in
0047 //! a projection plane. This is done by calculating
0048 //! the visible and the hidden parts of the shape.
0049 //! HLRBRep_PolyAlgo works with three types of entity:
0050 //! -   shapes to be visualized (these shapes must
0051 //! have already been triangulated.)
0052 //! -   edges in these shapes (these edges are
0053 //! defined as polygonal lines on the
0054 //! triangulation of the shape, and are the basic
0055 //! entities which will be visualized or hidden), and
0056 //! -   triangles in these shapes which hide the edges.
0057 //! HLRBRep_PolyAlgo is based on the principle
0058 //! of comparing each edge of the shape to be
0059 //! visualized with each of the triangles produced
0060 //! by the triangulation of the shape, and
0061 //! calculating the visible and the hidden parts of each edge.
0062 //! For a given projection, HLRBRep_PolyAlgo
0063 //! calculates a set of lines characteristic of the
0064 //! object being represented. It is also used in
0065 //! conjunction with the HLRBRep_PolyHLRToShape extraction
0066 //! utilities, which reconstruct a new, simplified
0067 //! shape from a selection of calculation results.
0068 //! This new shape is made up of edges, which
0069 //! represent the shape visualized in the projection.
0070 //! HLRBRep_PolyAlgo works with a polyhedral
0071 //! simplification of the shape whereas
0072 //! HLRBRep_Algo takes the shape itself into
0073 //! account. When you use HLRBRep_Algo, you
0074 //! obtain an exact result, whereas, when you use
0075 //! HLRBRep_PolyAlgo, you reduce computation
0076 //! time but obtain polygonal segments.
0077 //! An HLRBRep_PolyAlgo object provides a framework for:
0078 //! -   defining the point of view
0079 //! -   identifying the shape or shapes to be visualized
0080 //! -   calculating the outlines
0081 //! -   calculating the visible and hidden lines of the shape.
0082 //! Warning
0083 //! -   Superimposed lines are not eliminated by this algorithm.
0084 //! -   There must be no unfinished objects inside the shape you wish to visualize.
0085 //! -   Points are not treated.
0086 //! -   Note that this is not the sort of algorithm
0087 //! used in generating shading, which calculates
0088 //! the visible and hidden parts of each face in a
0089 //! shape to be visualized by comparing each
0090 //! face in the shape with every other face in the same shape.
0091 class HLRBRep_PolyAlgo : public Standard_Transient
0092 {
0093 
0094 public:
0095   //! Constructs an empty framework for the
0096   //! calculation of the visible and hidden lines of a shape in a projection.
0097   //! Use the functions:
0098   //! -   Projector to define the point of view
0099   //! -   Load to select the shape or shapes to be visualized
0100   //! -   Update to compute the visible and hidden lines of the shape.
0101   //! Warning
0102   //! The shape or shapes to be visualized must have already been triangulated.
0103   Standard_EXPORT HLRBRep_PolyAlgo();
0104 
0105   Standard_EXPORT HLRBRep_PolyAlgo(const occ::handle<HLRBRep_PolyAlgo>& A);
0106 
0107   Standard_EXPORT HLRBRep_PolyAlgo(const TopoDS_Shape& S);
0108 
0109   int NbShapes() const { return myShapes.Length(); }
0110 
0111   Standard_EXPORT TopoDS_Shape& Shape(const int I);
0112 
0113   //! remove the Shape of Index <I>.
0114   Standard_EXPORT void Remove(const int I);
0115 
0116   //! return the index of the Shape <S> and return 0 if
0117   //! the Shape <S> is not found.
0118   Standard_EXPORT int Index(const TopoDS_Shape& S) const;
0119 
0120   //! Loads the shape S into this framework.
0121   //! Warning S must have already been triangulated.
0122   void Load(const TopoDS_Shape& theShape) { myShapes.Append(theShape); }
0123 
0124   const occ::handle<HLRAlgo_PolyAlgo>& Algo() const { return myAlgo; }
0125 
0126   //! Sets the parameters of the view for this framework.
0127   //! These parameters are defined by an HLRAlgo_Projector object,
0128   //! which is returned by the Projector function on a Prs3d_Projector object.
0129   const HLRAlgo_Projector& Projector() const { return myProj; }
0130 
0131   void Projector(const HLRAlgo_Projector& theProj) { myProj = theProj; }
0132 
0133   double TolAngular() const { return myTolAngular; }
0134 
0135   void TolAngular(const double theTol) { myTolAngular = theTol; }
0136 
0137   double TolCoef() const { return myTolSta; }
0138 
0139   void TolCoef(const double theTol)
0140   {
0141     myTolSta = theTol;
0142     myTolEnd = 1.0 - theTol;
0143   }
0144 
0145   //! Launches calculation of outlines of the shape
0146   //! visualized by this framework. Used after setting the point of view and
0147   //! defining the shape or shapes to be visualized.
0148   Standard_EXPORT void Update();
0149 
0150   void InitHide() { myAlgo->InitHide(); }
0151 
0152   bool MoreHide() const { return myAlgo->MoreHide(); }
0153 
0154   void NextHide() { myAlgo->NextHide(); }
0155 
0156   Standard_EXPORT HLRAlgo_BiPoint::PointsT& Hide(HLRAlgo_EdgeStatus& status,
0157                                                  TopoDS_Shape&       S,
0158                                                  bool&               reg1,
0159                                                  bool&               regn,
0160                                                  bool&               outl,
0161                                                  bool&               intl);
0162 
0163   void InitShow() { myAlgo->InitShow(); }
0164 
0165   bool MoreShow() const { return myAlgo->MoreShow(); }
0166 
0167   void NextShow() { myAlgo->NextShow(); }
0168 
0169   Standard_EXPORT HLRAlgo_BiPoint::PointsT& Show(TopoDS_Shape& S,
0170                                                  bool&         reg1,
0171                                                  bool&         regn,
0172                                                  bool&         outl,
0173                                                  bool&         intl);
0174 
0175   //! Make a shape with the internal outlines in each
0176   //! face.
0177   Standard_EXPORT TopoDS_Shape OutLinedShape(const TopoDS_Shape& S) const;
0178 
0179   bool Debug() const { return myDebug; }
0180 
0181   void Debug(const bool theDebug) { myDebug = theDebug; }
0182 
0183   DEFINE_STANDARD_RTTIEXT(HLRBRep_PolyAlgo, Standard_Transient)
0184 
0185 private:
0186   Standard_EXPORT TopoDS_Shape MakeShape() const;
0187 
0188   Standard_EXPORT int InitShape(const TopoDS_Shape& Shape, bool& IsoledF, bool& IsoledE);
0189 
0190   Standard_EXPORT void StoreShell(
0191     const TopoDS_Shape&                                        theShape,
0192     int&                                                       theIShell,
0193     NCollection_Array1<occ::handle<HLRAlgo_PolyShellData>>&    theShell,
0194     const bool                                                 theIsoledF,
0195     const bool                                                 theIsoledE,
0196     NCollection_Array1<int>&                                   theES,
0197     NCollection_Array1<occ::handle<HLRAlgo_PolyData>>&         thePD,
0198     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID,
0199     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>&    theShapeMap1,
0200     NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>&    theShapeMap2);
0201 
0202   Standard_EXPORT bool Normal(const int                                        theINode,
0203                               HLRAlgo_PolyInternalNode::NodeIndices&           theNodIndices,
0204                               HLRAlgo_PolyInternalNode::NodeData&              theNod1RValues,
0205                               NCollection_Array1<HLRAlgo_TriangleData>&        theTData,
0206                               NCollection_Array1<HLRAlgo_PolyInternalSegment>& thePISeg,
0207                               NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod,
0208                               const bool orient) const;
0209 
0210   Standard_EXPORT bool AverageNormal(
0211     const int                                                  theINode,
0212     HLRAlgo_PolyInternalNode::NodeIndices&                     theNodeIndices,
0213     NCollection_Array1<HLRAlgo_TriangleData>&                  theTData,
0214     NCollection_Array1<HLRAlgo_PolyInternalSegment>&           thePISeg,
0215     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod,
0216     double&                                                    theX,
0217     double&                                                    theY,
0218     double&                                                    theZ) const;
0219 
0220   bool AverageNormal(const int                                                  theINode,
0221                      HLRAlgo_PolyInternalNode::NodeIndices&                     theNodeIndices,
0222                      NCollection_Array1<HLRAlgo_TriangleData>&                  theTData,
0223                      NCollection_Array1<HLRAlgo_PolyInternalSegment>&           thePISeg,
0224                      NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod,
0225                      gp_XYZ&                                                    theNormal) const
0226   {
0227     return AverageNormal(theINode,
0228                          theNodeIndices,
0229                          theTData,
0230                          thePISeg,
0231                          thePINod,
0232                          theNormal.ChangeCoord(1),
0233                          theNormal.ChangeCoord(2),
0234                          theNormal.ChangeCoord(3));
0235   }
0236 
0237   Standard_EXPORT void AddNormalOnTriangle(
0238     const int                                                  theITri,
0239     const int                                                  theINode,
0240     int&                                                       theJNode,
0241     NCollection_Array1<HLRAlgo_TriangleData>&                  theTData,
0242     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod,
0243     double&                                                    theX,
0244     double&                                                    theY,
0245     double&                                                    theZ,
0246     bool&                                                      theOK) const;
0247 
0248   Standard_EXPORT void InitBiPointsWithConnexity(
0249     const int                                                  theIEdge,
0250     TopoDS_Edge&                                               theEdge,
0251     NCollection_List<HLRAlgo_BiPoint>&                         theList,
0252     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID,
0253     NCollection_List<TopoDS_Shape>&                            theLS,
0254     const bool                                                 theIsConnex);
0255 
0256   Standard_EXPORT void Interpolation(
0257     NCollection_List<HLRAlgo_BiPoint>&                          List,
0258     double&                                                     X1,
0259     double&                                                     Y1,
0260     double&                                                     Z1,
0261     double&                                                     X2,
0262     double&                                                     Y2,
0263     double&                                                     Z2,
0264     double&                                                     XTI1,
0265     double&                                                     YTI1,
0266     double&                                                     ZTI1,
0267     double&                                                     XTI2,
0268     double&                                                     YTI2,
0269     double&                                                     ZTI2,
0270     const int                                                   e,
0271     double&                                                     U1,
0272     double&                                                     U2,
0273     HLRAlgo_PolyInternalNode::NodeIndices&                      theNodeIndices1,
0274     HLRAlgo_PolyInternalNode::NodeData&                         Nod11RValues,
0275     HLRAlgo_PolyInternalNode::NodeIndices&                      theNodeIndices2,
0276     HLRAlgo_PolyInternalNode::NodeData&                         Nod12RValues,
0277     const int                                                   i1p1,
0278     const int                                                   i1p2,
0279     const int                                                   i1,
0280     const occ::handle<HLRAlgo_PolyInternalData>&                pid1,
0281     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData1,
0282     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg1,
0283     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod1) const;
0284 
0285   Standard_EXPORT void Interpolation(
0286     NCollection_List<HLRAlgo_BiPoint>&                          List,
0287     double&                                                     X1,
0288     double&                                                     Y1,
0289     double&                                                     Z1,
0290     double&                                                     X2,
0291     double&                                                     Y2,
0292     double&                                                     Z2,
0293     double&                                                     XTI1,
0294     double&                                                     YTI1,
0295     double&                                                     ZTI1,
0296     double&                                                     XTI2,
0297     double&                                                     YTI2,
0298     double&                                                     ZTI2,
0299     const int                                                   e,
0300     double&                                                     U1,
0301     double&                                                     U2,
0302     const GeomAbs_Shape                                         rg,
0303     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod11Indices,
0304     HLRAlgo_PolyInternalNode::NodeData&                         Nod11RValues,
0305     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod12Indices,
0306     HLRAlgo_PolyInternalNode::NodeData&                         Nod12RValues,
0307     const int                                                   i1p1,
0308     const int                                                   i1p2,
0309     const int                                                   i1,
0310     const occ::handle<HLRAlgo_PolyInternalData>&                pid1,
0311     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData1,
0312     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg1,
0313     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod1,
0314     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod21Indices,
0315     HLRAlgo_PolyInternalNode::NodeData&                         Nod21RValues,
0316     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod22Indices,
0317     HLRAlgo_PolyInternalNode::NodeData&                         Nod22RValues,
0318     const int                                                   i2p1,
0319     const int                                                   i2p2,
0320     const int                                                   i2,
0321     const occ::handle<HLRAlgo_PolyInternalData>&                pid2,
0322     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData2,
0323     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg2,
0324     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod2) const;
0325 
0326   Standard_EXPORT bool Interpolation(const double                        U1,
0327                                      const double                        U2,
0328                                      HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
0329                                      HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
0330                                      double&                             X3,
0331                                      double&                             Y3,
0332                                      double&                             Z3,
0333                                      double&                             XT3,
0334                                      double&                             YT3,
0335                                      double&                             ZT3,
0336                                      double&                             coef3,
0337                                      double&                             U3,
0338                                      bool&                               mP3P1) const;
0339 
0340   Standard_EXPORT void MoveOrInsertPoint(
0341     NCollection_List<HLRAlgo_BiPoint>&                          List,
0342     double&                                                     X1,
0343     double&                                                     Y1,
0344     double&                                                     Z1,
0345     double&                                                     X2,
0346     double&                                                     Y2,
0347     double&                                                     Z2,
0348     double&                                                     XTI1,
0349     double&                                                     YTI1,
0350     double&                                                     ZTI1,
0351     double&                                                     XTI2,
0352     double&                                                     YTI2,
0353     double&                                                     ZTI2,
0354     const int                                                   e,
0355     double&                                                     U1,
0356     double&                                                     U2,
0357     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod11Indices,
0358     HLRAlgo_PolyInternalNode::NodeData&                         Nod11RValues,
0359     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod12Indices,
0360     HLRAlgo_PolyInternalNode::NodeData&                         Nod12RValues,
0361     const int                                                   i1p1,
0362     const int                                                   i1p2,
0363     const int                                                   i1,
0364     const occ::handle<HLRAlgo_PolyInternalData>&                pid1,
0365     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData1,
0366     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg1,
0367     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod1,
0368     const double                                                X3,
0369     const double                                                Y3,
0370     const double                                                Z3,
0371     const double                                                XT3,
0372     const double                                                YT3,
0373     const double                                                ZT3,
0374     const double                                                coef3,
0375     const double                                                U3,
0376     const bool                                                  insP3,
0377     const bool                                                  mP3P1,
0378     const int                                                   flag) const;
0379 
0380   Standard_EXPORT void MoveOrInsertPoint(
0381     NCollection_List<HLRAlgo_BiPoint>&                          List,
0382     double&                                                     X1,
0383     double&                                                     Y1,
0384     double&                                                     Z1,
0385     double&                                                     X2,
0386     double&                                                     Y2,
0387     double&                                                     Z2,
0388     double&                                                     XTI1,
0389     double&                                                     YTI1,
0390     double&                                                     ZTI1,
0391     double&                                                     XTI2,
0392     double&                                                     YTI2,
0393     double&                                                     ZTI2,
0394     const int                                                   e,
0395     double&                                                     U1,
0396     double&                                                     U2,
0397     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod11Indices,
0398     HLRAlgo_PolyInternalNode::NodeData&                         Nod11RValues,
0399     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod12Indices,
0400     HLRAlgo_PolyInternalNode::NodeData&                         Nod12RValues,
0401     const int                                                   i1p1,
0402     const int                                                   i1p2,
0403     const int                                                   i1,
0404     const occ::handle<HLRAlgo_PolyInternalData>&                pid1,
0405     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData1,
0406     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg1,
0407     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod1,
0408     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod21Indices,
0409     HLRAlgo_PolyInternalNode::NodeData&                         Nod21RValues,
0410     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod22Indices,
0411     HLRAlgo_PolyInternalNode::NodeData&                         Nod22RValues,
0412     const int                                                   i2p1,
0413     const int                                                   i2p2,
0414     const int                                                   i2,
0415     const occ::handle<HLRAlgo_PolyInternalData>&                pid2,
0416     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData2,
0417     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg2,
0418     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod2,
0419     const double                                                X3,
0420     const double                                                Y3,
0421     const double                                                Z3,
0422     const double                                                XT3,
0423     const double                                                YT3,
0424     const double                                                ZT3,
0425     const double                                                coef3,
0426     const double                                                U3,
0427     const bool                                                  insP3,
0428     const bool                                                  mP3P1,
0429     const int                                                   flag) const;
0430 
0431   Standard_EXPORT void MoveOrInsertPoint(
0432     NCollection_List<HLRAlgo_BiPoint>&                          List,
0433     double&                                                     X1,
0434     double&                                                     Y1,
0435     double&                                                     Z1,
0436     double&                                                     X2,
0437     double&                                                     Y2,
0438     double&                                                     Z2,
0439     double&                                                     XTI1,
0440     double&                                                     YTI1,
0441     double&                                                     ZTI1,
0442     double&                                                     XTI2,
0443     double&                                                     YTI2,
0444     double&                                                     ZTI2,
0445     const int                                                   e,
0446     double&                                                     U1,
0447     double&                                                     U2,
0448     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod11Indices,
0449     HLRAlgo_PolyInternalNode::NodeData&                         Nod11RValues,
0450     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod12Indices,
0451     HLRAlgo_PolyInternalNode::NodeData&                         Nod12RValues,
0452     const int                                                   i1p1,
0453     const int                                                   i1p2,
0454     const int                                                   i1,
0455     const occ::handle<HLRAlgo_PolyInternalData>&                pid1,
0456     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData1,
0457     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg1,
0458     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod1,
0459     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod21Indices,
0460     HLRAlgo_PolyInternalNode::NodeData&                         Nod21RValues,
0461     HLRAlgo_PolyInternalNode::NodeIndices&                      Nod22Indices,
0462     HLRAlgo_PolyInternalNode::NodeData&                         Nod22RValues,
0463     const int                                                   i2p1,
0464     const int                                                   i2p2,
0465     const int                                                   i2,
0466     const occ::handle<HLRAlgo_PolyInternalData>&                pid2,
0467     NCollection_Array1<HLRAlgo_TriangleData>*&                  TData2,
0468     NCollection_Array1<HLRAlgo_PolyInternalSegment>*&           PISeg2,
0469     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>*& PINod2,
0470     const double                                                X3,
0471     const double                                                Y3,
0472     const double                                                Z3,
0473     const double                                                XT3,
0474     const double                                                YT3,
0475     const double                                                ZT3,
0476     const double                                                coef3,
0477     const double                                                U3,
0478     const bool                                                  insP3,
0479     const bool                                                  mP3P1,
0480     const double                                                X4,
0481     const double                                                Y4,
0482     const double                                                Z4,
0483     const double                                                XT4,
0484     const double                                                YT4,
0485     const double                                                ZT4,
0486     const double                                                coef4,
0487     const double                                                U4,
0488     const bool                                                  insP4,
0489     const bool                                                  mP4P1,
0490     const int                                                   flag) const;
0491 
0492   Standard_EXPORT void InsertOnOutLine(
0493     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID);
0494 
0495   Standard_EXPORT void CheckFrBackTriangles(
0496     NCollection_List<HLRAlgo_BiPoint>&                         theList,
0497     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID);
0498 
0499   Standard_EXPORT void FindEdgeOnTriangle(const HLRAlgo_TriangleData& theTriangle,
0500                                           const int                   ip1,
0501                                           const int                   ip2,
0502                                           int&                        jtrouv,
0503                                           bool&                       isDirect) const;
0504 
0505   Standard_EXPORT void ChangeNode(
0506     const int                                                  theIp1,
0507     const int                                                  theIp2,
0508     HLRAlgo_PolyInternalNode::NodeIndices&                     theNod1Indices,
0509     HLRAlgo_PolyInternalNode::NodeData&                        theNod1RValues,
0510     HLRAlgo_PolyInternalNode::NodeIndices&                     theNod2Indices,
0511     HLRAlgo_PolyInternalNode::NodeData&                        theNod2RValues,
0512     const double                                               theCoef1,
0513     const double                                               theX3,
0514     const double                                               theY3,
0515     const double                                               theZ3,
0516     const bool                                                 theIsFirst,
0517     NCollection_Array1<HLRAlgo_TriangleData>&                  theTData,
0518     NCollection_Array1<HLRAlgo_PolyInternalSegment>&           thePISeg,
0519     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod) const;
0520 
0521   Standard_EXPORT void UpdateAroundNode(
0522     const int                                                  theINode,
0523     HLRAlgo_PolyInternalNode::NodeIndices&                     theNodeIndices,
0524     NCollection_Array1<HLRAlgo_TriangleData>&                  theTData,
0525     NCollection_Array1<HLRAlgo_PolyInternalSegment>&           thePISeg,
0526     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalNode>>& thePINod) const;
0527 
0528   Standard_EXPORT void OrientTriangle(const int                              iTri,
0529                                       HLRAlgo_TriangleData&                  theTriangle,
0530                                       HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices1,
0531                                       HLRAlgo_PolyInternalNode::NodeData&    Nod1RValues,
0532                                       HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices2,
0533                                       HLRAlgo_PolyInternalNode::NodeData&    Nod2RValues,
0534                                       HLRAlgo_PolyInternalNode::NodeIndices& theNodeIndices3,
0535                                       HLRAlgo_PolyInternalNode::NodeData&    Nod3RValues) const;
0536 
0537   Standard_EXPORT bool Triangles(const int                                         ip1,
0538                                  const int                                         ip2,
0539                                  HLRAlgo_PolyInternalNode::NodeIndices&            Nod1Indices,
0540                                  NCollection_Array1<HLRAlgo_PolyInternalSegment>*& PISeg,
0541                                  int&                                              iTri1,
0542                                  int&                                              iTri2) const;
0543 
0544   Standard_EXPORT bool NewNode(HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
0545                                HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
0546                                double&                             coef1,
0547                                bool&                               moveP1) const;
0548 
0549   Standard_EXPORT void UVNode(HLRAlgo_PolyInternalNode::NodeData& Nod1RValues,
0550                               HLRAlgo_PolyInternalNode::NodeData& Nod2RValues,
0551                               const double                        coef1,
0552                               double&                             U3,
0553                               double&                             V3) const;
0554 
0555   Standard_EXPORT void CheckDegeneratedSegment(
0556     HLRAlgo_PolyInternalNode::NodeIndices& Nod1Indices,
0557     HLRAlgo_PolyInternalNode::NodeData&    Nod1RValues,
0558     HLRAlgo_PolyInternalNode::NodeIndices& Nod2Indices,
0559     HLRAlgo_PolyInternalNode::NodeData&    Nod2RValues) const;
0560 
0561   Standard_EXPORT void UpdateOutLines(
0562     NCollection_List<HLRAlgo_BiPoint>&                         theList,
0563     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID);
0564 
0565   Standard_EXPORT void UpdateEdgesBiPoints(
0566     NCollection_List<HLRAlgo_BiPoint>&                               theList,
0567     const NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID,
0568     const bool                                                       theIsClosed);
0569 
0570   Standard_EXPORT void UpdatePolyData(
0571     NCollection_Array1<occ::handle<HLRAlgo_PolyData>>&         thePD,
0572     NCollection_Array1<occ::handle<HLRAlgo_PolyInternalData>>& thePID,
0573     const bool                                                 theClosed);
0574 
0575   Standard_EXPORT void TMultiply(double&    X,
0576                                  double&    Y,
0577                                  double&    Z,
0578                                  const bool VecPartOnly = false) const;
0579 
0580   void TMultiply(gp_XYZ& thePoint, const bool VecPartOnly = false) const
0581   {
0582     TMultiply(thePoint.ChangeCoord(1),
0583               thePoint.ChangeCoord(2),
0584               thePoint.ChangeCoord(3),
0585               VecPartOnly);
0586   }
0587 
0588   Standard_EXPORT void TTMultiply(double&    X,
0589                                   double&    Y,
0590                                   double&    Z,
0591                                   const bool VecPartOnly = false) const;
0592 
0593   void TTMultiply(gp_XYZ& thePoint, const bool VecPartOnly = false) const
0594   {
0595     TTMultiply(thePoint.ChangeCoord(1),
0596                thePoint.ChangeCoord(2),
0597                thePoint.ChangeCoord(3),
0598                VecPartOnly);
0599   }
0600 
0601   Standard_EXPORT void TIMultiply(double&    X,
0602                                   double&    Y,
0603                                   double&    Z,
0604                                   const bool VecPartOnly = false) const;
0605 
0606   void TIMultiply(gp_XYZ& thePoint, const bool VecPartOnly = false) const
0607   {
0608     TIMultiply(thePoint.ChangeCoord(1),
0609                thePoint.ChangeCoord(2),
0610                thePoint.ChangeCoord(3),
0611                VecPartOnly);
0612   }
0613 
0614 private:
0615   HLRAlgo_Projector                                             myProj;
0616   double                                                        TMat[3][3];
0617   double                                                        TLoc[3];
0618   double                                                        TTMa[3][3];
0619   double                                                        TTLo[3];
0620   double                                                        TIMa[3][3];
0621   double                                                        TILo[3];
0622   NCollection_Sequence<TopoDS_Shape>                            myShapes;
0623   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myEMap;
0624   NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> myFMap;
0625   occ::handle<HLRAlgo_PolyAlgo>                                 myAlgo;
0626   bool                                                          myDebug;
0627   double                                                        myTolSta;
0628   double                                                        myTolEnd;
0629   double                                                        myTolAngular;
0630   occ::handle<Geom_Surface>                                     myGSurf;
0631   BRepAdaptor_Surface                                           myBSurf;
0632   BRepAdaptor_Curve                                             myBCurv;
0633   BRepAdaptor_Curve2d                                           myPC;
0634 };
0635 
0636 #endif // _HLRBRep_PolyAlgo_HeaderFile