Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1997-05-14
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1997-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 _XSControl_Writer_HeaderFile
0018 #define _XSControl_Writer_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_CString.hxx>
0025 #include <IFSelect_ReturnStatus.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class XSControl_WorkSession;
0030 class Interface_InterfaceModel;
0031 class TopoDS_Shape;
0032 
0033 //! This class gives a simple way to create then write a
0034 //! Model compliant to a given norm, from a Shape
0035 //! The model can then be edited by tools by other appropriate tools
0036 class XSControl_Writer 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Creates a Writer from scratch
0044   Standard_EXPORT XSControl_Writer();
0045   
0046   //! Creates a Writer from scratch, with a norm name which
0047   //! identifie a Controller
0048   Standard_EXPORT XSControl_Writer(const Standard_CString norm);
0049   
0050   //! Creates a Writer from an already existing Session
0051   //! If <scratch> is True (D), clears already recorded data
0052   Standard_EXPORT XSControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
0053   
0054   //! Sets a specific norm to <me>
0055   //! Returns True if done, False if <norm> is not available
0056   Standard_EXPORT Standard_Boolean SetNorm (const Standard_CString norm);
0057   
0058   //! Sets a specific session to <me>
0059   Standard_EXPORT void SetWS (const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
0060   
0061   //! Returns the session used in <me>
0062   Standard_EXPORT Handle(XSControl_WorkSession) WS() const;
0063   
0064   //! Returns the produced model. Produces a new one if not yet done
0065   //! or if <newone> is True
0066   //! This method allows for instance to edit product or header
0067   //! data before writing
0068   Standard_EXPORT Handle(Interface_InterfaceModel) Model (const Standard_Boolean newone = Standard_False);
0069   
0070   //! Transfers a Shape according to the mode
0071   Standard_EXPORT IFSelect_ReturnStatus TransferShape (const TopoDS_Shape& sh,
0072                                                        const Standard_Integer mode = 0,
0073                                                        const Message_ProgressRange& theProgress = Message_ProgressRange());
0074   
0075   //! Writes the produced model
0076   Standard_EXPORT IFSelect_ReturnStatus WriteFile (const Standard_CString filename);
0077   
0078   //! Prints Statistics about Transfer
0079   Standard_EXPORT void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode = 0) const;
0080 
0081 
0082 
0083 
0084 protected:
0085 
0086 
0087 
0088 
0089 
0090 private:
0091 
0092 
0093 
0094   Handle(XSControl_WorkSession) thesession;
0095 
0096 
0097 };
0098 
0099 
0100 
0101 
0102 
0103 
0104 
0105 #endif // _XSControl_Writer_HeaderFile