Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:14:31

0001 // Created on: 1994-02-28
0002 // Created by: Bruno DUMORTIER
0003 // Copyright (c) 1994-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_SweepSectionGenerator_HeaderFile
0018 #define _GeomFill_SweepSectionGenerator_HeaderFile
0019 
0020 #include <Adaptor3d_Curve.hxx>
0021 #include <gp_Ax1.hxx>
0022 #include <gp_Trsf.hxx>
0023 #include <NCollection_Sequence.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <gp_Pnt.hxx>
0027 #include <gp_Vec.hxx>
0028 #include <gp_Pnt2d.hxx>
0029 #include <gp_Vec2d.hxx>
0030 
0031 class Geom_BSplineCurve;
0032 class Geom_Curve;
0033 class gp_Trsf;
0034 
0035 //! class for instantiation of AppBlend.
0036 //! evaluate the sections of a sweep surface.
0037 class GeomFill_SweepSectionGenerator
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   Standard_EXPORT GeomFill_SweepSectionGenerator();
0043 
0044   //! Create a sweept surface with a constant radius.
0045   Standard_EXPORT GeomFill_SweepSectionGenerator(const occ::handle<Geom_Curve>& Path,
0046                                                  const double                   Radius);
0047 
0048   //! Create a sweept surface with a constant section
0049   Standard_EXPORT GeomFill_SweepSectionGenerator(const occ::handle<Geom_Curve>& Path,
0050                                                  const occ::handle<Geom_Curve>& FirstSect);
0051 
0052   //! Create a sweept surface with an evolving section
0053   //! The section evaluate from First to Last Section
0054   Standard_EXPORT GeomFill_SweepSectionGenerator(const occ::handle<Geom_Curve>& Path,
0055                                                  const occ::handle<Geom_Curve>& FirstSect,
0056                                                  const occ::handle<Geom_Curve>& LastSect);
0057 
0058   //! Create a pipe with a constant radius with 2
0059   //! guide-line.
0060   Standard_EXPORT GeomFill_SweepSectionGenerator(const occ::handle<Geom_Curve>& Path,
0061                                                  const occ::handle<Geom_Curve>& Curve1,
0062                                                  const occ::handle<Geom_Curve>& Curve2,
0063                                                  const double                   Radius);
0064 
0065   //! Create a pipe with a constant radius with 2
0066   //! guide-line.
0067   Standard_EXPORT GeomFill_SweepSectionGenerator(const occ::handle<Adaptor3d_Curve>& Path,
0068                                                  const occ::handle<Adaptor3d_Curve>& Curve1,
0069                                                  const occ::handle<Adaptor3d_Curve>& Curve2,
0070                                                  const double                        Radius);
0071 
0072   Standard_EXPORT void Init(const occ::handle<Geom_Curve>& Path, const double Radius);
0073 
0074   Standard_EXPORT void Init(const occ::handle<Geom_Curve>& Path,
0075                             const occ::handle<Geom_Curve>& FirstSect);
0076 
0077   Standard_EXPORT void Init(const occ::handle<Geom_Curve>& Path,
0078                             const occ::handle<Geom_Curve>& FirstSect,
0079                             const occ::handle<Geom_Curve>& LastSect);
0080 
0081   Standard_EXPORT void Init(const occ::handle<Geom_Curve>& Path,
0082                             const occ::handle<Geom_Curve>& Curve1,
0083                             const occ::handle<Geom_Curve>& Curve2,
0084                             const double                   Radius);
0085 
0086   Standard_EXPORT void Init(const occ::handle<Adaptor3d_Curve>& Path,
0087                             const occ::handle<Adaptor3d_Curve>& Curve1,
0088                             const occ::handle<Adaptor3d_Curve>& Curve2,
0089                             const double                        Radius);
0090 
0091   Standard_EXPORT void Perform(const bool Polynomial = false);
0092 
0093   Standard_EXPORT void GetShape(int& NbPoles, int& NbKnots, int& Degree, int& NbPoles2d) const;
0094 
0095   Standard_EXPORT void Knots(NCollection_Array1<double>& TKnots) const;
0096 
0097   Standard_EXPORT void Mults(NCollection_Array1<int>& TMults) const;
0098 
0099   int NbSections() const;
0100 
0101   //! Used for the first and last section
0102   //! The method returns true if the derivatives
0103   //! are computed, otherwise it returns false.
0104   Standard_EXPORT bool Section(const int                     P,
0105                                NCollection_Array1<gp_Pnt>&   Poles,
0106                                NCollection_Array1<gp_Vec>&   DPoles,
0107                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0108                                NCollection_Array1<gp_Vec2d>& DPoles2d,
0109                                NCollection_Array1<double>&   Weigths,
0110                                NCollection_Array1<double>&   DWeigths) const;
0111 
0112   Standard_EXPORT void Section(const int                     P,
0113                                NCollection_Array1<gp_Pnt>&   Poles,
0114                                NCollection_Array1<gp_Pnt2d>& Poles2d,
0115                                NCollection_Array1<double>&   Weigths) const;
0116 
0117   //! raised if <Index> not in the range [1,NbSections()]
0118   Standard_EXPORT const gp_Trsf& Transformation(const int Index) const;
0119 
0120   //! Returns the parameter of <P>, to impose it for the
0121   //! approximation.
0122   Standard_EXPORT double Parameter(const int P) const;
0123 
0124 private:
0125   occ::handle<Geom_BSplineCurve> myPath;
0126   occ::handle<Geom_BSplineCurve> myFirstSect;
0127   occ::handle<Geom_BSplineCurve> myLastSect;
0128   occ::handle<Adaptor3d_Curve>   myAdpPath;
0129   occ::handle<Adaptor3d_Curve>   myAdpFirstSect;
0130   occ::handle<Adaptor3d_Curve>   myAdpLastSect;
0131   gp_Ax1                         myCircPathAxis;
0132   double                         myRadius;
0133   bool                           myIsDone;
0134   int                            myNbSections;
0135   NCollection_Sequence<gp_Trsf>  myTrsfs;
0136   int                            myType;
0137   bool                           myPolynomial;
0138 };
0139 
0140 #include <GeomFill_SweepSectionGenerator.lxx>
0141 
0142 #endif // _GeomFill_SweepSectionGenerator_HeaderFile