1 // Copyright (C) 2014-2022 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GeomAlgoAPI_CanonicalRecognition_H_
21 #define GeomAlgoAPI_CanonicalRecognition_H_
23 #include "GeomAlgoAPI.h"
24 #include <GeomAPI_Shape.h>
28 class GeomAlgoAPI_CanonicalRecognition
32 * \brief Check if the shape is planar
34 GEOMALGOAPI_EXPORT static bool isPlane(const GeomShapePtr& theShape, double theTolerance,
35 std::vector<double>& theNormal, std::vector<double>& theOrigin);
38 * \brief Check if shape is spherical
40 GEOMALGOAPI_EXPORT static bool isSphere(const GeomShapePtr& theShape, double theTolerance,
41 std::vector<double>& theOrigin, double& theRadius);
44 * \brief Check if shape is conical
46 GEOMALGOAPI_EXPORT static bool isCone(const GeomShapePtr& theShape, double theTolerance,
47 std::vector<double>& theAxis, std::vector<double>& theApex,
48 double& theHalfAngle);
51 * \brief Check if shape is cylinder
53 GEOMALGOAPI_EXPORT static bool isCylinder(const GeomShapePtr& theShape, double theTolerance,
54 std::vector<double>& theAxis, std::vector<double>& theOrigin,
58 * \brief Check if edge / wire is line
60 GEOMALGOAPI_EXPORT static bool isLine(const GeomShapePtr& theEdge, double theTolerance,
61 std::vector<double>& theDir, std::vector<double>& theOrigin);
64 * \brief Check if edge / wire is circle
66 GEOMALGOAPI_EXPORT static bool isCircle(const GeomShapePtr& theEdge, double theTolerance,
67 std::vector<double>& theNormal, std::vector<double>& theOrigin,
71 * \brief Check if edge / wire is ellipse
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);
79 * \brief Check if the algorithm is implemented (Shaper is built with appropriate OCCT version)
81 GEOMALGOAPI_EXPORT static bool isImplemented();