Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-05 09:24:14

0001 // Created on: 1994-09-14
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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 _StepSelect_WorkLibrary_HeaderFile
0018 #define _StepSelect_WorkLibrary_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <IFSelect_WorkLibrary.hxx>
0025 class Interface_InterfaceModel;
0026 class Interface_Protocol;
0027 class IFSelect_ContextWrite;
0028 class Interface_EntityIterator;
0029 class Interface_CopyTool;
0030 
0031 //! Performs Read and Write a STEP File with a STEP Model
0032 //! Following the protocols, Copy may be implemented or not
0033 class StepSelect_WorkLibrary : public IFSelect_WorkLibrary
0034 {
0035 
0036 public:
0037   //! Creates a STEP WorkLibrary
0038   //! <copymode> precises whether Copy is implemented or not
0039   Standard_EXPORT StepSelect_WorkLibrary(const bool copymode = true);
0040 
0041   //! Selects a mode to dump entities
0042   //! 0 (D) : prints numbers, then displays table number/label
0043   //! 1 : prints labels, then displays table label/number
0044   //! 2 : prints labels onky
0045   Standard_EXPORT void SetDumpLabel(const int mode);
0046 
0047   //! Reads a STEP File and returns a STEP Model (into <mod>),
0048   //! or lets <mod> "Null" in case of Error
0049   //! Returns 0 if OK, 1 if Read Error, -1 if File not opened
0050   Standard_EXPORT int ReadFile(const char* const                      name,
0051                                occ::handle<Interface_InterfaceModel>& model,
0052                                const occ::handle<Interface_Protocol>& protocol) const override;
0053 
0054   //! Reads a STEP File from stream and returns a STEP Model (into <mod>),
0055   //! or lets <mod> "Null" in case of Error
0056   //! Returns 0 if OK, 1 if Read Error, -1 if File not opened
0057   Standard_EXPORT int ReadStream(const char* const                      theName,
0058                                  std::istream&                          theIStream,
0059                                  occ::handle<Interface_InterfaceModel>& model,
0060                                  const occ::handle<Interface_Protocol>& protocol) const override;
0061 
0062   //! Writes a File from a STEP Model
0063   //! Returns False (and writes no file) if <ctx> does not bring a
0064   //! STEP Model
0065   Standard_EXPORT bool WriteFile(IFSelect_ContextWrite& ctx) const override;
0066 
0067   //! Performs the copy of entities from an original model to a new
0068   //! one. Works according <copymode> :
0069   //! if True, standard copy is run
0070   //! else nothing is done and returned value is False
0071   Standard_EXPORT bool CopyModel(const occ::handle<Interface_InterfaceModel>& original,
0072                                  const occ::handle<Interface_InterfaceModel>& newmodel,
0073                                  const Interface_EntityIterator&              list,
0074                                  Interface_CopyTool&                          TC) const override;
0075 
0076   //! Dumps an entity under STEP form, i.e. as a part of a Step file
0077   //! Works with a StepDumper.
0078   //! Level 0 just displays type; level 1 displays the entity itself
0079   //! and level 2 displays the entity plus its shared ones (one
0080   //! sub-level : immediately shared entities)
0081   Standard_EXPORT void DumpEntity(const occ::handle<Interface_InterfaceModel>& model,
0082                                   const occ::handle<Interface_Protocol>&       protocol,
0083                                   const occ::handle<Standard_Transient>&       entity,
0084                                   Standard_OStream&                            S,
0085                                   const int level) const override;
0086 
0087   DEFINE_STANDARD_RTTIEXT(StepSelect_WorkLibrary, IFSelect_WorkLibrary)
0088 
0089 private:
0090   bool thecopymode;
0091   int  thelabmode;
0092 };
0093 
0094 #endif // _StepSelect_WorkLibrary_HeaderFile