Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:57

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