1 // Created on: 1997-04-17
2 // Created by: Christophe MARION
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _HLRBRep_EdgeInterferenceTool_HeaderFile
18 #define _HLRBRep_EdgeInterferenceTool_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <HLRAlgo_Intersection.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopAbs_Orientation.hxx>
28 #include <Standard_Real.hxx>
29 class HLRBRep_Data;
30 class gp_Dir;
31 class HLRAlgo_Interference;
32 
33 
34 //! Implements the  methods required  to  instantiates
35 //! the EdgeInterferenceList from HLRAlgo.
36 class HLRBRep_EdgeInterferenceTool
37 {
38 public:
39 
40   DEFINE_STANDARD_ALLOC
41 
42 
43   Standard_EXPORT HLRBRep_EdgeInterferenceTool(const Handle(HLRBRep_Data)& DS);
44 
45   Standard_EXPORT void LoadEdge();
46 
47     void InitVertices();
48 
49     Standard_Boolean MoreVertices() const;
50 
51     void NextVertex();
52 
53     const HLRAlgo_Intersection& CurrentVertex() const;
54 
55     TopAbs_Orientation CurrentOrientation() const;
56 
57     Standard_Real CurrentParameter() const;
58 
59     Standard_Boolean IsPeriodic() const;
60 
61   //! Returns local geometric description of the Edge at
62   //! parameter   <Para>.  See  method  Reset  of  class
63   //! EdgeFaceTransition from TopCnx for other arguments.
64   Standard_EXPORT void EdgeGeometry (const Standard_Real Param, gp_Dir& Tgt, gp_Dir& Nrm, Standard_Real& Curv) const;
65 
66     Standard_Real ParameterOfInterference (const HLRAlgo_Interference& I) const;
67 
68   //! True if   the  two interferences are on   the same
69   //! geometric locus.
70   Standard_EXPORT Standard_Boolean SameInterferences (const HLRAlgo_Interference& I1, const HLRAlgo_Interference& I2) const;
71 
72   //! True if the  Interference and the  current  Vertex
73   //! are on the same geometric locus.
74   Standard_EXPORT Standard_Boolean SameVertexAndInterference (const HLRAlgo_Interference& I) const;
75 
76   //! Returns   the  geometry of  the   boundary  at the
77   //! interference  <I>.  See the AddInterference method
78   //! of the class  EdgeFaceTransition  from  TopCnx for
79   //! the other arguments.
80   Standard_EXPORT void InterferenceBoundaryGeometry (const HLRAlgo_Interference& I, gp_Dir& Tang, gp_Dir& Norm, Standard_Real& Curv) const;
81 
82 
83 
84 
85 protected:
86 
87 
88 
89 
90 
91 private:
92 
93 
94 
95   Handle(HLRBRep_Data) myDS;
96   HLRAlgo_Intersection inter[2];
97   Standard_Integer cur;
98 
99 
100 };
101 
102 
103 #include <HLRBRep_EdgeInterferenceTool.lxx>
104 
105 
106 
107 
108 
109 #endif // _HLRBRep_EdgeInterferenceTool_HeaderFile
110