Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:17:16

0001 // Copyright (c) 1991-1999 Matra Datavision
0002 // Copyright (c) 1999-2022 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _GeomConvert_FuncConeLSDist_HeaderFile
0016 #define _GeomConvert_FuncConeLSDist_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 
0021 #include <math_MultipleVarFunction.hxx>
0022 #include <gp_XYZ.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <math_Vector.hxx>
0026 #include <gp_Dir.hxx>
0027 
0028 //! Function for search of Cone canonic parameters: coordinates of center local coordinate system,
0029 //! direction of axis, radius and semi-angle from set of points
0030 //! by least square method.
0031 class GeomConvert_FuncConeLSDist : public math_MultipleVarFunction
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   //! Constructor.
0037   Standard_EXPORT GeomConvert_FuncConeLSDist() = default;
0038 
0039   Standard_EXPORT GeomConvert_FuncConeLSDist(
0040     const occ::handle<NCollection_HArray1<gp_XYZ>>& thePoints,
0041     const gp_Dir&                                   theDir);
0042 
0043   void SetPoints(const occ::handle<NCollection_HArray1<gp_XYZ>>& thePoints)
0044   {
0045     myPoints = thePoints;
0046   }
0047 
0048   void SetDir(const gp_Dir& theDir) { myDir = theDir; }
0049 
0050   //! Number of variables.
0051   Standard_EXPORT int NbVariables() const override;
0052 
0053   //! Value.
0054   Standard_EXPORT bool Value(const math_Vector& X, double& F) override;
0055 
0056 private:
0057   occ::handle<NCollection_HArray1<gp_XYZ>> myPoints;
0058   gp_Dir                                   myDir;
0059 };
0060 #endif // _GeomConvert_FuncConeLSDist_HeaderFile