Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-03-29
0002 // Created by: Laurent BOURESCHE
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 _Law_Composite_HeaderFile
0018 #define _Law_Composite_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Law_Laws.hxx>
0024 #include <Law_Function.hxx>
0025 #include <GeomAbs_Shape.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TColStd_Array1OfReal.hxx>
0028 
0029 
0030 class Law_Composite;
0031 DEFINE_STANDARD_HANDLE(Law_Composite, Law_Function)
0032 
0033 //! Loi  composite constituee  d une liste  de lois de
0034 //! ranges consecutifs.
0035 //! Cette implementation un peu lourde permet de reunir
0036 //! en une seule loi des portions de loi construites de
0037 //! facon independantes (par exemple en interactif) et
0038 //! de lancer le walking d un coup a l echelle d une
0039 //! ElSpine.
0040 //! CET OBJET REPOND DONC A UN PROBLEME D IMPLEMENTATION
0041 //! SPECIFIQUE AUX CONGES!!!
0042 class Law_Composite : public Law_Function
0043 {
0044 
0045 public:
0046 
0047 
0048   //! Construct an empty Law
0049   Standard_EXPORT Law_Composite();
0050 
0051   //! Construct an empty, trimmed Law
0052   Standard_EXPORT Law_Composite(const Standard_Real First, const Standard_Real Last, const Standard_Real Tol);
0053 
0054   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
0055 
0056   //! Returns  the number  of  intervals for  continuity
0057   //! <S>. May be one if Continuity(me) >= <S>
0058   Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE;
0059 
0060   //! Stores in <T> the  parameters bounding the intervals of continuity <S>.
0061   //! The array must provide enough room to accommodate for the parameters,
0062   //! i.e. T.Length() > NbIntervals()
0063   Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE;
0064 
0065   //! Returns the value at parameter X.
0066   Standard_EXPORT Standard_Real Value (const Standard_Real X) Standard_OVERRIDE;
0067 
0068   //! Returns the value and the first derivative at parameter X.
0069   Standard_EXPORT void D1 (const Standard_Real X, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE;
0070 
0071   //! Returns the value, first and second derivatives
0072   //! at parameter X.
0073   Standard_EXPORT void D2 (const Standard_Real X, Standard_Real& F, Standard_Real& D, Standard_Real& D2) Standard_OVERRIDE;
0074 
0075   //! Returns a  law equivalent of  <me>  between
0076   //! parameters <First>  and <Last>. <Tol>  is used  to
0077   //! test for 3d points confusion.
0078   //! It is usfule to determines the derivatives
0079   //! in these values <First> and <Last> if
0080   //! the Law is not Cn.
0081   Standard_EXPORT Handle(Law_Function) Trim (const Standard_Real PFirst, const Standard_Real PLast, const Standard_Real Tol) const Standard_OVERRIDE;
0082 
0083   //! Returns the parametric bounds of the function.
0084   Standard_EXPORT void Bounds (Standard_Real& PFirst, Standard_Real& PLast) Standard_OVERRIDE;
0085 
0086   //! Returns the elementary  function of the composite used
0087   //! to compute at parameter W.
0088   Standard_EXPORT Handle(Law_Function)& ChangeElementaryLaw (const Standard_Real W);
0089 
0090   Standard_EXPORT Law_Laws& ChangeLaws();
0091 
0092   Standard_EXPORT Standard_Boolean IsPeriodic() const;
0093 
0094   Standard_EXPORT void SetPeriodic();
0095 
0096   DEFINE_STANDARD_RTTIEXT(Law_Composite,Law_Function)
0097 
0098 private:
0099 
0100   //! Set the current function.
0101   Standard_EXPORT void Prepare (Standard_Real& W);
0102 
0103   Standard_Real first;
0104   Standard_Real last;
0105   Handle(Law_Function) curfunc;
0106   Law_Laws funclist;
0107   Standard_Boolean periodic;
0108   Standard_Real TFirst;
0109   Standard_Real TLast;
0110   Standard_Real PTol;
0111 
0112 };
0113 
0114 #endif // _Law_Composite_HeaderFile