Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:17:23

0001 // Created on: 1996-08-09
0002 // Created by: Herve LOUESSARD
0003 // Copyright (c) 1996-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 _LocalAnalysis_SurfaceContinuity_HeaderFile
0018 #define _LocalAnalysis_SurfaceContinuity_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GeomAbs_Shape.hxx>
0025 #include <LocalAnalysis_StatusErrorType.hxx>
0026 class Geom_Surface;
0027 class Geom2d_Curve;
0028 class GeomLProp_SLProps;
0029 
0030 //! This class gives tools to check local continuity C0
0031 //! C1 C2 G1 G2 between  two points situated on two surfaces
0032 class LocalAnalysis_SurfaceContinuity
0033 {
0034 public:
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! -u1,v1 are  the parameters of the point on Surf1
0038   //! -u2,v2  are  the  parameters of the point on Surf2
0039   //! -Order  is the required continuity:
0040   //! GeomAbs_C0    GeomAbs_C1  GeomAbs_C2
0041   //! GeomAbs_G1 GeomAbs_G2
0042   //!
0043   //! -EpsNul  is  used to  detect a  a vector with nul
0044   //! magnitude
0045   //!
0046   //! -EpsC0 is used for C0  continuity to confuse two
0047   //! points (in mm)
0048   //!
0049   //! -EpsC1 is  an angular  tolerance in radians  used
0050   //! for C1 continuity  to compare the angle between
0051   //! the first derivatives
0052   //!
0053   //! -EpsC2 is an   angular tolerance in radians  used
0054   //! for C2  continuity to  compare the angle  between
0055   //! the second derivatives
0056   //!
0057   //! -EpsG1 is an  angular  tolerance in radians  used
0058   //! for G1  continuity to compare  the angle  between
0059   //! the  normals
0060   //!
0061   //! -Percent  : percentage of  curvature variation (unitless)
0062   //! used for G2 continuity
0063   //!
0064   //! - Maxlen is the maximum length of Surf1 or Surf2  in
0065   //! meters used to detect null curvature (in mm)
0066   //!
0067   //! the constructor computes the quantities  which are
0068   //! necessary to check the continuity in the following cases:
0069   //!
0070   //! case  C0
0071   //! --------
0072   //! - the distance between P1 and P2  with P1=Surf (u1,v1)  and
0073   //! P2=Surfv2(u2,v2)
0074   //!
0075   //! case C1
0076   //! -------
0077   //!
0078   //! - the angle between the first derivatives in u :
0079   //!
0080   //! dSurf1(u1,v1)               dSurf2(u2,v2)
0081   //! -----------      and        ---------
0082   //! du                           du
0083   //!
0084   //! the angle value is between 0 and PI/2
0085   //!
0086   //! - the angle between the first derivatives in v :
0087   //!
0088   //! dSurf1(u1,v1)               dSurf2(u2,v2)
0089   //! --------         and         ---------
0090   //! dv                           dv
0091   //!
0092   //! - the ratio between  the magnitudes of  the first derivatives  in  u
0093   //! - the  ratio  between  the magnitudes of the first derivatives in v
0094   //!
0095   //! the angle value is between  0 and pi/2
0096   //!
0097   //! case  C2
0098   //! -------
0099   //! - the  angle  between the second derivatives in u
0100   //! 2                  2
0101   //! d Surf1(u1,v1)    d  Surf2(u2,v2)
0102   //! ----------        ----------
0103   //! 2                  2
0104   //! d u               d  u
0105   //!
0106   //! - the ratio between the  magnitudes of the second derivatives in  u
0107   //! - the  ratio between the  magnitudes of the  second derivatives in v
0108   //!
0109   //! the angle value is between 0 and PI/2
0110   //!
0111   //! case G1
0112   //! -------
0113   //! -the angle between  the normals  at each point
0114   //! the angle value is between 0 and PI/2
0115   //!
0116   //! case  G2
0117   //! -------
0118   //! - the maximum  normal curvature gap between the two
0119   //! points
0120   Standard_EXPORT LocalAnalysis_SurfaceContinuity(const Handle(Geom_Surface)& Surf1,
0121                                                   const Standard_Real         u1,
0122                                                   const Standard_Real         v1,
0123                                                   const Handle(Geom_Surface)& Surf2,
0124                                                   const Standard_Real         u2,
0125                                                   const Standard_Real         v2,
0126                                                   const GeomAbs_Shape         Order,
0127                                                   const Standard_Real         EpsNul  = 0.001,
0128                                                   const Standard_Real         EpsC0   = 0.001,
0129                                                   const Standard_Real         EpsC1   = 0.001,
0130                                                   const Standard_Real         EpsC2   = 0.001,
0131                                                   const Standard_Real         EpsG1   = 0.001,
0132                                                   const Standard_Real         Percent = 0.01,
0133                                                   const Standard_Real         Maxlen  = 10000);
0134 
0135   Standard_EXPORT LocalAnalysis_SurfaceContinuity(const Handle(Geom2d_Curve)& curv1,
0136                                                   const Handle(Geom2d_Curve)& curv2,
0137                                                   const Standard_Real         U,
0138                                                   const Handle(Geom_Surface)& Surf1,
0139                                                   const Handle(Geom_Surface)& Surf2,
0140                                                   const GeomAbs_Shape         Order,
0141                                                   const Standard_Real         EpsNul  = 0.001,
0142                                                   const Standard_Real         EpsC0   = 0.001,
0143                                                   const Standard_Real         EpsC1   = 0.001,
0144                                                   const Standard_Real         EpsC2   = 0.001,
0145                                                   const Standard_Real         EpsG1   = 0.001,
0146                                                   const Standard_Real         Percent = 0.01,
0147                                                   const Standard_Real         Maxlen  = 10000);
0148 
0149   //! This  constructor  is  used  when  we  want  to compute  many  analysis.
0150   //! After  we  use  the  method  ComputeAnalysis
0151   Standard_EXPORT LocalAnalysis_SurfaceContinuity(const Standard_Real EpsNul  = 0.001,
0152                                                   const Standard_Real EpsC0   = 0.001,
0153                                                   const Standard_Real EpsC1   = 0.001,
0154                                                   const Standard_Real EpsC2   = 0.001,
0155                                                   const Standard_Real EpsG1   = 0.001,
0156                                                   const Standard_Real Percent = 0.01,
0157                                                   const Standard_Real Maxlen  = 10000);
0158 
0159   Standard_EXPORT void ComputeAnalysis(GeomLProp_SLProps&  Surf1,
0160                                        GeomLProp_SLProps&  Surf2,
0161                                        const GeomAbs_Shape Order);
0162 
0163   Standard_EXPORT Standard_Boolean IsDone() const;
0164 
0165   Standard_EXPORT GeomAbs_Shape ContinuityStatus() const;
0166 
0167   Standard_EXPORT LocalAnalysis_StatusErrorType StatusError() const;
0168 
0169   Standard_EXPORT Standard_Real C0Value() const;
0170 
0171   Standard_EXPORT Standard_Real C1UAngle() const;
0172 
0173   Standard_EXPORT Standard_Real C1URatio() const;
0174 
0175   Standard_EXPORT Standard_Real C1VAngle() const;
0176 
0177   Standard_EXPORT Standard_Real C1VRatio() const;
0178 
0179   Standard_EXPORT Standard_Real C2UAngle() const;
0180 
0181   Standard_EXPORT Standard_Real C2URatio() const;
0182 
0183   Standard_EXPORT Standard_Real C2VAngle() const;
0184 
0185   Standard_EXPORT Standard_Real C2VRatio() const;
0186 
0187   Standard_EXPORT Standard_Real G1Angle() const;
0188 
0189   Standard_EXPORT Standard_Real G2CurvatureGap() const;
0190 
0191   Standard_EXPORT Standard_Boolean IsC0() const;
0192 
0193   Standard_EXPORT Standard_Boolean IsC1() const;
0194 
0195   Standard_EXPORT Standard_Boolean IsC2() const;
0196 
0197   Standard_EXPORT Standard_Boolean IsG1() const;
0198 
0199   Standard_EXPORT Standard_Boolean IsG2() const;
0200 
0201 protected:
0202 private:
0203   Standard_EXPORT void SurfC0(const GeomLProp_SLProps& Surf1, const GeomLProp_SLProps& Surf2);
0204 
0205   Standard_EXPORT void SurfC1(GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2);
0206 
0207   Standard_EXPORT void SurfC2(GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2);
0208 
0209   Standard_EXPORT void SurfG1(GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2);
0210 
0211   Standard_EXPORT void SurfG2(GeomLProp_SLProps& Surf1, GeomLProp_SLProps& Surf2);
0212 
0213   Standard_Real                 myContC0;
0214   Standard_Real                 myContC1U;
0215   Standard_Real                 myContC1V;
0216   Standard_Real                 myContC2U;
0217   Standard_Real                 myContC2V;
0218   Standard_Real                 myContG1;
0219   Standard_Real                 myLambda1U;
0220   Standard_Real                 myLambda2U;
0221   Standard_Real                 myLambda1V;
0222   Standard_Real                 myLambda2V;
0223   Standard_Real                 myETA1;
0224   Standard_Real                 myETA2;
0225   Standard_Real                 myETA;
0226   Standard_Real                 myZETA1;
0227   Standard_Real                 myZETA2;
0228   Standard_Real                 myZETA;
0229   Standard_Real                 myAlpha;
0230   GeomAbs_Shape                 myTypeCont;
0231   Standard_Real                 myepsC0;
0232   Standard_Real                 myepsnul;
0233   Standard_Real                 myepsC1;
0234   Standard_Real                 myepsC2;
0235   Standard_Real                 myepsG1;
0236   Standard_Real                 myperce;
0237   Standard_Real                 mymaxlen;
0238   Standard_Real                 myGap;
0239   Standard_Boolean              myIsDone;
0240   LocalAnalysis_StatusErrorType myErrorStatus;
0241 };
0242 
0243 #endif // _LocalAnalysis_SurfaceContinuity_HeaderFile