1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
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>
26 IMPLEMENT_STANDARD_RTTIEXT(StepData_ReadWriteModule,Interface_ReaderModule)
28 Standard_Integer StepData_ReadWriteModule::CaseNum
29 (const Handle(Interface_FileReaderData)& data,
30 const Standard_Integer num) const
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);
41 return CaseStep (stepdat->RecordType(num));
44 Standard_Integer StepData_ReadWriteModule::CaseStep (const TColStd_SequenceOfAsciiString&) const
49 Standard_Boolean StepData_ReadWriteModule::IsComplex (const Standard_Integer) const
51 return Standard_False;
54 TCollection_AsciiString StepData_ReadWriteModule::ShortType (const Standard_Integer ) const
56 return TCollection_AsciiString("");
59 Standard_Boolean StepData_ReadWriteModule::ComplexType (const Standard_Integer ,
60 TColStd_SequenceOfAsciiString& ) const
62 return Standard_False;
66 //=======================================================================
69 //=======================================================================
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
77 DeclareAndCast(StepData_StepReaderData,stepdat,data);
78 if (stepdat.IsNull()) return;
79 ReadStep (CN,stepdat,num,ach,ent);