973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | |
42cf5bc1 |
15 | #include <Interface_Check.hxx> |
16 | #include <Interface_FileReaderData.hxx> |
17 | #include <Interface_Macros.hxx> |
18 | #include <Standard_DomainError.hxx> |
19 | #include <Standard_Transient.hxx> |
20 | #include <Standard_Type.hxx> |
21 | #include <StepData_ReadWriteModule.hxx> |
22 | #include <StepData_StepReaderData.hxx> |
23 | #include <StepData_StepWriter.hxx> |
24 | #include <TCollection_AsciiString.hxx> |
7fd59977 |
25 | |
92efcf78 |
26 | IMPLEMENT_STANDARD_RTTIEXT(StepData_ReadWriteModule,Interface_ReaderModule) |
27 | |
b311480e |
28 | Standard_Integer StepData_ReadWriteModule::CaseNum |
7fd59977 |
29 | (const Handle(Interface_FileReaderData)& data, |
30 | const Standard_Integer num) const |
31 | { |
32 | DeclareAndCast(StepData_StepReaderData,stepdat,data); |
33 | if (stepdat.IsNull()) return 0; |
34 | if (stepdat->IsComplex(num)) { |
35 | TColStd_SequenceOfAsciiString types; |
36 | stepdat->ComplexType (num,types); |
37 | if (types.IsEmpty()) return 0; |
38 | if (types.Length() == 1) return CaseStep (types.Value(1)); |
39 | else return CaseStep (types); |
40 | } |
41 | return CaseStep (stepdat->RecordType(num)); |
42 | } |
43 | |
35e08fe8 |
44 | Standard_Integer StepData_ReadWriteModule::CaseStep (const TColStd_SequenceOfAsciiString&) const |
45 | { |
46 | return 0; |
47 | } // par defaut |
7fd59977 |
48 | |
35e08fe8 |
49 | Standard_Boolean StepData_ReadWriteModule::IsComplex (const Standard_Integer) const |
50 | { |
51 | return Standard_False; |
52 | } // par defaut |
7fd59977 |
53 | |
35e08fe8 |
54 | TCollection_AsciiString StepData_ReadWriteModule::ShortType (const Standard_Integer ) const |
55 | { |
56 | return TCollection_AsciiString(""); |
57 | } // par defaut vide |
7fd59977 |
58 | |
35e08fe8 |
59 | Standard_Boolean StepData_ReadWriteModule::ComplexType (const Standard_Integer , |
60 | TColStd_SequenceOfAsciiString& ) const |
61 | { |
62 | return Standard_False; |
63 | } |
7fd59977 |
64 | |
65 | |
66 | //======================================================================= |
67 | //function : Read |
68 | //purpose : |
69 | //======================================================================= |
70 | |
71 | void StepData_ReadWriteModule::Read(const Standard_Integer CN, |
72 | const Handle(Interface_FileReaderData)& data, |
73 | const Standard_Integer num, |
74 | Handle(Interface_Check)& ach, |
75 | const Handle(Standard_Transient)& ent) const |
76 | { |
77 | DeclareAndCast(StepData_StepReaderData,stepdat,data); |
78 | if (stepdat.IsNull()) return; |
79 | ReadStep (CN,stepdat,num,ach,ent); |
80 | } |