Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-11-20
0002 // Created by: Philippe MANGIN
0003 // Copyright (c) 1997-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_LocationLaw_HeaderFile
0018 #define _GeomFill_LocationLaw_HeaderFile
0019 
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <GeomAbs_Shape.hxx>
0022 #include <GeomFill_PipeError.hxx>
0023 #include <TColgp_Array1OfPnt2d.hxx>
0024 #include <TColgp_Array1OfVec2d.hxx>
0025 #include <TColStd_Array1OfReal.hxx>
0026 
0027 class gp_Mat;
0028 class gp_Vec;
0029 class gp_Pnt;
0030 
0031 class GeomFill_LocationLaw;
0032 DEFINE_STANDARD_HANDLE(GeomFill_LocationLaw, Standard_Transient)
0033 
0034 //! To define location  law in Sweeping location is --
0035 //! defined   by an  Matrix  M and  an Vector  V,  and
0036 //! transform an point P in MP+V.
0037 class GeomFill_LocationLaw : public Standard_Transient
0038 {
0039 
0040 public:
0041   //! initialize curve of location law
0042   Standard_EXPORT virtual Standard_Boolean SetCurve (const Handle(Adaptor3d_Curve)& C) = 0;
0043   
0044   Standard_EXPORT virtual const Handle(Adaptor3d_Curve)& GetCurve() const = 0;
0045   
0046   //! Set a transformation Matrix like   the law M(t) become
0047   //! Mat * M(t)
0048   Standard_EXPORT virtual void SetTrsf (const gp_Mat& Transfo) = 0;
0049   
0050   Standard_EXPORT virtual Handle(GeomFill_LocationLaw) Copy() const = 0;
0051   
0052   //! compute Location
0053   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V) = 0;
0054   
0055   //! compute Location and 2d points
0056   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V, TColgp_Array1OfPnt2d& Poles2d) = 0;
0057   
0058   //! compute location 2d  points and  associated
0059   //! first derivatives.
0060   //! Warning : It used only for C1 or C2 approximation
0061   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);
0062   
0063   //! compute location 2d  points and associated
0064   //! first and seconde  derivatives.
0065   //! Warning : It used only for C2 approximation
0066   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);
0067   
0068   //! get the number of  2d  curves (Restrictions  +  Traces)
0069   //! to approximate.
0070   Standard_EXPORT Standard_Integer Nb2dCurves() const;
0071   
0072   //! Say if the first restriction is defined in this class.
0073   //! If it  is true the  first element  of poles array   in
0074   //! D0,D1,D2... Correspond to this restriction.
0075   //! Returns Standard_False (default implementation)
0076   Standard_EXPORT virtual Standard_Boolean HasFirstRestriction() const;
0077   
0078   //! Say if the last restriction is defined in this class.
0079   //! If it is  true the  last element  of poles array in
0080   //! D0,D1,D2... Correspond to this restriction.
0081   //! Returns Standard_False (default implementation)
0082   Standard_EXPORT virtual Standard_Boolean HasLastRestriction() const;
0083   
0084   //! Give the number of trace (Curves 2d which are not restriction)
0085   //! Returns 0 (default implementation)
0086   Standard_EXPORT virtual Standard_Integer TraceNumber() const;
0087   
0088   //! Give a status to the Law
0089   //! Returns PipeOk (default implementation)
0090   Standard_EXPORT virtual GeomFill_PipeError ErrorStatus() const;
0091   
0092   //! Returns  the number  of  intervals for  continuity
0093   //! <S>.
0094   //! May be one if Continuity(me) >= <S>
0095   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const = 0;
0096   
0097   //! Stores in <T> the  parameters bounding the intervals
0098   //! of continuity <S>.
0099   //!
0100   //! The array must provide  enough room to  accommodate
0101   //! for the parameters. i.e. T.Length() > NbIntervals()
0102   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
0103   
0104   //! Sets the bounds of the parametric interval on
0105   //! the function
0106   //! This determines the derivatives in these values if the
0107   //! function is not Cn.
0108   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) = 0;
0109   
0110   //! Gets the bounds of the parametric interval on
0111   //! the function
0112   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const = 0;
0113   
0114   //! Gets the bounds of the function parametric domain.
0115   //! Warning: This domain it is  not modified by the
0116   //! SetValue method
0117   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const = 0;
0118   
0119   //! Returns the resolutions in the  sub-space 2d <Index>
0120   //! This information is usfull to find an good tolerance in
0121   //! 2d approximation.
0122   Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const;
0123   
0124   //! Is useful, if (me) have to run numerical
0125   //! algorithm to perform D0, D1 or D2
0126   //! The default implementation make nothing.
0127   Standard_EXPORT virtual void SetTolerance (const Standard_Real Tol3d, const Standard_Real Tol2d);
0128   
0129   //! Get the maximum Norm  of the matrix-location part.  It
0130   //! is usful to find an good Tolerance to approx M(t).
0131   Standard_EXPORT virtual Standard_Real GetMaximalNorm() = 0;
0132   
0133   //! Get average value of M(t) and V(t) it is usfull to
0134   //! make fast approximation of rational surfaces.
0135   Standard_EXPORT virtual void GetAverageLaw (gp_Mat& AM, gp_Vec& AV) = 0;
0136   
0137   //! Say if the Location  Law, is an translation of  Location
0138   //! The default implementation is " returns False ".
0139   Standard_EXPORT virtual Standard_Boolean IsTranslation (Standard_Real& Error) const;
0140   
0141   //! Say if the Location  Law, is a rotation of Location
0142   //! The default implementation is " returns False ".
0143   Standard_EXPORT virtual Standard_Boolean IsRotation (Standard_Real& Error) const;
0144   
0145   Standard_EXPORT virtual void Rotation (gp_Pnt& Center) const;
0146 
0147 
0148 
0149 
0150   DEFINE_STANDARD_RTTIEXT(GeomFill_LocationLaw,Standard_Transient)
0151 
0152 protected:
0153 
0154 
0155 
0156 
0157 private:
0158 
0159 
0160 
0161 
0162 };
0163 
0164 
0165 
0166 
0167 
0168 
0169 
0170 #endif // _GeomFill_LocationLaw_HeaderFile