0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017
[occt.git] / src / IntAna / IntAna_Quadric.hxx
1 // Created on: 1992-07-01
2 // Created by: Laurent BUCHARD
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IntAna_Quadric_HeaderFile
18 #define _IntAna_Quadric_HeaderFile
19
20 #include <Standard_DefineAlloc.hxx>
21 #include <NCollection_List.hxx>
22
23 //! This class provides a description of Quadrics by their
24 //! Coefficients in natural coordinate system.
25 class IntAna_Quadric 
26 {
27 public:
28
29   DEFINE_STANDARD_ALLOC
30
31   
32   //! Empty Constructor
33   Standard_EXPORT IntAna_Quadric();
34   
35   //! Creates a Quadric from a Pln
36   Standard_EXPORT IntAna_Quadric(const gp_Pln& P);
37   
38   //! Creates a Quadric from a Sphere
39   Standard_EXPORT IntAna_Quadric(const gp_Sphere& Sph);
40   
41   //! Creates a Quadric from a Cylinder
42   Standard_EXPORT IntAna_Quadric(const gp_Cylinder& Cyl);
43   
44   //! Creates a Quadric from a Cone
45   Standard_EXPORT IntAna_Quadric(const gp_Cone& Cone);
46   
47   //! Initializes the quadric with a Pln
48   Standard_EXPORT void SetQuadric (const gp_Pln& P);
49   
50   //! Initialize the quadric with a Sphere
51   Standard_EXPORT void SetQuadric (const gp_Sphere& Sph);
52   
53   //! Initializes the quadric with a Cone
54   Standard_EXPORT void SetQuadric (const gp_Cone& Con);
55   
56   //! Initializes the quadric with a Cylinder
57   Standard_EXPORT void SetQuadric (const gp_Cylinder& Cyl);
58   
59   //! Returns the coefficients of the polynomial equation
60   //! which define the quadric:
61   //! xCXX x**2 + xCYY y**2 + xCZZ z**2
62   //! + 2 ( xCXY x y  + xCXZ x z  + xCYZ y z  )
63   //! + 2 ( xCX x + xCY y + xCZ z )
64   //! + xCCte
65   Standard_EXPORT void Coefficients (Standard_Real& xCXX, Standard_Real& xCYY, Standard_Real& xCZZ, Standard_Real& xCXY, Standard_Real& xCXZ, Standard_Real& xCYZ, Standard_Real& xCX, Standard_Real& xCY, Standard_Real& xCZ, Standard_Real& xCCte) const;
66   
67   //! Returns the coefficients of the polynomial equation
68   //! ( written in the natural coordinates system )
69   //! in the local coordinates system defined by Axis
70   Standard_EXPORT void NewCoefficients (Standard_Real& xCXX, Standard_Real& xCYY, Standard_Real& xCZZ, Standard_Real& xCXY, Standard_Real& xCXZ, Standard_Real& xCYZ, Standard_Real& xCX, Standard_Real& xCY, Standard_Real& xCZ, Standard_Real& xCCte, const gp_Ax3& Axis) const;
71
72   //! Returns the list of special points (with singularities)
73   const NCollection_List<gp_Pnt>& SpecialPoints() const
74   {
75     return mySpecialPoints;
76   }
77
78
79 protected:
80
81
82
83
84
85 private:
86
87
88
89   Standard_Real CXX;
90   Standard_Real CYY;
91   Standard_Real CZZ;
92   Standard_Real CXY;
93   Standard_Real CXZ;
94   Standard_Real CYZ;
95   Standard_Real CX;
96   Standard_Real CY;
97   Standard_Real CZ;
98   Standard_Real CCte;
99   NCollection_List<gp_Pnt> mySpecialPoints;
100
101 };
102
103
104
105
106
107
108
109 #endif // _IntAna_Quadric_HeaderFile