Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Law_Composite.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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