Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:39

0001 // Created on: 1998-07-08
0002 // Created by: Stephanie HUMEAU
0003 // Copyright (c) 1998-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 _GeomFill_LocationGuide_HeaderFile
0018 #define _GeomFill_LocationGuide_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <TColgp_HArray2OfPnt2d.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <Standard_Real.hxx>
0025 #include <gp_Mat.hxx>
0026 #include <math_Vector.hxx>
0027 #include <GeomFill_LocationLaw.hxx>
0028 #include <TColgp_Array1OfPnt2d.hxx>
0029 #include <TColgp_Array1OfVec2d.hxx>
0030 #include <GeomAbs_Shape.hxx>
0031 #include <TColStd_Array1OfReal.hxx>
0032 #include <TColgp_HArray1OfPnt2d.hxx>
0033 class GeomFill_TrihedronWithGuide;
0034 class GeomFill_SectionLaw;
0035 class gp_Vec;
0036 class gp_Pnt;
0037 class Geom_Curve;
0038 
0039 
0040 class GeomFill_LocationGuide;
0041 DEFINE_STANDARD_HANDLE(GeomFill_LocationGuide, GeomFill_LocationLaw)
0042 
0043 
0044 class GeomFill_LocationGuide : public GeomFill_LocationLaw
0045 {
0046 
0047 public:
0048 
0049   
0050   Standard_EXPORT GeomFill_LocationGuide(const Handle(GeomFill_TrihedronWithGuide)& Triedre);
0051   
0052   Standard_EXPORT void Set (const Handle(GeomFill_SectionLaw)& Section, const Standard_Boolean rotat, const Standard_Real SFirst, const Standard_Real SLast, const Standard_Real PrecAngle, Standard_Real& LastAngle);
0053   
0054   Standard_EXPORT void EraseRotation();
0055   
0056   //! calculating poles on a surface (courbe guide / the surface of rotation in points myNbPts)
0057   //! @return Standard_True
0058   Standard_EXPORT virtual Standard_Boolean SetCurve (const Handle(Adaptor3d_Curve)& C) Standard_OVERRIDE;
0059   
0060   Standard_EXPORT virtual const Handle(Adaptor3d_Curve)& GetCurve() const Standard_OVERRIDE;
0061   
0062   Standard_EXPORT virtual void SetTrsf (const gp_Mat& Transfo) Standard_OVERRIDE;
0063   
0064   Standard_EXPORT virtual Handle(GeomFill_LocationLaw) Copy() const Standard_OVERRIDE;
0065   
0066   //! compute Location
0067   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V) Standard_OVERRIDE;
0068   
0069   //! compute Location and 2d points
0070   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V, TColgp_Array1OfPnt2d& Poles2d) Standard_OVERRIDE;
0071   
0072   //! compute location 2d  points and  associated
0073   //! first derivatives.
0074   //! Warning : It used only for C1 or C2 approximation
0075   Standard_EXPORT virtual Standard_Boolean D1 (const Standard_Real Param, gp_Mat& M, gp_Vec& V, gp_Mat& DM, gp_Vec& DV, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d) Standard_OVERRIDE;
0076   
0077   //! compute location 2d  points and associated
0078   //! first and seconde  derivatives.
0079   //! Warning : It used only for C2 approximation
0080   Standard_EXPORT virtual Standard_Boolean D2 (const Standard_Real Param, gp_Mat& M, gp_Vec& V, gp_Mat& DM, gp_Vec& DV, gp_Mat& D2M, gp_Vec& D2V, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d) Standard_OVERRIDE;
0081   
0082   //! Say if the first restriction is defined in this class.
0083   //! If it  is true the  first element  of poles array   in
0084   //! D0,D1,D2... Correspond to this restriction.
0085   //! Returns Standard_False (default implementation)
0086   Standard_EXPORT virtual Standard_Boolean HasFirstRestriction() const Standard_OVERRIDE;
0087   
0088   //! Say if the last restriction is defined in this class.
0089   //! If it is  true the  last element  of poles array in
0090   //! D0,D1,D2... Correspond to this restriction.
0091   //! Returns Standard_False (default implementation)
0092   Standard_EXPORT virtual Standard_Boolean HasLastRestriction() const Standard_OVERRIDE;
0093   
0094   //! Give the number of trace (Curves 2d which are not restriction)
0095   //! Returns 1 (default implementation)
0096   Standard_EXPORT virtual Standard_Integer TraceNumber() const Standard_OVERRIDE;
0097   
0098   //! Give a status to the Law
0099   //! Returns PipeOk (default implementation)
0100   Standard_EXPORT virtual GeomFill_PipeError ErrorStatus() const Standard_OVERRIDE;
0101   
0102   //! Returns  the number  of  intervals for  continuity
0103   //! <S>.
0104   //! May be one if Continuity(me) >= <S>
0105   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0106   
0107   //! Stores in <T> the  parameters bounding the intervals
0108   //! of continuity <S>.
0109   //!
0110   //! The array must provide  enough room to  accommodate
0111   //! for the parameters. i.e. T.Length() > NbIntervals()
0112   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0113   
0114   //! Sets the bounds of the parametric interval on
0115   //! the function
0116   //! This determines the derivatives in these values if the
0117   //! function is not Cn.
0118   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0119   
0120   //! Gets the bounds of the parametric interval on
0121   //! the function
0122   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0123   
0124   //! Gets the bounds of the function parametric domain.
0125   //! Warning: This domain it is  not modified by the
0126   //! SetValue method
0127   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0128   
0129   //! Is useful, if (me) have to run numerical
0130   //! algorithm to perform D0, D1 or D2
0131   //! The default implementation make nothing.
0132   Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d) Standard_OVERRIDE;
0133   
0134   //! Returns the resolutions in the  sub-space 2d <Index>
0135   //! This information is usfull to find an good tolerance in
0136   //! 2d approximation.
0137   //! Warning: Used only if Nb2dCurve > 0
0138   Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0139   
0140   //! Get the maximum Norm  of the matrix-location part.  It
0141   //! is usful to find an good Tolerance to approx M(t).
0142   Standard_EXPORT virtual Standard_Real GetMaximalNorm() Standard_OVERRIDE;
0143   
0144   //! Get average value of M(t) and V(t) it is usfull to
0145   //! make fast approximation of rational  surfaces.
0146   Standard_EXPORT virtual void GetAverageLaw (gp_Mat& AM, gp_Vec& AV) Standard_OVERRIDE;
0147   
0148   //! Say if the Location  Law, is an translation of  Location
0149   //! The default implementation is " returns False ".
0150   Standard_EXPORT virtual Standard_Boolean IsTranslation (Standard_Real& Error) const Standard_OVERRIDE;
0151   
0152   //! Say if the Location  Law, is a rotation of Location
0153   //! The default implementation is " returns False ".
0154   Standard_EXPORT virtual Standard_Boolean IsRotation (Standard_Real& Error) const Standard_OVERRIDE;
0155   
0156   Standard_EXPORT virtual void Rotation (gp_Pnt& Center) const Standard_OVERRIDE;
0157   
0158   Standard_EXPORT Handle(Geom_Curve) Section() const;
0159   
0160   Standard_EXPORT Handle(Adaptor3d_Curve) Guide() const;
0161   
0162   Standard_EXPORT void SetOrigine (const Standard_Real Param1, const Standard_Real Param2);
0163   
0164   Standard_EXPORT GeomFill_PipeError ComputeAutomaticLaw (Handle(TColgp_HArray1OfPnt2d)& ParAndRad) const;
0165 
0166 
0167 
0168 
0169   DEFINE_STANDARD_RTTIEXT(GeomFill_LocationGuide,GeomFill_LocationLaw)
0170 
0171 protected:
0172 
0173 
0174   Handle(TColgp_HArray2OfPnt2d) myPoles2d;
0175 
0176 
0177 private:
0178 
0179   
0180   Standard_EXPORT void SetRotation (const Standard_Real PrecAngle, Standard_Real& LastAngle);
0181   
0182   Standard_EXPORT void InitX (const Standard_Real Param);
0183 
0184   Handle(GeomFill_TrihedronWithGuide) myLaw;
0185   Handle(GeomFill_SectionLaw) mySec;
0186   Handle(Adaptor3d_Curve) myCurve;
0187   Handle(Adaptor3d_Curve) myGuide;
0188   Handle(Adaptor3d_Curve) myTrimmed;
0189   Standard_Integer myNbPts;
0190   Standard_Boolean rotation;
0191   Standard_Real OrigParam1;
0192   Standard_Real OrigParam2;
0193   Standard_Real Uf;
0194   Standard_Real Ul;
0195   Standard_Real myFirstS;
0196   Standard_Real myLastS;
0197   Standard_Real ratio;
0198   Standard_Boolean WithTrans;
0199   gp_Mat Trans;
0200   math_Vector TolRes;
0201   math_Vector Inf;
0202   math_Vector Sup;
0203   math_Vector X;
0204   math_Vector R;
0205   GeomFill_PipeError myStatus;
0206 
0207 
0208 };
0209 
0210 
0211 
0212 
0213 
0214 
0215 
0216 #endif // _GeomFill_LocationGuide_HeaderFile