Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:38

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 <TColgp_HArray1OfXYZ.hxx>
0023 #include <math_Vector.hxx>
0024 #include <gp_Dir.hxx>
0025 
0026 //! Function for search of Cone canonic parameters: coordinates of center local coordinate system, 
0027 //! direction of axis, radius and semi-angle from set of points
0028 //! by least square method.
0029 //! 
0030 //!
0031 class GeomConvert_FuncConeLSDist : public math_MultipleVarFunction
0032 {
0033 public:
0034 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! Constructor.
0038   Standard_EXPORT GeomConvert_FuncConeLSDist() {};
0039   
0040   Standard_EXPORT GeomConvert_FuncConeLSDist(const Handle(TColgp_HArray1OfXYZ)& thePoints,
0041                                                    const gp_Dir& theDir);
0042 
0043   void SetPoints(const Handle(TColgp_HArray1OfXYZ)& thePoints)
0044   {
0045     myPoints = thePoints;
0046   }
0047 
0048   void SetDir(const gp_Dir& theDir)
0049   {
0050     myDir = theDir;
0051   }
0052 
0053   //! Number of variables.
0054   Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
0055 
0056   //! Value.
0057   Standard_EXPORT Standard_Boolean Value(const math_Vector& X,Standard_Real& F) Standard_OVERRIDE;
0058 
0059 
0060 private:
0061 
0062   Handle(TColgp_HArray1OfXYZ) myPoints;
0063   gp_Dir myDir;
0064   
0065 };
0066 #endif // _GeomConvert_FuncConeLSDist_HeaderFile