Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:08

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_SequenceOfLine.hxx>
0022 #include <IntSurf_Quadric.hxx>
0023 #include <IntSurf_LineOn2S.hxx>
0024 
0025 class IntPatch_ALine;
0026 class IntSurf_PntOn2S;
0027 
0028 class IntPatch_ALineToWLine 
0029 {
0030 public:
0031 
0032   DEFINE_STANDARD_ALLOC
0033 
0034   //! Constructor
0035   Standard_EXPORT IntPatch_ALineToWLine(const Handle(Adaptor3d_Surface)& theS1,
0036                                         const Handle(Adaptor3d_Surface)& theS2,
0037                                         const Standard_Integer theNbPoints = 200);
0038   
0039   Standard_EXPORT void SetTolOpenDomain (const Standard_Real aT);
0040   
0041   Standard_EXPORT Standard_Real TolOpenDomain() const;
0042   
0043   Standard_EXPORT void SetTolTransition (const Standard_Real aT);
0044   
0045   Standard_EXPORT Standard_Real TolTransition() const;
0046   
0047   Standard_EXPORT void SetTol3D (const Standard_Real aT);
0048   
0049   Standard_EXPORT Standard_Real Tol3D() const;
0050   
0051   //! Converts aline to the set of Walking-lines and adds
0052   //! them in theLines.
0053   Standard_EXPORT void MakeWLine (const Handle(IntPatch_ALine)& aline,
0054                                   IntPatch_SequenceOfLine& 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 Handle(IntPatch_ALine)& aline,
0059                                   const Standard_Real paraminf,
0060                                   const Standard_Real paramsup,
0061                                   IntPatch_SequenceOfLine& 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 Standard_Boolean StepComputing(const Handle(IntPatch_ALine)& theALine,
0072                                                  const IntSurf_PntOn2S& thePOn2S,
0073                                                  const Standard_Real theLastParOfAline,
0074                                                  const Standard_Real theCurParam,
0075                                                  const Standard_Real theTgMagnitude,
0076                                                  const Standard_Real theStepMin,
0077                                                  const Standard_Real theStepMax,
0078                                                  const Standard_Real theMaxDeflection,
0079                                                  Standard_Real& 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 Standard_Integer CheckDeflection(const gp_XYZ& theMidPt,
0086                                                    const Standard_Real theMaxDeflection) const;
0087 
0088   //! Returns radius of a circle obtained by intersection the quadric with a plane
0089   //! goes through thePnt3d perpendicular to the quadric axis. This radius is computed
0090   //! for both quadrics and minimal value is returned.
0091   //! This check is made for cone and sphere only.
0092   Standard_EXPORT Standard_Real GetSectionRadius(const gp_Pnt& thePnt3d) const;
0093 
0094   //! Corrects the U-parameter of an end point (first or last) of the line
0095   //! if this end point is a pole.
0096   //! The line must contain at least 3 points.
0097   //! This is made for cone and sphere only.
0098   Standard_EXPORT void CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine,
0099                                        const Standard_Integer    theIndex) const;
0100 
0101 private:
0102 
0103 
0104   Handle(Adaptor3d_Surface) myS1;
0105   Handle(Adaptor3d_Surface) myS2;
0106   IntSurf_Quadric myQuad1;
0107   IntSurf_Quadric myQuad2;
0108 
0109   //! Approximate number of points in resulting
0110   //! WLine (precise number of points is computed
0111   //! by the algorithms)
0112   Standard_Integer myNbPointsInWline;
0113   Standard_Real myTolOpenDomain;
0114   Standard_Real myTolTransition;
0115   Standard_Real myTol3D;
0116 };
0117 
0118 #endif // _IntPatch_ALineToWLine_HeaderFile