|
||||
File indexing completed on 2025-01-18 10:05:06
0001 // Created on: 1993-01-25 0002 // Created by: Christian CAILLET 0003 // Copyright (c) 1993-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _StepData_ReadWriteModule_HeaderFile 0018 #define _StepData_ReadWriteModule_HeaderFile 0019 0020 #include <Standard.hxx> 0021 0022 #include <Interface_ReaderModule.hxx> 0023 #include <TColStd_SequenceOfAsciiString.hxx> 0024 class Interface_FileReaderData; 0025 class TCollection_AsciiString; 0026 class Interface_Check; 0027 class Standard_Transient; 0028 class StepData_StepReaderData; 0029 class StepData_StepWriter; 0030 0031 0032 class StepData_ReadWriteModule; 0033 DEFINE_STANDARD_HANDLE(StepData_ReadWriteModule, Interface_ReaderModule) 0034 0035 //! Defines basic File Access Module (Recognize, Read, Write) 0036 //! That is : ReaderModule (Recognize & Read) + Write for 0037 //! StepWriter (for a more centralized description) 0038 //! Warning : A sub-class of ReadWriteModule, which belongs to a particular 0039 //! Protocol, must use the same definition for Case Numbers (give 0040 //! the same Value for a StepType defined as a String from a File 0041 //! as the Protocol does for the corresponding Entity) 0042 class StepData_ReadWriteModule : public Interface_ReaderModule 0043 { 0044 0045 public: 0046 0047 0048 //! Translate the Type of record <num> in <data> to a positive 0049 //! Case Number, or 0 if failed. 0050 //! Works with a StepReaderData, in which the Type of an Entity 0051 //! is defined as a String : Reads the RecordType <num> then calls 0052 //! CaseNum (this type) 0053 //! Warning : The methods CaseStep, StepType and Recognize, 0054 //! must be in phase (triplets CaseNum-StepType-Type of Object) 0055 Standard_EXPORT Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const Standard_OVERRIDE; 0056 0057 //! Defines Case Numbers corresponding to the recognized Types 0058 //! Called by CaseNum (data,num) above for a Simple Type Entity 0059 //! Warning : CaseStep must give the same Value as Protocol does for the 0060 //! Entity type which corresponds to this Type given as a String 0061 Standard_EXPORT virtual Standard_Integer CaseStep (const TCollection_AsciiString& atype) const = 0; 0062 0063 //! Same a above but for a Complex Type Entity ("Plex") 0064 //! The provided Default recognizes nothing 0065 Standard_EXPORT virtual Standard_Integer CaseStep (const TColStd_SequenceOfAsciiString& types) const; 0066 0067 //! Returns True if the Case Number corresponds to a Complex Type 0068 //! ("Plex"). Remember that all possible combinations must be 0069 //! aknowledged to be processed 0070 //! Default is False for all cases. For a Protocol which defines 0071 //! possible Plexes, this method must be redefined. 0072 Standard_EXPORT virtual Standard_Boolean IsComplex (const Standard_Integer CN) const; 0073 0074 //! Function specific to STEP, which delivers the StepType as it 0075 //! is recorded in and read from a File compliant with STEP. 0076 //! This method is symmetric to the method CaseStep. 0077 //! StepType can be different from Dynamic Type's name, but 0078 //! belongs to the same class of Object. 0079 //! Returns an empty String if <CN> is zero. 0080 //! Warning : For a Complex Type Entity, returns an Empty String 0081 //! (Complex Type must be managed by users) 0082 Standard_EXPORT virtual const TCollection_AsciiString& StepType (const Standard_Integer CN) const = 0; 0083 0084 //! Function specific to STEP. Some STEP Types have a short form 0085 //! This method can be redefined to fill it 0086 //! By default, returns an empty string, which is then interpreted 0087 //! to take normal form from StepType 0088 Standard_EXPORT virtual TCollection_AsciiString ShortType (const Standard_Integer CN) const; 0089 0090 //! Function specific to STEP, which delivers the list of types 0091 //! which corresponds to a complex type. If <CN> is not for a 0092 //! complex type, this method returns False. Else it returns True 0093 //! and fills the list in alphabetic order. 0094 //! The default returns False. To be redefined as required. 0095 Standard_EXPORT virtual Standard_Boolean ComplexType (const Standard_Integer CN, TColStd_SequenceOfAsciiString& types) const; 0096 0097 //! General Read Function, calls ReadStep 0098 Standard_EXPORT void Read (const Standard_Integer CN, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; 0099 0100 //! Specific Read Function. Works with StepReaderData 0101 Standard_EXPORT virtual void ReadStep (const Standard_Integer CN, const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const = 0; 0102 0103 //! Write Function, switched by CaseNum 0104 Standard_EXPORT virtual void WriteStep (const Standard_Integer CN, StepData_StepWriter& SW, const Handle(Standard_Transient)& ent) const = 0; 0105 0106 0107 0108 0109 DEFINE_STANDARD_RTTIEXT(StepData_ReadWriteModule,Interface_ReaderModule) 0110 0111 protected: 0112 0113 0114 0115 0116 private: 0117 0118 0119 0120 0121 }; 0122 0123 0124 0125 0126 0127 0128 0129 #endif // _StepData_ReadWriteModule_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |