Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2019 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _RWObj_CafReader_HeaderFile
0015 #define _RWObj_CafReader_HeaderFile
0016 
0017 #include <RWMesh_CafReader.hxx>
0018 #include <RWObj_TriangulationReader.hxx>
0019 
0020 //! The OBJ mesh reader into XDE document.
0021 class RWObj_CafReader : public RWMesh_CafReader, protected RWObj_IShapeReceiver
0022 {
0023   DEFINE_STANDARD_RTTIEXT(RWObj_CafReader, RWMesh_CafReader)
0024 public:
0025 
0026   //! Empty constructor.
0027   Standard_EXPORT RWObj_CafReader();
0028 
0029   //! Return single precision flag for reading vertex data (coordinates); FALSE by default.
0030   Standard_Boolean IsSinglePrecision() const { return myIsSinglePrecision; }
0031 
0032   //! Setup single/double precision flag for reading vertex data (coordinates).
0033   void SetSinglePrecision (Standard_Boolean theIsSinglePrecision) { myIsSinglePrecision = theIsSinglePrecision; }
0034 
0035 protected:
0036 
0037   //! Read the mesh from specified file.
0038   Standard_EXPORT virtual Standard_Boolean performMesh (std::istream& theStream,
0039                                                         const TCollection_AsciiString& theFile,
0040                                                         const Message_ProgressRange& theProgress,
0041                                                         const Standard_Boolean theToProbe) Standard_OVERRIDE;
0042 
0043 protected:
0044 
0045   //! Create reader context.
0046   //! Can be overridden by sub-class to read triangulation into application-specific data structures instead of Poly_Triangulation.
0047   Standard_EXPORT virtual Handle(RWObj_TriangulationReader) createReaderContext();
0048 
0049   //! @param theShape       shape to register
0050   //! @param theName        shape name
0051   //! @param theMaterial    shape material
0052   //! @param theIsRootShape indicates that this is a root object (free shape)
0053   Standard_EXPORT virtual void BindNamedShape (const TopoDS_Shape& theShape,
0054                                                const TCollection_AsciiString& theName,
0055                                                const RWObj_Material* theMaterial,
0056                                                const Standard_Boolean theIsRootShape) Standard_OVERRIDE;
0057 
0058 protected:
0059 
0060   NCollection_DataMap<TCollection_AsciiString, Handle(XCAFDoc_VisMaterial)> myObjMaterialMap;
0061   Standard_Boolean myIsSinglePrecision; //!< flag for reading vertex data with single or double floating point precision
0062 };
0063 
0064 #endif // _RWObj_CafReader_HeaderFile