7fd59977 |
1 | // File: BOPTools_ShapeShapeInterference.cxx |
2 | // Created: Tue Nov 21 15:21:34 2000 |
3 | // Author: Peter KURNEV |
4 | // <pkv@irinox> |
5 | |
6 | |
7 | #include <BOPTools_ShapeShapeInterference.ixx> |
8 | |
9 | //======================================================================= |
10 | //function : BOPTools_ShapeShapeInterference::BOPTools_ShapeShapeInterference |
11 | //purpose : |
12 | //======================================================================= |
13 | BOPTools_ShapeShapeInterference::BOPTools_ShapeShapeInterference() |
14 | : |
15 | myIndex1(0), myIndex2(0), myNewShape(0) |
16 | {} |
17 | |
18 | //======================================================================= |
19 | //function : BOPTools_ShapeShapeInterference::BOPTools_ShapeShapeInterference |
20 | //purpose : |
21 | //======================================================================= |
22 | BOPTools_ShapeShapeInterference::BOPTools_ShapeShapeInterference |
23 | (const Standard_Integer anIndex1, |
24 | const Standard_Integer anIndex2) |
25 | : |
26 | myIndex1(anIndex1), |
27 | myIndex2(anIndex2), |
28 | myNewShape(0) |
29 | {} |
30 | |
31 | //======================================================================= |
32 | //function : SetIndex1 |
33 | //purpose : |
34 | //======================================================================= |
35 | void BOPTools_ShapeShapeInterference::SetIndex1(const Standard_Integer anIndex1) |
36 | { |
37 | myIndex1=anIndex1; |
38 | } |
39 | |
40 | //======================================================================= |
41 | //function : SetIndex2 |
42 | //purpose : |
43 | //======================================================================= |
44 | void BOPTools_ShapeShapeInterference::SetIndex2(const Standard_Integer anIndex2) |
45 | { |
46 | myIndex2=anIndex2; |
47 | } |
48 | |
49 | //======================================================================= |
50 | //function : SetNewShape |
51 | //purpose : |
52 | //======================================================================= |
53 | void BOPTools_ShapeShapeInterference::SetNewShape(const Standard_Integer anIndex) |
54 | { |
55 | myNewShape=anIndex; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : Index1 |
60 | //purpose : |
61 | //======================================================================= |
62 | Standard_Integer BOPTools_ShapeShapeInterference::Index1() const |
63 | { |
64 | return myIndex1; |
65 | } |
66 | |
67 | //======================================================================= |
68 | //function : Index2 |
69 | //purpose : |
70 | //======================================================================= |
71 | Standard_Integer BOPTools_ShapeShapeInterference::Index2() const |
72 | { |
73 | return myIndex2; |
74 | } |
75 | //======================================================================= |
76 | //function : OppositeIndex |
77 | //purpose : |
78 | //======================================================================= |
79 | Standard_Integer BOPTools_ShapeShapeInterference::OppositeIndex |
80 | (const Standard_Integer anIndex) const |
81 | { |
82 | if (anIndex==myIndex1) { |
83 | return myIndex2; |
84 | } |
85 | else if(anIndex==myIndex2) { |
86 | return myIndex1; |
87 | } |
88 | else { |
89 | return 0; |
90 | } |
91 | } |
92 | |
93 | //======================================================================= |
94 | //function : Indices |
95 | //purpose : |
96 | //======================================================================= |
97 | void BOPTools_ShapeShapeInterference::Indices(Standard_Integer& i1, |
98 | Standard_Integer& i2) const |
99 | { |
100 | i1=myIndex1; |
101 | i2=myIndex2; |
102 | } |
103 | |
104 | //======================================================================= |
105 | //function : NewShape |
106 | //purpose : |
107 | //======================================================================= |
108 | Standard_Integer BOPTools_ShapeShapeInterference::NewShape() const |
109 | { |
110 | return myNewShape; |
111 | } |