Salome HOME
2982a34b206d3a6061c1b229b52491c0775d776e
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_SolidClassifier.h
1 // Copyright (C) 2014-2024  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_SolidClassifier_H_
21 #define GeomAlgoAPI_SolidClassifier_H_
22
23 #include <GeomAlgoAPI.h>
24
25 #include <memory>
26
27 class GeomAPI_Shape;
28 class GeomAPI_Solid;
29
30 /// \class GeomAlgoAPI_SolidClassifier
31 /// \ingroup DataAlgo
32 /// \brief Classify shape according to the given solid.
33 class GeomAlgoAPI_SolidClassifier
34 {
35 public:
36   typedef int State;
37
38   static const State State_UNKNOWN = 0x0;
39   static const State State_IN      = 0x1;
40   static const State State_ON      = 0x2;
41   static const State State_OUT     = 0x4;
42   static const State State_ALL     = State_IN & State_ON & State_OUT;
43
44 public:
45   /// \brief Perform classification of the shape according to the solid.
46   /// \param[in] theSolid       the base solid
47   /// \param[in] theShape       the shape to classify
48   /// \param[in] theTolerance   comparison tolrence
49   GEOMALGOAPI_EXPORT GeomAlgoAPI_SolidClassifier(const std::shared_ptr<GeomAPI_Solid> theSolid,
50                                                  const std::shared_ptr<GeomAPI_Shape> theShape,
51                                                  const double theTolerance = 1.e-7);
52
53   /// \return Classification result.
54   State state() const { return myState; }
55
56 private:
57   State myState;
58 };
59
60 #endif