b311480e |
1 | // Created on: 2001-02-08 |
2 | // Created by: Peter KURNEV |
3 | // Copyright (c) 2001-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | #include <BOPTools_Pave.ixx> |
22 | |
23 | //======================================================================= |
24 | // function: BOPTools_Pave::BOPTools_Pave |
25 | // purpose: |
26 | //======================================================================= |
b311480e |
27 | BOPTools_Pave::BOPTools_Pave() |
7fd59977 |
28 | : |
29 | myParam(0.), |
30 | myIndex(0), |
31 | myType(BooleanOperations_UnknownInterference), |
32 | myInterf(0) |
33 | {} |
34 | //======================================================================= |
35 | // function: BOPTools_Pave::BOPTools_Pave |
36 | // purpose: |
37 | //======================================================================= |
38 | BOPTools_Pave::BOPTools_Pave(const Standard_Integer anIndex, |
39 | const Standard_Real aParam, |
40 | const BooleanOperations_KindOfInterference aType) |
41 | : |
42 | myParam(aParam), |
43 | myIndex(anIndex), |
44 | myType(aType), |
45 | myInterf(0) |
46 | {} |
47 | //======================================================================= |
48 | // function: SetParam |
49 | // purpose: |
50 | //======================================================================= |
51 | void BOPTools_Pave::SetParam(const Standard_Real aParam) |
52 | { |
53 | myParam=aParam; |
54 | } |
55 | //======================================================================= |
56 | // function: SetIndex |
57 | // purpose: |
58 | //======================================================================= |
59 | void BOPTools_Pave::SetIndex(const Standard_Integer anIndex) |
60 | { |
61 | myIndex=anIndex; |
62 | } |
63 | //======================================================================= |
64 | // function: SetType |
65 | // purpose: |
66 | //======================================================================= |
67 | void BOPTools_Pave::SetType(const BooleanOperations_KindOfInterference aType) |
68 | { |
69 | myType=aType; |
70 | } |
71 | //======================================================================= |
72 | // function: SetInterference |
73 | // purpose: |
74 | //======================================================================= |
75 | void BOPTools_Pave::SetInterference(const Standard_Integer anIndex) |
76 | { |
77 | myInterf=anIndex; |
78 | } |
79 | //======================================================================= |
80 | // function: Param |
81 | // purpose: |
82 | //======================================================================= |
83 | Standard_Real BOPTools_Pave::Param() const |
84 | { |
85 | return myParam; |
86 | } |
87 | //======================================================================= |
88 | // function: Index |
89 | // purpose: |
90 | //======================================================================= |
91 | Standard_Integer BOPTools_Pave::Index() const |
92 | { |
93 | return myIndex; |
94 | } |
95 | //======================================================================= |
96 | // function: Type |
97 | // purpose: |
98 | //======================================================================= |
99 | BooleanOperations_KindOfInterference BOPTools_Pave::Type() const |
100 | { |
101 | return myType; |
102 | } |
103 | //======================================================================= |
104 | // function: Interference |
105 | // purpose: |
106 | //======================================================================= |
107 | Standard_Integer BOPTools_Pave::Interference() const |
108 | { |
109 | return myInterf; |
110 | } |
111 | //======================================================================= |
112 | // function: IsEqual |
113 | // purpose: |
114 | //======================================================================= |
115 | Standard_Boolean BOPTools_Pave::IsEqual(const BOPTools_Pave& Other) const |
116 | { |
117 | Standard_Integer anIndOther; |
118 | Standard_Real aParamOther, dt=1.e-14; |
119 | |
120 | anIndOther=Other.Index(); |
121 | if (anIndOther!=myIndex) { |
122 | return Standard_False; |
123 | } |
124 | |
125 | aParamOther=Other.Param(); |
126 | if (fabs (aParamOther-myParam) > dt){ |
127 | return Standard_False; |
128 | } |
129 | return Standard_True; |
130 | } |