Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_CanonicalRecognition.h
1 // Copyright (C) 2014-2023  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GeomAlgoAPI_CanonicalRecognition_H_
21 #define GeomAlgoAPI_CanonicalRecognition_H_
22
23 #include "GeomAlgoAPI.h"
24 #include <GeomAPI_Shape.h>
25
26 #include <vector>
27
28 class GeomAlgoAPI_CanonicalRecognition
29 {
30 public:
31   /*!
32    *  \brief Check if the shape is planar
33    */
34   GEOMALGOAPI_EXPORT static bool isPlane(const GeomShapePtr& theShape, double theTolerance,
35     std::vector<double>& theNormal, std::vector<double>& theOrigin);
36
37   /*!
38    * \brief Check if shape is spherical
39    */
40   GEOMALGOAPI_EXPORT static bool isSphere(const GeomShapePtr& theShape, double theTolerance,
41     std::vector<double>& theOrigin, double& theRadius);
42
43   /*!
44    * \brief Check if shape is conical
45    */
46   GEOMALGOAPI_EXPORT static bool isCone(const GeomShapePtr& theShape, double theTolerance,
47     std::vector<double>& theAxis, std::vector<double>& theApex,
48     double& theHalfAngle);
49
50   /*!
51    * \brief Check if shape is cylinder
52    */
53   GEOMALGOAPI_EXPORT static bool isCylinder(const GeomShapePtr& theShape, double theTolerance,
54     std::vector<double>& theAxis, std::vector<double>& theOrigin,
55     double& theRadius);
56
57   /*!
58    * \brief Check if edge / wire is line
59    */
60   GEOMALGOAPI_EXPORT static bool isLine(const GeomShapePtr& theEdge, double theTolerance,
61     std::vector<double>& theDir, std::vector<double>& theOrigin);
62
63   /*!
64    * \brief Check if edge / wire is circle
65    */
66   GEOMALGOAPI_EXPORT static bool isCircle(const GeomShapePtr& theEdge, double theTolerance,
67     std::vector<double>& theNormal, std::vector<double>& theOrigin,
68     double& theRadius);
69
70   /*!
71    * \brief Check if edge / wire is ellipse
72    */
73   GEOMALGOAPI_EXPORT static bool isEllipse(const GeomShapePtr& theEdge, double theTolerance,
74     std::vector<double>& theNormal, std::vector<double>& theDirX,
75     std::vector<double>& theOrigin,
76     double& theMajorRadius, double& theMinorRadius);
77
78   /*!
79    * \brief Check if the algorithm is implemented (Shaper is built with appropriate OCCT version)
80    */
81   GEOMALGOAPI_EXPORT static bool isImplemented();
82
83 };
84
85 #endif