Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:18:16

0001 //! Created on: 2016-06-03
0002 //! Created by: NIKOLAI BUKHALOV
0003 //! Copyright (c) 2016 OPEN CASCADE SAS
0004 //!
0005 //! This file is part of Open CASCADE Technology software library.
0006 //!
0007 //! This library is free software; you can redistribute it and/or modify it under
0008 //! the terms of the GNU Lesser General Public License version 2.1 as published
0009 //! by the Free Software Foundation, with special exception defined in the file
0010 //! OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 //! distribution for complete text of the license and disclaimer of any warranty.
0012 //!
0013 //! Alternatively, this file may be used under the terms of Open CASCADE
0014 //! commercial license or contractual agreement.
0015 
0016 #ifndef _IntPatch_SpecialPoints_HeaderFile
0017 #define _IntPatch_SpecialPoints_HeaderFile
0018 
0019 //! Contains methods to add some special points
0020 //! (such as apex of cone, pole of sphere,
0021 //! point on surface boundary etc.) in the intersection line.
0022 
0023 #include <Adaptor3d_Surface.hxx>
0024 #include <IntPatch_SpecPntType.hxx>
0025 
0026 class gp_Cone;
0027 class gp_Vec;
0028 class gp_XYZ;
0029 class IntPatch_Point;
0030 class IntSurf_PntOn2S;
0031 
0032 template <typename T>
0033 class math_VectorBase;
0034 using math_Vector = math_VectorBase<double>;
0035 
0036 class IntPatch_SpecialPoints
0037 {
0038 public:
0039   //! Adds the point defined as intersection
0040   //! of two isolines (U = 0 and V = 0) on theQSurf in theLine.
0041   //! theRefPt is used to correct adjusting parameters.
0042   //! If theIsReversed is TRUE then theQSurf correspond to the
0043   //! second (otherwise, the first) surface while forming
0044   //! intersection point IntSurf_PntOn2S.
0045   Standard_EXPORT static bool AddCrossUVIsoPoint(const occ::handle<Adaptor3d_Surface>& theQSurf,
0046                                                  const occ::handle<Adaptor3d_Surface>& thePSurf,
0047                                                  const IntSurf_PntOn2S&                theRefPt,
0048                                                  const double                          theTol3d,
0049                                                  IntSurf_PntOn2S& theAddedPoint,
0050                                                  const bool       theIsReversed = false);
0051 
0052   //! Adds the point lain strictly in the isoline U = 0 or V = 0 of theQSurf,
0053   //! in theLine.
0054   //! theRefPt is used to correct adjusting parameters.
0055   //! If theIsReversed is TRUE then theQSurf corresponds to the
0056   //! second (otherwise, the first) surface while forming
0057   //! intersection point IntSurf_PntOn2S.
0058   //! All math_Vector-objects must be filled as follows:
0059   //!   [1] - U-parameter of thePSurf;
0060   //!   [2] - V-parameter of thePSurf;
0061   //!   [3] - U- (if V-isoline is considered) or V-parameter
0062   //!         (if U-isoline is considered) of theQSurf.
0063   Standard_EXPORT static bool AddPointOnUorVIso(const occ::handle<Adaptor3d_Surface>& theQSurf,
0064                                                 const occ::handle<Adaptor3d_Surface>& thePSurf,
0065                                                 const IntSurf_PntOn2S&                theRefPt,
0066                                                 const bool                            theIsU,
0067                                                 const double       theIsoParameter,
0068                                                 const math_Vector& theToler,
0069                                                 const math_Vector& theInitPoint,
0070                                                 const math_Vector& theInfBound,
0071                                                 const math_Vector& theSupBound,
0072                                                 IntSurf_PntOn2S&   theAddedPoint,
0073                                                 const bool         theIsReversed = false);
0074 
0075   //! Computes the pole of sphere to add it in the intersection line.
0076   //! Stores the result in theAddedPoint variable (does not add in the line).
0077   //! At that, cone and sphere (with singularity) must be set in theQSurf parameter.
0078   //! By default (if theIsReversed == FALSE), theQSurf is the first surface of the
0079   //! Walking line. If it is not, theIsReversed parameter must be set to TRUE.
0080   //! theIsReqRefCheck is TRUE if and only if 3D-point of theRefPt must be pole or apex
0081   //! for check (e.g. if it is vertex).
0082   //! thePtIso is the reference point for obtaining isoline where must be placed the Apex/Pole.
0083   //!
0084   //! ATTENTION!!!
0085   //!   theVertex must be initialized before calling the method .
0086   Standard_EXPORT static bool AddSingularPole(const occ::handle<Adaptor3d_Surface>& theQSurf,
0087                                               const occ::handle<Adaptor3d_Surface>& thePSurf,
0088                                               const IntSurf_PntOn2S&                thePtIso,
0089                                               IntPatch_Point&                       theVertex,
0090                                               IntSurf_PntOn2S&                      theAddedPoint,
0091                                               const bool theIsReversed    = false,
0092                                               const bool theIsReqRefCheck = false);
0093 
0094   //! Special point has already been added in the line. Now, we need in correct
0095   //! prolongation of the line or in start new line. This function returns new point.
0096   //!
0097   //! ATTENTION!!!
0098   //!   theNewPoint is not only Output parameter. It is Input/Output one. I.e.
0099   //! theNewPoint is reference point together with theRefPt.
0100   Standard_EXPORT static bool ContinueAfterSpecialPoint(
0101     const occ::handle<Adaptor3d_Surface>& theQSurf,
0102     const occ::handle<Adaptor3d_Surface>& thePSurf,
0103     const IntSurf_PntOn2S&                theRefPt,
0104     const IntPatch_SpecPntType            theSPType,
0105     const double                          theTol2D,
0106     IntSurf_PntOn2S&                      theNewPoint,
0107     const bool                            theIsReversed = false);
0108 
0109   //! Sets theNewPoint parameters in 2D-space the closest to
0110   //! theRefPoint with help of adding/subtracting corresponding periods.
0111   //! theArrPeriods must be filled as follows:
0112   //! {<U-period of 1st surface>, <V-period of 1st surface>,
0113   //!  <U-period of 2nd surface>, <V-period of 2nd surface>}.
0114   //! If theVertex != 0 then its parameters will be filled as
0115   //! corresponding parameters of theNewPoint.
0116   //!
0117   //! ATTENTION!!!
0118   //!   theNewPoint is not only Output parameter. It is Input/Output one. I.e.
0119   //! theNewPoint is reference point together with theRefPt.
0120   Standard_EXPORT static void AdjustPointAndVertex(const IntSurf_PntOn2S& theRefPoint,
0121                                                    const double           theArrPeriods[4],
0122                                                    IntSurf_PntOn2S&       theNewPoint,
0123                                                    IntPatch_Point* const  theVertex = nullptr);
0124 
0125 protected:
0126   //! Computes "special point" in the sphere
0127   //! The parameter will be found in the range [0, 2*PI].
0128   //! Therefore it must be adjusted to valid range by
0129   //! the high-level algorithm
0130   static Standard_EXPORT bool ProcessSphere(const IntSurf_PntOn2S& thePtIso,
0131                                             const gp_Vec&          theDUofPSurf,
0132                                             const gp_Vec&          theDVofPSurf,
0133                                             const bool             theIsReversed,
0134                                             const double           theVquad,
0135                                             double&                theUquad,
0136                                             bool&                  theIsIsoChoosen);
0137 
0138   //! Computes "special point" in the cone.
0139   //! The parameter will be found in the range [0, 2*PI].
0140   //! Therefore it must be adjusted to valid range by
0141   //! the high-level algorithm.
0142   static Standard_EXPORT bool ProcessCone(const IntSurf_PntOn2S& thePtIso,
0143                                           const gp_Vec&          theDUofPSurf,
0144                                           const gp_Vec&          theDVofPSurf,
0145                                           const gp_Cone&         theCone,
0146                                           const bool             theIsReversed,
0147                                           double&                theUquad,
0148                                           bool&                  theIsIsoChoosen);
0149 
0150   //! Computes vector tangent to the intersection line in cone apex.
0151   //! There exist not more than 2 tangent. They will be stores in theResult vector.
0152   //! Returns the number of found tangents.
0153   //! thePlnNormal is the normalized vector of the normal to the plane intersected the cone.
0154   static Standard_EXPORT int GetTangentToIntLineForCone(const double  theConeSemiAngle,
0155                                                         const gp_XYZ& thePlnNormal,
0156                                                         gp_XYZ        theResult[2]);
0157 };
0158 
0159 #endif // _IntPatch_AddSpecialPoints_HeaderFile