|
||||
File indexing completed on 2025-01-18 10:03:37
0001 // Created on: 1994-03-21 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 _GeomAPI_PointsToBSpline_HeaderFile 0018 #define _GeomAPI_PointsToBSpline_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <TColgp_Array1OfPnt.hxx> 0025 #include <Standard_Integer.hxx> 0026 #include <GeomAbs_Shape.hxx> 0027 #include <Approx_ParametrizationType.hxx> 0028 #include <TColStd_Array1OfReal.hxx> 0029 class Geom_BSplineCurve; 0030 0031 0032 //! This class is used to approximate a BsplineCurve 0033 //! passing through an array of points, with a given Continuity. 0034 //! Describes functions for building a 3D BSpline 0035 //! curve which approximates a set of points. 0036 //! A PointsToBSpline object provides a framework for: 0037 //! - defining the data of the BSpline curve to be built, 0038 //! - implementing the approximation algorithm, and consulting the results. 0039 class GeomAPI_PointsToBSpline 0040 { 0041 public: 0042 0043 DEFINE_STANDARD_ALLOC 0044 0045 0046 //! Constructs an empty approximation algorithm. 0047 //! Use an Init function to define and build the BSpline curve. 0048 Standard_EXPORT GeomAPI_PointsToBSpline(); 0049 0050 //! Approximate a BSpline Curve passing through an 0051 //! array of Point. The resulting BSpline will have 0052 //! the following properties: 0053 //! 1- his degree will be in the range [Degmin,Degmax] 0054 //! 2- his continuity will be at least <Continuity> 0055 //! 3- the distance from the point <Points> to the 0056 //! BSpline will be lower to Tol3D 0057 Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0058 0059 //! Approximate a BSpline Curve passing through an 0060 //! array of Point. The resulting BSpline will have 0061 //! the following properties: 0062 //! 1- his degree will be in the range [Degmin,Degmax] 0063 //! 2- his continuity will be at least <Continuity> 0064 //! 3- the distance from the point <Points> to the 0065 //! BSpline will be lower to Tol3D 0066 Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0067 0068 //! Approximate a BSpline Curve passing through an 0069 //! array of Point, which parameters are given by the 0070 //! array <Parameters>. 0071 //! The resulting BSpline will have the following 0072 //! properties: 0073 //! 1- his degree will be in the range [Degmin,Degmax] 0074 //! 2- his continuity will be at least <Continuity> 0075 //! 3- the distance from the point <Points> to the 0076 //! BSpline will be lower to Tol3D 0077 Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0078 0079 //! Approximate a BSpline Curve passing through an 0080 //! array of Point using variational smoothing algorithm, 0081 //! which tries to minimize additional criterium: 0082 //! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion 0083 Standard_EXPORT GeomAPI_PointsToBSpline(const TColgp_Array1OfPnt& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0084 0085 //! Approximate a BSpline Curve passing through an 0086 //! array of Point. The resulting BSpline will have 0087 //! the following properties: 0088 //! 1- his degree will be in the range [Degmin,Degmax] 0089 //! 2- his continuity will be at least <Continuity> 0090 //! 3- the distance from the point <Points> to the 0091 //! BSpline will be lower to Tol3D 0092 Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0093 0094 //! Approximate a BSpline Curve passing through an 0095 //! array of Point. The resulting BSpline will have 0096 //! the following properties: 0097 //! 1- his degree will be in the range [Degmin,Degmax] 0098 //! 2- his continuity will be at least <Continuity> 0099 //! 3- the distance from the point <Points> to the 0100 //! BSpline will be lower to Tol3D 0101 Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Approx_ParametrizationType ParType, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0102 0103 //! Approximate a BSpline Curve passing through an 0104 //! array of Point, which parameters are given by the 0105 //! array <Parameters>. 0106 //! The resulting BSpline will have the following 0107 //! properties: 0108 //! 1- his degree will be in the range [Degmin,Degmax] 0109 //! 2- his continuity will be at least <Continuity> 0110 //! 3- the distance from the point <Points> to the 0111 //! BSpline will be lower to Tol3D 0112 Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const TColStd_Array1OfReal& Parameters, const Standard_Integer DegMin = 3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0113 0114 //! Approximate a BSpline Curve passing through an 0115 //! array of Point using variational smoothing algorithm, 0116 //! which tries to minimize additional criterium: 0117 //! Weight1*CurveLength + Weight2*Curvature + Weight3*Torsion 0118 Standard_EXPORT void Init (const TColgp_Array1OfPnt& Points, const Standard_Real Weight1, const Standard_Real Weight2, const Standard_Real Weight3, const Standard_Integer DegMax = 8, const GeomAbs_Shape Continuity = GeomAbs_C2, const Standard_Real Tol3D = 1.0e-3); 0119 0120 //! Returns the computed BSpline curve. 0121 //! Raises StdFail_NotDone if the curve is not built. 0122 Standard_EXPORT const Handle(Geom_BSplineCurve)& Curve() const; 0123 Standard_EXPORT operator Handle(Geom_BSplineCurve)() const; 0124 0125 Standard_EXPORT Standard_Boolean IsDone() const; 0126 0127 0128 0129 0130 protected: 0131 0132 0133 0134 0135 0136 private: 0137 0138 0139 0140 Standard_Boolean myIsDone; 0141 Handle(Geom_BSplineCurve) myCurve; 0142 0143 0144 }; 0145 0146 0147 0148 0149 0150 0151 0152 #endif // _GeomAPI_PointsToBSpline_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |