Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1998-06-03 |
2 | -- Created by: data exchange team | |
3 | -- Copyright (c) 1998-1999 Matra Datavision | |
973c2be1 | 4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 5 | -- |
973c2be1 | 6 | -- This file is part of Open CASCADE Technology software library. |
b311480e | 7 | -- |
d5f74e42 | 8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
12 | -- distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 13 | -- |
973c2be1 | 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. | |
7fd59977 | 16 | |
17 | class ReShape from BRepTools inherits TShared from MMgt | |
18 | ||
19 | ---Purpose: Rebuilds a Shape by making pre-defined substitutions on some | |
20 | -- of its components | |
21 | -- | |
22 | -- In a first phase, it records requests to replace or remove | |
23 | -- some individual shapes | |
24 | -- For each shape, the last given request is recorded | |
25 | -- Requests may be applied "Oriented" (i.e. only to an item with | |
26 | -- the SAME orientation) or not (the orientation of replacing | |
27 | -- shape is respectful of that of the original one) | |
28 | -- | |
29 | -- Then, these requests may be applied to any shape which may | |
30 | -- contain one or more of these individual shapes | |
31 | ||
32 | uses | |
33 | ShapeEnum from TopAbs, | |
34 | Shape from TopoDS, | |
35 | DataMapOfShapeShape from TopTools | |
36 | ||
37 | is | |
38 | ||
6e33d3ce | 39 | Create returns ReShape from BRepTools; |
7fd59977 | 40 | ---Purpose: Returns an empty Reshape |
41 | ||
42 | Clear (me: mutable); | |
43 | ---Purpose: Clears all substitutions requests | |
44 | ||
45 | Remove (me: mutable; shape: Shape from TopoDS; | |
46 | oriented: Boolean = Standard_False); | |
47 | ---Purpose: Sets a request to Remove a Shape | |
48 | -- If <oriented> is True, only for a shape with the SAME | |
49 | -- orientation. Else, whatever the orientation | |
50 | ||
51 | Replace (me: mutable; shape, newshape: Shape from TopoDS; | |
52 | oriented: Boolean = Standard_False); | |
53 | ---Purpose: Sets a request to Replace a Shape by a new one | |
54 | -- If <oriented> is True, only if the orientation is the same | |
55 | -- Else, whatever the orientation, and the new shape takes the | |
56 | -- same orientation as <newshape> if the replaced one has the | |
57 | -- same as <shape>, else it is reversed | |
58 | ||
59 | IsRecorded (me; shape: Shape from TopoDS) returns Boolean; | |
60 | ---Purpose: Tells if a shape is recorded for Replace/Remove | |
61 | ||
62 | Value (me; shape: Shape from TopoDS) returns Shape from TopoDS; | |
63 | ---Purpose: Returns the new value for an individual shape | |
64 | -- If not recorded, returns the original shape itself | |
65 | -- If to be Removed, returns a Null Shape | |
66 | -- Else, returns the replacing item | |
67 | ||
68 | Status (me: mutable; shape: Shape from TopoDS; newsh: out Shape from TopoDS; last : Boolean = Standard_False) | |
69 | returns Integer is virtual; | |
70 | ---Purpose: Returns a complete substitution status for a shape | |
71 | -- 0 : not recorded, <newsh> = original <shape> | |
72 | -- < 0: to be removed, <newsh> is NULL | |
73 | -- > 0: to be replaced, <newsh> is a new item | |
74 | -- If <last> is False, returns status and new shape recorded in | |
75 | -- the map directly for the shape, if True and status > 0 then | |
76 | -- recursively searches for the last status and new shape. | |
77 | ||
78 | Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs; buildmode: Integer) | |
79 | returns Shape from TopoDS is virtual; | |
80 | ---Purpose: Applies the substitutions requests to a shape | |
81 | -- | |
82 | -- <until> gives the level of type until which requests are taken | |
83 | -- into account. For subshapes of the type <until> no rebuild | |
84 | -- and futher exploring are done. | |
85 | -- ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE | |
86 | -- | |
87 | -- <buildmode> says how to do on a SOLID,SHELL ... if one of its | |
88 | -- sub-shapes has been changed: | |
89 | -- 0: at least one Replace or Remove -> COMPOUND, else as such | |
90 | -- 1: at least one Remove (Replace are ignored) -> COMPOUND | |
91 | -- 2: Replace and Remove are both ignored | |
92 | -- If Replace/Remove are ignored or absent, the result as same | |
93 | -- type as the starting shape | |
94 | ||
95 | Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs = TopAbs_SHAPE) | |
96 | returns Shape from TopoDS is virtual; | |
97 | ---Purpose: Applies the substitutions requests to a shape. | |
98 | -- | |
99 | -- <until> gives the level of type until which requests are taken | |
100 | -- into account. For subshapes of the type <until> no rebuild | |
101 | -- and futher exploring are done. | |
102 | -- | |
103 | -- NOTE: each subshape can be replaced by shape of the same type | |
104 | -- or by shape containing only shapes of that type (for | |
105 | -- example, TopoDS_Edge can be replaced by TopoDS_Edge, | |
106 | -- TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges). | |
107 | -- If incompatible shape type is encountered, it is ignored | |
108 | -- and flag FAIL1 is set in Status. | |
109 | ||
110 | ModeConsiderLocation(me: mutable) returns Boolean; | |
111 | ---C++: return & | |
112 | ---Purpose:Returns (modifiable) the flag which defines whether Location of shape take into account | |
113 | -- during replacing shapes. | |
114 | ||
115 | ModeConsiderOrientation(me: mutable) returns Boolean; | |
116 | ---C++: return & | |
117 | ---Purpose:Returns (modifiable) the flag which defines whether Orientation of shape take into account | |
118 | -- during replacing shapes. | |
119 | ||
120 | fields | |
121 | ||
337a0f4e RL |
122 | myNMap: DataMapOfShapeShape from TopTools is protected; -- normal case |
123 | myRMap: DataMapOfShapeShape from TopTools is protected; -- REVERSED | |
7fd59977 | 124 | myStatus: Integer is protected; -- error status |
125 | myConsiderLocation : Boolean; | |
126 | myConsiderOrientation : Boolean; | |
127 | ||
128 | end ReShape; |