Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:16:58

0001 // Created on: 1993-01-28
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1993-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 _IntPatch_PrmPrmIntersection_HeaderFile
0018 #define _IntPatch_PrmPrmIntersection_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <IntPatch_Line.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <IntSurf_PntOn2S.hxx>
0024 #include <NCollection_List.hxx>
0025 
0026 class Adaptor3d_TopolTool;
0027 class IntPatch_Polyhedron;
0028 class IntPatch_PrmPrmIntersection_T3Bits;
0029 class IntSurf_LineOn2S;
0030 
0031 //! Implementation of the Intersection between two bi-parametrised surfaces.
0032 //!
0033 //! To avoid multiple constructions of the approximated
0034 //! polyhedron of the surfaces, the algorithm can be
0035 //! called with the two surfaces and their associated polyhedron.
0036 class IntPatch_PrmPrmIntersection
0037 {
0038 public:
0039   DEFINE_STANDARD_ALLOC
0040 
0041   //! Empty Constructor
0042   Standard_EXPORT IntPatch_PrmPrmIntersection();
0043 
0044   //! Performs the intersection between <Caro1> and
0045   //! <Caro2>. Associated Polyhedrons <Polyhedron1>
0046   //! and <Polyhedron2> are given.
0047   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0048                                const IntPatch_Polyhedron&              Polyhedron1,
0049                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0050                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0051                                const IntPatch_Polyhedron&              Polyhedron2,
0052                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0053                                const double                            TolTangency,
0054                                const double                            Epsilon,
0055                                const double                            Deflection,
0056                                const double                            Increment);
0057 
0058   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0059                                const IntPatch_Polyhedron&              Polyhedron1,
0060                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0061                                const double                            TolTangency,
0062                                const double                            Epsilon,
0063                                const double                            Deflection,
0064                                const double                            Increment);
0065 
0066   //! Performs the intersection between <Caro1> and
0067   //! <Caro2>. The method computes the polyhedron on
0068   //! each surface.
0069   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0070                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0071                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0072                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0073                                const double                            TolTangency,
0074                                const double                            Epsilon,
0075                                const double                            Deflection,
0076                                const double                            Increment,
0077                                const bool                              ClearFlag = true);
0078 
0079   //! Performs the intersection between <Caro1> and
0080   //! <Caro2>. The method computes the polyhedron on
0081   //! each surface.
0082   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0083                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0084                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0085                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0086                                const double                            TolTangency,
0087                                const double                            Epsilon,
0088                                const double                            Deflection,
0089                                const double                            Increment,
0090                                NCollection_List<IntSurf_PntOn2S>&      ListOfPnts);
0091 
0092   //! Performs the intersection between <Caro1> and
0093   //! <Caro2>. The method computes the polyhedron on
0094   //! each surface.
0095   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0096                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0097                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0098                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0099                                const double                            U1,
0100                                const double                            V1,
0101                                const double                            U2,
0102                                const double                            V2,
0103                                const double                            TolTangency,
0104                                const double                            Epsilon,
0105                                const double                            Deflection,
0106                                const double                            Increment);
0107 
0108   //! Performs the intersection between <Caro1> and
0109   //! <Caro2>. The method computes the polyhedron on
0110   //! each surface.
0111   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0112                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0113                                const double                            TolTangency,
0114                                const double                            Epsilon,
0115                                const double                            Deflection,
0116                                const double                            Increment);
0117 
0118   //! Performs the intersection between <Caro1> and
0119   //! <Caro2>.
0120   //!
0121   //! The polyhedron which approximates <Caro2>,
0122   //! <Polyhedron2> is given. The other one is
0123   //! computed.
0124   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0125                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0126                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0127                                const IntPatch_Polyhedron&              Polyhedron2,
0128                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0129                                const double                            TolTangency,
0130                                const double                            Epsilon,
0131                                const double                            Deflection,
0132                                const double                            Increment);
0133 
0134   //! Performs the intersection between <Caro1> and
0135   //! <Caro2>.
0136   //!
0137   //! The polyhedron which approximates <Caro1>,
0138   //! <Polyhedron1> is given. The other one is
0139   //! computed.
0140   Standard_EXPORT void Perform(const occ::handle<Adaptor3d_Surface>&   Caro1,
0141                                const IntPatch_Polyhedron&              Polyhedron1,
0142                                const occ::handle<Adaptor3d_TopolTool>& Domain1,
0143                                const occ::handle<Adaptor3d_Surface>&   Caro2,
0144                                const occ::handle<Adaptor3d_TopolTool>& Domain2,
0145                                const double                            TolTangency,
0146                                const double                            Epsilon,
0147                                const double                            Deflection,
0148                                const double                            Increment);
0149 
0150   //! Returns true if the calculus was successful.
0151   bool IsDone() const;
0152 
0153   //! Returns true if the is no intersection.
0154   bool IsEmpty() const;
0155 
0156   //! Returns the number of intersection lines.
0157   int NbLines() const;
0158 
0159   //! Returns the line of range Index.
0160   //! An exception is raised if Index<=0 or Index>NbLine.
0161   const occ::handle<IntPatch_Line>& Line(const int Index) const;
0162 
0163   //! Computes about <NbPoints> Intersection Points on
0164   //! the Line <IndexLine> between the Points of Index
0165   //! <LowPoint> and <HighPoint>.
0166   //!
0167   //! All the points of the line of index <IndexLine>
0168   //! with an index between <LowPoint> and <HighPoint>
0169   //! are in the returned line. New Points are inserted
0170   //! between existing points if those points are not
0171   //! too closed.
0172   //!
0173   //! An exception is raised if Index<=0 or Index>NbLine.
0174   //! or if IsDone returns False
0175   Standard_EXPORT occ::handle<IntPatch_Line> NewLine(const occ::handle<Adaptor3d_Surface>& Caro1,
0176                                                      const occ::handle<Adaptor3d_Surface>& Caro2,
0177                                                      const int IndexLine,
0178                                                      const int LowPoint,
0179                                                      const int HighPoint,
0180                                                      const int NbPoints) const;
0181 
0182   int GrilleInteger(const int ix, const int iy, const int iz) const;
0183 
0184   void IntegerGrille(const int t, int& ix, int& iy, int& iz) const;
0185 
0186   int DansGrille(const int t) const;
0187 
0188   int NbPointsGrille() const;
0189 
0190   Standard_EXPORT void RemplitLin(const int                           x1,
0191                                   const int                           y1,
0192                                   const int                           z1,
0193                                   const int                           x2,
0194                                   const int                           y2,
0195                                   const int                           z2,
0196                                   IntPatch_PrmPrmIntersection_T3Bits& Map) const;
0197 
0198   Standard_EXPORT void RemplitTri(const int                           x1,
0199                                   const int                           y1,
0200                                   const int                           z1,
0201                                   const int                           x2,
0202                                   const int                           y2,
0203                                   const int                           z2,
0204                                   const int                           x3,
0205                                   const int                           y3,
0206                                   const int                           z3,
0207                                   IntPatch_PrmPrmIntersection_T3Bits& Map) const;
0208 
0209   Standard_EXPORT void Remplit(const int                           a,
0210                                const int                           b,
0211                                const int                           c,
0212                                IntPatch_PrmPrmIntersection_T3Bits& Map) const;
0213 
0214   int CodeReject(const double x1,
0215                  const double y1,
0216                  const double z1,
0217                  const double x2,
0218                  const double y2,
0219                  const double z2,
0220                  const double x3,
0221                  const double y3,
0222                  const double z3) const;
0223 
0224   Standard_EXPORT void PointDepart(occ::handle<IntSurf_LineOn2S>&        LineOn2S,
0225                                    const occ::handle<Adaptor3d_Surface>& S1,
0226                                    const int                             SU1,
0227                                    const int                             SV1,
0228                                    const occ::handle<Adaptor3d_Surface>& S2,
0229                                    const int                             SU2,
0230                                    const int                             SV2) const;
0231 
0232 private:
0233   bool                                             done;
0234   bool                                             empt;
0235   NCollection_Sequence<occ::handle<IntPatch_Line>> SLin;
0236 };
0237 
0238 #include <IntPatch_PrmPrmIntersection.lxx>
0239 
0240 #endif // _IntPatch_PrmPrmIntersection_HeaderFile