Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:16:22

0001 // Created on: 1993-11-26
0002 // Created by: Modelistation
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_ALineToWLine_HeaderFile
0018 #define _IntPatch_ALineToWLine_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <IntPatch_Line.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <IntSurf_Quadric.hxx>
0024 #include <IntSurf_LineOn2S.hxx>
0025 
0026 class IntPatch_ALine;
0027 class IntSurf_PntOn2S;
0028 
0029 class IntPatch_ALineToWLine
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   //! Constructor
0035   Standard_EXPORT IntPatch_ALineToWLine(const occ::handle<Adaptor3d_Surface>& theS1,
0036                                         const occ::handle<Adaptor3d_Surface>& theS2,
0037                                         const int                             theNbPoints = 200);
0038 
0039   Standard_EXPORT void SetTolOpenDomain(const double aT);
0040 
0041   Standard_EXPORT double TolOpenDomain() const;
0042 
0043   Standard_EXPORT void SetTolTransition(const double aT);
0044 
0045   Standard_EXPORT double TolTransition() const;
0046 
0047   Standard_EXPORT void SetTol3D(const double aT);
0048 
0049   Standard_EXPORT double Tol3D() const;
0050 
0051   //! Converts aline to the set of Walking-lines and adds
0052   //! them in theLines.
0053   Standard_EXPORT void MakeWLine(const occ::handle<IntPatch_ALine>&                aline,
0054                                  NCollection_Sequence<occ::handle<IntPatch_Line>>& theLines) const;
0055 
0056   //! Converts aline (limited by paraminf and paramsup) to the set of
0057   //! Walking-lines and adds them in theLines.
0058   Standard_EXPORT void MakeWLine(const occ::handle<IntPatch_ALine>&                aline,
0059                                  const double                                      paraminf,
0060                                  const double                                      paramsup,
0061                                  NCollection_Sequence<occ::handle<IntPatch_Line>>& theLines) const;
0062 
0063 protected:
0064   //! Computes step value to construct point-line. The step depends on
0065   //! the local curvature of the intersection line computed in thePOn2S.
0066   //! theTgMagnitude is the magnitude of tangent vector to the intersection
0067   //! line (in the point thePOn2S).
0068   //! Computed step is always in the range [theStepMin, theStepMax].
0069   //! Returns FALSE if the step cannot be computed. In this case, its value
0070   //! will not be changed.
0071   Standard_EXPORT bool StepComputing(const occ::handle<IntPatch_ALine>& theALine,
0072                                      const IntSurf_PntOn2S&             thePOn2S,
0073                                      const double                       theLastParOfAline,
0074                                      const double                       theCurParam,
0075                                      const double                       theTgMagnitude,
0076                                      const double                       theStepMin,
0077                                      const double                       theStepMax,
0078                                      const double                       theMaxDeflection,
0079                                      double&                            theStep) const;
0080 
0081   //! Compares distances from theMidPt to every quadrics with theMaxDeflection
0082   //! (maximal distance of two ones is taken into account).
0083   //! Returns the result of this comparison: -1 - small distance, +1 - big distance,
0084   //! 0 - Dist == theMaxDeflection. Comparisons are done with internal tolerances.
0085   Standard_EXPORT int CheckDeflection(const gp_XYZ& theMidPt, const double theMaxDeflection) const;
0086 
0087   //! Returns radius of a circle obtained by intersection the quadric with a plane
0088   //! goes through thePnt3d perpendicular to the quadric axis. This radius is computed
0089   //! for both quadrics and minimal value is returned.
0090   //! This check is made for cone and sphere only.
0091   Standard_EXPORT double GetSectionRadius(const gp_Pnt& thePnt3d) const;
0092 
0093   //! Corrects the U-parameter of an end point (first or last) of the line
0094   //! if this end point is a pole.
0095   //! The line must contain at least 3 points.
0096   //! This is made for cone and sphere only.
0097   Standard_EXPORT void CorrectEndPoint(occ::handle<IntSurf_LineOn2S>& theLine,
0098                                        const int                      theIndex) const;
0099 
0100 private:
0101   occ::handle<Adaptor3d_Surface> myS1;
0102   occ::handle<Adaptor3d_Surface> myS2;
0103   IntSurf_Quadric                myQuad1;
0104   IntSurf_Quadric                myQuad2;
0105 
0106   //! Approximate number of points in resulting
0107   //! WLine (precise number of points is computed
0108   //! by the algorithms)
0109   int    myNbPointsInWline;
0110   double myTolOpenDomain;
0111   double myTolTransition;
0112   double myTol3D;
0113 };
0114 
0115 #endif // _IntPatch_ALineToWLine_HeaderFile