| 1 | -- Created on: 2000-11-27 |
| 2 | -- Created by: Michael KLOKOV |
| 3 | -- Copyright (c) 2000-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 | |
| 20 | |
| 21 | class IteratorOfCoupleOfShape from BOPTools |
| 22 | |
| 23 | ---Purpose: The class IteratorOfCoupleOfShape provides the iteration |
| 24 | --- on the couples of shapes stored in ShapesDataStructure |
| 25 | --- according to the given types of shapes and |
| 26 | --- status of their intersection. |
| 27 | --- The statuses are stored in 2 dimension array. |
| 28 | |
| 29 | uses |
| 30 | ShapeEnum from TopAbs, |
| 31 | HArray2OfIntersectionStatus from BOPTools, |
| 32 | PShapesDataStructure from BooleanOperations, |
| 33 | IntersectionStatus from BOPTools, |
| 34 | ListOfCoupleOfInteger from BOPTools, |
| 35 | ListIteratorOfListOfCoupleOfInteger from BOPTools, |
| 36 | NoSuchObject from Standard |
| 37 | |
| 38 | raises NoSuchObject from Standard |
| 39 | |
| 40 | is |
| 41 | |
| 42 | Create |
| 43 | returns IteratorOfCoupleOfShape from BOPTools; |
| 44 | ---Purpose: |
| 45 | --- Empty Constructor |
| 46 | --- |
| 47 | |
| 48 | Create(PDS: PShapesDataStructure from BooleanOperations; |
| 49 | Type1: ShapeEnum from TopAbs; |
| 50 | Type2: ShapeEnum from TopAbs) |
| 51 | returns IteratorOfCoupleOfShape from BOPTools; |
| 52 | ---Purpose: |
| 53 | --- Initializes iterator by ShapesDataStructure and |
| 54 | --- shape types |
| 55 | --- |
| 56 | |
| 57 | Destroy(me: in out) is virtual; |
| 58 | ---C++: alias "Standard_EXPORT virtual ~BOPTools_IteratorOfCoupleOfShape(){Destroy();}" |
| 59 | |
| 60 | Initialize(me: in out; Type1: ShapeEnum from TopAbs; |
| 61 | Type2: ShapeEnum from TopAbs) |
| 62 | |
| 63 | raises NoSuchObject from Standard |
| 64 | is virtual; |
| 65 | ---Purpose: |
| 66 | --- Initializes iterator with shape types. |
| 67 | --- The iterator uses PDS assigned in constructor or in SetDataStructure(). |
| 68 | --- Raises the exception if myPDS is null. |
| 69 | --- |
| 70 | |
| 71 | |
| 72 | SetDataStructure(me: in out; PDS: PShapesDataStructure from BooleanOperations) |
| 73 | raises |
| 74 | NoSuchObject from Standard; |
| 75 | ---Purpose: |
| 76 | --- Initialize iterator with ShapeDataStructure. |
| 77 | --- |
| 78 | |
| 79 | |
| 80 | More(me) |
| 81 | returns Boolean from Standard |
| 82 | is virtual; |
| 83 | ---Purpose: |
| 84 | --- Returns True if there are still not |
| 85 | --- treated couples of shapes |
| 86 | --- |
| 87 | |
| 88 | Next(me: in out) |
| 89 | is virtual; |
| 90 | ---Purpose: |
| 91 | --- Moves to the next couple of iteration |
| 92 | --- |
| 93 | |
| 94 | Current(me; Index1: in out Integer from Standard; |
| 95 | Index2: in out Integer from Standard; |
| 96 | WithSubShape: out Boolean from Standard) |
| 97 | is virtual; |
| 98 | ---Purpose: |
| 99 | --- Returns current couple of indices and |
| 100 | --- flag WithSubShape which is true |
| 101 | --- if bounding boxes of subshapes |
| 102 | --- are intersected |
| 103 | --- |
| 104 | |
| 105 | ListOfCouple(me) |
| 106 | returns ListOfCoupleOfInteger from BOPTools; |
| 107 | ---C++: return const & |
| 108 | ---Purpose: |
| 109 | --- Returns a list of couples of shape indices |
| 110 | --- according to shape types by which |
| 111 | --- the iterator was initialized |
| 112 | --- |
| 113 | |
| 114 | MoreP(me) |
| 115 | returns Boolean from Standard |
| 116 | is protected; |
| 117 | |
| 118 | NextP(me: in out) |
| 119 | is protected; |
| 120 | |
| 121 | CurrentP(me;Index1: in out Integer from Standard; |
| 122 | Index2: in out Integer from Standard) |
| 123 | raises NoSuchObject from Standard |
| 124 | is protected; |
| 125 | |
| 126 | SetIntersectionStatus(me: in out; Index1: Integer from Standard; |
| 127 | Index2: Integer from Standard; |
| 128 | theStatus: IntersectionStatus from BOPTools); |
| 129 | ---Purpose: |
| 130 | --- Sets status to array according to Index1 and Index2 |
| 131 | --- |
| 132 | |
| 133 | GetTableOfIntersectionStatus(me) |
| 134 | returns HArray2OfIntersectionStatus from BOPTools; |
| 135 | ---C++: return const & |
| 136 | ---Purpose: |
| 137 | --- Returns 2 dimension array of intersection statuses |
| 138 | --- |
| 139 | |
| 140 | DumpTableOfIntersectionStatus(me); |
| 141 | ---Purpose: |
| 142 | --- For internal use |
| 143 | --- |
| 144 | |
| 145 | fields |
| 146 | myPDS: PShapesDataStructure from BooleanOperations is protected; |
| 147 | myTableOfStatus: HArray2OfIntersectionStatus from BOPTools is protected; |
| 148 | myCurrentIndex1: Integer from Standard is protected; |
| 149 | myCurrentIndex2: Integer from Standard is protected; |
| 150 | myType1: ShapeEnum from TopAbs is protected; |
| 151 | myType2: ShapeEnum from TopAbs is protected; |
| 152 | -- |
| 153 | myFirstLowerIndex :Integer from Standard is protected; |
| 154 | myFirstUpperIndex :Integer from Standard is protected; |
| 155 | mySecondLowerIndex:Integer from Standard is protected; |
| 156 | mySecondUpperIndex:Integer from Standard is protected; |
| 157 | myListOfCouple :ListOfCoupleOfInteger from BOPTools is protected; |
| 158 | myIterator :ListIteratorOfListOfCoupleOfInteger from BOPTools is protected; |
| 159 | -- |
| 160 | end IteratorOfCoupleOfShape from BOPTools; |