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 Standard_Integer StepData_ReadWriteModule::CaseNum
27 (const Handle(Interface_FileReaderData)& data,
28 const Standard_Integer num) const
30 DeclareAndCast(StepData_StepReaderData,stepdat,data);
31 if (stepdat.IsNull()) return 0;
32 if (stepdat->IsComplex(num)) {
33 TColStd_SequenceOfAsciiString types;
34 stepdat->ComplexType (num,types);
35 if (types.IsEmpty()) return 0;
36 if (types.Length() == 1) return CaseStep (types.Value(1));
37 else return CaseStep (types);
39 return CaseStep (stepdat->RecordType(num));
42 Standard_Integer StepData_ReadWriteModule::CaseStep (const TColStd_SequenceOfAsciiString&) const
47 Standard_Boolean StepData_ReadWriteModule::IsComplex (const Standard_Integer) const
49 return Standard_False;
52 TCollection_AsciiString StepData_ReadWriteModule::ShortType (const Standard_Integer ) const
54 return TCollection_AsciiString("");
57 Standard_Boolean StepData_ReadWriteModule::ComplexType (const Standard_Integer ,
58 TColStd_SequenceOfAsciiString& ) const
60 return Standard_False;
64 //=======================================================================
67 //=======================================================================
69 void StepData_ReadWriteModule::Read(const Standard_Integer CN,
70 const Handle(Interface_FileReaderData)& data,
71 const Standard_Integer num,
72 Handle(Interface_Check)& ach,
73 const Handle(Standard_Transient)& ent) const
75 DeclareAndCast(StepData_StepReaderData,stepdat,data);
76 if (stepdat.IsNull()) return;
77 ReadStep (CN,stepdat,num,ach,ent);