7fd59977 |
1 | -- File: TransferBRep.cdl |
2 | -- Created: Mon Oct 3 10:03:04 1994 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@stylox> |
5 | ---Copyright: Matra Datavision 1994 |
6 | |
7 | |
8 | package TransferBRep |
9 | |
10 | ---Purpose : This package gathers services to simply read files and convert |
11 | -- them to Shapes from CasCade. IE. it can be used in conjunction |
12 | -- with purely CasCade software |
13 | |
14 | uses Standard, TCollection, TColStd, TopoDS, TopAbs, TopTools, Interface, Transfer, Message |
15 | |
16 | is |
17 | |
18 | class Reader; |
19 | |
20 | -- class Analyzer; |
21 | |
22 | class ShapeInfo; |
23 | class BinderOfShape instantiates SimpleBinder from Transfer |
24 | (Shape from TopoDS, ShapeInfo); |
25 | |
26 | class ShapeBinder; |
27 | class ShapeListBinder; |
28 | |
29 | class ShapeMapper instantiates Mapper from Transfer |
30 | (Shape from TopoDS, ShapeMapHasher from TopTools, ShapeInfo); |
31 | class OrientedShapeMapper instantiates Mapper from Transfer |
32 | (Shape from TopoDS, OrientedShapeMapHasher from TopTools, ShapeInfo); |
33 | |
34 | class TransferResultInfo; |
35 | class SequenceOfTransferResultInfo instantiates Sequence from TCollection |
36 | (TransferResultInfo from TransferBRep); |
37 | class HSequenceOfTransferResultInfo instantiates HSequence from TCollection |
38 | (TransferResultInfo from TransferBRep, |
39 | SequenceOfTransferResultInfo from TransferBRep); |
40 | |
41 | -- some usefull functions for binding shapes -- |
42 | |
43 | ShapeResult (binder : Binder from Transfer) returns Shape from TopoDS; |
44 | ---Purpose : Get the Shape recorded in a Binder |
45 | -- If the Binder brings a multiple result, search for the Shape |
46 | |
47 | ShapeResult (TP : TransientProcess from Transfer; ent : Transient) |
48 | returns Shape from TopoDS; |
49 | ---Purpose : Get the Shape recorded in a TransientProcess as result of the |
50 | -- Transfer of an entity. I.E. in the binder bound to that Entity |
51 | -- If no result or result not a single Shape, returns a Null Shape |
52 | |
53 | SetShapeResult (TP : mutable TransientProcess from Transfer; ent : Transient; |
54 | result : Shape from TopoDS); |
55 | ---Purpose : Sets a Shape as a result for a starting entity <ent> |
56 | -- (reverse of ShapeResult) |
57 | -- It simply creates a ShapeBinder then binds it to the entity |
58 | |
59 | Shapes (TP : TransientProcess from Transfer; rootsonly : Boolean = Standard_True) |
60 | returns HSequenceOfShape from TopTools; |
61 | ---Purpose : Gets the Shapes recorded in a TransientProcess as result of a |
62 | -- Transfer, considers roots only or all results according |
63 | -- <rootsonly>, returns them as a HSequence |
64 | |
65 | Shapes (TP : TransientProcess from Transfer; |
66 | list : HSequenceOfTransient from TColStd) |
67 | returns HSequenceOfShape from TopTools; |
68 | ---Purpose : Gets the Shapes recorded in a TransientProcess as result of a |
69 | -- Transfer, for a given list of starting entities, returns |
70 | -- the shapes as a HSequence |
71 | |
72 | |
73 | ShapeState (FP : FinderProcess from Transfer; shape : Shape from TopoDS) |
74 | returns Orientation from TopAbs; |
75 | ---Purpose : Returns a Status regarding a Shape in a FinderProcess |
76 | -- - FORWARD means bound with SAME Orientation |
77 | -- - REVERSED means bound with REVERSE Orientation |
78 | -- - EXTERNAL means NOT BOUND |
79 | -- - INTERNAL is not used |
80 | |
81 | ResultFromShape (FP : FinderProcess from Transfer; shape : Shape from TopoDS) |
82 | returns Binder from Transfer; |
83 | ---Purpose : Returns the result (as a Binder) attached to a given Shape |
84 | -- Null if none |
85 | |
86 | TransientFromShape (FP : FinderProcess from Transfer; shape : Shape from TopoDS) |
87 | returns Transient; |
88 | ---Purpose : Returns the result as pure Transient attached to a Shape |
89 | -- first one if multiple result |
90 | |
91 | SetTransientFromShape (FP : FinderProcess from Transfer; |
92 | shape : Shape from TopoDS; result : Transient); |
93 | ---Purpose : Binds a Transient Result to a Shape in a FinderProcess |
94 | -- (as first result if multiple : does not add it to existing one) |
95 | |
96 | ShapeMapper (FP : FinderProcess from Transfer; shape : Shape from TopoDS) |
97 | returns ShapeMapper; |
98 | ---Purpose : Returns a ShapeMapper for a given Shape (location included) |
99 | -- Either <shape> is already mapped, then its Mapper is returned |
100 | -- Or it is not, then a new one is created then returned, BUT |
101 | -- it is not mapped here (use Bind or FindElseBind to do this) |
102 | |
103 | -- Functions to collect transfer result information -- |
104 | |
105 | TransferResultInfo (TP : TransientProcess from Transfer; |
106 | EntityTypes: HSequenceOfTransient from TColStd; |
107 | InfoSeq : out HSequenceOfTransferResultInfo from TransferBRep); |
108 | ---Purpose: Fills sequence of TransferResultInfo for each type of entity |
109 | -- given in the EntityTypes (entity are given as objects). |
110 | -- Method IsKind applied to the entities in TP is used to |
111 | -- compare with entities in EntityTypes. |
112 | -- TopAbs_ShapeEnum). |
113 | |
114 | TransferResultInfo (FP : FinderProcess from Transfer; |
115 | ShapeTypes: HSequenceOfInteger from TColStd; |
116 | InfoSeq : out HSequenceOfTransferResultInfo from TransferBRep); |
117 | ---Purpose: Fills sequence of TransferResultInfo for each type of shape |
118 | -- given in the ShapeTypes (which are in fact considered as |
119 | -- TopAbs_ShapeEnum). |
120 | -- The Finders in the FP are considered as ShapeMappers. |
121 | |
122 | PrintResultInfo ( Printer : Printer from Message; |
123 | Header : Msg from Message; |
124 | ResultInfo: TransferResultInfo from TransferBRep; |
125 | printEmpty: Boolean = Standard_True); |
126 | ---Purpose: Prints the results of transfer to given priner with given header. |
127 | |
128 | |
129 | |
130 | -- Functions to analyse checks on objects, shapes ... -- |
131 | |
132 | BRepCheck (shape : Shape from TopoDS; lev : Integer = 1) |
133 | returns CheckIterator from Interface; |
134 | ---Purpose : Performs a heavy check by calling the Analyser from BRepCheck |
135 | -- This tool computes a lot of informations about integrity of a |
136 | -- Shape. This method uses it and converts its internal result |
137 | -- to a classic check-list. |
138 | -- <lev> allows to get more informations : |
139 | -- 0 : BRepCheck only |
140 | -- 1(D) + Curves/Surfaces not C0 ; 2 + SameParameter on Edges |
141 | -- Warning : entities to which checks are bound are the Shapes themselves, |
142 | -- embedded in ShapeMapper |
143 | |
144 | ResultCheckList (chl : CheckIterator from Interface; |
145 | FP : FinderProcess from Transfer; |
146 | model : InterfaceModel from Interface) |
147 | returns CheckIterator from Interface; |
148 | ---Purpose : Takes a starting CheckIterator which brings checks bound with |
149 | -- starting objects (Shapes, Transient from an Imagine appli ...) |
150 | -- and converts it to a CheckIterator in which checks are bound |
151 | -- with results in an InterfaceModel |
152 | -- Mapping is recorded in the FinderProcess |
153 | -- Starting objects for which no individual result is recorded |
154 | -- remain in their state |
155 | |
156 | Checked (chl : CheckIterator from Interface; |
157 | alsoshapes : Boolean = Standard_False) |
158 | returns HSequenceOfTransient from TColStd; |
159 | ---Purpose : Returns the list of objects to which a non-empty Check is |
160 | -- bound in a check-list. Objects are transients, they can then |
161 | -- be either Imagine objects entities for an Interface Norm. |
162 | -- <alsoshapes> commands Shapes to be returned too |
163 | -- (as ShapeMapper), see also CheckedShapes |
164 | |
165 | CheckedShapes (chl : CheckIterator from Interface) |
166 | returns HSequenceOfShape from TopTools; |
167 | ---Purpose : Returns the list of shapes to which a non-empty Check is bound |
168 | -- in a check-list |
169 | |
170 | CheckObject (chl : CheckIterator from Interface; obj : Transient) |
171 | returns CheckIterator from Interface; |
172 | ---Purpose : Returns the check-list bound to a given object, generally none |
173 | -- (if OK) or one check. <obj> can be, either a true Transient |
174 | -- object or entity, or a ShapeMapper, in that case the Shape is |
175 | -- considered |
176 | |
177 | -- Complementary helps |
178 | |
179 | end TransferBRep; |