1 // Created on: 2014-06-18
2 // Created by: Oleg AGASHIN
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BRepMesh_WireInterferenceChecker_HeaderFile
17 #define _BRepMesh_WireInterferenceChecker_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Mutex.hxx>
21 #include <BRepMesh_WireChecker.hxx>
22 #include <BRepMesh_Status.hxx>
25 // paralleling using Intel TBB
26 #include <tbb/blocked_range.h>
29 //! Auxilary class implementing functionality for
30 //! checking interference between two discretized wires.
31 class BRepMesh_WireInterferenceChecker
35 //! Enumerates states of segments intersection check.
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 std::vector<BRepMeshCol::SegmentsTree>& theWires,
53 BRepMesh_Status* theStatus,
54 Standard_Mutex* theMutex);
57 //! \param theWireRange range of wires to be checked.
58 void operator ()(const tbb::blocked_range<Standard_Integer>& theWireRange) const;
61 //! \param theWires wires that should be checked.
62 //! \param theStatus shared flag to set status of the check.
63 BRepMesh_WireInterferenceChecker(
64 const std::vector<BRepMesh_WireChecker::SegmentsTree>& theWires,
65 BRepMesh_Status* theStatus);
69 //! \param theWireId Id of discretized wire to be checked.
70 void operator ()(const Standard_Integer& theWireId) const;
74 //! Classifies the point in case of coincidence of two vectors.
75 //! \param thePoint1 the start point of a segment (base point).
76 //! \param thePoint2 the end point of a segment.
77 //! \param thePointToCheck the point to classify.
78 //! \return zero value if point is out of segment and non zero value
79 //! if point is between the first and the second point of segment.
80 static Standard_Integer classifyPoint (const gp_XY& thePoint1,
81 const gp_XY& thePoint2,
82 const gp_XY& thePointToCheck);
84 const BRepMeshCol::SegmentsTree* myWires;
85 Standard_Integer myWiresNb;
86 BRepMesh_Status* myStatus;
89 Standard_Mutex* myMutex;