Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:16:06

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen ( SIVA )
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESSolid_BooleanTree_HeaderFile
0018 #define _IGESSolid_BooleanTree_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <IGESData_IGESEntity.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <Standard_Integer.hxx>
0026 
0027 //! defines BooleanTree, Type <180> Form Number <0>
0028 //! in package IGESSolid
0029 //! The Boolean tree describes a binary tree structure
0030 //! composed of regularized Boolean operations and operands,
0031 //! in post-order notation.
0032 class IGESSolid_BooleanTree : public IGESData_IGESEntity
0033 {
0034 
0035 public:
0036   Standard_EXPORT IGESSolid_BooleanTree();
0037 
0038   //! This method is used to set the fields of the class
0039   //! BooleanTree
0040   //! - operands   : Array containing pointer to DE of operands
0041   //! - operations : Array containing integer type for operations
0042   Standard_EXPORT void Init(
0043     const occ::handle<NCollection_HArray1<occ::handle<IGESData_IGESEntity>>>& operands,
0044     const occ::handle<NCollection_HArray1<int>>&                              operations);
0045 
0046   //! returns the length of the post-order list
0047   Standard_EXPORT int Length() const;
0048 
0049   //! returns True if Index'th value in the post-order list is an Operand;
0050   //! else returns False if it is an Integer Operations
0051   //! raises exception if Index < 1 or Index > Length()
0052   Standard_EXPORT bool IsOperand(const int Index) const;
0053 
0054   //! returns the Index'th value in the post-order list only if it is
0055   //! an operand else returns NULL
0056   //! raises exception if Index < 1 or Index > Length()
0057   Standard_EXPORT occ::handle<IGESData_IGESEntity> Operand(const int Index) const;
0058 
0059   //! returns the Index'th value in the post-order list only if it is
0060   //! an operation else returns 0
0061   //! raises exception if Index < 1 or Index > Length()
0062   Standard_EXPORT int Operation(const int Index) const;
0063 
0064   DEFINE_STANDARD_RTTIEXT(IGESSolid_BooleanTree, IGESData_IGESEntity)
0065 
0066 private:
0067   occ::handle<NCollection_HArray1<occ::handle<IGESData_IGESEntity>>> theOperands;
0068   occ::handle<NCollection_HArray1<int>>                              theOperations;
0069 };
0070 
0071 #endif // _IGESSolid_BooleanTree_HeaderFile