SHAPER  9.12.0
GeomAlgoAPI_CanonicalRecognition.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 
29 {
30 public:
34  GEOMALGOAPI_EXPORT static bool isPlane(const GeomShapePtr& theShape, double theTolerance,
35  std::vector<double>& theNormal, std::vector<double>& theOrigin);
36 
40  GEOMALGOAPI_EXPORT static bool isSphere(const GeomShapePtr& theShape, double theTolerance,
41  std::vector<double>& theOrigin, double& theRadius);
42 
46  GEOMALGOAPI_EXPORT static bool isCone(const GeomShapePtr& theShape, double theTolerance,
47  std::vector<double>& theAxis, std::vector<double>& theApex,
48  double& theHalfAngle);
49 
53  GEOMALGOAPI_EXPORT static bool isCylinder(const GeomShapePtr& theShape, double theTolerance,
54  std::vector<double>& theAxis, std::vector<double>& theOrigin,
55  double& theRadius);
56 
60  GEOMALGOAPI_EXPORT static bool isLine(const GeomShapePtr& theEdge, double theTolerance,
61  std::vector<double>& theDir, std::vector<double>& theOrigin);
62 
66  GEOMALGOAPI_EXPORT static bool isCircle(const GeomShapePtr& theEdge, double theTolerance,
67  std::vector<double>& theNormal, std::vector<double>& theOrigin,
68  double& theRadius);
69 
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 
81  GEOMALGOAPI_EXPORT static bool isImplemented();
82 
83 };
84 
85 #endif
Definition: GeomAlgoAPI_CanonicalRecognition.h:29
static bool isLine(const GeomShapePtr &theEdge, double theTolerance, std::vector< double > &theDir, std::vector< double > &theOrigin)
Check if edge / wire is line.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:258
static bool isSphere(const GeomShapePtr &theShape, double theTolerance, std::vector< double > &theOrigin, double &theRadius)
Check if shape is spherical.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:100
static bool isEllipse(const GeomShapePtr &theEdge, double theTolerance, std::vector< double > &theNormal, std::vector< double > &theDirX, std::vector< double > &theOrigin, double &theMajorRadius, double &theMinorRadius)
Check if edge / wire is ellipse.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:362
static bool isPlane(const GeomShapePtr &theShape, double theTolerance, std::vector< double > &theNormal, std::vector< double > &theOrigin)
Check if the shape is planar.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:52
static bool isImplemented()
Check if the algorithm is implemented (Shaper is built with appropriate OCCT version)
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:434
static bool isCone(const GeomShapePtr &theShape, double theTolerance, std::vector< double > &theAxis, std::vector< double > &theApex, double &theHalfAngle)
Check if shape is conical.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:145
static bool isCircle(const GeomShapePtr &theEdge, double theTolerance, std::vector< double > &theNormal, std::vector< double > &theOrigin, double &theRadius)
Check if edge / wire is circle.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:307
static bool isCylinder(const GeomShapePtr &theShape, double theTolerance, std::vector< double > &theAxis, std::vector< double > &theOrigin, double &theRadius)
Check if shape is cylinder.
Definition: GeomAlgoAPI_CanonicalRecognition.cpp:201