cd8ab514d430c05ffcd5e172cda8c8bb578c17ac
[occt.git] / src / BRepTools / BRepTools_ReShape.cdl
1 -- Created on: 1998-06-03
2 -- Created by: data exchange team
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class ReShape from BRepTools inherits TShared from MMgt
24
25     ---Purpose: Rebuilds a Shape by making pre-defined substitutions on some
26     --          of its components
27     --
28     --          In a first phase, it records requests to replace or remove
29     --          some individual shapes
30     --          For each shape, the last given request is recorded
31     --          Requests may be applied "Oriented" (i.e. only to an item with
32     --          the SAME orientation) or not (the orientation of replacing
33     --          shape is respectful of that of the original one)
34     --           
35     --          Then, these requests may be applied to any shape which may
36     --          contain one or more of these individual shapes
37
38 uses 
39     ShapeEnum from TopAbs, 
40     Shape     from TopoDS,
41     DataMapOfShapeShape from TopTools
42
43 is
44
45     Create returns mutable ReShape from BRepTools;
46         ---Purpose: Returns an empty Reshape
47
48     Clear (me: mutable);
49         ---Purpose: Clears all substitutions requests
50
51     Remove (me: mutable; shape: Shape from TopoDS;
52             oriented: Boolean = Standard_False);
53         ---Purpose: Sets a request to Remove a Shape
54         --          If <oriented> is True, only for a shape with the SAME
55         --          orientation. Else, whatever the orientation
56
57     Replace (me: mutable; shape, newshape: Shape from TopoDS;
58              oriented: Boolean = Standard_False);
59         ---Purpose: Sets a request to Replace a Shape by a new one
60         --          If <oriented> is True, only if the orientation is the same
61         --          Else, whatever the orientation, and the new shape takes the
62         --          same orientation as <newshape> if the replaced one has the
63         --          same as <shape>, else it is reversed
64
65     IsRecorded (me; shape: Shape from TopoDS) returns Boolean;
66         ---Purpose: Tells if a shape is recorded for Replace/Remove
67
68     Value (me; shape: Shape from TopoDS) returns Shape from TopoDS;
69         ---Purpose: Returns the new value for an individual shape
70         --          If not recorded, returns the original shape itself
71         --          If to be Removed, returns a Null Shape
72         --          Else, returns the replacing item
73
74     Status (me: mutable; shape: Shape from TopoDS; newsh: out Shape from TopoDS; last : Boolean = Standard_False)
75     returns Integer is virtual;
76         ---Purpose: Returns a complete substitution status for a shape
77         --          0  : not recorded,   <newsh> = original <shape>
78         --          < 0: to be removed,  <newsh> is NULL
79         --          > 0: to be replaced, <newsh> is a new item
80         --          If <last> is False, returns status and new shape recorded in
81         --          the map directly for the shape, if True and status > 0 then
82         --          recursively searches for the last status and new shape.
83
84     Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs; buildmode: Integer)
85     returns Shape from TopoDS is virtual;
86         ---Purpose: Applies the substitutions requests to a shape
87         --         
88         --          <until> gives the level of type until which requests are taken
89         --          into account. For subshapes of the type <until> no rebuild 
90         --          and futher exploring are done.
91         --          ACTUALLY, NOT IMPLEMENTED BELOW  TopAbs_FACE
92         --           
93         --          <buildmode> says how to do on a SOLID,SHELL ... if one of its
94         --          sub-shapes has been changed:
95         --          0: at least one Replace or Remove -> COMPOUND, else as such
96         --          1: at least one Remove (Replace are ignored) -> COMPOUND
97         --          2: Replace and Remove are both ignored
98         --          If Replace/Remove are ignored or absent, the result as same
99         --          type as the starting shape
100
101     Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs = TopAbs_SHAPE)
102     returns Shape from TopoDS is virtual;
103         ---Purpose: Applies the substitutions requests to a shape.
104         --         
105         --          <until> gives the level of type until which requests are taken
106         --          into account. For subshapes of the type <until> no rebuild 
107         --          and futher exploring are done.
108         --
109         --          NOTE: each subshape can be replaced by shape of the same type
110         --          or by shape containing only shapes of that type (for 
111         --          example, TopoDS_Edge can be replaced by TopoDS_Edge,
112         --          TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
113         --          If incompatible shape type is encountered, it is ignored
114         --          and flag FAIL1 is set in Status.
115     
116     ModeConsiderLocation(me: mutable) returns Boolean;
117     ---C++: return &
118     ---Purpose:Returns (modifiable) the flag which defines whether Location of shape take into account
119     --         during replacing shapes.
120
121     ModeConsiderOrientation(me: mutable) returns Boolean;
122     ---C++: return &
123     ---Purpose:Returns (modifiable) the flag which defines whether Orientation of shape take into account
124     --         during replacing shapes.
125
126 fields
127
128     myNMap: DataMapOfShapeShape from TopTools;  -- normal case
129     myRMap: DataMapOfShapeShape from TopTools;  -- REVERSED
130     myStatus: Integer is protected; -- error status
131     myConsiderLocation    : Boolean;
132     myConsiderOrientation : Boolean;
133
134 end ReShape;