7fd59977 |
1 | //-------------------------------------------------------------------- |
2 | // |
3 | // File Name : IGESSolid_BooleanTree.cxx |
4 | // Date : |
5 | // Author : CKY / Contract Toubro-Larsen |
6 | // Copyright : MATRA-DATAVISION 1993 |
7 | // |
8 | //-------------------------------------------------------------------- |
9 | |
10 | #include <IGESSolid_BooleanTree.ixx> |
11 | #include <Standard_DimensionError.hxx> |
12 | |
13 | |
14 | IGESSolid_BooleanTree::IGESSolid_BooleanTree () { } |
15 | |
16 | |
17 | void IGESSolid_BooleanTree::Init |
18 | (const Handle(IGESData_HArray1OfIGESEntity)& operands, |
19 | const Handle(TColStd_HArray1OfInteger)& operations) |
20 | { |
21 | if (operands->Lower() != 1 || operations->Lower() != 1 || |
22 | operands->Length() != operations->Length()) |
23 | Standard_DimensionError::Raise("IGESSolid_BooleanTree : Init"); |
24 | |
25 | theOperations = operations; |
26 | theOperands = operands; |
27 | InitTypeAndForm(180,0); |
28 | } |
29 | |
30 | Standard_Integer IGESSolid_BooleanTree::Length () const |
31 | { |
32 | return theOperands->Length(); |
33 | } |
34 | |
35 | Standard_Boolean IGESSolid_BooleanTree::IsOperand |
36 | (const Standard_Integer Index) const |
37 | { |
38 | return (!theOperands->Value(Index).IsNull()); |
39 | } |
40 | |
41 | Handle(IGESData_IGESEntity) IGESSolid_BooleanTree::Operand |
42 | (const Standard_Integer Index) const |
43 | { |
44 | return theOperands->Value(Index); |
45 | } |
46 | |
47 | Standard_Integer IGESSolid_BooleanTree::Operation |
48 | (const Standard_Integer Index) const |
49 | { |
50 | if (theOperands->Value(Index).IsNull()) |
51 | return theOperations->Value(Index); |
52 | else |
53 | return 0; // It is not an operation. (operations can be : 1-2-3) |
54 | } |