Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-03-13
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1996-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_TransferWriter_HeaderFile
0018 #define _XSControl_TransferWriter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <IFSelect_ReturnStatus.hxx>
0025 #include <Transfer_FinderProcess.hxx>
0026 class XSControl_Controller;
0027 class Interface_InterfaceModel;
0028 class TopoDS_Shape;
0029 class Interface_CheckIterator;
0030 
0031 
0032 class XSControl_TransferWriter;
0033 DEFINE_STANDARD_HANDLE(XSControl_TransferWriter, Standard_Transient)
0034 
0035 //! TransferWriter gives help to control transfer to write a file
0036 //! after having converted data from Cascade/Imagine
0037 //!
0038 //! It works with a Controller (which itself can work with an
0039 //! Actor to Write) and a FinderProcess. It records results and
0040 //! checks
0041 class XSControl_TransferWriter : public Standard_Transient
0042 {
0043  public:
0044   
0045   //! Creates a TransferWriter, empty, ready to run
0046   //! with an empty FinderProcess (but no controller, etc)
0047   XSControl_TransferWriter()
0048   : myTransferWriter(new Transfer_FinderProcess),
0049     myTransferMode(0)
0050   {}
0051   
0052   //! Returns the FinderProcess itself
0053   const Handle(Transfer_FinderProcess) & FinderProcess() const
0054   { return myTransferWriter; }
0055   
0056   //! Sets a new FinderProcess and forgets the former one
0057   void SetFinderProcess (const Handle(Transfer_FinderProcess)& theFP)
0058   { myTransferWriter = theFP; }
0059 
0060   //! Returns the currently used Controller
0061   const Handle(XSControl_Controller) & Controller() const
0062   { return myController; }
0063   
0064   //! Sets a new Controller, also sets a new FinderProcess
0065   void SetController (const Handle(XSControl_Controller)& theCtl)
0066   {
0067     myController = theCtl;
0068     Clear(-1);
0069   }
0070   
0071   //! Clears recorded data according a mode
0072   //! 0 clears FinderProcess (results, checks)
0073   //! -1 create a new FinderProcess
0074   Standard_EXPORT void Clear (const Standard_Integer theMode);
0075   
0076   //! Returns the current Transfer Mode (an Integer)
0077   //! It will be interpreted by the Controller to run Transfers
0078   //! This call form could be later replaced by more specific ones
0079   //! (parameters suited for each norm / transfer case)
0080   Standard_Integer TransferMode() const
0081   { return myTransferMode; }
0082 
0083   //! Changes the Transfer Mode
0084   void SetTransferMode (const Standard_Integer theMode)
0085   { myTransferMode = theMode; }
0086 
0087   //! Prints statistics on current Trace File, according what,mode
0088   //! See PrintStatsProcess for details
0089   Standard_EXPORT void PrintStats (const Standard_Integer theWhat, const Standard_Integer theMode = 0) const;
0090   
0091   //! Tells if a transient object (from an application) is a valid
0092   //! candidate for a transfer to a model
0093   //! Asks the Controller (RecognizeWriteTransient)
0094   //! If <obj> is a HShape, calls RecognizeShape
0095   Standard_EXPORT Standard_Boolean RecognizeTransient (const Handle(Standard_Transient)& theObj);
0096   
0097   //! Transfers a Transient object (from an application) to a model
0098   //! of current norm, according to the last call to SetTransferMode
0099   //! Works by calling the Controller
0100   //! Returns status : =0 if OK, >0 if error during transfer, <0 if
0101   //! transfer badly initialised
0102   Standard_EXPORT IFSelect_ReturnStatus TransferWriteTransient
0103                    (const Handle(Interface_InterfaceModel)& theModel,
0104                     const Handle(Standard_Transient)& theObj,
0105                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0106   
0107   //! Tells if a Shape is valid for a transfer to a model
0108   //! Asks the Controller (RecognizeWriteShape)
0109   Standard_EXPORT Standard_Boolean RecognizeShape (const TopoDS_Shape& theShape);
0110   
0111   //! Transfers a Shape from CasCade to a model of current norm,
0112   //! according to the last call to SetTransferMode
0113   //! Works by calling the Controller
0114   //! Returns status : =0 if OK, >0 if error during transfer, <0 if
0115   //! transfer badly initialised
0116   Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape
0117                    (const Handle(Interface_InterfaceModel)& theModel,
0118                     const TopoDS_Shape& theShape,
0119                     const Message_ProgressRange& theProgress = Message_ProgressRange());
0120   
0121   //! Returns the check-list of last transfer (write), i.e. the
0122   //! check-list currently recorded in the FinderProcess
0123   Standard_EXPORT Interface_CheckIterator CheckList() const;
0124   
0125   //! Returns the check-list of last transfer (write), but tries
0126   //! to bind to each check, the resulting entity in the model
0127   //! instead of keeping the original Mapper, whenever known
0128   Standard_EXPORT Interface_CheckIterator ResultCheckList (const Handle(Interface_InterfaceModel)& theModel) const;
0129 
0130   DEFINE_STANDARD_RTTIEXT(XSControl_TransferWriter,Standard_Transient)
0131 
0132  private:
0133 
0134   Handle(XSControl_Controller) myController;
0135   Handle(Transfer_FinderProcess) myTransferWriter;
0136   Standard_Integer myTransferMode;
0137 };
0138 
0139 #endif // _XSControl_TransferWriter_HeaderFile