Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:28:24

0001 // Created on: 1992-07-01
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IntAna_Quadric_HeaderFile
0018 #define _IntAna_Quadric_HeaderFile
0019 
0020 #include <NCollection_List.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 class gp_Cone;
0024 class gp_Cylinder;
0025 class gp_Pln;
0026 class gp_Sphere;
0027 
0028 //! This class provides a description of Quadrics by their
0029 //! Coefficients in natural coordinate system.
0030 class IntAna_Quadric
0031 {
0032 public:
0033   DEFINE_STANDARD_ALLOC
0034 
0035   //! Empty Constructor
0036   Standard_EXPORT IntAna_Quadric();
0037 
0038   //! Creates a Quadric from a Pln
0039   Standard_EXPORT IntAna_Quadric(const gp_Pln& P);
0040 
0041   //! Creates a Quadric from a Sphere
0042   Standard_EXPORT IntAna_Quadric(const gp_Sphere& Sph);
0043 
0044   //! Creates a Quadric from a Cylinder
0045   Standard_EXPORT IntAna_Quadric(const gp_Cylinder& Cyl);
0046 
0047   //! Creates a Quadric from a Cone
0048   Standard_EXPORT IntAna_Quadric(const gp_Cone& Cone);
0049 
0050   //! Initializes the quadric with a Pln
0051   Standard_EXPORT void SetQuadric(const gp_Pln& P);
0052 
0053   //! Initialize the quadric with a Sphere
0054   Standard_EXPORT void SetQuadric(const gp_Sphere& Sph);
0055 
0056   //! Initializes the quadric with a Cone
0057   Standard_EXPORT void SetQuadric(const gp_Cone& Con);
0058 
0059   //! Initializes the quadric with a Cylinder
0060   Standard_EXPORT void SetQuadric(const gp_Cylinder& Cyl);
0061 
0062   //! Returns the coefficients of the polynomial equation
0063   //! which define the quadric:
0064   //! xCXX x**2 + xCYY y**2 + xCZZ z**2
0065   //! + 2 ( xCXY x y  + xCXZ x z  + xCYZ y z  )
0066   //! + 2 ( xCX x + xCY y + xCZ z )
0067   //! + xCCte
0068   Standard_EXPORT void Coefficients(double& xCXX,
0069                                     double& xCYY,
0070                                     double& xCZZ,
0071                                     double& xCXY,
0072                                     double& xCXZ,
0073                                     double& xCYZ,
0074                                     double& xCX,
0075                                     double& xCY,
0076                                     double& xCZ,
0077                                     double& xCCte) const;
0078 
0079   //! Returns the coefficients of the polynomial equation
0080   //! ( written in the natural coordinates system )
0081   //! in the local coordinates system defined by Axis
0082   Standard_EXPORT void NewCoefficients(double&       xCXX,
0083                                        double&       xCYY,
0084                                        double&       xCZZ,
0085                                        double&       xCXY,
0086                                        double&       xCXZ,
0087                                        double&       xCYZ,
0088                                        double&       xCX,
0089                                        double&       xCY,
0090                                        double&       xCZ,
0091                                        double&       xCCte,
0092                                        const gp_Ax3& Axis) const;
0093 
0094   //! Returns the list of special points (with singularities)
0095   const NCollection_List<gp_Pnt>& SpecialPoints() const { return mySpecialPoints; }
0096 
0097 private:
0098   double                   CXX;
0099   double                   CYY;
0100   double                   CZZ;
0101   double                   CXY;
0102   double                   CXZ;
0103   double                   CYZ;
0104   double                   CX;
0105   double                   CY;
0106   double                   CZ;
0107   double                   CCte;
0108   NCollection_List<gp_Pnt> mySpecialPoints;
0109 };
0110 
0111 #endif // _IntAna_Quadric_HeaderFile