Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-11-15
0002 // Created by: Laurent BOURESCHE
0003 // Copyright (c) 1995-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 _Law_Interpolate_HeaderFile
0018 #define _Law_Interpolate_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColStd_HArray1OfReal.hxx>
0025 #include <TColStd_HArray1OfBoolean.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 class Law_BSpline;
0028 
0029 
0030 //! This  class   is used  to   interpolate a BsplineCurve
0031 //! passing through    an  array of  points,   with   a C2
0032 //! Continuity if tangency  is not requested at the point.
0033 //! If tangency is  requested at the  point the continuity
0034 //! will be C1.  If Perodicity is requested the curve will
0035 //! be  closed  and the junction will  be  the first point
0036 //! given. The curve will than be only C1
0037 class Law_Interpolate 
0038 {
0039 public:
0040 
0041   DEFINE_STANDARD_ALLOC
0042 
0043   
0044   //! Tolerance is to check if  the points are not too close
0045   //! to one an  other.  It is  also  used to check   if the
0046   //! tangent vector  is not too small.   There should be at
0047   //! least 2 points. If PeriodicFlag is True then the curve
0048   //! will be periodic be periodic
0049   Standard_EXPORT Law_Interpolate(const Handle(TColStd_HArray1OfReal)& Points, const Standard_Boolean PeriodicFlag, const Standard_Real Tolerance);
0050   
0051   //! Tolerance is to check if  the points are not too close
0052   //! to one an  other.  It is  also  used to check   if the
0053   //! tangent vector  is not too small.   There should be at
0054   //! least 2 points. If PeriodicFlag is True then the curve
0055   //! will be periodic be periodic
0056   Standard_EXPORT Law_Interpolate(const Handle(TColStd_HArray1OfReal)& Points, const Handle(TColStd_HArray1OfReal)& Parameters, const Standard_Boolean PeriodicFlag, const Standard_Real Tolerance);
0057   
0058   //! loads initial and final tangents if any.
0059   Standard_EXPORT void Load (const Standard_Real InitialTangent, const Standard_Real FinalTangent);
0060   
0061   //! loads the tangents. We should have as many tangents as
0062   //! they are points  in the array if TangentFlags.Value(i)
0063   //! is    Standard_True  use the tangent Tangents.Value(i)
0064   //! otherwise the tangent is not constrained.
0065   Standard_EXPORT void Load (const TColStd_Array1OfReal& Tangents, const Handle(TColStd_HArray1OfBoolean)& TangentFlags);
0066   
0067   //! Clears the tangents if any
0068   Standard_EXPORT void ClearTangents();
0069   
0070   //! Makes the interpolation
0071   Standard_EXPORT void Perform();
0072   
0073   Standard_EXPORT const Handle(Law_BSpline)& Curve() const;
0074   
0075   Standard_EXPORT Standard_Boolean IsDone() const;
0076 
0077 
0078 
0079 
0080 protected:
0081 
0082 
0083 
0084 
0085 
0086 private:
0087 
0088   
0089   //! Interpolates in a non periodic fashion.
0090   Standard_EXPORT void PerformNonPeriodic();
0091   
0092   //! Interpolates in a C1 periodic fashion.
0093   Standard_EXPORT void PerformPeriodic();
0094 
0095 
0096   Standard_Real myTolerance;
0097   Handle(TColStd_HArray1OfReal) myPoints;
0098   Standard_Boolean myIsDone;
0099   Handle(Law_BSpline) myCurve;
0100   Handle(TColStd_HArray1OfReal) myTangents;
0101   Handle(TColStd_HArray1OfBoolean) myTangentFlags;
0102   Handle(TColStd_HArray1OfReal) myParameters;
0103   Standard_Boolean myPeriodic;
0104   Standard_Boolean myTangentRequest;
0105 
0106 
0107 };
0108 
0109 
0110 
0111 
0112 
0113 
0114 
0115 #endif // _Law_Interpolate_HeaderFile