0025547: static class mehtods not exported in BrepMesh_GeomTool
[occt.git] / src / BRepMesh / BRepMesh_WireInterferenceChecker.hxx
1 // Created on: 2014-06-18
2 // Created by: Oleg AGASHIN
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _BRepMesh_WireInterferenceChecker_HeaderFile
17 #define _BRepMesh_WireInterferenceChecker_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_Mutex.hxx>
21 #include <BRepMesh_WireChecker.hxx>
22 #include <BRepMesh_Status.hxx>
23
24 #ifdef HAVE_TBB
25   // paralleling using Intel TBB
26   #include <tbb/blocked_range.h>
27 #endif
28
29 //! Auxilary class implementing functionality for 
30 //! checking interference between two discretized wires.
31 class BRepMesh_WireInterferenceChecker
32 {
33 public:
34
35   //! Enumerates states of segments intersection check.
36   enum IntFlag
37   {
38     NoIntersection,
39     Cross,
40     EndPointTouch,
41     PointOnSegment,
42     Glued,
43     Same
44   };
45
46 #ifdef HAVE_TBB
47   //! Constructor
48   //! @param theWires wires that should be checked.
49   //! @param theStatus shared flag to set status of the check.
50   //! @param theMutex shared mutex for parallel processing.
51   BRepMesh_WireInterferenceChecker(
52     const BRepMesh::Array1OfSegmentsTree& theWires,
53     BRepMesh_Status*                      theStatus,
54     Standard_Mutex*                       theMutex);
55
56   //! Checker's body.
57   //! @param theWireRange range of wires to be checked.
58   void operator ()(const tbb::blocked_range<Standard_Integer>& theWireRange) const;
59 #else
60   //! Constructor
61   //! @param theWires wires that should be checked.
62   //! @param theStatus shared flag to set status of the check.
63   BRepMesh_WireInterferenceChecker(
64     const BRepMesh::Array1OfSegmentsTree& theWires,
65     BRepMesh_Status*                      theStatus);
66 #endif
67
68   //! Checker's body.
69   //! @param theWireId Id of discretized wire to be checked.
70   void operator ()(const Standard_Integer& theWireId) const;
71
72 private:
73
74   //! Assignment operator.
75   void operator =(const BRepMesh_WireInterferenceChecker& /*theOther*/)
76   {
77   }
78
79 private:
80   const BRepMesh::Array1OfSegmentsTree& myWires;
81   BRepMesh_Status*                      myStatus;
82
83 #ifdef HAVE_TBB
84   Standard_Mutex*                       myMutex;
85 #endif
86 };
87
88 #endif