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