|
|
|||
File indexing completed on 2026-09-28 09:20:04
0001 // Copyright (c) 2025 OPEN CASCADE SAS 0002 // 0003 // This file is part of Open CASCADE Technology software library. 0004 // 0005 // This library is free software; you can redistribute it and/or modify it under 0006 // the terms of the GNU Lesser General Public License version 2.1 as published 0007 // by the Free Software Foundation, with special exception defined in the file 0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0009 // distribution for complete text of the license and disclaimer of any warranty. 0010 // 0011 // Alternatively, this file may be used under the terms of Open CASCADE 0012 // commercial license or contractual agreement. 0013 0014 #ifndef _Geom2dGridEval_OffsetCurve_HeaderFile 0015 #define _Geom2dGridEval_OffsetCurve_HeaderFile 0016 0017 #include <Geom2d_Curve.hxx> 0018 #include <Geom2d_OffsetCurve.hxx> 0019 #include <Geom2dGridEval.hxx> 0020 #include <NCollection_Array1.hxx> 0021 #include <Standard.hxx> 0022 #include <Standard_DefineAlloc.hxx> 0023 0024 //! @brief Batch evaluator for 2D offset curve grid points. 0025 //! 0026 //! Evaluates the 2D offset curve formula: 0027 //! P(u) = C(u) + Offset * N / ||N|| 0028 //! where N = (D1.Y, -D1.X) is the normal (tangent rotated 90 degrees). 0029 //! 0030 //! Uses Geom2dGridEval_Curve for batch evaluation of the basis curve, 0031 //! then applies offset transformation. 0032 //! 0033 //! Usage: 0034 //! @code 0035 //! Geom2dGridEval_OffsetCurve anEvaluator(myGeom2dOffset); 0036 //! NCollection_Array1<gp_Pnt2d> aGrid = anEvaluator.EvaluateGrid(myParams); 0037 //! @endcode 0038 class Geom2dGridEval_OffsetCurve 0039 { 0040 public: 0041 DEFINE_STANDARD_ALLOC 0042 0043 //! Constructor with geometry. 0044 //! @param theOffset the 2D offset curve geometry to evaluate 0045 Geom2dGridEval_OffsetCurve(const occ::handle<Geom2d_OffsetCurve>& theOffset) 0046 : myGeom(theOffset), 0047 myOffset(0.0) 0048 { 0049 if (!myGeom.IsNull()) 0050 { 0051 myOffset = myGeom->Offset(); 0052 myBasis = myGeom->BasisCurve(); 0053 } 0054 } 0055 0056 //! Non-copyable and non-movable. 0057 Geom2dGridEval_OffsetCurve(const Geom2dGridEval_OffsetCurve&) = delete; 0058 Geom2dGridEval_OffsetCurve& operator=(const Geom2dGridEval_OffsetCurve&) = delete; 0059 Geom2dGridEval_OffsetCurve(Geom2dGridEval_OffsetCurve&&) = delete; 0060 Geom2dGridEval_OffsetCurve& operator=(Geom2dGridEval_OffsetCurve&&) = delete; 0061 0062 //! Returns the geometry handle. 0063 const occ::handle<Geom2d_OffsetCurve>& Geometry() const { return myGeom; } 0064 0065 //! Evaluate all grid points. 0066 //! @param theParams array of parameter values 0067 //! @return array of evaluated points (1-based indexing), 0068 //! or empty array if geometry is null or no parameters 0069 Standard_EXPORT NCollection_Array1<gp_Pnt2d> EvaluateGrid( 0070 const NCollection_Array1<double>& theParams) const; 0071 0072 //! Evaluate all grid points with first derivative. 0073 //! @param theParams array of parameter values 0074 //! @return array of CurveD1 (1-based indexing), 0075 //! or empty array if geometry is null or no parameters 0076 Standard_EXPORT NCollection_Array1<Geom2dGridEval::CurveD1> EvaluateGridD1( 0077 const NCollection_Array1<double>& theParams) const; 0078 0079 //! Evaluate all grid points with first and second derivatives. 0080 //! @param theParams array of parameter values 0081 //! @return array of CurveD2 (1-based indexing), 0082 //! or empty array if geometry is null or no parameters 0083 Standard_EXPORT NCollection_Array1<Geom2dGridEval::CurveD2> EvaluateGridD2( 0084 const NCollection_Array1<double>& theParams) const; 0085 0086 //! Evaluate all grid points with derivatives up to third order. 0087 //! @param theParams array of parameter values 0088 //! @return array of CurveD3 (1-based indexing), 0089 //! or empty array if geometry is null or no parameters 0090 Standard_EXPORT NCollection_Array1<Geom2dGridEval::CurveD3> EvaluateGridD3( 0091 const NCollection_Array1<double>& theParams) const; 0092 0093 //! Evaluate Nth derivative at all grid points. 0094 //! For orders 1-3, reuses EvaluateGridD1/D2/D3. 0095 //! For orders > 3, uses basis curve DN method. 0096 //! @param theParams array of parameter values 0097 //! @param theN derivative order (N >= 1) 0098 //! @return array of derivative vectors (1-based indexing) 0099 Standard_EXPORT NCollection_Array1<gp_Vec2d> EvaluateGridDN( 0100 const NCollection_Array1<double>& theParams, 0101 int theN) const; 0102 0103 private: 0104 occ::handle<Geom2d_OffsetCurve> myGeom; 0105 occ::handle<Geom2d_Curve> myBasis; 0106 double myOffset; 0107 }; 0108 0109 #endif // _Geom2dGridEval_OffsetCurve_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|