| 1 | -- Created on: 2012-06-01 |
| 2 | -- Created by: Eugeny MALTCHIKOV |
| 3 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
| 4 | -- |
| 5 | -- This file is part of Open CASCADE Technology software library. |
| 6 | -- |
| 7 | -- This library is free software; you can redistribute it and/or modify it under |
| 8 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
| 9 | -- by the Free Software Foundation, with special exception defined in the file |
| 10 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
| 11 | -- distribution for complete text of the license and disclaimer of any warranty. |
| 12 | -- |
| 13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
| 14 | -- commercial license or contractual agreement. |
| 15 | |
| 16 | class Builder from BRepFeat |
| 17 | inherits BOP from BOPAlgo |
| 18 | |
| 19 | ---Purpose: Provides a basic tool to implement features topological |
| 20 | -- operations. The main goal of the algorithm is to perform |
| 21 | -- the result of the operation according to the |
| 22 | -- kept parts of the tool. |
| 23 | -- Input data: a) DS; |
| 24 | -- b) The kept parts of the tool; |
| 25 | -- If the map of the kept parts of the tool |
| 26 | -- is not filled boolean operation of the |
| 27 | -- given type will be performed; |
| 28 | -- c) Operation required. |
| 29 | -- Steps: a) Fill myShapes, myRemoved maps; |
| 30 | -- b) Rebuild edges and faces; |
| 31 | -- c) Build images of the object; |
| 32 | -- d) Build the result of the operation. |
| 33 | -- Result: Result shape of the operation required. |
| 34 | |
| 35 | uses |
| 36 | Shape from TopoDS, |
| 37 | Face from TopoDS, |
| 38 | ListOfShape from TopTools, |
| 39 | MapOfOrientedShape from BOPCol, |
| 40 | MapOfShape from BOPCol, |
| 41 | IndexedMapOfShape from BOPCol, |
| 42 | DataMapOfShapeListOfShape from BOPCol, |
| 43 | DataMapOfShapeShape from BOPCol, |
| 44 | BaseAllocator from BOPCol, |
| 45 | ListOfShape from BOPCol, |
| 46 | BOP from BOPAlgo |
| 47 | |
| 48 | is |
| 49 | Create |
| 50 | returns Builder from BRepFeat; |
| 51 | ---C++: alias "Standard_EXPORT virtual ~BRepFeat_Builder();" |
| 52 | |
| 53 | Clear(me:out) |
| 54 | is redefined; |
| 55 | ---Purpose: Clears internal fields and arguments. |
| 56 | |
| 57 | Init(me:out; |
| 58 | theShape : Shape from TopoDS); |
| 59 | ---Purpose: Initialyzes the object of local boolean operation. |
| 60 | -- |
| 61 | |
| 62 | Init(me:out; |
| 63 | theShape : Shape from TopoDS; |
| 64 | theTool : Shape from TopoDS); |
| 65 | ---Purpose: Initialyzes the arguments of local boolean operation. |
| 66 | -- |
| 67 | |
| 68 | SetOperation(me:out; |
| 69 | theFuse : Integer from Standard); |
| 70 | ---Purpose: Sets the operation of local boolean operation. |
| 71 | -- If theFuse = 0 than the operation is CUT, otherwise FUSE. |
| 72 | |
| 73 | SetOperation(me:out; |
| 74 | theFuse : Integer from Standard; |
| 75 | theFlag : Boolean from Standard); |
| 76 | ---Purpose: Sets the operation of local boolean operation. |
| 77 | -- If theFlag = TRUE it means that no selection of parts |
| 78 | -- of the tool is needed, t.e. no second part. In that case |
| 79 | -- if theFuse = 0 than operation is COMMON, otherwise CUT21. |
| 80 | -- If theFlag = FALSE SetOperation(theFuse) function is called. |
| 81 | |
| 82 | Prepare(me:out) |
| 83 | is redefined protected; |
| 84 | ---Purpose: Prepares builder of local operation. |
| 85 | -- |
| 86 | |
| 87 | PartsOfTool(me:out; |
| 88 | theLT : out ListOfShape from TopTools); |
| 89 | ---Purpose: Collects parts of the tool. |
| 90 | |
| 91 | KeepParts(me:out; |
| 92 | theIm : ListOfShape from TopTools); |
| 93 | ---Purpose: Initialyzes parts of the tool for second step of algorithm. |
| 94 | -- Collects shapes and all sub-shapes into myShapes map. |
| 95 | |
| 96 | KeepPart(me:out; |
| 97 | theS : Shape from TopoDS); |
| 98 | ---Purpose: Adds shape theS and all its sub-shapes into myShapes map. |
| 99 | -- |
| 100 | |
| 101 | PerformResult(me:out); |
| 102 | ---Purpose: Main function to build the result of the |
| 103 | -- local operation required. |
| 104 | |
| 105 | RebuildFaces(me:out); |
| 106 | ---Purpose: Rebuilds faces in accordance with the kept parts of the tool. |
| 107 | -- |
| 108 | |
| 109 | RebuildEdge(me:out; |
| 110 | theE:Shape from TopoDS; |
| 111 | theF:Face from TopoDS; |
| 112 | theME:MapOfShape from BOPCol; |
| 113 | aLEIm:out ListOfShape from BOPCol); |
| 114 | ---Purpose: Rebuilds edges in accordance with the kept parts of the tool. |
| 115 | -- |
| 116 | |
| 117 | CheckSolidImages(me:out); |
| 118 | ---Purpose: Collects the images of the object, that contains in |
| 119 | -- the images of the tool. |
| 120 | |
| 121 | FillRemoved(me:out); |
| 122 | ---Purpose: Collects the removed parts of the tool into myRemoved map. |
| 123 | -- |
| 124 | |
| 125 | FillRemoved(me:out; |
| 126 | theS : Shape from TopoDS; |
| 127 | theM : in out MapOfShape from BOPCol); |
| 128 | ---Purpose: Adds the shape S and its sub-shapes into myRemoved map. |
| 129 | -- |
| 130 | |
| 131 | FillIn3DParts(me:out; |
| 132 | theInParts:out DataMapOfShapeListOfShape from BOPCol; |
| 133 | theDraftSolids:out DataMapOfShapeShape from BOPCol; |
| 134 | theAllocator:BaseAllocator from BOPCol) |
| 135 | is redefined protected; |
| 136 | ---Purpose: Function is redefined to avoid the usage of removed faces. |
| 137 | -- |
| 138 | |
| 139 | fields |
| 140 | myShapes : MapOfShape from BOPCol is protected; |
| 141 | myRemoved : MapOfShape from BOPCol is protected; |
| 142 | myFuse : Integer from Standard is protected; |
| 143 | |
| 144 | end Builder; |