Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:04

0001 // Created on: 1994-09-01
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 _IGESToBRep_Reader_HeaderFile
0018 #define _IGESToBRep_Reader_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TopTools_SequenceOfShape.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_CString.hxx>
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class IGESData_IGESModel;
0030 class IGESToBRep_Actor;
0031 class Transfer_TransientProcess;
0032 class TopoDS_Shape;
0033 
0034 //! A simple way to read geometric IGES data.
0035 //! Encapsulates reading file and calling transfer tools
0036 class IGESToBRep_Reader 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Creates a Reader
0044   Standard_EXPORT IGESToBRep_Reader();
0045   
0046   //! Loads a Model from a file.Returns 0 if success.
0047   //! returns 1 if the file could not be opened,
0048   //! returns -1 if an error occurred while the file was being loaded.
0049   Standard_EXPORT Standard_Integer LoadFile (const Standard_CString filename);
0050   
0051   //! Specifies a Model to work on
0052   //! Also clears the result and Done status, sets TransientProcess
0053   Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model);
0054   
0055   //! Returns the Model to be worked on.
0056   Standard_EXPORT Handle(IGESData_IGESModel) Model() const;
0057   
0058   //! Allows to set an already defined TransientProcess
0059   //! (to be called after LoadFile or SetModel)
0060   Standard_EXPORT void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP);
0061   
0062   //! Returns the TransientProcess
0063   Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
0064   
0065   //! Returns "theActor"
0066   Standard_EXPORT Handle(IGESToBRep_Actor) Actor() const;
0067   
0068   //! Clears the results between two translation operations.
0069   Standard_EXPORT void Clear();
0070   
0071   //! Checks the IGES file that was
0072   //! loaded into memory. Displays error messages in the default
0073   //! message file if withprint is true. Returns True if no fail
0074   //! message was found and False if there was at least one fail message.
0075   Standard_EXPORT Standard_Boolean Check (const Standard_Boolean withprint) const;
0076   
0077   //! Translates root entities in an
0078   //! IGES file. Standard_True is the default value and means that only
0079   //! visible root entities are translated. Standard_False
0080   //! translates all of the roots (visible and invisible).
0081   Standard_EXPORT void TransferRoots (const Standard_Boolean onlyvisible = Standard_True,
0082                                       const Message_ProgressRange& theProgress = Message_ProgressRange());
0083   
0084   //! Transfers an Entity given its rank in the Model (Root or not)
0085   //! Returns True if it is recognized as Geom-Topol.
0086   //! (But it can have failed : see IsDone)
0087   Standard_EXPORT Standard_Boolean Transfer (const Standard_Integer num,
0088                                              const Message_ProgressRange& theProgress = Message_ProgressRange());
0089   
0090   //! Returns True if the LAST Transfer/TransferRoots was a success
0091   Standard_EXPORT Standard_Boolean IsDone() const;
0092   
0093   //! Returns the Tolerance which has been actually used, converted
0094   //! in millimeters
0095   //! (either that from File or that from Session, according the mode)
0096   Standard_EXPORT Standard_Real UsedTolerance() const;
0097   
0098   //! Returns the number of shapes produced by the translation.
0099   Standard_EXPORT Standard_Integer NbShapes() const;
0100   
0101   //! Returns the num the resulting shape in a translation operation.
0102   Standard_EXPORT TopoDS_Shape Shape (const Standard_Integer num = 1) const;
0103   
0104   //! Returns all of the results in a
0105   //! single shape which is:
0106   //! - a null shape if there are no results,
0107   //! - a shape if there is one result,
0108   //! - a compound containing the resulting shapes if there are several.
0109   Standard_EXPORT TopoDS_Shape OneShape() const;
0110 
0111 
0112 
0113 
0114 protected:
0115 
0116 
0117 
0118 
0119 
0120 private:
0121 
0122 
0123 
0124   Handle(IGESData_IGESModel) theModel;
0125   Standard_Boolean theDone;
0126   TopTools_SequenceOfShape theShapes;
0127   Handle(IGESToBRep_Actor) theActor;
0128   Handle(Transfer_TransientProcess) theProc;
0129 
0130 
0131 };
0132 
0133 
0134 
0135 
0136 
0137 
0138 
0139 #endif // _IGESToBRep_Reader_HeaderFile