1 // Created on: 1991-06-24
2 // Created by: Didier PIFFAULT
3 // Copyright (c) 1991-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 _Intf_Interference_HeaderFile
18 #define _Intf_Interference_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <Intf_SeqOfSectionPoint.hxx>
25 #include <Intf_SeqOfSectionLine.hxx>
26 #include <Intf_SeqOfTangentZone.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Real.hxx>
29 #include <Standard_Integer.hxx>
30 class Intf_SectionPoint;
31 class Intf_SectionLine;
32 class Intf_TangentZone;
33 
34 
35 //! Describes the   Interference  computation    result
36 //! between polygon2d or polygon3d or polyhedron
37 //! (as  three sequences   of  points  of  intersection,
38 //! polylines of intersection and zones de tangence).
39 class Intf_Interference
40 {
41 public:
42 
43   DEFINE_STANDARD_ALLOC
44 
45 
46   //! Gives the number   of  points of  intersection  in the
47   //! interference.
48     Standard_Integer NbSectionPoints() const;
49 
50   //! Gives the point of  intersection of address  Index in
51   //! the interference.
52     const Intf_SectionPoint& PntValue (const Standard_Integer Index) const;
53 
54   //! Gives the number  of polylines of  intersection in the
55   //! interference.
56     Standard_Integer NbSectionLines() const;
57 
58   //! Gives the polyline of intersection at address <Index> in
59   //! the interference.
60     const Intf_SectionLine& LineValue (const Standard_Integer Index) const;
61 
62   //! Gives the number of zones of tangence in the interference.
63     Standard_Integer NbTangentZones() const;
64 
65   //! Gives  the zone of  tangence at address   Index in the
66   //! interference.
67     const Intf_TangentZone& ZoneValue (const Standard_Integer Index) const;
68 
69   //! Gives the tolerance used for the calculation.
70     Standard_Real GetTolerance() const;
71 
72   //! Tests if the polylines of  intersection or the zones of
73   //! tangence contain the point of intersection <ThePnt>.
74   Standard_EXPORT Standard_Boolean Contains (const Intf_SectionPoint& ThePnt) const;
75 
76   //! Inserts a new zone of tangence in  the current list of
77   //! tangent zones of  the interference  and  returns  True
78   //! when done.
79   Standard_EXPORT Standard_Boolean Insert (const Intf_TangentZone& TheZone);
80 
81   //! Insert a new segment of intersection in the current  list of
82   //! polylines of intersection of the interference.
83   Standard_EXPORT void Insert (const Intf_SectionPoint& pdeb, const Intf_SectionPoint& pfin);
84 
85   Standard_EXPORT void Dump() const;
86 
87 
88 
89 
90 protected:
91 
92   //! Empty constructor
93   Standard_EXPORT Intf_Interference(const Standard_Boolean Self);
94 
95   //! Destructor is protected, for safer inheritance
~Intf_Interference()96   ~Intf_Interference () {}
97 
98   //! Only one argument for the intersection.
99   Standard_EXPORT void SelfInterference (const Standard_Boolean Self);
100 
101 
102   Intf_SeqOfSectionPoint mySPoins;
103   Intf_SeqOfSectionLine mySLines;
104   Intf_SeqOfTangentZone myTZones;
105   Standard_Boolean SelfIntf;
106   Standard_Real Tolerance;
107 
108 
109 private:
110 
111 
112 
113 
114 
115 };
116 
117 
118 #include <Intf_Interference.lxx>
119 
120 
121 
122 
123 
124 #endif // _Intf_Interference_HeaderFile
125