1 -- Created on: 1994-09-01
2 -- Created by: Marie Jose MARTZ
3 -- Copyright (c) 1994-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Reader from IGESToBRep
19 ---Purpose : A simple way to read geometric IGES data.
20 -- Encapsulates reading file and calling transfer tools
23 IGESModel from IGESData,
24 ShareFlags from Interface,
25 TransientProcess from Transfer,
27 SequenceOfShape from TopTools,
32 Create returns Reader;
33 ---Purpose : Creates a Reader
35 LoadFile (me : in out; filename : CString) returns Integer;
36 ---Purpose : Loads a Model from a file.Returns 0 if success.
37 -- returns 1 if the file could not be opened,
38 -- returns -1 if an error occurred while the file was being loaded.
40 SetModel (me : in out; model : IGESModel);
41 ---Purpose : Specifies a Model to work on
42 -- Also clears the result and Done status, sets TransientProcess
44 Model (me) returns IGESModel;
45 ---Purpose : Returns the Model to be worked on.
47 SetTransientProcess (me : in out; TP : TransientProcess);
48 ---Purpose : Allows to set an already defined TransientProcess
49 -- (to be called after LoadFile or SetModel)
51 TransientProcess (me) returns TransientProcess;
52 ---Purpose : Returns the TransientProcess
54 Actor (me) returns Actor from IGESToBRep;
55 ---Purpose : Returns "theActor"
58 ---Purpose : Clears the results between two translation operations.
60 Check (me; withprint : Boolean) returns Boolean;
61 ---Purpose : Checks the IGES file that was
62 -- loaded into memory. Displays error messages in the default
63 -- message file if withprint is true. Returns True if no fail
64 -- message was found and False if there was at least one fail message.
66 TransferRoots (me : in out; onlyvisible : Boolean = Standard_True);
67 ---Purpose : Translates root entities in an
68 -- IGES file. Standard_True is the default value and means that only
69 -- visible root entities are translated. Standard_False
70 -- translates all of the roots (visible and invisible).
72 Transfer (me : in out; num : Integer) returns Boolean;
73 ---Purpose : Transfers an Entity given its rank in the Model (Root or not)
74 -- Returns True if it is recognized as Geom-Topol.
75 -- (But it can have failed : see IsDone)
77 IsDone (me) returns Boolean;
78 ---Purpose : Returns True if the LAST Transfer/TransferRoots was a success
80 UsedTolerance (me) returns Real;
81 ---Purpose : Returns the Tolerance which has been actually used, converted
83 -- (either that from File or that from Session, according the mode)
85 NbShapes (me) returns Integer;
86 ---Purpose : Returns the number of shapes produced by the translation.
88 Shape (me; num : Integer = 1) returns Shape from TopoDS;
89 ---Purpose : Returns the num the resulting shape in a translation operation.
91 OneShape (me) returns Shape from TopoDS;
92 ---Purpose : Returns all of the results in a
93 -- single shape which is:
94 -- - a null shape if there are no results,
95 -- - a shape if there is one result,
96 -- - a compound containing the resulting shapes if there are several.
102 theModel : IGESModel from IGESData;
104 theShapes : SequenceOfShape from TopTools;
105 theActor : Actor from IGESToBRep;
106 theProc : TransientProcess from Transfer;