1 -- Created on: 2000-08-22
2 -- Created by: Andrey BETENEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
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.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class ShapeContext from ShapeProcess inherits Context from ShapeProcess
18 ---Purpose: Extends Context to handle shapes
19 -- Contains map of shape-shape, and messages
26 ShapeEnum from TopAbs,
27 DataMapOfShapeShape from TopTools,
28 Modifier from BRepTools,
29 ReShape from ShapeBuild,
32 MsgRegistrator from ShapeExtend,
37 Create (file: CString; seq: CString = "");
38 Create (S: Shape from TopoDS; file: CString; seq: CString = "");
39 ---Purpose: Initializes a tool by resource file and shape
42 Init (me: mutable; S: Shape from TopoDS);
43 ---Purpose: Initializes tool by a new shape and clears all results
45 Shape (me) returns Shape from TopoDS;
46 ---Purpose: Returns shape being processed
47 ---C++: return const &
49 Result (me) returns Shape from TopoDS;
50 ---Purpose: Returns current result
51 ---C++: return const &
53 Map (me) returns DataMapOfShapeShape from TopTools;
54 ---Purpose: Returns map of replacements shape -> shape
55 -- This map is not recursive
56 ---C++: return const &
58 Messages (me) returns MsgRegistrator from ShapeExtend;
59 ---C++: return const &
61 Messages (me: mutable) returns MsgRegistrator from ShapeExtend;
63 ---Purpose: Returns messages recorded during shape processing
64 -- It can be nullified before processing in order to
65 -- avoid recording messages
67 SetDetalisation (me: mutable; level: ShapeEnum from TopAbs);
68 GetDetalisation (me) returns ShapeEnum from TopAbs;
69 ---Purpose: Set and get value for detalisation level
70 -- Only shapes of types from TopoDS_COMPOUND and until
71 -- specified detalisation level will be recorded in maps
72 -- To cancel mapping, use TopAbs_SHAPE
73 -- To force full mapping, use TopAbs_VERTEX
74 -- The default level is TopAbs_FACE
76 SetResult (me: mutable; S: Shape from TopoDS);
77 ---Purpose: Sets a new result shape
78 -- NOTE: this method should be used very carefully
79 -- to keep consistency of modifications
80 -- It is recommended to use RecordModification() methods
81 -- with explicit definition of mapping from current
82 -- result to a new one
84 RecordModification (me: mutable; repl: DataMapOfShapeShape from TopTools);
85 RecordModification (me: mutable; repl: ReShape from ShapeBuild;
86 msg : MsgRegistrator from ShapeExtend);
87 RecordModification (me: mutable; repl: ReShape from ShapeBuild);
88 RecordModification (me: mutable; sh : Shape from TopoDS;
89 repl: Modifier from BRepTools);
90 ---Purpose: Records modifications and resets result accordingly
91 -- NOTE: modification of resulting shape should be explicitly
92 -- defined in the maps along with modifications of subshapes
94 -- In the last function, sh is the shape on which Modifier
95 -- was run. It can be different from the whole shape,
96 -- but in that case result as a whole should be reset later
97 -- either by call to SetResult(), or by another call to
98 -- RecordModification() which contains mapping of current
99 -- result to a new one explicitly
101 AddMessage (me: mutable; S: Shape from TopoDS; msg: Msg from Message;
102 gravity: Gravity from Message = Message_Warning);
103 ---Purpose: Record a message for shape S
104 -- Shape S should be one of subshapes of original shape
105 -- (or whole one), but not one of intermediate shapes
106 -- Records only if Message() is not Null
108 GetContinuity (me; param: CString; val: out Shape from GeomAbs)
110 ---Purpose: Get value of parameter as being of the type GeomAbs_Shape
111 -- Returns False if parameter is not defined or has a wrong type
113 ContinuityVal (me; param: CString; def: Shape from GeomAbs)
114 returns Shape from GeomAbs;
115 ---Purpose: Get value of parameter as being of the type GeomAbs_Shape
116 -- If parameter is not defined or does not have expected
117 -- type, returns default value as specified
119 PrintStatistics (me);
120 ---Purpose: Prints statistics on Shape Processing onto the current Messenger.
121 ---Remark: At the moment outputs information only on shells and faces.
125 myShape : Shape from TopoDS;
126 myResult: Shape from TopoDS;
128 myMap : DataMapOfShapeShape from TopTools;
129 myMsg : MsgRegistrator from ShapeExtend;
131 myUntil : ShapeEnum from TopAbs;