Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:13

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 class StepSelect_WorkLibrary;
0032 DEFINE_STANDARD_HANDLE(StepSelect_WorkLibrary, IFSelect_WorkLibrary)
0033 
0034 //! Performs Read and Write a STEP File with a STEP Model
0035 //! Following the protocols, Copy may be implemented or not
0036 class StepSelect_WorkLibrary : public IFSelect_WorkLibrary
0037 {
0038 
0039 public:
0040 
0041   
0042   //! Creates a STEP WorkLibrary
0043   //! <copymode> precises whether Copy is implemented or not
0044   Standard_EXPORT StepSelect_WorkLibrary(const Standard_Boolean copymode = Standard_True);
0045   
0046   //! Selects a mode to dump entities
0047   //! 0 (D) : prints numbers, then displays table number/label
0048   //! 1 : prints labels, then displays table label/number
0049   //! 2 : prints labels onky
0050   Standard_EXPORT void SetDumpLabel (const Standard_Integer mode);
0051   
0052   //! Reads a STEP File and returns a STEP Model (into <mod>),
0053   //! or lets <mod> "Null" in case of Error
0054   //! Returns 0 if OK, 1 if Read Error, -1 if File not opened
0055   Standard_EXPORT Standard_Integer ReadFile (const Standard_CString name, Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) const Standard_OVERRIDE;
0056 
0057   //! Reads a STEP File from stream and returns a STEP Model (into <mod>),
0058   //! or lets <mod> "Null" in case of Error
0059   //! Returns 0 if OK, 1 if Read Error, -1 if File not opened
0060   Standard_EXPORT Standard_Integer ReadStream(const Standard_CString theName,
0061                                               std::istream& theIStream, 
0062                                               Handle(Interface_InterfaceModel)& model,
0063                                               const Handle(Interface_Protocol)& protocol) const Standard_OVERRIDE;
0064 
0065   //! Writes a File from a STEP Model
0066   //! Returns False (and writes no file) if <ctx> does not bring a
0067   //! STEP Model
0068   Standard_EXPORT Standard_Boolean WriteFile (IFSelect_ContextWrite& ctx) const Standard_OVERRIDE;
0069   
0070   //! Performs the copy of entities from an original model to a new
0071   //! one. Works according <copymode> :
0072   //! if True, standard copy is run
0073   //! else nothing is done and returned value is False
0074   Standard_EXPORT virtual Standard_Boolean CopyModel (const Handle(Interface_InterfaceModel)& original, const Handle(Interface_InterfaceModel)& newmodel, const Interface_EntityIterator& list, Interface_CopyTool& TC) const Standard_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 virtual void DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, Standard_OStream& S, const Standard_Integer level) const Standard_OVERRIDE;
0082 
0083 
0084 
0085 
0086   DEFINE_STANDARD_RTTIEXT(StepSelect_WorkLibrary,IFSelect_WorkLibrary)
0087 
0088 protected:
0089 
0090 
0091 
0092 
0093 private:
0094 
0095 
0096   Standard_Boolean thecopymode;
0097   Standard_Integer thelabmode;
0098 
0099 
0100 };
0101 
0102 
0103 
0104 
0105 
0106 
0107 
0108 #endif // _StepSelect_WorkLibrary_HeaderFile