Back to home page

EIC code displayed by LXR

 
 

    


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

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