0023950: Names and visibility of points not saved when writing XCAF Document into...
[occt.git] / src / STEPControl / STEPControl_Reader.cdl
1 -- Created on: 1996-07-08
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class Reader  from STEPControl inherits Reader from XSControl
18
19         ---Purpose : Reads STEP files, checks them and translates their contents
20         -- into Open CASCADE models. The STEP data can be that of
21         -- a whole model or that of a specific list of entities in the model.
22         -- As in XSControl_Reader, you specify the list using a selection.
23         -- For the translation of iges files it is possible to use next sequence:
24         -- To change translation parameters 
25         -- class Interface_Static should be used before beginning of
26         -- translation  (see STEP Parameters and General Parameters) 
27         --     Creation of reader - STEPControl_Reader reader;
28         --  To load s file in a model use method reader.ReadFile("filename.stp")
29         -- To print load results reader.PrintCheckLoad(failsonly,mode)
30         -- where mode is equal to the value of enumeration IFSelect_PrintCount 
31         --   For definition number of candidates :
32         -- Standard_Integer nbroots = reader. NbRootsForTransfer();
33         -- To transfer entities from a model the following methods can be used:
34         -- for the whole model - reader.TransferRoots(); 
35         -- to transfer a list of entities: reader.TransferList(list);
36         -- to transfer one entity Handle(Standard_Transient)
37         -- ent = reader.RootForTransfer(num);
38         -- reader.TransferEntity(ent), or 
39         -- reader.TransferOneRoot(num), or
40         -- reader.TransferOne(num), or 
41         -- reader.TransferRoot(num)
42         --   To obtain the result the following method can be used:
43         -- reader.NbShapes() and reader.Shape(num); or reader.OneShape(); 
44         -- To print the results of transfer use method:
45         -- reader.PrintCheckTransfer(failwarn,mode);
46         -- where printfail is equal to the value of enumeration
47         -- IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer();
48         -- Gets correspondence between a STEP entity and a result
49         -- shape obtained from it.
50         -- Handle(XSControl_WorkSession)
51         -- WS = reader.WS();
52         -- if ( WS->TransferReader()->HasResult(ent) )
53         -- TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);
54
55 uses
56
57     CString, OStream, Transient, SequenceOfTransient from TColStd,
58     StepModel from StepData, WorkSession from XSControl,
59     ReturnStatus from IFSelect, PrintCount from IFSelect,
60     Shape from TopoDS, SequenceOfShape from TopTools,
61     SequenceOfAsciiString from TColStd,
62     Array1OfAsciiString from TColStd,
63     Array1OfReal from TColStd,
64     SequenceOfAsciiString from TColStd,
65     RepresentationContext from StepRepr
66 is
67
68     Create returns Reader;
69     ---Purpose : Creates a reader object with an empty STEP model.
70
71     Create (WS : WorkSession from XSControl;
72                  scratch : Boolean = Standard_True) returns Reader;
73     ---Purpose : Creates a Reader for STEP from an already existing Session
74     --           Clears the session if it was not yet set for STEP
75
76     StepModel (me) returns StepModel;
77     ---Purpose : Returns the model as a StepModel.
78     --           It can then be consulted (header, product)
79
80     TransferRoot (me : in out; num : Integer = 1) returns Boolean;
81     ---Purpose : Transfers a root given its rank in the list of candidate roots
82     --           Default is the first one
83     --           Returns True if a shape has resulted, false else
84     --           Same as inherited TransferOneRoot, kept for compatibility
85
86     NbRootsForTransfer (me : in out) returns Integer is redefined;
87     ---Purpose : Determines the list of root entities from Model which are candidate for
88     --           a transfer to a Shape (type of entities is PRODUCT)
89     
90     FileUnits(me : in out; theUnitLengthNames : in out SequenceOfAsciiString from TColStd;
91                   theUnitAngleNames : in out SequenceOfAsciiString from TColStd;
92                   theUnitSolidAngleNames : in out SequenceOfAsciiString from TColStd );
93      ---Purpose : Returns sequence of all unit names for shape representations 
94      --           found in file
95      
96     findUnits(me : in out ; theReprContext : RepresentationContext from StepRepr;
97         theNameUnits : in out Array1OfAsciiString from TColStd;
98         theFactorUnits : in out Array1OfReal from TColStd) returns Boolean is private;
99      ---Purpose : Returns  units for length , angle and solidangle for shape representations 
100     
101     
102 end Reader;