1 IGES Support {#user_guides__iges}
4 @section occt_iges_1 Introduction
7 This manual explains how to convert an IGES file to an Open CASCADE Technology (**OCCT**) shape and vice versa. It provides basic documentation on conversion. For advanced information on conversion, see our offerings on our web site at <a href="http://www.opencascade.org/support/training/">www.opencascade.org/support/training/</a>
9 IGES files up to and including IGES version 5.3 can be read. IGES files that are produced by this interface conform to IGES version 5.3 (Initial Graphics Exchange Specification, IGES 5.3. ANS US PRO/IPO-100-1996).
11 This manual principally deals with two OCCT classes:
12 * The Reader class, which loads IGES files and translates their contents to OCCT shapes,
13 * The Writer class, which translates OCCT shapes to IGES entities and then writes these entities to IGES files.
15 File translation is performed in the programming mode, via C++ calls, and the resulting OCCT objects are shapes.
17 All definitions in IGES version 5.3 are recognized but only 3D geometric entities are translated. When the processor encounters data, which is not translated, it ignores it and writes a message identifying the types of data, which was not handled. This message can be written either to a log file or to screen output.
19 @section occt_iges_2 Reading IGES
20 @subsection occt_iges_2_1 Procedure
21 You can translate an IGES file to an OCCT shape by following the steps below:
23 -# Check file consistency,
24 -# Set the translation parameters,
25 -# Perform the file translation,
27 @subsection occt_iges_2_2 Domain covered
28 @subsubsection occt_iges_2_2_1 Translatable entities
29 The types of IGES entities, which can be translated, are:
35 * Structure entities (groups). Each entity in the group outputs a shape. There can be a group of groups.
36 * Subfigures. Each entity defined in a subfigure outputs a shape
37 * Transformation Matrix.
39 **Note** that all non-millimeter length unit values in the IGES file are converted to millimeters.
41 @subsubsection occt_iges_2_2_2 Attributes
42 Entity attributes in the Directory Entry Section of the IGES file (such as layers, colors and thickness) are translated to Open CASCADE Technology using XDE.
43 @subsubsection occt_iges_2_2_3 Administrative data
44 Administrative data, in the Global Section of the IGES file (such as the file name, the name of the author, the date and time a model was created or last modified) is not translated to Open CASCADE Technology. Administrative data can, however, be consulted in the IGES file.
47 @subsection occt_iges_2_3 Description of the process
48 @subsubsection occt_iges_2_3_1 Loading the IGES file
49 Before performing any other operation, you have to load the file using the syntax below.
51 IGESControl_Reader reader;
52 IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”);
54 The loading operation only loads the IGES file into computer memory; it does not translate it.
56 @subsubsection occt_iges_2_3_2 Checking the IGES file
57 This step is not obligatory. Check the loaded file with:
59 Standard_Boolean ok = reader.Check(Standard_True);
61 The variable “ok is True” is returned if no fail message was found; “ok is False” is returned if there was at least one fail message.
63 reader.PrintCheckLoad (failsonly, mode);
65 Error messages are displayed if there are invalid or incomplete IGES entities, giving you information on the cause of the error.
67 Standard_Boolean failsonly = Standard_True or Standard_False;
69 If you give True, you will see fail messages only. If you give False, you will see both fail and warning messages.
71 Your analysis of the file can be either message-oriented or entity-oriented. Choose your preference with *IFSelect_PrintCount mode = IFSelect_xxx*, where *xxx* can be any of the following:
72 * *ItemsByEntity* gives a sequential list of all messages per IGES entity.
73 * *CountByItem* gives the number of IGES entities with their types per message.
74 * *ShortByItem* gives the number of IGES entities with their types per message and displays rank numbers of the first five IGES entities per message.
75 * *ListByItem* gives the number of IGES entities with their type and rank numbers per message.
76 * *EntitiesByItem* gives the number of IGES entities with their types, rank numbers and Directory Entry numbers per message.
78 @subsubsection occt_iges_2_3_3 Setting translation parameters
79 The following parameters can be used to translate an IGES file to an OCCT shape. If you give a value that is not within the range of possible values, it will be ignored.
81 <h4>read.iges.bspline.continuity</h4>
82 manages the continuity of BSpline curves (IGES entities 106, 112 and 126) after translation to Open CASCADE Technology (Open CASCADE Technology requires that the curves in a model be at least C1 continuous; no such requirement is made by IGES).
83 * 0: no change; the curves are taken as they are in the IGES file. C0 entities of Open CASCADE Technology may be produced.
84 * 1: if an IGES BSpline, Spline or CopiousData curve is C0 continuous, it is broken down into pieces of C1 continuous *Geom_BSplineCurve*.
85 * 2: This option concerns IGES Spline curves only. IGES Spline curves are broken down into pieces of C2 continuity. If C2 cannot be ensured, the Spline curves will be broken down into pieces of C1 continuity.
87 Read this parameter with:
89 Standard_Integer ic = Interface_Static::IVal("read.iges.bspline.continuity");
91 Modify this value with:
93 if (!Interface_Static::SetIVal ("read.iges.bspline.continuity",2))
98 This parameter does not change the continuity of curves that are used in the construction of IGES BRep entities. In this case, the parameter does not influence the continuity of the resulting OCCT curves (it is ignored).
101 <h4>read.precision.mode</h4>
102 reads the precision value.
103 * File (0) the precision value is read in the IGES file header (default).
104 * User (1) the precision value is that of the read.precision.val parameter.
106 Read this parameter with:
108 Standard_Integer ic = Interface_Static::IVal("read.precision.mode");
110 Modify this value with:
112 if (!Interface_Static::SetIVal ("read.precision.mode",1))
115 Default value is *File* (0).
117 <h4>read.precision.val</h4>
118 User defined precision value. This parameter gives the precision for shape construction when the read.precision.mode parameter value is 1. By default it is 0.0001, but can be any real positive (non null) value.
120 This value is in the measurement unit defined in the IGES file header.
122 Read this parameter with:
124 Standard_Real rp = Interface_Static::RVal("read.precision.val");
126 Modify this parameter with:
128 if (!Interface_Static::SetRVal ("read.precision.val",0.001))
131 Default value is 0.0001.
133 The value given to this parameter is a target value that is applied to *TopoDS_Vertex, TopoDS_Edge* and *TopoDS_Face* entities. The processor does its best to reach it. Under certain circumstances, the value you give may not be attached to all of the entities concerned at the end of processing. IGES-to-OCCT translation does not improve the quality of the geometry in the original IGES file. This means that the value you enter may be impossible to attain the given quality of geometry in the IGES file.
135 Value of tolerance used for computation is calculated by multiplying the value of *read.precision.val* and the value of coefficient of transfer from the file units to millimeters.
137 <h4>read.maxprecision.mode</h4>
138 defines the mode of applying the maximum allowed tolerance. Its possible values are:
140 * *Preferred(0)* maximum tolerance is used as a limit but sometimes it can be exceeded (currently, only for deviation of a 3D curve of an edge from its pcurves and from vertices of such edge) to ensure shape validity;
141 * *Forced(1)* maximum tolerance is used as a rigid limit, i.e. it can not be exceeded and, if this happens, tolerance is trimmed to suit the maximum-allowable value.
143 Read this parameter with:
145 Standard_Integer mv = Interface_Static::IVal("read.maxprecision.mode");
147 Modify this parameter with:
149 if (!Interface_Static::SetIVal ("read.maxprecision.mode",1))
152 Default value is *Preferred (0)*.
154 <h4>read.maxprecision.val</h4>
155 defines the maximum allowable tolerance (in mm) of the shape. It should be not less than the basis value of tolerance set in processor (either Resolution from the file or *read.precision.val*). Actually, the maximum between *read.maxprecision.val* and basis tolerance is used to define maximum allowed tolerance.
156 Read this parameter with:
158 Standard_Real rp = Interface_Static::RVal("read.maxprecision.val");
160 Modify this parameter with:
162 if (!Interface_Static::SetRVal ("read.maxprecision.val",0.1))
167 <h4>read.stdsameparameter.mode</h4>
168 defines the using of *BRepLib::SameParameter*. Its possible values are:
169 * 0 (Off) - *BRepLib::SameParameter* is not called,
170 * 1 (On) - *BRepLib::SameParameter* is called.
171 *BRepLib::SameParameter* is used through *ShapeFix_Edge::SameParameter*. It ensures that the resulting edge will have the lowest tolerance taking pcurves either unmodified from the IGES file or modified by *BRepLib::SameParameter*.
172 Read this parameter with:
174 Standard_Integer mv = Interface_Static::IVal("read.stdsameparameter.mode");
176 Modify this parameter with:
178 if (!Interface_Static::SetIVal ("read.stdsameparameter.mode",1))
181 Deafault value is 0 (Off).
183 <h4>read.surfacecurve.mode</h4>
184 preference for the computation of curves in case of 2D/3D inconsistency in an entity which has both 2D and 3D representations.
186 Here we are talking about entity types 141 (Boundary), 142 (CurveOnSurface) and 508 (Loop). These are entities representing a contour lying on a surface, which is translated to a *TopoDS_Wire*, formed by *TopoDS_Edges*. Each *TopoDS_Edge* must have a 3D curve and a 2D curve that reference the surface.
188 The processor also decides to re-compute either the 3D or the 2D curve even if both curves are translated successfully and seem to be correct, in case there is inconsistency between them. The processor considers that there is inconsistency if any of the following conditions is satisfied:
189 * the number of sub-curves in the 2D curve is different from the number of sub-curves in the 3D curve. This can be either due to different numbers of sub-curves given in the IGES file or because of splitting of curves during translation.
190 * 3D or 2D curve is a Circular Arc (entity type 100) starting and ending in the same point (note that this case is incorrect according to the IGES standard).
192 The parameter *read.surfacecurve.mode* defines which curve (3D or 2D) is used for re-computing the other one:
193 * *Default(0)* use the preference flag value in the entity's Parameter Data section. The flag values are:
194 * 0: no preference given,
195 * 1: use 2D for 142 entities and 3D for 141 entities,
196 * 2: use 3D for 142 entities and 2D for 141 entities,
197 * 3: both representations are equally preferred.
198 * *2DUse_Preferred (2)* : the 2D is used to rebuild the 3D in case of their inconsistency,
199 * *2DUse_Forced (-2)*: the 2D is always used to rebuild the 3D (even if 2D is present in the file),
200 * *3DUse_Preferred (3)*: the 3D is used to rebuild the 2D in case of their inconsistency,
201 * *3DUse_Forced (-3)*: the 3D is always used to rebuild the 2D (even if 2D is present in the file),
203 If no preference is defined (if the value of *read.surfacecurve.mode* is *Default* and the value of the preference flag in the entity's Parameter Data section is 0 or 3), an additional analysis is performed.
205 The 3D representation is preferred to the 2D in two cases:
206 * if 3D and 2D contours in the file have a different number of curves,
207 * if the 2D curve is a Circular Arc (entity type 100) starting and ending in the same point and the 3D one is not.
209 In any other case, the 2D representation is preferred to the 3D.
211 If either a 3D or a 2D contour is absent in the file or cannot be translated, then it is re-computed from another contour. If the translation of both 2D and 3D contours fails, the whole curve (type 141 or 142) is not translated. If this curve is used for trimming a face, the face will be translated without this trimming and will have natural restrictions.
213 Read this parameter with:
215 Standard_Integer ic = Interface_Static::IVal("read.surfacecurve.mode");
217 Modify this value with:
219 if (!Interface_Static::SetIVal ("read.surfacecurve.mode",3))
222 Default value is Default (0).
224 <h4>read.encoderegularity.angle</h4>
225 This parameter is used within the *BRepLib::EncodeRegularity()* function which is called for a shape read from an IGES or a STEP file at the end of translation process. This function sets the regularity flag of an edge in a shell when this edge is shared by two faces. This flag shows the continuity, which these two faces are connected with at that edge.
227 Read this parameter with:
229 Standard_Real era = Interface_Static::RVal("read.encoderegularity.angle");
231 Modify this parameter with:
233 if (!Interface_Static::SetRVal ("read.encoderegularity.angle",0.1))
236 Default value is 0.01.
238 <h4>read.iges.bspline.approxd1.mode</h4>
239 This parameter is obsolete (it is rarely used in real practice). If set to True, it affects the translation of bspline curves of degree 1 from IGES: these curves (which geometrically are polylines) are split by duplicated points, and the translator attempts to convert each of the obtained parts to a bspline of a higher continuity.
241 Read this parameter with:
243 Standard_Real bam = Interface_Static::CVal("read.iges.bspline.approxd1.mode");
245 Modify this parameter with:
247 if (!Interface_Static::SetRVal ("read.encoderegularity.angle","On"))
250 Default value is Off.
253 <h4>read.iges.resource.name and read.iges.sequence</h4>
254 These two parameters define the name of the resource file and the name of the sequence of operators (defined in that file) for Shape Processing, which is automatically performed by the IGES translator. The Shape Processing is a user-configurable step, which is performed after the translation and consists in application of a set of operators to a resulting shape. This is a very powerful tool allowing to customize the shape and to adapt it to the needs of a receiving application. By default, the sequence consists of a single operator *ShapeFix* that calls Shape Healing from the IGES translator.
256 Please find an example of the resource file for IGES (which defines parameters corresponding to the sequence applied by default, i.e. if the resource file is not found) in the Open CASCADE Technology installation, by the path <i>%CASROOT%/src/XSTEPResource/IGES</i> .
258 In order for the IGES translator to use that file, you have to define the environment variable *CSF_IGESDefaults*, which should point to the directory where the resource file resides. Note that if you change parameter *read.iges.resource.name*, you should change the name of the resource file and the name of the environment variable correspondingly. The variable should contain a path to the resource file.
261 * read.iges.resource.name - IGES,
262 * read.iges.sequence - FromIGES.
264 <h4>read.scale.unit</h4>
265 This parameter is obsolete (the parameter *xstep.cascade.unit* should be used instead when necessary). If it is set to 'M', the shape is scaled 0.001 times (as if it were in meters) after translation from IGES or STEP.
269 <h4>xstep.cascade.unit</h4>
270 This parameter defines units to which a shape should be converted when translated from IGES or STEP to CASCADE. Normally it is MM; only those applications that work internally in units other than MM should use this parameter.
274 @subsubsection occt_iges_2_3_4 Selecting entities
276 A list of entities can be formed by invoking the method *IGESControl_Reader::GiveList*.
278 Handle(TColStd_HSequenceOfTransient) list = reader.GiveList();
280 Several predefined operators can be used to select a list of entities of a specific type.
281 To make a selection, you use the method *IGESControl_Reader::GiveList* with the selection type in quotation marks as an argument. You can also make cumulative selections. For example, you would use the following syntax:
282 1. Requesting the faces in the file:
284 faces = Reader.GiveList("iges-faces");
286 2. Requesting the visible roots in the file:
288 visibles = Reader.GiveList(iges-visible-roots);
290 3. Requesting the visible faces:
292 visfac = Reader.GiveList(iges-visible-roots,faces);
294 Using a signature, you can define a selection dynamically, filtering the string by means of a criterion. When you request a selection using the method GiveList, you can give either a predefined selection or a selection by signature. You make your selection by signature using the predefined signature followed by your criterion in parentheses as shown in the example below. The syntaxes given are equivalent to each other.
296 faces = Reader.GiveList(“xst-type(SurfaceOfRevolution)”);
297 faces = Reader.GiveList(“iges-type(120)”);
299 You can also look for:
300 * values returned by your signature which match your criterion exactly
302 faces = Reader.GiveList(“xst-type(=SurfaceOfRevolution)”);
304 * values returned by your signature which do not contain your criterion
306 faces = Reader.GiveList(“xst-type(!SurfaceOfRevolution)”);
308 * values returned by your signature which do not exactly match your criterion.
310 faces = Reader.GiveList(“xst-type(!=SurfaceOfRevolution)”);
313 <h4>List of predefined operators that can be used:</h4>
314 * *xst-model-all* - selects all entities.
315 * *xst-model-roots* - selects all roots.
316 * *xst-transferrable-all* - selects all translatable entities.
317 * *xst-transferrable-roots* - selects all translatable roots (default).
318 * *xst-sharing + selection* - selects all entities sharing at least one entity selected by selection.
319 * *xst-shared + selection* - selects all entities shared by at least one entity selected by selection.
320 * *iges-visible-roots* - selects all visible roots, whether translatable or not.
321 * *iges-visible-transf-roots* - selects all visible and translatable roots.
322 * *iges-blanked-roots* - selects all blank roots, whether translatable or not.
323 * *iges-blanked-transf-roots* - selects all blank and translatable roots.
324 * *iges-status-independant* - selects entities whose IGES Subordinate Status = 0.
325 * *iges-bypass-group* Selects all root entities. If a root entity is a group (402/7 or 402/9), the entities in the group are selected.
326 * *iges-bypass-subfigure* Selects all root entities. If a root entity is a subfigure definition (308), the entities in the subfigure definition are selected.
327 * * iges-bypass-group-subfigure* Selects all root entities. If a root entity is a group (402/7 or 402/9) or a subfigure definition (308), the entities in the group and in the subfigure definition are selected.
328 * *iges-curves-3d* - selects 3D curves, whether they are roots or not (e.g. a 3D curve on a surface).
329 * *iges-basic-geom* - selects 3D curves and untrimmed surfaces.
330 * *iges-faces* - selects face-supporting surfaces (trimmed or not).
331 * *iges-surfaces* - selects surfaces not supporting faces (i.e. with natural bounds).
332 * *iges-basic-curves-3d* selects the same entities as iges-curves-3d. Composite Curves are broken down into their components and the components are selected.
334 @subsubsection occt_iges_2_3_5 Performing the IGES file translation
335 Perform translation according to what you want to translate:
336 1. Translate an entity identified by its rank with:
338 Standard_Boolean ok = reader.Transfer (rank);
340 2. Translate an entity identified by its handle with:
342 Standard_Boolean ok = reader.TransferEntity (ent);
344 3. Translate a list of entities in one operation with:
346 Standard_Integer nbtrans = reader.TransferList (list);
349 where *nbtrans* returns the number of items in the list that produced a shape and *reader.IsDone()* indicates whether at least one entity was translated.
350 4. Translate a list of entities, entity by entity:
352 Standard_Integer i,nb = list-Length();
353 for (i = 1; i = nb; i ++) {
354 Handle(Standard_Transient) ent = list-Value(i);
355 Standard_Boolean OK = reader.TransferEntity (ent);
358 5. Translate the whole file (all entities or only visible entities) with:
360 Standard_Boolean onlyvisible = Standard_True or Standard_False;
361 reader.TransferRoots(onlyvisible)
364 @subsubsection occt_iges_2_36 Getting the translation results
365 Each successful translation operation outputs one shape. A series of translations gives a series of shapes.
366 Each time you invoke *TransferEntity, Transfer* or *Transferlist*, their results are accumulated and NbShapes increases. You can clear the results (Clear function) between two translation operations, if you do not do this, the results from the next translation will be added to the accumulation. *TransferRoots* operations automatically clear all existing results before they start.
368 Standard_Integer nbs = reader.NbShapes();
370 returns the number of shapes recorded in the result.
372 TopoDS_Shape shape = reader.Shape(num);,
374 returns the result *num,* where *num* is an integer between 1 and *NbShapes*.
376 TopoDS_Shape shape = reader.Shape();
378 returns the first result in a translation operation.
380 TopoDS_Shape shape = reader.OneShape();
382 returns all results in a single shape which is:
383 * a null shape if there are no results,
384 * in case of a single result, a shape that is specific to that result,
385 * a compound that lists the results if there are several results.
389 erases the existing results.
391 reader.PrintTransferInfo (failsonly, mode);
393 displays the messages that appeared during the last invocation of *Transfer* or *TransferRoots*.
395 If *failsonly* is *IFSelect_FailOnly*, only fail messages will be output, if it is *IFSelect_FailAndWarn*, all messages will be output. Parameter “mode” can have *IFSelect_xxx* values where *xxx* can be:
396 * *GeneralCount* - gives general statistics on the transfer (number of translated IGES entities, number of fails and warnings, etc)
397 * *CountByItem* - gives the number of IGES entities with their types per message.
398 * *ListByItem* - gives the number of IGES entities with their type and DE numbers per message.
399 * *ResultCount* - gives the number of resulting OCCT shapes per type.
400 * *Mapping* gives mapping between roots of the IGES file and the resulting OCCT shape per IGES and OCCT type.
402 @subsection occt_iges_2_4 Mapping of IGES entities to Open CASCADE Technology shapes
404 *NOTE* that IGES entity types that are not given in the following tables are not translatable.
406 @subsubsection occt_iges_2_4_1 Points
408 | IGES entity type | CASCADE shape | Comments |
410 | ----------------: | -------------: | ---------: |
412 | 116: Point | TopoDS_Vertex |
414 @subsubsection occt_iges_2_4_2 Curves
415 Curves, which form the 2D of face boundaries, are translated as *Geom2D_Curves* (Geom2D circles, etc.).
417 IGES entity type CASCADE shape Comments
418 100: Circular Arc TopoDS_Edge
419 The geometrical support is:
421 - or a Geom_TrimmedCurve.
422 A Geom_TrimmedCurve is output if the arc is not closed.
425 The resulting shape is always a TopoDS_Wire that is built from a set of TopoDS_Edges.
426 Each TopoDS_Edge is connected to the preceding and to the following edge by a common TopoDS_Vertex.
427 104: Conic Arc TopoDS_Edge The geometric support depends on whether the IGES entity's form is:
430 - 2 (Geom_Hyperbola),
431 - or 3 (Geom_Parabola).
432 A Geom_TrimmedCurve is output if the arc is not closed.
433 106: Copious Data TopoDS_Edge or TopoDS_Wire IGES entity Copious Data (type 106, forms 1-3) is translated just as the IGES entities Linear Path (106/11-13) and the Simple Closed Planar Curve (106/63). Vectors applying to forms other than 11,12 or 63 are ignored.
434 The Geom_BSplineCurve (geometrical support) has C0 continuity.
435 If the Copious Data has vectors (DataType = 3) they will be ignored.
436 110: Line TopoDS_Edge The supporting curve is a Geom_TrimmedCurve whose basis curve is a Geom_Line.
437 112: Parametric Spline Curve TopoDS_Edge or TopoDS_Wire The geometric support is a Geom_BsplineCurve.
438 126: BSpline Curve TopoDS_Edge or TopoDS_Wire
439 130: Offset Curve TopoDS_Edge or TopoDS_Wire
440 The resulting shape is a TopoDS_Edge or a TopoDS_Wire (depending on the translation of the basis curve) whose geometrical support is a Geom_OffsetCurve built from a basis Geom_Curve.
441 Limitation: The IGES Offset Type value must be 1.
442 141: Boundary TopoDS_Wire Same behavior as for the Curve On Surface (see below).
443 The translation of a non-referenced Boundary IGES entity in a BoundedSurface IGES entity outputs a TopoDS_Edge or a TopoDS_Wire with a Geom_Curve.
444 142: Curve On Surface TopoDS_Wire Each TopoDS_Edge is defined by a 3D curve and by a 2D curve that references the surface.
446 The type of OCCT shapes (either *TopDS_Edges* or *TopoDS_Wires*) that result from the translation of IGES entities 106, 112 and 126 depends on the continuity of the curve in the IGES file and the value of the *read.iges.bspline.continuity* translation parameter.
448 @subsubsection occt_iges_2_4_3 Surfaces
449 Translation of a surface outputs either a TopoDS_Face or a TopoDS_Shell.
450 If a TopoDS_Face is output, its geometrical support is a Geom_Surface and its outer and inner boundaries (if it has any) are TopoDS_Wires.
452 IGES entity type CASCADE shape Comments
455 The geometrical support for the TopoDS_Face is a Geom_Plane and the orientation of its TopoDS_Wire depends on whether it is an outer TopoDS_Wire or whether it is a hole.
456 114: Parametric Spline Surface TopoDS_Face The geometrical support of a TopoDS_Face is a Geom_BSplineSurface.
460 TopoDS_Shell The translation of a Ruled Surface outputs:
461 - a TopoDS_Face if the profile curves become TopoDS_Edges,
462 - a TopoDS_Shell if the profile curves become TopoDS_Wires.
464 Limitation: This translation cannot be completed when these two TopoDS_Wires are oriented in different directions.
465 120: Surface Of Revolution TopoDS_Face
468 The translation of a Surface Of Revolution outputs:
469 - a TopoDS_Face if the generatrix becomes a TopoDS_Edge,
470 - a TopoDS_Shell if the generatrix becomes a TopoDS_Wire.
471 The geometrical support may be:
472 - a Geom_CylindricalSurface,
473 - a Geom_ConicalSurface,
474 - a Geom_SphericalSurface,
475 - a Geom_ToroidalSurface
476 - or a Geom_SurfaceOfRevolution
477 depending on the result of the CASCADE computation (based on the generatrix type).
478 122: Tabulated Cylinder TopoDS_Face
481 The translation outputs:
482 - a TopoDS_Face if the base becomes a TopoDS_Edge,
483 - a TopoDS_Shell if the base becomes a TopoDS_Wire.
485 The geometrical support may be:
487 - a Geom_Cylindrical Surface,
488 - a Geom_SurfaceOfLinearExtrusion
489 depending on the result of the CASCADE computation (based on the generatrix type).
490 The Geom_Surface geometrical support is limited according to the generatrix.
491 128: BSpline Surface TopoDS_Face The geometrical support of the TopoDS_Face is a Geom_BsplineSurface.
492 140: Offset Surface TopoDS_Face
494 The translation of an Offset Surface outputs a TopoDS_Face whose geometrical support is a Geom_OffsetSurface.
497 For OCCT algorithms, the original surface must be C1-continuous so that the Geom_OffsetSurface can be created.
498 If the basis surface is not C1-continuous, its translation outputs a TopoDS_Shell and only the first TopoDS_Face in the TopoDS_Shell is offset.
499 143: Bounded Surface TopoDS_Face or TopoDS_Shell If the basis surface outputs a TopoDS_Shell (that has more than one TopoDS_Face), the IGES boundaries are not translated.
502 If the bounding curves define holes, natural bounds are not created.
503 If the orientation of the contours is wrong, it is not corrected.
504 144: Trimmed Surface TopoDS_Face
506 For the needs of interface processing, the basis surface must be a face.
507 Shells are only processed if they are single-face.
508 The contours (wires that are correctly oriented according to the definition of the IGES 142: Curve On Surface entity) are added to the face that is already created.
509 If the orientation of the contours is wrong, it is corrected.
510 190: Plane Surface TopoDS_Face
511 This type of IGES entity can only be used in BRep entities in place of an IGES 108 type entity.
512 The geometrical support of the face is a Geom_Plane.
516 @subsubsection occt_iges_2_4_4 Boundary Representation Solid Entities
518 IGES entity type CASCADE shape Comments
519 186: ManifoldSolid TopoDS_Solid
520 514: Shell TopoDS_Shell
521 510: Face TopoDS_Face This is the lowest IGES entity in the BRep structure that can be specified as a starting point for translation.
522 508: Loop TopoDS_Wire
527 @subsubsection occt_iges_2_4_5 Structure Entities
529 IGES entity type CASCADE shape Comments
530 402/1: Associativity Instance: Group with back pointers
532 402/7: Associativity Instance: Group without back pointers TopoDS_Compound
533 402/9: Associativity Instance: Single Parent
535 The translation of a SingleParent entity is only performed for 402 form 9 with entities 108/1 and 108/-1.
536 The geometrical support for the TopoDS_Face is a Geom_Plane with boundaries:
537 - the parent plane defines the outer boundary,
538 - child planes define the inner boundaries.
542 @subsubsection occt_iges_2_4_6 Subfigures
544 IGES entity type CASCADE shape Comments
545 308: Subfigure Definition TopoDS_Compound This IGES entity is only translated when there are no Singular Subfigure Instance entities.
546 408: Singular Subfigure Instance TopoDS_Compound This shape has the Subfigure Definition Compound as its origin and is positioned in space by its translation vector and its scale factor.
550 @subsubsection occt_iges_2_4_7 Transformation Matrix
552 IGES entity type CASCADE shape Comments
553 124: Transformation Matrix Geom_Transformation This entity is never translated alone. It must be included in the definition of another entity.
556 @subsection occt_iges_2_5 Messages
557 Messages are displayed concerning the normal functioning of the processor (transfer, loading, etc.).
558 You must declare an include file:
560 #includeInterface_DT.hxx
563 You have the choice of the following options for messages:
565 IDT_SetLevel (level);
567 level modifies the level of messages:
569 * 1: raise and fail messages are displayed, as are messages concerning file access,
570 * 2: warnings are also displayed.
572 IDT_SetFile (“tracefile.log”);
574 prints the messages in a file,
578 restores screen output.
580 @subsection occt_iges_2_6 Tolerance management
581 @subsubsection occt_iges_2_6_1 Values used for tolerances during reading IGES
583 During the transfer of IGES to Open CASCADE Technology several parameters are used as tolerances and precisions for different algorithms. Some of them are computed from other using specific functions.
585 <h4>3D (spatial) tolerances</h4>
587 * Package method *Precision::Confusion* equal to 10<sup>-7</sup> is used as a minimal distance between points, which are considered distinct.
588 * Resolution in the IGES file is defined in the Global section of an IGES file. It is used as a fundamental value of precision during the transfer.
589 * User-defined variable *read.precision.val* can be used instead of resolution from the file when parameter *read.precision.mode* is set to 1 ("User").
590 * Field *EpsGeom* of the class *IGESToBRep_CurveAndSurface* is a basic precision for translating an IGES object. It is set for each object of class *IGESToBRep_CurveAndSurface* and its derived classes. It is initialized for the root of transfer either by value of resolution from the file or by value of *read.precision.val*, depending on the value of *read.precision.mode* parameter. It is returned by call to method *IGESToBRep_CurvAndSurface::GetEpsGeom*. As this value belongs to measurement units of the IGES file, it is usually multiplied by the coefficient *UnitFactor* (returned by method *IGESToBRep_CurvAndSurface::GetUnitFactor*) to convert it to Open CASCADE Technology units.
591 * Field *MaxTol* of the class *IGESToBRep_CurveAndSurface* is used as the maximum tolerance for some algorithms. Currently, it is computed as the maximum between 1 and <i>GetEpsGeom*GetUnitFactor</i>. This field is returned by method *IGESToBRep_CurvAndSurface::GetMaxTol*.
593 <h4>2D (parametric) tolerances</h4>
595 * Package method *Precision::PConfusion* equal to <i> 0.01*Precision::Confusion</i>, i.e. 10<sup>-9</sup>. It is used to compare parametric bounds of curves.
596 * Field *EpsCoeff* of the class *IGESToBRep_CurveAndSurface* is a parametric precision for translating an IGES object. It is set for each object of class *IGESToBRep_CurveAndSurface* and its derived classes. Currently, it always has its default value 10<sup>-6</sup>. It is returned by call to method *IGESToBRep_CurvAndSurface::GetEpsCoeff*. This value is used for translating 2d objects (for instance, parametric curves).
597 * Methods *UResolution(tolerance3d)* and *VResolution(tolerance3d)* of the class *GeomAdaptor_Surface* or *BRepAdaptor_Surface* return tolerance in parametric space of a surface computed from 3D tolerance. When one tolerance value is to be used for both U and V parametric directions, the maximum or the minimum value of *UResolution* and *VResolution* is used.
598 * Methods *Resolution(tolerance3d)* of the class *GeomAdaptor_Curve* or *BRepAdaptor_Curve* return tolerance in the parametric space of a curve computed from 3d tolerance.
600 <h4>Zero-dimensional tolerances</h4>
601 * Field *Epsilon* of the class *IGESToBRep_CurveAndSurface* is set for each object of class *IGESToBRep_CurveAndSurface* and returned by call to method *GetEpsilon*. It is used in comparing angles and converting transformation matrices. In most cases, it is reset to a fixed value (10<sup>-5</sup> - 10<sup>-3</sup>) right before use. The default value is 10<sup>-4</sup>.
603 @subsubsection occt_iges_2_6_2 Initial setting of tolerances in translating objects
605 Transfer starts from one entity treated as a root (either the actual root in the IGES file or an entity selected by the user). The function which performs the transfer (that is *IGESToBRep_Actor::Transfer* or *IGESToBRep_Reader::Transfer*) creates an object of the type *IGESToBRep_CurveAndSurface*, which is intended for translating geometry.
607 This object contains three tolerances: *Epsilon, EpsGeom* and *EpsCoeff*.
609 Parameter *Epsilon* is set by default to value 10<sup>-4</sup>. In most cases when it is used in the package *IGESToBRep*, it is reset to a fixed value, either 10<sup>-5</sup> or 10<sup>-4</sup> or 10<sup>-3</sup>. It is used as precision when comparing angles and transformation matrices and does not have influence on the tolerance of the resulting shape.
611 Parameter *EpsGeom* is set right after creating a *IGESToBRep_CurveAndSurface* object to the value of resolution, taken either from the Global section of an IGES file, or from the *XSTEP.readprecision.val* parameter, depending on the value of *XSTEP.readprecision.mode*.
613 Parameter *EpsCoeff* is set by default to 10<sup>-6</sup> and is not changed.
615 During the transfer of a shape, new objects of type *IGESToBRep_CurveAndSurface* are created for translating subshapes. All of them have the same tolerances as the root object.
617 @subsubsection occt_iges_2_6_3 Transfer process
618 <h4>Translating into Geometry</h4>
619 Geometrical entities are translated by classes *IGESToBRep_BasicCurve* and *IGESToBRep_BasicSurface*. Methods of these classes convert curves and surfaces of an IGES file to Open CASCADE Technology geometry objects: *Geom_Curve, Geom_Surface,* and *Geom_Transformation*.
621 Since these objects are not BRep objects, they do not have tolerances. Hence, tolerance parameters are used in these classes only as precisions: to detect specific cases (e.g., to distinguish a circle, an ellipse, a parabola and a hyperbola) and to detect bad cases (such as coincident points).
623 Use of precision parameters is reflected in the following classes:
624 * *IGESToBRep_BasicCurve* - all parameters and points are compared with precision *EpsGeom*. All transformations (except *IGESToBRep_BasicCurve::TransferTransformation*) are fulfilled with precision *Epsilon* which is set to 10<sup>-3</sup> (in the *IGESToBRep_BasicCurve::TransferTransformation* the value 10<sup>-5</sup> is used).
625 * *IGESToBRep_BasicCurve::TransferBSplineCurve* - all weights of *BSplineCurve* are assumed to be more than *Precision::PConfusion* (else the curve is not translated).
626 * *IGESToBRep_BasicSurface* all parameters and points are compared with precision *EpsGeom*. All transformations are fulfilled with precision *Epsilon*, which is set to 10<sup>-3</sup>.
627 * *IGESToBRep_BasicSurface::TransferBSplineSurface* - all weights of *BSplineSurface* are assumed to be more than *Precision::PConfusion* (else the surface is not translated).
630 <h4>Translating into Topology</h4>
632 IGES entities represented as topological shapes and geometrical objects are translated into OCCT shapes by use of the following classes:
633 IGESToBRep_TopoCurve, IGESToBRep_TopoSurface, IGESToBRep_BRepEntity, ShapeFix_Wire
634 Class IGESToBRep_BRepEntity is intended for transferring BRep entities (IGES version ³ 5.1) while the two former are used for translating geometry and topology defined in IGES 5.1. Methods from IGESToBRep_BRepEntity call methods from IGESToBRep_TopoCurve and IGESToBRep_TopoSurface, while those call methods from IGESToBRep_BasicCurve and IGESToBRep_BasicSurface in order to translate IGES geometry into OCCT geometry.
635 Although the IGES file contains only one parameter for tolerance in the Global Section, OCCT shapes are produced with different tolerances. As a rule, updating the tolerance is fulfilled according to local distances between shapes (distance between vertices of adjacent edges, deviation of edge’s 3D curve and its parametric curve and so on) and may be less or greater than precision in the file.
636 The following classes show what default tolerances are used when creating shapes and how they are updated during transfer.
637 <h5>Class IGESToBRep_TopoCurve</h5>
638 All the methods which are in charge of transferring curves from IGES curve entities (TransferCompositeCurve, Transfer2dCompositeCurve, TransferCurveOnFace, TransferBoundaryOnFace, TransferOffsetCurve, TransferTopoBasicCurve) if an entity has transformation call to IGESData_ToolLocation::ConvertLocation with Epsilon value set to 10-4.
639 * IGESToBRep_TopoCurve::TransferPoint
640 Vertex is constructed from a Point entity with tolerance EpsGeom*UnitFactor.
641 * IGESToBRep_TopoCurve::Transfer2dPoint
642 Vertex is constructed from a Point entity with tolerance EpsCoeff.
643 * IGESToBRep_TopoCurve::TransferCompositeCurveGeneral
644 Obtains shapes (edges or wires) from other methods and adds them into the resulting wire. Two adjacent edges of the wire can be connected with tolerance up to MaxTol.
645 * IGESToBRep_TopoCurve::TransferCurveOnFace and IGESToBRep_TopoCurve::TransferBoundaryOnFace
646 This method builds a wire from 3D and 2D representations of a curve on surface.
647 Edges and vertices of the wire cannot have tolerance larger than MaxTol.
648 The value EpsGeom*UnitFactor is passed into ShapeFix_Wire::SetPrecision and MaxTol - into ShapeFix_Wire::MaxTolerance. To find out how these parameters affect the resulting tolerance changes, please refer to class ShapeFix_Wire.
649 * IGESToBRep_TopoCurve::TransferTopoBasicCurve and IGESToBRep_TopoCurve::Transfer2dTopoBasicCurve
650 The boundary vertices of an edge (or a wire if a curve was of C0 continuity) translated from a basis IGES curve (BSplineCurve, CopiousData, Line, etc.) are built with tolerance EpsGeom*UnitFactor, the tolerance of the edge(s) is (are) Precision::Confusion*.*
651 If a curve was divided into several edges, the common vertices of such adjacent edges have tolerance Precision::Confusion*.*
652 <h5>Class IGESToBRep_TopoSurface</h5>
653 All the faces created by this class have tolerance Precision::Confusion*.*
654 <h5>Class IGESToBRep_BRepEntity</h5>
655 * IGESToBRep_BRepEntity::TransferVertex
656 The vertices from the VertexList entity are constructed with tolerance EpsGeom*UnitFactor.
657 * IGESToBRep_BRepEntity::TransferEdge
658 The edges from the EdgeList entity are constructed with tolerance Precision::Confusion*.*
659 * IGESToBRep_BRepEntity::TransferLoop
660 This function works like IGESToBRep_TopoCurve::TransferCurveOnFace* *and* *IGESToBRep_TopoCurve::TransferBoundaryOnFace*.*
661 * IGESToBRep_BRepEntity::TransferFace
662 The face from the Face IGES entity is constructed with tolerance Precision::Confusion.
663 <h5>Shape Healing classes</h5>
664 After performing a simple mapping, shape-healing algorithms are called (class ShapeFix_Shape) by IGESToBRep_Actor::Transfer(). A shape-healing algorithm performs the correction of a resulting OCCT shape.
665 Class ShapeFix_Wire can increase the tolerance of a shape. This class is used in IGESToBRep_BRepEntity::TransferLoop*,* IGESToBRep_TopoCurve::TransferBoundaryOnFace and IGESToBRep_TopoCurve::TransferCurveOnFace for correcting a wire. The maximum possible tolerance which edges or vertices will have after invoking the methods of this class is MaxTolerance (set by method ShapeFix_Wire::MaxTolerance()).
667 @subsection occt_iges_2_7 Code architecture
668 @subsubsection occt_iges_2_71 List of the classes
669 <h5>Package IGESControl</h5>
671 <h5>Package IGESToBRep</h5>
674 IGESToBRep_CurveAndSurface
675 IGESToBRep_BasicCurve
676 IGESToBRep_BasicSurface
678 IGESToBRep_TopoSurface
679 IGESToBRep_BRepEntity
680 <h5>Package IGESConvGeom</h5>
681 For description of classes, refer to CDL.
682 @subsubsection occt_iges_2_72 List of API classes
683 <h5>package IGESControl</h5>
685 <h5>package IGESToBRep</h5>
687 <h5>package IGESData</h5>
688 class IGESData_IGESModel
689 class IGESData_IGESEntity
690 For details, refer to 4 API for reading/writing IGES and CDL.
691 @subsubsection occt_iges_2_73 Graph of calls
692 The following diagram illustrates the structure of calls in reading IGES.
693 The highlighted classes produce OCCT geometry.
694 @image html /user_guides/iges/images/iges_image003.jpg
695 @image latex /user_guides/iges/images/iges_image003.jpg
697 @subsection occt_iges_2_8 Example
698 #include “IGESControl_Reader.hxx”
699 #include “TColStd_HSequenceOfTransient.hxx”
700 #include “TopoDS_Shape.hxx”
702 IGESControl_Reader myIgesReader;
703 Standard_Integer nIgesFaces,nTransFaces;
705 myIgesReader.ReadFile (“MyFile.igs”);
706 //loads file MyFile.igs
708 Handle(TColStd_HSequenceOfTransient) myList = myIgesReader.GiveList(“iges-faces”);
709 //selects all IGES faces in the file and puts them into a list called //MyList,
711 nIgesFaces = myList-Length();
712 nTransFaces = myIgesReader.TransferList(myList);
715 cout“IGES Faces: “nIgesFaces“ Transferred:”nTransFacesendl;
716 TopoDS_Shape sh = myIgesReader.OneShape();
717 //and obtains the results in an OCCT shape.
721 @section occt_1856844696_874243683 Writing IGES
722 @subsection occt_1856844696_8742436831 Procedure
723 You can translate OCCT shapes to IGES entities in the following steps:
724 1. initialize the process.
725 2. set the translation parameters,
726 3. perform the model translation,
727 4. write the output IGES file.
728 You can translate several shapes before writing a file. Each shape will be a root entity in the IGES model.
729 @subsection occt_1856844696_8742436832 Domain covered
730 There are two families of OCCT objects that can be translated:
733 @subsection occt_1856844696_8742436833 Description of the process
734 @subsubsection occt_1856844696_87424368331 Initializing the process
735 Choose the unit and the mode you want to use to write the output file as follows:
736 IGESControl_Controller::Init
737 performs standard initialization. Returns False if an error occurred.
738 IGESControl_Writer writer;
739 uses the default unit (millimeters) and the default write mode (Face).
740 IGESControl_Writer writer (UNIT);
741 uses the Face write mode and any of the units that are accepted by IGES.
742 IGESControl_Writer writer (UNIT,modecr);
743 uses the unit (accepted by IGES) and the write mode of your choice.
746 The result is an IGESControl_Writer object.
747 @subsubsection occt_1856844696_87424368332 Setting the translation parameters
748 The following parameters are used for the OCCT-to-IGES translation.
749 <h4>write.iges.brep.mode: </h4>
750 gives the choice of the write mode. You can choose the following write modes:
752 ;Faces; (0): OCCT TopoDS_Faces will be translated into IGES 144 (Trimmed Surface) entities, no B-Rep entities will be written to the IGES file,
753 ;BRep; (1): OCCT TopoDS_Faces will be translated into IGES 510 (Face) entities, the IGES file will contain B-Rep entities.
754 Read this parameter with:
755 Standard_Integer byvalue = Interface_Static::IVal(;write.iges.brep.mode;);
756 Modify this parameter with:
757 Interface_Static::SetIVal (;write.iges.brep.mode;, 1);
758 Default value is ;Faces; (0).
759 <h4>write.convertsurface.mode</h4>
760 For writing to IGES in the BRep mode (see parameter write.iges.brep.mode), this parameter indicates whether elementary surfaces (cylindrical, conical, spherical, and toroidal) are converted into corresponding IGES 5.3 entities (if parameter's value is On), or written as surfaces of revolution (by default).
761 Default value is Off.
762 <h4>write.iges.unit:</h4>
763 gives the choice of the unit. The default unit for Open CASCADE Technology is the millimeter. You can choose to write your file in any of the units that are accepted by IGES.
764 Read this parameter with:
765 Standard_String byvalue = Interface_Static::CVal(;write.iges.unit;);
766 Modify this parameter with:
767 Interface_Static::SetCVal (;write.iges.unit;, ;INCH;);
768 Default value is ;MM;.
769 <h4>write.iges.header.autor:</h4>
770 gives the name of the author of the file.
771 Read this parameter with:
772 Standard_String byvalue = Interface_Static::CVal(;write.iges.header.author;);
773 Modify this value with:
774 Interface_Static::SetCVal (;write.iges.header.author;, ;name;);
775 Default value is the system name of the user.
776 <h4>write.iges.header.company:</h4>
777 gives the name of the sending company.
778 Read this parameter with:
779 Standard_String byvalue = Interface_Static::CVal(;write.iges.header.company;);
780 Modify this value with:
781 Interface_Static::SetCVal (;write.iges.header.company;, ;MDTV;);
782 Default value is ;; (empty).
783 <h4>write.iges.header.product:</h4>
784 gives the name of the sending product.
785 Read this parameter with:
786 Standard_String byvalue = Interface_Static::CVal(;write.iges.header.product;);
787 Modify this value with:
788 Interface_Static::SetCVal (;write.iges.header.product;, ;product name;);
789 Default value is ;CAS.CADE IGES processor Vx.x; where x.x means the current version of Open CASCADE Technology.
790 <h4>write.iges.header.receiver:</h4>
791 gives the name of the receiving company.
792 Read this parameter with:
793 Standard_String byvalue = Interface_Static::CVal(;write.iges.header.receiver;);
794 Modify this value with:
795 Interface_Static::SetCVal (;write.iges.header.receiver;, ;reciever name;);
796 Default value is ;; (empty).
797 <h4>write.precision.mode:</h4>
798 specifies the mode of writing the resolution value into the IGES file.
799 ;Least; (-1): resolution value is set to the minimum tolerance of all edges and all vertices in an OCCT shape,
800 ;Average; (0): resolution value is set to average between the average tolerance of all edges and the average tolerance of all vertices in an OCCT shape (default),
801 ;Greatest; (1): resolution value is set to the maximum tolerance of all edges and all vertices in an OCCT shape,
802 ;Session; (2): resolution value is that of the write.precision.val parameter.
803 Read this parameter with:
804 Standard_Integer ic = Interface_Static::IVal(;write.precision.mode;);
805 Modify this parameter with:
806 if (!Interface_Static::SetIVal(;write.precision.mode;,1))
808 Default value is ;Average; (0).
809 <h4>write.precision.val:</h4>
810 user precision value. This parameter gives the resolution value for an IGES file when the write.precision.mode parameter value is 1.
812 any real positive (non null) value.
813 Read this parameter with:
814 Standard_Real rp = Interface_Static::RVal(;write.precision.val;);
815 Modify this parameter with:
816 if (!Interface_Static::SetRVal(;write.precision.val;,0.01))
818 Default value is 0.0001.
819 <h4>write.iges.resource.name</h4>
820 <h4>write.iges.sequence</h4>
821 The same as read.iges.*, please see above. Note that the default sequence for writing contains one operator – DirectFaces - which converts elementary surfaces based on left-hand axes (valid in CASCADE) to right-hand axes (which are valid only in IGES).
822 Default values : write.iges.resource.name – IGES, write.iges.sequence – ToIGES.
823 @subsubsection occt_1856844696_87424368333 Performing the Open CASCADE Technology shape translation
824 You can perform the translation in one or several operations. Here is how you translate topological and geometrical objects:
825 Standard_Boolean ok = writer.AddShape (shape);
826 where shape is a TopoDS_Shape.
827 ok is True if translation was correctly performed and False if there was at least one entity that was not translated.
828 Standard_Boolean ok = writer.AddGeom (geom);
829 where geom is either Handle(Geom_Curve) or Handle(Geom_Surface)
830 ok is True if the translation was correctly performed and False if there was at least one entity whose geometry was not among the allowed types.
831 @subsubsection occt_1856844696_87424368334 Writing the IGES file
832 Write the IGES file with:
833 Standard_Boolean ok = writer.Write (;filename.igs;);
834 to give the file name.
835 Standard_Boolean ok = writer.Write (S);
836 where S is Standard_OStream
837 ok is True if the operation was correctly performed and False if an error occurred (for instance, if the processor could not create the file).
838 @subsection occt_1856844696_8742436834 Mapping Open CASCADE Technology shapes to IGES entities
839 Translated objects depend on the write mode that you chose. If you chose the Face mode, all of the shapes are translated, but the level of topological entities becomes lower (geometrical one). If you chose the BRep mode, topological OCCT shapes become topological IGES entities.
840 @subsubsection occt_1856844696_87424368341 Curves
841 @subsubsection occt_1856844696_87424368342 Surfaces
843 @subsubsection occt_1856844696_87424368343 Topological entities
844 <h5>Translation in Face mode</h5>
846 <h5>Translation in BRep mode</h5>
847 @subsection occt_1856844696_8742436835 Tolerance management
848 @subsubsection occt_1856844696_87424368351 Setting resolution in an IGES file
849 There are several possibilities to set resolution in an IGES file. They are controlled by write.precision.mode parameter; the dependence between the value of this parameter and the set resolution is described in paragraph 3.3.2 Setting the translation parameters.
850 If the value of parameter write.precision.mode is -1, 0 or 1, resolution is computed from tolerances of sub-shapes inside the shape to be translated. In this computation, only tolerances of TopoDS_Edges and TopoDS_Vertices participate since they reflect the accuracy of the shape. TopoDS_Faces are ignored in computations since their tolerances may have influence on resulting computed resolution while IGES resolution mainly concerns points and curves but not surfaces.
852 @subsection occt_1856844696_8742436836 Code architecture
853 @subsubsection occt_1856844696_87424368361 List of the classes
854 <h5>package IGESControl </h5>
855 IGESControl_Controller
857 <h5>package BRepToIGES </h5>
862 <h5>package BRepToIGESBRep </h5>
863 BRepToIGESBRep_Entity
864 <h5>package GeomToIGES </h5>
866 GeomToIGES_GeomVector
868 GeomToIGES_GeomSurface
869 <h5>package Geom2dToIGES </h5>
870 Geom2dToIGES_Geom2dCurve
871 <h5>package IGESConvGeom </h5>
872 IGESConvGeom_GeomBuilder
873 For description of classes refer to CDL.
874 @subsubsection occt_1856844696_87424368362 List of API classes
875 <h5>package IGESControl</h5>
876 * IGESControl_Controller
878 <h5>package IGESData</h5>
879 * class IGESData_IGESModel
880 * class IGESData_IGESEntity
881 For details refer to 4. API for reading/writing IGES and CDL.
882 @subsubsection occt_1856844696_87424368363 Graph of calls
883 The following diagram illustrates the class structure in writing IGES.
884 The highlighted classes are intended to translate geometry.
886 @image html /user_guides/iges/images/iges_image004.jpg
887 @image latex /user_guides/iges/images/iges_image004.jpg
889 @subsection occt_1856844696_8742436837 Example
890 #include IGESControl_Controller.hxx
891 #include IGESControl_Writer.hxx
892 #include TopoDS_Shape.hxx
893 Standard_Integer main()
895 IGESControl_Controller::Init();
896 IGESControl_Writer ICW (;MM;, 0);
897 //creates a writer object for writing in Face mode with millimeters
900 //adds shape sh to IGES model
902 Standard_Boolean OK = ICW.Write (;MyFile.igs;);
903 //writes a model to the file MyFile.igs
905 @section occt_1856844696_1288309531 API for reading/writing IGES
906 @subsection occt_1856844696_12883095311 Overview
907 API classes provides the following tools:
908 * loading IGES files into memory,
909 * checking IGES files consistency,
910 * translating IGES files into OCCT shapes,
911 * translating OCCT shapes into IGES files,
912 * accessing the IGES model (which is an image of the IGES file in memory),
913 * selecting entities from the IGES model,
914 * accessing each entity in the IGES model.
915 @subsection occt_1856844696_12883095312 Package IGESControl
916 @subsubsection occt_1856844696_128830953121 General description
917 This package is intended to provide a tool to convert IGES-format entities to OCCT shapes and vice versa.
918 The package allows the end-user to perform both import from and export to an IGES file.
919 IGES files up to and including IGES version 5.3 can be read.
920 IGES files that are produced by this component conform to IGES version 5.3.
921 The result of reading IGES files is either a single Open CASCADE Technology shape or a set of them, the result of exporting Open CASCADE Technology geometric or topologic objects is an IGES file which may include one or several root entities (the ones not referenced by others).
922 @subsubsection occt_1856844696_128830953122 Class IGESControl_Controller
923 <h4>General description </h4>
924 This class controls the IGES norm.
925 This class is intended to provide an appropriate initialization of the IGES norm, namely it includes a set of necessary parameters for IGES translation and declaration of possible selections for IGES entities.
926 After the execution of initialization procedures, the use of IGES norm becomes available.
932 <h5>Constructors</h5>
933 IGESControl_Controller(const Standard_Boolean modefnes = Standard_False);
934 Purpose: Initializes the use of IGES (if modefnes is False) or FNES (if modefnes is True) norm.
935 <h5>Method for performing initialization</h5>
937 static Standard_Boolean Init() ;
938 Purpose: Performs standard initialization creating controller objects for both IGES and FNES norm.
939 Returns True when done, False if an error occurred.
940 <h5>Method for creating IGES model</h5>
941 IGESControl:: NewModel
942 Handle_Interface_InterfaceModel NewModel() const;
943 Purpose: Creates a new empty model ready to receive data of the norm. The Global section is filled with static parameters (receiver, author, company and unit).
944 <h5>Method for getting the actor object</h5>
945 IGESControl:: ActorRead
946 Handle_Transfer_ActorOfTransientProcess ActorRead( const Handle(Interface_InterfaceModel)& model) const;
947 Purpose: Returns the actor object for reading (actually, it is of type IGESToBRep_Actor) with a set parameter of spline continuity taken from static parameter.
948 <h5>Method for translating an Open CASCADE Technology shape</h5>
949 IGESControl:: TransferWriteShape
950 virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape, const Handle(Transfer_FinderProcess)& FP, const Handle(Interface_InterfaceModel)& model, const Standard_Integer modetrans = 0) const;
951 Purpose: Translates shape into the interface model.
952 modetrans: 0 - group of Faces (IGES 5.1) , 1 - for BRep (IGES = 5.1)
954 IFSelect_RetDone: OK,
955 IFSelect_RetError: if modetrans is not equal to 0 or 1, or model is not an IGES model.
956 IFSelect_Fail: if shape is null.
958 @subsubsection occt_1856844696_128830953123 Class IGESControl_Reader
959 <h4>General description</h4>
960 This object reads IGES files and translates their contents into OCCT shapes.
961 All definitions in IGES version 5.3 are recognized but only geometric and topologic entities can be translated. Data, which cannot be translated, is loaded with the file but during translation it is ignored.
962 The translation of the IGES model into the OCCT model goes through the following steps:
963 * loading a file into memory,
964 * checking file consistency,
965 * setting translation parameters,
966 * performing the translation itself,
967 * fetching the results.
969 The resulting OCCT objects belong to topologic shapes. The geometric objects (2D and 3D) are constructed in intermediate steps and serve as a support for topologic entities.
970 Each successful translation operation outputs one shape. A series of translations gives a list of shapes.
973 This class complements IGESToBRep_Reader class:
974 * deals directly with WorkSession object,
975 * computes the list of IGES entities matching specified criteria,
976 * performs translation of a list of entities and the ones specified by handle,
977 * outputs the results of checking and translating.
979 <h5>Constructors: </h5>
980 * IGESControl_Reader ();
981 Purpose: Creates a reader from scratch and with a new WorkSession object.
982 * IGESControl_Reader (const Handle(XSControl_WorkSession)& WS,
983 const Standard_Boolean scratch);
984 Purpose: Defines work session for the reader. If scratch is True the new model will be created in the work session.
985 <h5>Methods for dealing with WorkSession object </h5>
986 * IGESControl_Reader::SetWS
987 void SetWS ( const Handle(XSControl_WorkSession)& WS,
988 const Standard_Boolean scratch = Standard_True);
989 Purpose: Defines the work session for the reader.
990 If scratch is True the new model will be created in the work session object.
991 * IGESControl_Reader::WS
992 Handle_XSControl_WorkSession() const;
993 Purpose: Returns the used work session object.
994 <h5>Method for loading an IGES file into memory </h5>
995 * IGESControl_Reader::ReadFile
996 IFSelect_ReturnStatus ReadFile(const Standard_CString filename);
997 Purpose: Loads and memorizes an IGES file in memory.
999 IFSelect_RetDone: the file was successfully read
1000 IFSelect_RetVoid: no file found
1001 IFSelect_RetError: an error occurred during reading
1003 IGESToBRep_Reader::LoadFile()
1005 <h5>Methods for selecting entities to transfer</h5>
1006 * IGESControl_Reader::GiveList
1007 Handle_TColStd_HSequenceOfTransient GiveList( const Standard_CString first = ;;, const Standard_CString second = ;;);
1008 Purpose: Returns a list of entities from the model according to the following rules:
1009 * if first and second are empty - the list of roots for transfer,
1010 * if first is a number or label of an entity - this entity itself,
1011 * if first is a list of numbers/labels separated by commas - these entities,
1012 * if first is a name of a selection in work session and second is not defined - the standard result of this selection,
1013 * if first is a name of a selection and second is defined - the criterion defined by second is applied to result of first selection
1015 if second is erroneous it is ignored.
1016 Handle_TColStd_HSequenceOfTransient GiveList( const Standard_CString first, const Handle(Standard_Transient)& ent) ;
1017 Purpose: Returns a list of entities from the model according to the following rules:
1018 * if first is a selection name and second is an entity or a list of entities (as a HSequenceOfTransient) - the standard result of this selection is applied to this list.
1020 if first is erroneous, a null handle is returned.
1021 <h5>Methods for performing translation</h5>
1022 * IGESControl_Reader::TransferEntity
1023 Standard_Boolean TransferEntity(const Handle(Standard_Transient)& start) ;
1024 Purpose: Performs the translation of the entity specified by its handle.
1025 Returns False if an entity is not in the Model, else returns the result of the transfer.
1026 * IGESControl_Reader:: TransferList
1027 Standard_Integer TransferList( const Handle(TColStd_HSequenceOfTransient)& list) ;
1028 Purpose: Performs the translation of the list of entities.
1029 Returns the number of successful transfers.
1030 <h5>Methods for printing statistics</h5>
1031 * IGESControl_Reader:: PrintCheckLoad
1032 void PrintCheckLoad( const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const ;
1033 Purpose: Displays the check results on file entities.
1034 If failsonly is True prints only "Fail" messages, otherwise all messages.
1035 mode determines the contents and the order of messages:
1036 IFSelect_ItemsByEntity - sequential list of messages per entity,
1037 IFSelect_CountByItem - counts the number of entities per message,
1038 IFSelect_ShortByItem - the same function but also of the first five entities,
1039 IFSelect_ListByItem - the same but displays the rank numbers of all (not only five) entities,
1040 IFSelect_EntitiesByItem - the same plus it displays the Directory Entry number for each entity
1041 * IGESControl_Reader:: PrintCheckTransfer
1042 void PrintCheckTransfer( const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const;
1043 Purpose: Displays the checking results of the last transfer.
1044 The parameters play the same role as in PrintCheckLoad.
1045 * IGESControl_Reader:: PrintStatsTransfer
1046 void PrintStatsTransfer( const Standard_Integer what, const Standard_Integer mode = 0) const;
1047 Purpose: Displays all available statistics of the last transfer on the default trace file. The returned information is filtered by giving parameters.
1048 what defines what kind of statistics are to be printed:
1051 2 - all recorded (roots, intermediate, checked entities),
1052 3 - abnormal records,
1053 4 - warnings and fails messages,
1054 5 - only fail messages
1055 mode is used according to what:
1056 if what is 0 mode is ignored
1057 if what is 1, 2 or 3 mode defines the following:
1058 0 - lists numbers of concerned entities in the model,
1059 1 - for each entity, gives the number, label, type and result type and/or status (fail / warning...),
1060 2 - for each entity, gives the maximum information (check result),
1061 3 - counts per type of starting entity (class type),
1062 4 - counts per result type and/or status,
1063 5 - counts per couple (starting type / result type/status),
1064 6 – does the same thing plus gives for each item, the list of numbers of entities in the starting model
1065 if what is 4 or 5 - mode is treated as enumeration IFSelect_PrintCount.
1066 * IGESControl_Reader:: PrintTransferInfo
1067 void PrintTransferInfo( const IFSelect_PrintFail failwarn, const IFSelect_PrintCount mode) const;
1068 Purpose: Displays information concerning the last transfer on the default trace file according to the given parameters:
1069 mode defines what will be printed:
1070 IFSelect_GeneralCount - general statistics (number of selected IGES entities, number of root IGES entities, number of resulting OCCT shapes, number of fail and warning messages),
1071 IFSelect_CountByItem - number of IGES entities per each message type and IGES type and form,
1072 IFSelect_ListByItem - number and a complete list of DE numbers of IGES entities per each message type and IGES type and form,
1073 IFSelect_ResultCount - number of resulting OCCT shapes per each type of the shape,
1074 IFSelect_Mapping - mapping of root IGES entities into OCCT shapes per IGES type and form and OCCT shape type.
1075 failwarn defines if only fail messages (if failwarn is IFSelect_FailOnly) or both fail and warning messages (if it is IFSelect_FailAndWarn) will be printed if mode is IFSelect_CountByItem or IFSelect_ListByItem.
1076 @subsubsection occt_1856844696_128830953124 Class IGESControl_Writer
1077 <h4>General description </h4>
1078 This class is intended to create and write an IGES file out of OCCT models.
1079 IGES files produced by this component conform to IGES version 5.3.
1080 This component gives a possibility to write an IGES file containing either geometric entities (conformant to IGES version less than 5.1) only or BRep entities (conformant to IGES version up to and including 5.3) as well. The writing mode is chosen by specifying the appropriate parameter.
1081 The translation of an OCCT model (which can be a 2D or 3D geometric object or a topologic shape) into an IGES file is fulfilled in the following steps:
1082 1. initializing the file,
1083 2. setting the translation parameters,
1084 3. performing the translation itself,
1085 4. writing the IGES file.
1086 Export to the IGES file can be performed on the basis of either an already existing IGES model (representation of the IGES file in memory) or a new one. The former case gives an opportunity to add geometric/topologic OCCT objects into an IGES model (file) that already exists.
1088 <h5>Constructors:</h5>
1089 * IGESControl_Writer();
1090 Purpose: Creates a writer object with the default unit and write mode (Face).
1091 * IGESControl_Writer( const Standard_CString unit, const Standard_Integer modecr = 0 );
1092 Purpose: Creates a writer object with the given values for the unit and write mode.
1093 unit is the name of the units that are accepted by IGES in the upper case ("IN" or "INCH" for inches, "MM" for millimeters and so on),
1094 modecr corresponds to write mode:
1097 * IGESControl_Writer( const Handle(IGESData_IGESModel)& model,
1098 const Standard_Integer modecr = 0);
1099 Purpose: Creates a writer object with an already prepared IGES model and write mode.
1100 <h5>Methods dealing with IGES models</h5>
1101 * IGESControl_Writer:: Model
1102 Handle_IGESData_IGESModel Model() const;
1103 Purpose: Returns the produced model.
1104 * IGESControl_Writer:: ComputeModel() ;
1105 void ComputeModel() ;
1106 Purpose: Prepares the model before writing by setting the required statuses inside the model.
1107 <h5>Methods dealing with transfer processes</h5>
1108 * IGESControl_Writer:: SetTransferProcess
1109 void SetTransferProcess(const Handle(Transfer_FinderProcess)& TP) ;
1110 Purpose: Sets the FinderProcess object for the writer.
1111 * IGESControl_Writer:: TransferProcess
1112 Handle_Transfer_FinderProcess TransferProcess() const;
1113 Purpose: Returns the FinderProcess object (containing final results and messages if any).
1114 <h5>Methods for performing translation</h5>
1115 * IGESControl_Writer:: AddShape
1116 Standard_Boolean AddShape(const TopoDS_Shape& sh) ;
1117 Purpose: Translates a shape sh to IGES entities and adds them to the model.
1118 Returns True if done, False if sh is not suitable for IGES or is null.
1119 * IGESControl_Writer:: AddGeom
1120 Standard_Boolean AddGeom(const Handle(Standard_Transient)& geom) ;
1121 Purpose: Translates geom (which must be a curve or a surface) to IGES entities and adds them to the model.
1122 Returns True if done, False if geom is neither a surface nor a curve suitable for IGES or is null.
1123 * IGESControl_Writer:: AddEntity
1124 Standard_Boolean AddEntity(const Handle(IGESData_IGESEntity)& ent) ;
1125 Purpose: Adds an IGES entity (and the ones it references) to the model.
1126 Returns False if ent is null.
1127 <h5>Methods for writing an IGES file</h5>
1128 * IGESControl_Writer:: Write
1129 Standard_Boolean Write( Standard_OStream& S, const Standard_Boolean fnes = Standard_False) ;
1130 Standard_Boolean Write( const Standard_CString file, const Standard_Boolean fnes = Standard_False) ;
1131 Purpose: Prepares (call ComputeModel()) and writes the model to the stream S or to the file file.
1132 Returns True if the operation was correctly performed, False in case of error.
1133 If mode fnes is equal to True, the resulting file will be written in the FNES format.
1134 <h5>Method for obtaining statistics</h5>
1135 * IGESControl_Writer:: PrintStatsTransfer
1136 void PrintStatsTransfer( const Standard_Integer what, const Standard_Integer mode = 0) const;
1137 Purpose: Intended to display all statistics on the last performed translation.
1138 Remarks: At the present moment does nothing (an empty method).
1141 @subsubsection occt_1856844696_128830953125 General description
1142 Performs the actual translation of IGES entities into OCCT objects.
1143 This package recognizes an IGES entity, performs its translation into an OCCT object (which can be 2D or 3D geometric objects, topologic shapes or transformation matrices) and returns the resulting shapes with associated messages (if there are any) occurred during the translation.
1144 Those IGES entities that can be translated into OCCT objects by this package are given in the following table:
1146 Finally, all geometric IGES entities (curves and surfaces) are translated into topologic shapes. OCCT geometric objects serve as a support for topology.
1147 @subsubsection occt_1856844696_128830953126 Class IGESToBRep_Reader
1148 <h4>General description</h4>
1149 This class reads IGES files and translates their contents into OCCT shapes.
1150 This class provides basic tools for loading, checking and translating IGES files into OCCT topologic shapes. It is complemented with more high-level features by class IGESControl_Reader.
1151 The functionalities provided by this class are the following:
1152 * loading a file into memory,
1153 * checking an IGES model in memory,
1154 * translating all root entities or one entity specified by its rank number into OCCT shapes,
1155 * fetching the results.
1158 <h5>Constructors: </h5>
1159 * IGESToBRep_Reader();
1160 Purpose: Performs initialization calling IGESAppli::Init() and IGESSolid::Init(), creates a new Actor object for transfer.
1162 <h5>Method for loading an IGES file into memory</h5>
1163 * IGESToBRep_Reader:: LoadFile
1164 Standard_Integer LoadFile(const Standard_CString filename) ;
1165 Purpose: Loads an IGES file filename into memory calling IGESFile_Read(), sets the returned IGES model (representing the loaded IGES file) calling SetModel().
1166 <h5>Method for checking an IGES file</h5>
1167 * IGESToBRep_Reader:: Check
1168 Standard_Boolean Check(const Standard_Boolean withprint) const;
1169 Purpose: Performs checking of a loaded IGES file calling Interface_CheckTool and Interface_CheckIterator. If withprint is True outputs the results of checking to the default trace file.
1170 <h5>Methods for preparing the transfer process</h5>
1171 * IGESToBRep_Reader:: SetModel
1172 void SetModel(const Handle(IGESData_IGESModel)& model) ;
1173 Purpose: Sets a new IGES model object. Clears the list of translated shapes (if there are any), sets a new transfer process object.
1174 * IGESToBRep_Reader:: Model
1175 Handle_IGESData_IGESModel Model() const;
1176 Purpose: Returns the used IGES model object.
1177 * IGESToBRep_Reader:: SetTransientProcess
1178 void SetTransientProcess(const Handle(Transfer_TransientProcess)& TP) ;
1179 Purpose: Sets the transfer process object.
1180 * IGESToBRep_Reader:: TransientProcess
1181 Handle_Transfer_TransientProcess TransientProcess() const;
1182 Purpose: Returns the used transfer process object.
1183 * IGESToBRep_Reader:: Actor
1184 Handle_IGESToBRep_Actor Actor() const;
1185 Purpose: Returns the used actor object.
1186 * IGESToBRep_Reader::Clear
1188 Purpose: Clears the list of translated shapes.
1189 <h5>Methods for translation</h5>
1190 * IGESToBRep_Reader:: TransferRoots
1191 void TransferRoots(const Standard_Boolean onlyvisible = Standard_True)
1192 Purpose: Performs the translation of root entities (ones that are not referenced by others). If onlyvisible is True, translates only visible entities (with Blank status equal to 0). Sets the continuity in accordance with the static parameter read.iges.bspline.continuity.
1193 If parameter read.maxprecision.mode is set to 1, calls to ShapeTool_Utils::LimitTolerance() for the resulting shape with parameters 0 and the maximum between read.maxprecision.val and the basis tolerance of processor.
1194 * IGESToBRep_Reader:: Transfer
1195 Standard_Boolean Transfer(const Standard_Integer num) ;
1196 Purpose: Performs the translation of an entity specified by its rank number.
1197 Creates an object of class IGESToBRep_CurveAndSurface and sets:
1198 3D precision (taking its value either from the file or from the work session in accordance with the static parameter read.precision.mode),
1199 the approximation mode parameter in accordance with static the parameter read.iges.bspline.approxd1.mode,
1200 the mode for a preferred computation of curves on a surface in accordance with the static parameter read.surfacecurve.mode,
1201 the spline continuity parameter in accordance with the static parameter read.iges.bspline.continuity,
1202 the transfer process object taken from itself.
1203 Once all the fields have been filled out this method calls method TransferGeometry() with the IGES entity calculated by its rank number to obtain the OCCT shape.
1204 Like method TransferRoots() this one also limits the tolerance if the static parameter read.maxprecision.mode is set to 1.
1205 Returns False if num is greater than the number of entities in the model or less than 1, otherwise returns True even if there was an exception during the transfer.
1206 <h5>Methods for fetching the results</h5>
1207 * IGESToBRep_Reader:: IsDone
1208 Standard_Boolean IsDone() const;
1209 Purpose: Returns True if the last transfer was successful.
1210 * IGESToBRep_Reader:: NbShapes
1211 Standard_Integer NbShapes() const;
1212 Purpose: Returns the number of shapes recorded in the result.
1213 * IGESToBRep_Reader:: Shape
1214 TopoDS_Shape Shape(const Standard_Integer num = 1) const;
1215 Purpose: Returns the result number num where num is an integer between 1 and NbShapes(). If not returns a null shape.
1216 * IGESToBRep_Reader:: OneShape
1217 TopoDS_Shape OneShape() const;
1218 Purpose: Returns all results in a single shape, which is:
1219 * a null shape if there are no results,
1220 * in the case of a single result, only that shape,
1221 * a compound that lists all the results if there are several resulting shapes.
1222 @subsection occt_1856844696_12883095313 Package IGESData
1223 @subsubsection occt_1856844696_128830953131 General description
1224 This package defines general objects for dealing with the IGES interface.
1225 It gives a basic description of the IGES interface:
1226 * defines the Model for IGES (class IGESData_IGESModel),
1227 * defines the Protocol tool specific for IGES (class IGESData_Protocol)
1228 * defines the basic class IGESData_IGESEntity describing abstract IGES entity
1229 * defines classes derived from IGESEntity and representing general IGES entities (IGESData_LineFontEntity, IGESData_TransfEntity, IGESData_SingleParentEntity, etc.),
1230 @subsubsection occt_1856844696_128830953132 Class IGESData_IGESModel
1231 <h4>General description </h4>
1232 Gives an access to the general data in the Start and the Global sections of an IGES file.
1233 Defines a model specific for IGES.
1234 An IGES file includes the following sections:
1241 Interface_InterfaceModel
1245 <h5>Constructor</h5>
1246 * IGESData_IGESModel ();
1247 Purpose: Creates an empty IGES Model.
1248 <h5>Methods for initializing</h5>
1249 * IGESData_IGESModel::ClearHeader
1250 void ClearHeader() ;
1251 Purpose: Erases all the data in the Start and Global sections.
1252 * IGESData_IGESModel::NewEmptyModel
1253 Handle_Interface_InterfaceModel NewEmptyModel() const;
1254 Purpose: Returns a new Empty Model of the same type as this object, i.e. of type IGESData_IGESModel.
1255 <h5>Methods for dealing with the Start and the Global sections</h5>
1256 * IGESData_IGESModel::DumpHeader
1257 void DumpHeader(Standard_OStream& S, const Standard_Integer level = 0) const;
1258 Remark: the Integer parameter is intended to be used as a level indicator, but not used for the moment.
1259 * IGESData_IGESModel::StartSection
1260 Handle_TColStd_HSequenceOfHAsciiString StartSection() const;
1261 Purpose: Returns the Start section of the Model as a list of lines.
1262 * IGESData_IGESModel::NbStartLines
1263 Standard_Integer NbStartLines() const;
1264 Purpose: Returns the number of the lines in the Start section.
1265 * IGESData_IGESModel::StartLine
1266 Standard_CString StartLine(const Standard_Integer num) const;
1267 Purpose: Returns a line from the Start section specified by number num.
1268 Remark: An empty string is returned if number num is out of range [1, NbStartLines()].
1269 * IGESData_IGESModel::ClearStartSection
1270 void ClearStartSection() ;
1271 Purpose: Clears the Start section.
1272 * IGESData_IGESModel::SetStartSection
1273 void SetStartSection(const Handle(TColStd_HSequenceOfHAsciiString)& list, const Standard_Boolean copy = Standard_True) ;
1274 Purpose: Sets a new Start section from the list of strings list, copying it if copy is True (by default) or pointing to the list if copy is False.
1275 * IGESData_IGESModel::AddStartLine
1276 void AddStartLine(const Standard_CString line, const Standard_Integer atnum = 0) ;
1277 Purpose: Adds a new string to the end of the existing Start section if atnum is 0 or not given, or before the atnum-th line.
1278 Remark: If a number is out of range [0, NbStartLines()], the line is added at the end of section.
1279 * IGESData_IGESModel::GlobalSection
1280 const IGESData_GlobalSection& GlobalSection() const;
1281 Purpose: Returns the Global section of the Model.
1282 * IGESData_IGESModel::SetGlobalSection.
1283 void SetGlobalSection(const IGESData_GlobalSection& header) ;
1284 Purpose: Sets the Model's Global section.
1285 * IGESData_IGESModel::ApplyStatic
1286 Standard_Boolean ApplyStatic(const Standard_CString param = ;;) ;
1287 Purpose: Sets some parameters of the Global section to those defined by static parameters (see parameters of translation). The allowed values for param (all by default) are: receiver, author and company (these are acronyms of static parameters). Returns True when done and if param is given, False if param is unknown or empty.
1288 Remark: To set a unit into the Global section use the IGESData_BasicEditor class.
1289 See also: User’s Guide: Parameters of translation.
1290 * IGESData_IGESModel::GetFromAnother
1291 void GetFromAnother(const Handle(Interface_InterfaceModel)& other) ;
1292 Purpose: Takes the Global section from another Model.
1293 * IGESData_IGESModel::VerifyCheck
1294 virtual void VerifyCheck(Interface_Check& ach) const;
1295 Purpose: Checks whether the Global section contains valid data according to the IGES specification. If the Global section is correct this method adds nothing into ach, but if not the method adds fail messages.
1296 * IGESData_IGESModel::SetLineWeights
1297 void SetLineWeights(const Standard_Real defw) ;
1298 Purpose: Sets LineWeights of entities according to the Global section (MaxLineWeight and LineWeightGrad values) or to a default value (defw) for undefined weights.
1299 <h5>Methods for dealing with IGES entities</h5>
1300 * IGESData_IGESModel::ClearLabels() ;
1301 void ClearLabels() ;
1302 Purpose: Erases labels. Not yet implemented.
1303 * IGESData_IGESModel::PrintLabel
1304 void PrintLabel(const Handle(Standard_Transient)& ent, Standard_OStream& S) const;
1305 Purpose: Prints the Directory Entry number of a given entity, i.e. 'Dnn' where Dnn=2*number-1on the stream S.
1306 * IGESData_IGESModel::StringLabel
1307 Handle_TCollection_HAsciiString StringLabel (const Handle(Standard_Transient)& ent) const;
1308 Purpose: Returns a string with a Directory Entry number of a given entity, i.e. a string 'Dnn' where Dnn=2*number-1.
1309 * IGESData_IGESModel::Entity
1310 Handle_IGESData_IGESEntity Entity(const Standard_Integer num) const;
1311 Purpose: Returns an entity given by its rank number.
1312 * IGESData_IGESModel::DNum
1313 Standard_Integer DNum(const Handle(IGESData_IGESEntity)& ent) const;
1314 Purpose: Returns the DE Number of an entity, i.e. 2*Number(ent)-1, or 0 if ent is unknown from this Model.
1315 @subsubsection occt_1856844696_128830953133 Class IGESData_IGESEntity
1316 <h4>General description</h4>
1317 Represents an abstract IGES entity.
1318 This class provides an access to common IGES entity fields (TypeNumber, TransformationMatrix,
1320 This class is a basic one for other classes complementing it to represent a certain IGES entity.
1321 Refer to the IGES specification for more details.
1326 <h5>Constructors: </h5>
1327 * IGESData_IGESEntity();
1328 Purpose: Creates an empty object. Sets all values to defaults (calls Clear()).
1329 <h5>Methods for initializing fields of object.</h5>
1330 * IGESData_IGESEntity::Clear
1332 Purpose: Clears all fields of the object.
1333 * IGESData_IGESEntity::InitTypeAndForm
1334 void InitTypeAndForm( const Standard_Integer typenum, const Standard_Integer formnum) ;
1335 Purpose: Sets the Type and Form Numbers to new values.
1336 Remarks: Private method. Reserved for special use.
1337 * IGESData_IGESEntity::InitDirFieldEntity
1338 void InitDirFieldEntity( const Standard_Integer fieldnum, const Handle(IGESData_IGESEntity)& ent) ;
1339 Purpose: Sets a directory field to an ent of any kind (see DirFieldEntity() for more details).
1340 Remarks: If fieldnum is not equal to values listed in DirFieldEntity(), this method does nothing.
1341 * IGESData_IGESEntity::InitTransf
1342 void InitTransf(const Handle(IGESData_TransfEntity)& ent) ;
1343 Purpose: Sets the Transf or erases it if ent is null.
1344 * IGESData_IGESEntity::InitView
1345 void InitView(const Handle(IGESData_ViewKindEntity)& ent) ;
1346 Purpose: Sets the View or erases it if ent is null.
1347 * IGESData_IGESEntity::InitLineFont
1348 void InitLineFont( const Handle(IGESData_LineFontEntity)& ent, const Standard_Integer rank = 0) ;
1349 Purpose: Sets the LineFont. If ent is null the RankLineFont is set to rank, otherwise it is set to a negative value.
1350 * IGESData_IGESEntity::InitLevel
1351 void InitLevel( const Handle(IGESData_LevelListEntity)& ent, const Standard_Integer val = 0) ;
1352 Purpose: Sets the Level. If ent is null the DefLevel is set to val, otherwise it is set to a negative value.
1353 * IGESData_IGESEntity::InitColor
1354 void InitColor( const Handle(IGESData_ColorEntity)& ent, const Standard_Integer rank = 0) ;
1355 Purpose: Sets the Color. If ent is null the DefColor is set to rank, otherwise it is set to a negative value.
1356 * IGESData_IGESEntity::InitStatus
1357 void InitStatus( const Standard_Integer blank,
1358 const Standard_Integer subordinate,
1359 const Standard_Integer useflag,
1360 const Standard_Integer hierarchy) ;
1361 Purpose: Sets the flags of the Directory Part.
1362 * IGESData_IGESEntity::SetLabel
1363 void SetLabel( const Handle(TCollection_HAsciiString)& label, const Standard_Integer sub = -1) ;
1364 Purpose: Sets a new Label to an Entity. If sub is given, it sets the value of SubScriptNumber, else SubScriptNumber is erased.
1365 * IGESData_IGESEntity::InitMisc
1366 void InitMisc( const Handle(IGESData_IGESEntity)& str,
1367 const Handle(IGESData_LabelDisplayEntity)& lab,
1368 const Standard_Integer weightnum) ;
1369 Purpose: Sets data or erases it if it is given as null (zero for weightnum):
1371 lab for LabelDisplay,
1372 weightnum for WeightNumber
1373 * IGESData_IGESEntity::SetLineWeight
1374 void SetLineWeight( const Standard_Real defw,
1375 const Standard_Real maxw,
1376 const Standard_Integer gradw) ;
1377 Purpose: Computes and sets the ;true; line weight according to IGES rules from the global data MaxLineWeight (maxw) and LineWeightGrad (gradw), or sets it to defw (Default) if LineWeightNumber is null
1378 Remarks: If gradw is zero, there is division by zero in this method.
1379 <h5>Methods for querying the corresponding fields of an IGES entity. </h5>
1380 * IGESData_IGESEntity::IGESType
1381 IGESData_IGESType IGESType() const;
1382 Purpose: Returns information on the IGES type of an entity including the type and the form of that entity.
1383 * IGESData_IGESEntity::TypeNumber
1384 Standard_Integer TypeNumber() const;
1385 Purpose: Returns the IGES Type number.
1386 * IGESData_IGESEntity::FormNumber
1387 Standard_Integer FormNumber() const;
1388 Purpose: Returns the IGES Form number.
1389 * IGESData_IGESEntity::DirFieldEntity
1390 Handle_IGESData_IGESEntity DirFieldEntity(const Standard_Integer fieldnum) const;
1391 Purpose: Returns the Entity that is recorded for a given Field Number fieldnum where:
1396 7 - Transf(ormation Matrix)
1399 In a case of other values it returns a null handle.
1401 * IGESData_IGESEntity::HasStructure
1402 Standard_Boolean HasStructure() const;
1403 Purpose: Returns True if an IGES entity is defined with a structure (it is normally reserved for certain classes, such as Macros).
1404 * IGESData_IGESEntity::Structure
1405 Handle_IGESData_IGESEntity Structure() const;
1406 Purpose: Returns the Structure (used by some types of IGES entities only), returns a null handle if Structure is not defined.
1407 * IGESData_IGESEntity::DefLineFont
1408 IGESData_DefType DefLineFont() const;
1409 Purpose: Returns the definition status of LineFont.
1410 * IGESData_IGESEntity::RankLineFont
1411 Standard_Integer RankLineFont() const;
1412 Purpose: Returns LineFont definition as an integer if it is defined as Rank. If LineFont is defined as an Entity, returns a negative value
1413 * IGESData_IGESEntity::LineFont
1414 Handle_IGESData_LineFontEntity LineFont() const;
1415 Purpose: Returns LineFont as an entity if it is defined as Reference. Returns a null handle if DefLineFont is not ;DefReference;.
1416 * IGESData_IGESEntity::DefLevel
1417 IGESData_DefList DefLevel() const;
1418 Purpose: Returns the definition status of Level.
1419 * IGESData_IGESEntity::Level
1420 Standard_Integer Level() const;
1421 Purpose: Returns Level definition as an integer.
1422 * IGESData_IGESEntity::LevelList
1423 Handle_IGESData_LevelListEntity LevelList() const;
1424 Purpose: Returns LevelList if Level is defined as List. Returns a null handle if DefLevel is not ;DefSeveral;.
1425 * IGESData_IGESEntity::DefView
1426 IGESData_DefList DefView() const;
1427 Purpose: Returns the definition status of View (None,One or Several).
1428 * IGESData_IGESEntity::View
1429 Handle_IGESData_ViewKindEntity View() const;
1430 Purpose: Returns the View (either Single or List) if it is defined. Returns a null handle if it is not defined.
1432 * IGESData_IGESEntity::SingleView
1433 Handle_IGESData_ViewKindEntity SingleView() const;
1434 Purpose: Returns View as Single, if defined as One. Returns a null handle if DefView is not ;DefOne;.
1435 * IGESData_IGESEntity::ViewList
1436 Handle_IGESData_ViewKindEntity ViewList() const;
1437 Purpose: Returns View as a List. Returns a null handle if DefView is not ;DefSeveral;.
1438 * IGESData_IGESEntity::HasTransf
1439 Standard_Boolean HasTransf() const;
1440 Purpose: Returns True if a Transformation Matrix is defined.
1441 * IGESData_IGESEntity::Transf
1442 Handle_IGESData_TransfEntity Transf() const;
1443 Purpose: Returns the Transformation Matrix (under IGES definition). Returns a null handle if there is none.
1444 Remarks: For a more complete use, see Location & CompoundLocation.
1445 * IGESData_IGESEntity::HasLabelDisplay
1446 Standard_Boolean HasLabelDisplay() const;
1447 Purpose: Returns True if the LabelDisplay mode is defined for this entity.
1448 * IGESData_IGESEntity::LabelDisplay
1449 Handle_IGESData_LabelDisplayEntity LabelDisplay() const;
1450 Purpose: Returns the LabelDisplay, if there is one; else returns a null handle.
1451 * IGESData_IGESEntity::BlankStatus
1452 Standard_Integer BlankStatus() const;
1453 Purpose: Returns the Blank Status (0 - visible, 1 - blanked).
1454 * IGESData_IGESEntity::SubordinateStatus
1455 Standard_Integer SubordinateStatus() const;
1456 Purpose: Returns the Subordinate Switch (0-1-2-3)
1457 * IGESData_IGESEntity::UseFlag
1458 Standard_Integer UseFlag() const;
1459 Purpose: Returns the Use Flag (0 to 5) of an entity.
1460 * IGESData_IGESEntity::HierarchyStatus
1461 Standard_Integer HierarchyStatus() const;
1462 Purpose: Returns the Hierarchy status (0-1-2).
1463 * IGESData_IGESEntity::LineWeightNumber
1464 Standard_Integer LineWeightNumber() const;
1465 Purpose: Returns the LineWeight Number (0 if it is not defined).
1466 See also: LineWeight.
1468 * IGESData_IGESEntity::LineWeight
1469 Standard_Real LineWeight() const;
1470 Purpose: Returns ;true; LineWeight, computed from LineWeightNumber and the global parameter of the Model by call to SetLineWeight.
1471 * IGESData_IGESEntity::DefColor
1472 IGESData_DefType DefColor() const;
1473 Purpose: Returns the definition status of Color.
1474 * IGESData_IGESEntity::RankColor
1475 Standard_Integer RankColor() const;
1476 Purpose: Returns the Color definition as an Integer (if defined as Rank). If Color is defined as an Entity, returns a negative value.
1477 * IGESData_IGESEntity::Color
1478 Handle_IGESData_ColorEntity Color() const;
1479 Purpose: Returns the Color as an Entity (if defined as Reference) or a null handle if Color Definition is not ;DefReference;.
1480 * IGESData_IGESEntity::CResValues
1481 Standard_Boolean CResValues( const Standard_CString res1,
1482 const Standard_CString res2) const;
1483 Purpose: Fills res1 and res2 with inner ;reserved; alphanumeric fields theRes1 and theRes2. Returns False if both are blank, otherwise returns True.
1484 Warning: Both must be of a length equal to at least 9 characters. The contents of res1 and res2 are modofied. The 9-th character becomes null.
1485 * IGESData_IGESEntity::HasShortLabel
1486 Standard_Boolean HasShortLabel() const;
1487 Purpose: Returns True if ShortLabel is not null.
1488 * IGESData_IGESEntity::ShortLabel
1489 Handle_TCollection_HAsciiString ShortLabel() const;
1490 Purpose: Returns label value as a string (null if ShortLabel is blank).
1491 * IGESData_IGESEntity::HasSubScriptNumber
1492 virtualStandard_Boolean HasSubScriptNumber() const;
1493 Purpose: Returns True if SubScript Number is defined.
1494 * IGESData_IGESEntity::SubScriptNumber
1495 Standard_Integer SubScriptNumber() const;
1496 Purpose: Returns SubScript Number as an integer (0 if not defined).
1497 * IGESData_IGESEntity::HasOneParent()
1498 Standard_Boolean HasOneParent() const;
1499 Purpose: Returns True if an entity has one and only one parent, defined by a SingleParentEntity Type Associativity (explicit sharing).
1500 Remarks: Thus, implicit sharing remains defined at the model level.
1501 See class ToolLocation.
1502 * IGESData_IGESEntity::UniqueParent() const;
1503 Handle_IGESData_IGESEntity UniqueParent() const;
1504 Purpose: Returns the Unique Parent (if it is the one).
1505 Exceptions: Interface_InterfaceError if there are either several or no parents.
1506 * IGESData_IGESEntity::Location()
1507 gp_GTrsf Location() const;
1508 Purpose: Returns the entity Location given by Transf in the Directory Part (see above). Considers local location only (not taking into account the parent's one - see CompoundLocation for that). If no Transf is defined, returns Identity.
1509 * IGESData_IGESEntity::VectorLocation()
1510 gp_GTrsf VectorLocation() const;
1511 Purpose: Returns the Translation part of a local location (as for Location).
1512 * IGESData_IGESEntity::CompoundLocation()
1513 gp_GTrsf CompoundLocation() const;
1514 Purpose: Returns the location of this object combined with CompoundLocation of its Parent (i.e. can be recursive). If the Parent is not single (see HasOneParent) returns Location.
1515 * IGESData_IGESEntity::HasName()
1516 Standard_Boolean HasName() const;
1517 Purpose: Says if a Name is defined as Short Label or as Name Property. (Property is looked for first, otherwise ShortLabel is considered).
1518 * IGESData_IGESEntity::NameValue()
1519 Handle_TCollection_HAsciiString NameValue() const;
1520 Purpose: Returns the Name value as a String (Property Name or ShortLabel). If SubNumber is defined, it is concatenated after ShortLabel as follows - label (number). Ignored in case of Property Name.
1521 <h5>Methods for dealing with associativities and properties.</h5>
1522 * IGESData_IGESEntity::ArePresentAssociativities()
1523 Standard_Boolean ArePresentAssociativities() const;
1524 Purpose: Returns True if the Entity is defined with an Associativity list, even an empty one (i.e., the file is of 0 length). Otherwise returns False (the file contains no identification concerning this list at all).
1525 * IGESData_IGESEntity::NbAssociativities
1526 Standard_Integer NbAssociativities() const;
1527 Purpose: Returns the number of recorded associativities (0 if no list is defined).
1528 * IGESData_IGESEntity::Associativities
1529 Interface_EntityIterator Associativities() const;
1530 Purpose: Returns the Associativity List in the form of an EntityIterator.
1531 * IGESData_IGESEntity::NbTypedAssociativities
1532 Standard_Integer NbTypedAssociativities
1533 const Handle(Standard_Type)& atype) const;
1534 Purpose: Returns information on how many Associativities have the given type.
1536 * IGESData_IGESEntity::TypedAssociativity
1537 Handle_IGESData_IGESEntity TypedAssociativity
1538 (const Handle(Standard_Type)& atype) const;
1539 Purpose: Returns the Associativity of a given Type (if one exists)
1540 Exceptions: Interface_InterfaceError if there is none or more than one associativity.
1541 * IGESData_IGESEntity::AddAssociativity
1542 void AddAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
1543 Purpose: Adds an Associativity to the list (called by Associate only).
1544 Exceptions: Standard_NullObject if ent is null.
1545 * IGESData_IGESEntity::RemoveAssociativity
1546 void RemoveAssociativity(const Handle(IGESData_IGESEntity)& ent) ;
1547 Purpose: Removes an Associativity from the list (called by Dissociate).
1548 Exceptions: Standard_NullObject if ent is null.
1549 * IGESData_IGESEntity::LoadAssociativities
1550 void LoadAssociativities(const Interface_EntityList& list) ;
1551 Purpose: Loads a complete List of Asociativities (used during Read or Copy operations).
1552 * IGESData_IGESEntity::ClearAssociativities
1553 void ClearAssociativities() ;
1554 Purpose: Removes all associativities at once.
1555 * IGESData_IGESEntity::Associate
1556 void Associate(const Handle(IGESData_IGESEntity)& ent) const;
1557 Purpose: Sets this object to the Associativity list of another Entity. If ent is a null object, method does nothing.
1558 * IGESData_IGESEntity::Dissociate
1559 void Dissociate(const Handle(IGESData_IGESEntity)& ent) const;
1560 Purpose: Removes this object from the Associativity list of another Entity. If ent is a null object, method does nothing.
1561 * IGESData_IGESEntity::ArePresentProperties
1562 Standard_Boolean ArePresentProperties() const;
1563 Purpose: Returns True if the Entity is defined with a Property list, even an empty one (i.e., the file is of 0 length). Otherwise, returns False (file contains no identification concerning this list at all).
1564 * IGESData_IGESEntity::NbProperties()
1565 Standard_Integer NbProperties() const;
1566 Purpose: Returns the number of recorded properties (0 if no list is defined)
1567 * IGESData_IGESEntity::Properties()
1568 Interface_EntityIterator Properties() const;
1569 Purpose: Returns the Property List in the form of an EntityIterator
1570 * IGESData_IGESEntity::NbTypedProperties
1571 Standard_Integer NbTypedProperties
1572 (const Handle(Standard_Type)& atype) const;
1573 Purpose: Returns information on how many Properties have a given type
1574 * IGESData_IGESEntity::TypedProperty
1575 Handle_IGESData_IGESEntity TypedProperty
1576 (const Handle(Standard_Type)& atype) const;
1577 Purpose: Returns the Property of a given Type (if only one exists)
1578 Exceptions: Interface_InterfaceError if there is none or more than one Properties.
1579 * IGESData_IGESEntity::AddProperty
1580 void AddProperty(const Handle(IGESData_IGESEntity)& ent) ;
1581 Purpose: Adds a Property to the list.
1582 Exceptions: Standard_NullObject if entis null.
1583 * IGESData_IGESEntity::RemoveProperty
1584 void RemoveProperty(const Handle(IGESData_IGESEntity)& ent) ;
1585 Purpose: Removes a Property from the list.
1586 Exceptions: Standard_NullObject if entis null.
1587 * IGESData_IGESEntity::LoadProperties
1588 void LoadProperties(const Interface_EntityList& list) ;
1589 Purpose: Loads a complete List of Properties (used during Read or Copy operations).
1590 * IGESData_IGESEntity::ClearProperties() ;
1591 void ClearProperties() ;
1592 Purpose: Removes all properties at once
1596 @section occt_1856844696_722523915 Using XSTEPDRAW
1597 @subsection occt_1856844696_7225239151 XSDRAWIGES Overview
1598 XSTEPDRAW UL is intended for creating executables for testing XSTEP interfaces interactively in the DRAW environment. It provides an additional set of DRAW commands specific for the data exchange tasks, which allow loading and writing data files and analysis of resulting data structures and shapes.
1599 This paragraph 5 is divided into several sections. Sections 5.3 and 5.5 deal with reading and writing of IGES files and are intended specifically for the IGES processor, sections 5.2 and 5.4 describe some general tools for setting parameters and analyzing the data. Most of them are independent of the norm being tested. Additionally, a table of mentioned DRAW commands is provided.
1601 In the description of commands, square brackets ([]) are used to indicate optional parameters. Parameters given in the angle brackets () and sharps (#) are to be substituted by an appropriate value. When several exclusive variants are possible, vertical dash (|) is used.
1602 @subsection occt_1856844696_7225239152 Setting interface parameters
1603 A set of parameters for importing and exporting IGES files is defined in the XSTEP resource file. In XSTEPDRAW, these parameters can be viewed or changed using command
1604 Draw param [parameter_name [value]]
1605 Command param with no arguments gives a list of all parameters with their values. When argument parameter_name is specified, information about this parameter is printed (current value and short description).
1606 The third argument is used to set a new value of the given parameter. The result of the setting is printed immediately.
1607 During all interface operations, the protocol of the process (fail and warning messages, mapping of the loaded entities into OCCT shapes etc.) can be output to the trace file. Two parameters are defined in the DRAW session: trace level (integer value from 0 to 9, default is 0), and trace file (default is a standard output).
1608 Command xtrace is intended to view and change these parameters:
1610 - prints current settings (e.g.: ;Level=0 - Standard Output;);
1612 - sets the trace level to the value #;
1613 Draw xtrace tracefile.log
1614 - sets the trace file as tracefile.log; and
1616 - directs all messages to the standard output.
1618 @subsection occt_1856844696_7225239153 Reading IGES files
1619 For a description of parameters used in reading an IGES file refer to 2.3.3 ;Setting the translation parameters ;.
1620 These parameters are set by command param:
1623 It is possible either only to load an IGES file into memory (i.e. to fill the model with data from the file), or to read it (i.e. to load and convert all entities to OCCT shapes).
1624 Loading is done by the command
1625 Draw xload file_name
1626 Once the file is loaded, it is possible to investigate the structure of the loaded data. To learn how to do it see 5.4 Analyzing the transferred.
1627 Reading of an IGES file is done by the command
1628 Draw igesbrep file_name result_shape_name [selection]
1629 Here a dot can be used instead of a filename if the file is already loaded by **xload** or **igesbrep** command. In that case, only conversion of IGES entities to OCCT shapes will be done.
1630 Command **igesbrep** will interactively ask the user to select a set of entities to be converted:
1633 After the selected set of entities is loaded the user will be asked how loaded entities should be converted into OCCT shapes (e.g., one shape per root or one shape for all the entities). It is also possible to save loaded shapes in files, and to cancel loading.
1634 The second parameter of the **igesbrep** command defines the name of the loaded shape. If several shapes are created, they will get indexed names. For instance, if the last parameter was ‘s’, they will be s_1, ... s_N.
1635 selection specifies the scope of selected entities in the model, it is xst-transferrable-roots by default. An asterisk “*” can be specified instead of iges-visible-transf-roots. For possible values for selection refer to 2.3.4.
1636 Instead of igesbrep the following commands can be used:
1637 Draw trimport file_name result_shape_name selection
1638 which outputs the result of translation of each selected entity into one shape,
1639 Draw trimpcomp file_name result_shape_name selection
1640 which outputs the result of translation of all selected entities into one shape (TopoDS_Compound for several entities).
1641 An asterisk “*” can be specified instead of selection, it means xst-transferrable-roots.
1642 During the IGES translation, a map of correspondence between IGES entities and OCCT shapes is created.
1643 To get information on the result of translation of the given IGES entity the command
1646 To create an OCCT shape corresponding to an IGES entity the command
1649 To get the number of an IGES entity corresponding to an OCCT shape the command
1650 Draw fromshape shape_name
1652 To clear the map of correspondences between IGES entities and OCCT shapes the command
1655 @subsection occt_1856844696_7225239154 Analyzing the transferred data
1656 The procedure of analysis of the data import can be divided into two stages:
1657 1. checking the file contents,
1658 2. estimation of translation results (conversion and validated ratios).
1659 @subsubsection occt_1856844696_72252391541 Checking file contents
1660 General statistics on the loaded data can be obtained by using command
1662 The information printed by this command depends on the symbol specified:
1665 There is a set of special objects, which can be used to operate with the loaded model. They can be of the following types:
1667 A list of these objects defined in the current session can be printed in DRAW by command
1669 In the following commands if several selection arguments are specified the results of each following selection are applied to those of the one preceding it.
1671 Draw givelist selection_name [selection_name]
1672 prints a list of loaded entities defined by selection argument. For possible values of selection_name please refer to 2.3.4.
1674 Draw givecount selection_name [selection_name]
1675 prints a number of loaded entities defined by selection argument. For possible values of selection_name please refer to 2.3.4.
1676 Three commands are used to calculate statistics on the entities in the model:
1677 Draw count counter [selection ...]
1678 Prints only a number of entities per each type matching the criteria defined by arguments.
1679 Draw sumcount counter [selection ...]
1680 Prints the total number of entities of all types matching the criteria defined by arguments and the largest number corresponding to one type.
1681 Draw listcount counter [selection ...]
1682 Prints a list of entities per each type matching the criteria defined by arguments.
1683 Optional selection argument, if specified, defines a subset of entities, which are to be taken into account. Argument counter should be one of the currently defined counters:
1686 Draw listtypes selection_name ...
1687 gives a list of entity types which were encountered in the last loaded file (with a number of IGES entities of each type). The list can be shown not for all entities but for a subset of them. This subset is defined by an optional selection argument.
1689 Entities in the IGES file are numbered in the succeeding order. An entity can be identified either by its number (#) or by its label. Label is the letter ‘D’ followed by the index of the first line with the data for this entity in the Directory Entry section of the IGES file. The label can be calculated on the basis of the number as ‘D(2*# -1)’. For example, entity # 6 has label D11. To get a label for an entity with a known number, command
1692 In the same way, command
1694 prints a number for an entity with the given label.
1695 The content of an IGES entity can be obtained by using command
1696 Draw entity # level_of_information
1697 The list of entities referenced by a given entity and the list of entities referencing to it can be obtained by command
1699 @subsubsection occt_1856844696_72252391542 Estimating the results of reading IGES
1700 All of the following commands are available only after the data are converted into OCCT shapes (i.e. after command **igesbrep**).
1702 Draw tpstat [*|?]symbol [selection]
1703 is provided to get all statistics on the last transfer, including the list of transferred entities with mapping from IGES to OCCT types, as well as fail and warning messages. The parameter *symbol *defines what information will be printed:
1706 The sign ‘*’ before the parameters **n**, **s**, **b**, **t**, **r** makes it work on all entities (not only on roots). The sign ‘?’ before **n**, **s**, **b**, **t** limits the scope of information to invalid entities.
1707 Optional argument selection can limit the action of the command with a selected subset of entities.
1708 To get help, run this command without arguments.
1709 Example. Translation ratio on IGES faces.
1710 Draw: tpstat *l iges-faces
1711 The second version of the same command is TPSTAT (not capital spelling).
1713 Symbol can be of the following values:
1715 Sometimes the trimming contours of IGES faces (i.e., entity 141 for 143, 142 for 144) can be lost during translation due to fails. To obtain the number of lost trims and the number of corresponding IGES entities the command
1716 Draw tplosttrim [IGES_type]
1717 is used. It outputs the rank and DE numbers of faces that lost their trims and their numbers for each type (143, 144, 510) and their total number. If a face lost several of its trims it is output only once.
1718 Optional parameter IGES_type can be TrimmedSurface, BoundedSurface or Face to specify the only type of IGES faces.
1719 Example. Untrimmed 144 entities.
1720 Draw tplosttrim TrimmedSurface
1721 To get information on OCCT shape contents the command
1722 Draw statshape shape_name
1724 It outputs the number of each kind of shapes (vertex, edge, wire, etc.) in a shape and some geometrical data (number of C0 surfaces, curves, indirect surfaces, etc.).
1725 Note. The number of faces is returned as a number of references. To obtain the number of single instances the standard command (from TTOPOLOGY executable) **nbshapes** can be used.
1726 To analyze the internal validity of a shape, command
1727 Draw checkbrep shape_name expurged_shape_name
1728 is used. It checks the geometry and topology of a shape for different cases of inconsistency, like self-intersecting wires or wrong orientation of trimming contours. If an error is found, it copies bad parts of the shape with the names ; expurged_subshape_name _#; and generates an appropriate message. If possible, this command also tries to find IGES entities the OCCT shape was produced from.
1729 expurged_shape_name will contain the original shape without invalid subshapes.
1730 To get information on tolerances of subshapes the command
1731 Draw tolerance shape_name [min [max] [symbol]]
1732 is used. It outputs maximum, average and minimum values of tolerances for each kind of subshapes having tolerances or it can output tolerances of all subshapes of the whole shape.
1733 When specifying min and max arguments this command outputs shapes with names shape_name_... and their total number with tolerances in the range [min, max].
1734 Symbol is used for specifying the kind of sub-shapes to analyze: v - for vertices, e - for edges, f - for faces, c - for shells and faces.
1735 @subsection occt_1856844696_7225239155 Writing an IGES file
1736 For a description of parameters used in reading an IGES file refer to 3.3.2 Setting the translation parameters.
1737 These parameters are set by command **param**:
1740 Several shapes can be written in one file. To start writing a new file, enter command
1742 Actually, command **newmodel** will clear the InterfaceModel to make it empty, and the next command will convert the specified shapes to IGES entities and put them into the InterfaceModel:
1743 Draw brepiges shape_name_1 [filename.igs]
1744 To write the prepared model to a file with name **filename.igs**, enter
1745 Draw writeall filename.igs
1746 @subsection occt_1856844696_7225239156 Index of useful commands
1751 @section occt_1856844696_332489123 Reading from and writing to XDE
1752 @subsection occt_1856844696_3324891231 Description of the process
1753 @subsubsection occt_1856844696_33248912311 Loading an IGES file
1754 Before performing any other operation, you must load an IGES file with:
1755 IGESCAFControl_Reader reader(XSDRAW::Session(), Standard_False);
1756 IFSelect_ReturnStatus stat = reader.ReadFile(“filename.igs”);
1757 Loading the file only memorizes, but does not translate the data.
1758 @subsubsection occt_1856844696_33248912312 Checking the loaded IGES file
1759 This step is not obligatory. See the description of this step below in paragraph 2.3.2.
1760 @subsubsection occt_1856844696_33248912313 Setting parameters for translation to XDE
1761 See the description of this step below in paragraph 2.3.3.
1762 In addition, the following parameters can be set for XDE translation of attributes:
1763 • Parameter for transferring colors:
1764 reader.SetColorMode(mode);
1765 // mode can be Standard_True or Standard_False
1766 • Parameter for transferring names:
1767 reader.SetNameMode(mode);
1768 // mode can be Standard_True or Standard_False
1769 @subsubsection occt_1856844696_33248912314 Performing the translation of an IGES file to XDE
1770 The following function performs a translation of the whole document:
1771 Standard_Boolean ok = reader.Transfer(doc);
1772 where ;doc; is a variable which contains a handle to the output document and should have a type Handle(TDocStd_Document).
1773 @subsubsection occt_1856844696_33248912315 Initializing the process of translation from XDE to IGES
1774 Here is how the process is initialized:
1775 IGESCAFControl_Writer aWriter(XSDRAW::Session(),Standard_False);
1776 @subsubsection occt_1856844696_33248912316 Setting parameters for translation from XDE to IGES
1777 The following parameters can be set for translation of attributes to IGES:
1778 • Parameter for transferring colors:
1779 aWriter.SetColorMode(mode);
1780 // mode can be Standard_True or Standard_False
1781 • Parameter for transferring names:
1782 aWriter.SetNameMode(mode);
1783 // mode can be Standard_True or Standard_False
1784 @subsubsection occt_1856844696_33248912317 Performing the translation of an XDE document to IGES
1785 You can perform the translation of a document by calling the function:
1786 IFSelect_ReturnStatus aRetSt = aWriter.Transfer(doc);
1787 where ;doc; is a variable which contains a handle to the input document for transferring and should have a type Handle(TDocStd_Document).
1788 @subsubsection occt_1856844696_33248912318 Writing an IGES file
1789 Write an IGES file with:
1790 IFSelect_ReturnStatus statw = aWriter.WriteFile(;filename.igs;);
1792 IFSelect_ReturnStatus statw = writer.WriteFile (S);