Back to home page

EIC code displayed by LXR

 
 

    


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

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   DEFINE_STANDARD_ALLOC
0040 
0041   //! Creates a Writer from scratch
0042   Standard_EXPORT XSControl_Writer();
0043 
0044   //! Creates a Writer from scratch, with a norm name which
0045   //! identifie a Controller
0046   Standard_EXPORT XSControl_Writer(const char* const norm);
0047 
0048   //! Creates a Writer from an already existing Session
0049   //! If <scratch> is True (D), clears already recorded data
0050   Standard_EXPORT XSControl_Writer(const occ::handle<XSControl_WorkSession>& WS,
0051                                    const bool                                scratch = true);
0052 
0053   //! Sets a specific norm to <me>
0054   //! Returns True if done, False if <norm> is not available
0055   Standard_EXPORT bool SetNorm(const char* const norm);
0056 
0057   //! Sets a specific session to <me>
0058   Standard_EXPORT void SetWS(const occ::handle<XSControl_WorkSession>& WS,
0059                              const bool                                scratch = true);
0060 
0061   //! Returns the session used in <me>
0062   Standard_EXPORT occ::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 occ::handle<Interface_InterfaceModel> Model(const bool newone = false);
0069 
0070   //! Transfers a Shape according to the mode
0071   Standard_EXPORT IFSelect_ReturnStatus
0072     TransferShape(const TopoDS_Shape&          sh,
0073                   const int                    mode        = 0,
0074                   const Message_ProgressRange& theProgress = Message_ProgressRange());
0075 
0076   //! Writes the produced model
0077   Standard_EXPORT IFSelect_ReturnStatus WriteFile(const char* const filename);
0078 
0079   //! Prints Statistics about Transfer
0080   Standard_EXPORT void PrintStatsTransfer(const int what, const int mode = 0) const;
0081 
0082 private:
0083   occ::handle<XSControl_WorkSession> thesession;
0084 };
0085 
0086 #endif // _XSControl_Writer_HeaderFile