Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:27:29

0001 // Created on: 1994-11-15
0002 // Created by: Marie Jose MARTZ
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 _BRepToIGES_BREntity_HeaderFile
0018 #define _BRepToIGES_BREntity_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_CString.hxx>
0025 #include <Message_ProgressRange.hxx>
0026 
0027 class IGESData_IGESModel;
0028 class Transfer_FinderProcess;
0029 class IGESData_IGESEntity;
0030 class TopoDS_Shape;
0031 class Standard_Transient;
0032 
0033 //! provides methods to transfer BRep entity from CASCADE to IGES.
0034 class BRepToIGES_BREntity
0035 {
0036 public:
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Creates a tool BREntity
0040   Standard_EXPORT BRepToIGES_BREntity();
0041 
0042   //! Initializes the field of the tool BREntity with
0043   //! default creating values.
0044   Standard_EXPORT void Init();
0045 
0046   //! Set the value of "TheModel"
0047   Standard_EXPORT void SetModel(const occ::handle<IGESData_IGESModel>& model);
0048 
0049   //! Returns the value of "TheModel"
0050   Standard_EXPORT occ::handle<IGESData_IGESModel> GetModel() const;
0051 
0052   //! Returns the value of the UnitFlag of the header of the model
0053   //! in meters.
0054   Standard_EXPORT double GetUnit() const;
0055 
0056   //! Set the value of "TheMap"
0057   Standard_EXPORT void SetTransferProcess(const occ::handle<Transfer_FinderProcess>& TP);
0058 
0059   //! Returns the value of "TheMap"
0060   Standard_EXPORT occ::handle<Transfer_FinderProcess> GetTransferProcess() const;
0061 
0062   //! Returns the result of the transfert of any Shape
0063   //! If the transfer has failed, this member return a NullEntity.
0064   Standard_EXPORT virtual occ::handle<IGESData_IGESEntity> TransferShape(
0065     const TopoDS_Shape&          start,
0066     const Message_ProgressRange& theProgress = Message_ProgressRange());
0067 
0068   //! Records a new Fail message
0069   Standard_EXPORT void AddFail(const TopoDS_Shape& start, const char* const amess);
0070 
0071   //! Records a new Warning message
0072   Standard_EXPORT void AddWarning(const TopoDS_Shape& start, const char* const amess);
0073 
0074   //! Records a new Fail message
0075   Standard_EXPORT void AddFail(const occ::handle<Standard_Transient>& start,
0076                                const char* const                      amess);
0077 
0078   //! Records a new Warning message
0079   Standard_EXPORT void AddWarning(const occ::handle<Standard_Transient>& start,
0080                                   const char* const                      amess);
0081 
0082   //! Returns True if start was already treated and has a result in "TheMap"
0083   //! else returns False.
0084   Standard_EXPORT bool HasShapeResult(const TopoDS_Shape& start) const;
0085 
0086   //! Returns the result of the transfer of the Shape "start" contained
0087   //! in "TheMap". (if HasShapeResult is True).
0088   Standard_EXPORT occ::handle<Standard_Transient> GetShapeResult(const TopoDS_Shape& start) const;
0089 
0090   //! set in "TheMap" the result of the transfer of the Shape "start".
0091   Standard_EXPORT void SetShapeResult(const TopoDS_Shape&                    start,
0092                                       const occ::handle<Standard_Transient>& result);
0093 
0094   //! Returns True if start was already treated and has a result in "TheMap"
0095   //! else returns False.
0096   Standard_EXPORT bool HasShapeResult(const occ::handle<Standard_Transient>& start) const;
0097 
0098   //! Returns the result of the transfer of the Transient "start" contained
0099   //! in "TheMap". (if HasShapeResult is True).
0100   Standard_EXPORT occ::handle<Standard_Transient> GetShapeResult(
0101     const occ::handle<Standard_Transient>& start) const;
0102 
0103   //! set in "TheMap" the result of the transfer of the Transient "start".
0104   Standard_EXPORT void SetShapeResult(const occ::handle<Standard_Transient>& start,
0105                                       const occ::handle<Standard_Transient>& result);
0106 
0107   //! Returns mode for conversion of surfaces
0108   //! (value of parameter write.convertsurface.mode)
0109   Standard_EXPORT bool GetConvertSurfaceMode() const;
0110 
0111   //! Returns mode for writing pcurves
0112   //! (value of parameter write.surfacecurve.mode)
0113   Standard_EXPORT bool GetPCurveMode() const;
0114 
0115   Standard_EXPORT virtual ~BRepToIGES_BREntity();
0116 
0117 private:
0118   occ::handle<IGESData_IGESModel>     TheModel;
0119   double                              TheUnitFactor;
0120   bool                                myConvSurface;
0121   bool                                myPCurveMode;
0122   occ::handle<Transfer_FinderProcess> TheMap;
0123 };
0124 
0125 #endif // _BRepToIGES_BREntity_HeaderFile