| // Copyright (c) 1991-1999 Matra Datavision | |
| // Copyright (c) 1999-2022 OPEN CASCADE SAS | |
| // | |
| // This file is part of Open CASCADE Technology software library. | |
| // | |
| // This library is free software; you can redistribute it and/or modify it under | |
| // the terms of the GNU Lesser General Public License version 2.1 as published | |
| // by the Free Software Foundation, with special exception defined in the file | |
| // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
| // distribution for complete text of the license and disclaimer of any warranty. | |
| // | |
| // Alternatively, this file may be used under the terms of Open CASCADE | |
| // commercial license or contractual agreement. | |
| #ifndef _GeomConvert_FuncConeLSDist_HeaderFile | |
| #define _GeomConvert_FuncConeLSDist_HeaderFile | |
| #include <Standard.hxx> | |
| #include <Standard_DefineAlloc.hxx> | |
| #include <math_MultipleVarFunction.hxx> | |
| #include <gp_XYZ.hxx> | |
| #include <NCollection_Array1.hxx> | |
| #include <NCollection_HArray1.hxx> | |
| #include <math_Vector.hxx> | |
| #include <gp_Dir.hxx> | |
| //! Function for search of Cone canonic parameters: coordinates of center local coordinate system, | |
| //! direction of axis, radius and semi-angle from set of points | |
| //! by least square method. | |
| class GeomConvert_FuncConeLSDist : public math_MultipleVarFunction | |
| { | |
| public: | |
| DEFINE_STANDARD_ALLOC | |
| //! Constructor. | |
| Standard_EXPORT GeomConvert_FuncConeLSDist() = default; | |
| Standard_EXPORT GeomConvert_FuncConeLSDist( | |
| const occ::handle<NCollection_HArray1<gp_XYZ>>& thePoints, | |
| const gp_Dir& theDir); | |
| void SetPoints(const occ::handle<NCollection_HArray1<gp_XYZ>>& thePoints) | |
| { | |
| myPoints = thePoints; | |
| } | |
| void SetDir(const gp_Dir& theDir) { myDir = theDir; } | |
| //! Number of variables. | |
| Standard_EXPORT int NbVariables() const override; | |
| //! Value. | |
| Standard_EXPORT bool Value(const math_Vector& X, double& F) override; | |
| private: | |
| occ::handle<NCollection_HArray1<gp_XYZ>> myPoints; | |
| gp_Dir myDir; | |
| }; | |
| #endif // _GeomConvert_FuncConeLSDist_HeaderFile |