Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-30 09:03:55

0001 // Created on: 1996-09-06
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 _IGESControl_Reader_HeaderFile
0018 #define _IGESControl_Reader_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 #include <XSControl_Reader.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <IFSelect_PrintFail.hxx>
0026 #include <IFSelect_PrintCount.hxx>
0027 
0028 class IGESData_IGESModel;
0029 
0030 //! Reads IGES files, checks them and translates their contents into Open CASCADE models.
0031 //! The IGES data can be that of a whole model or that of a specific list of entities in the model.
0032 //! As in XSControl_Reader, you specify the list using a selection.
0033 //! For translation of iges files it is possible to use the following sequence:
0034 //! To change parameters of translation
0035 //! class Interface_Static should be used before the beginning of translation
0036 //! (see IGES Parameters and General Parameters)
0037 //! Creation of reader
0038 //! IGESControl_Reader reader;
0039 //! To load a file in a model use method:
0040 //! reader.ReadFile("filename.igs")
0041 //! To check a loading file use method Check:
0042 //! reader.Check(failsonly); where failsonly is equal to true or
0043 //! false;
0044 //! To print the results of load:
0045 //! reader.PrintCheckLoad(failsonly,mode) where mode is equal to the value of
0046 //! enumeration IFSelect_PrintCount
0047 //! To transfer entities from a model the following methods can be used:
0048 //! for the whole model
0049 //! reader.TransferRoots(onlyvisible); where onlyvisible is equal to
0050 //! true or false;
0051 //! To transfer a list of entities:
0052 //! reader.TransferList(list);
0053 //! To transfer one entity
0054 //! reader.TransferEntity(ent) or reader.Transfer(num);
0055 //! To obtain a result the following method can be used:
0056 //! reader.IsDone()
0057 //! reader.NbShapes() and reader.Shape(num); or reader.OneShape();
0058 //! To print the results of transfer use method:
0059 //! reader.PrintTransferInfo(failwarn,mode); where printfail is equal to the
0060 //! value of enumeration IFSelect_PrintFail, mode see above.
0061 //! Gets correspondence between an IGES entity and a result shape obtained therefrom.
0062 //! reader.TransientProcess();
0063 //! TopoDS_Shape shape =
0064 //! TransferBRep::ShapeResult(reader.TransientProcess(),ent);
0065 class IGESControl_Reader : public XSControl_Reader
0066 {
0067 public:
0068   DEFINE_STANDARD_ALLOC
0069 
0070   //! Creates a Reader from scratch
0071   Standard_EXPORT IGESControl_Reader();
0072 
0073   //! Creates a Reader from an already existing Session
0074   Standard_EXPORT IGESControl_Reader(const occ::handle<XSControl_WorkSession>& WS,
0075                                      const bool                                scratch = true);
0076 
0077   //! Set the transion of ALL Roots (if theReadOnlyVisible is False)
0078   //! or of Visible Roots (if theReadOnlyVisible is True)
0079   void SetReadVisible(const bool ReadRoot);
0080 
0081   bool GetReadVisible() const;
0082 
0083   //! Returns the model as a IGESModel.
0084   //! It can then be consulted (header, product)
0085   Standard_EXPORT occ::handle<IGESData_IGESModel> IGESModel() const;
0086 
0087   //! Determines the list of root entities from Model which are candidate for
0088   //! a transfer to a Shape (type of entities is PRODUCT)
0089   //! <theReadOnlyVisible> is taken into account to define roots
0090   Standard_EXPORT int NbRootsForTransfer() override;
0091 
0092   //! Prints Statistics and check list for Transfer
0093   Standard_EXPORT void PrintTransferInfo(const IFSelect_PrintFail  failwarn,
0094                                          const IFSelect_PrintCount mode) const;
0095 
0096 protected:
0097   //! Returns default parameters for shape fixing.
0098   //! @return default parameters for shape fixing.
0099   Standard_EXPORT DE_ShapeFixParameters GetDefaultShapeFixParameters() const override;
0100 
0101   //! Returns default flags for shape processing.
0102   //! @return Default flags for shape processing.
0103   Standard_EXPORT ShapeProcess::OperationsFlags GetDefaultShapeProcessFlags() const override;
0104 
0105 private:
0106   bool theReadOnlyVisible;
0107 };
0108 
0109 #include <IGESControl_Reader.lxx>
0110 
0111 #endif // _IGESControl_Reader_HeaderFile