Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-04-21
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_LocationDraft_HeaderFile
0018 #define _GeomFill_LocationDraft_HeaderFile
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <gp_Mat.hxx>
0022 #include <gp_Dir.hxx>
0023 #include <Standard_Real.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TColgp_HArray1OfPnt2d.hxx>
0026 #include <Standard_Boolean.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 
0033 class GeomFill_DraftTrihedron;
0034 
0035 DEFINE_STANDARD_HANDLE(GeomFill_LocationDraft, GeomFill_LocationLaw)
0036 
0037 class GeomFill_LocationDraft : public GeomFill_LocationLaw
0038 {
0039 
0040 public:
0041 
0042   
0043   Standard_EXPORT GeomFill_LocationDraft(const gp_Dir& Direction, const Standard_Real Angle);
0044   
0045   Standard_EXPORT void SetStopSurf (const Handle(Adaptor3d_Surface)& Surf);
0046   
0047   Standard_EXPORT void SetAngle (const Standard_Real Angle);
0048   
0049   //! calculation of poles on locking surfaces (the intersection between the generatrixand the surface at the cross - section points myNbPts)
0050   //! @return Standard_True in case if execution end correctly
0051   Standard_EXPORT virtual Standard_Boolean SetCurve (const Handle(Adaptor3d_Curve)& C) Standard_OVERRIDE;
0052   
0053   Standard_EXPORT virtual const Handle(Adaptor3d_Curve)& GetCurve() const Standard_OVERRIDE;
0054   
0055   Standard_EXPORT virtual void SetTrsf (const gp_Mat& Transfo) Standard_OVERRIDE;
0056   
0057   Standard_EXPORT virtual Handle(GeomFill_LocationLaw) Copy() const Standard_OVERRIDE;
0058   
0059   //! compute Location
0060   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V) Standard_OVERRIDE;
0061   
0062   //! compute Location and 2d points
0063   Standard_EXPORT virtual Standard_Boolean D0 (const Standard_Real Param, gp_Mat& M, gp_Vec& V, TColgp_Array1OfPnt2d& Poles2d) Standard_OVERRIDE;
0064   
0065   //! compute location 2d  points and  associated
0066   //! first derivatives.
0067   //! Warning : It used only for C1 or C2 approximation
0068   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;
0069   
0070   //! compute location 2d  points and associated
0071   //! first and seconde  derivatives.
0072   //! Warning : It used only for C2 approximation
0073   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;
0074   
0075   //! Say if the first restriction is defined in this class.
0076   //! If it  is true the  first element  of poles array   in
0077   //! D0,D1,D2... Correspond to this restriction.
0078   //! Returns Standard_False (default implementation)
0079   Standard_EXPORT virtual Standard_Boolean HasFirstRestriction() const Standard_OVERRIDE;
0080   
0081   //! Say if the last restriction is defined in this class.
0082   //! If it is  true the  last element  of poles array in
0083   //! D0,D1,D2... Correspond to this restriction.
0084   //! Returns Standard_False (default implementation)
0085   Standard_EXPORT virtual Standard_Boolean HasLastRestriction() const Standard_OVERRIDE;
0086   
0087   //! Give the number of trace (Curves 2d which are not restriction)
0088   //! Returns 1 (default implementation)
0089   Standard_EXPORT virtual Standard_Integer TraceNumber() const Standard_OVERRIDE;
0090   
0091   //! Returns  the number  of  intervals for  continuity
0092   //! <S>.
0093   //! May be one if Continuity(me) >= <S>
0094   Standard_EXPORT virtual Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0095   
0096   //! Stores in <T> the  parameters bounding the intervals
0097   //! of continuity <S>.
0098   //!
0099   //! The array must provide  enough room to  accommodate
0100   //! for the parameters. i.e. T.Length() > NbIntervals()
0101   Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0102   
0103   //! Sets the bounds of the parametric interval on
0104   //! the function
0105   //! This determines the derivatives in these values if the
0106   //! function is not Cn.
0107   Standard_EXPORT virtual void SetInterval (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE;
0108   
0109   //! Gets the bounds of the parametric interval on
0110   //! the function
0111   Standard_EXPORT virtual void GetInterval (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0112   
0113   //! Gets the bounds of the function parametric domain.
0114   //! Warning: This domain it is  not modified by the
0115   //! SetValue method
0116   Standard_EXPORT virtual void GetDomain (Standard_Real& First, Standard_Real& Last) const Standard_OVERRIDE;
0117   
0118   //! Returns the resolutions in the  sub-space 2d <Index>
0119   //! This information is usfull to find an good tolerance in
0120   //! 2d approximation.
0121   //! Warning: Used only if Nb2dCurve > 0
0122   Standard_EXPORT virtual void Resolution (const Standard_Integer Index, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const Standard_OVERRIDE;
0123   
0124   //! Get the maximum Norm  of the matrix-location part.  It
0125   //! is usful to find an good Tolerance to approx M(t).
0126   Standard_EXPORT virtual Standard_Real GetMaximalNorm() Standard_OVERRIDE;
0127   
0128   //! Get average value of M(t) and V(t) it is usfull to
0129   //! make fast approximation of rational  surfaces.
0130   Standard_EXPORT virtual void GetAverageLaw (gp_Mat& AM, gp_Vec& AV) Standard_OVERRIDE;
0131   
0132   //! Say if the Location  Law, is an translation of  Location
0133   //! The default implementation is " returns False ".
0134   Standard_EXPORT virtual Standard_Boolean IsTranslation (Standard_Real& Error) const Standard_OVERRIDE;
0135   
0136   //! Say if the Location  Law, is a rotation of Location
0137   //! The default implementation is " returns False ".
0138   Standard_EXPORT virtual Standard_Boolean IsRotation (Standard_Real& Error) const Standard_OVERRIDE;
0139   
0140   Standard_EXPORT virtual void Rotation (gp_Pnt& Center) const Standard_OVERRIDE;
0141   
0142   //! Say if the generatrice interset the surface
0143   Standard_EXPORT Standard_Boolean IsIntersec() const;
0144   
0145   Standard_EXPORT gp_Dir Direction() const;
0146 
0147 
0148 
0149 
0150   DEFINE_STANDARD_RTTIEXT(GeomFill_LocationDraft,GeomFill_LocationLaw)
0151 
0152 protected:
0153 
0154 
0155   Handle(TColgp_HArray1OfPnt2d) myPoles2d;
0156 
0157 
0158 private:
0159 
0160   
0161   Standard_EXPORT void Prepare();
0162 
0163   gp_Mat Trans;
0164   Handle(GeomFill_DraftTrihedron) myLaw;
0165   Handle(Adaptor3d_Surface) mySurf;
0166   Handle(Adaptor3d_Curve) myCurve;
0167   Handle(Adaptor3d_Curve) myTrimmed;
0168   gp_Dir myDir;
0169   Standard_Real myAngle;
0170   Standard_Integer myNbPts;
0171   Standard_Boolean Intersec;
0172   Standard_Boolean WithTrans;
0173 
0174 
0175 };
0176 
0177 
0178 
0179 
0180 
0181 
0182 
0183 #endif // _GeomFill_LocationDraft_HeaderFile