Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/RWObj_CafReader.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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   //! Empty constructor.
0026   Standard_EXPORT RWObj_CafReader();
0027 
0028   //! Return single precision flag for reading vertex data (coordinates); FALSE by default.
0029   bool IsSinglePrecision() const { return myIsSinglePrecision; }
0030 
0031   //! Setup single/double precision flag for reading vertex data (coordinates).
0032   void SetSinglePrecision(bool theIsSinglePrecision) { myIsSinglePrecision = theIsSinglePrecision; }
0033 
0034 protected:
0035   //! Read the mesh from specified file.
0036   Standard_EXPORT bool performMesh(std::istream&                  theStream,
0037                                    const TCollection_AsciiString& theFile,
0038                                    const Message_ProgressRange&   theProgress,
0039                                    const bool                     theToProbe) override;
0040 
0041 protected:
0042   //! Create reader context.
0043   //! Can be overridden by sub-class to read triangulation into application-specific data structures
0044   //! instead of Poly_Triangulation.
0045   Standard_EXPORT virtual occ::handle<RWObj_TriangulationReader> createReaderContext();
0046 
0047   //! @param theShape       shape to register
0048   //! @param theName        shape name
0049   //! @param theMaterial    shape material
0050   //! @param theIsRootShape indicates that this is a root object (free shape)
0051   Standard_EXPORT void BindNamedShape(const TopoDS_Shape&            theShape,
0052                                       const TCollection_AsciiString& theName,
0053                                       const RWObj_Material*          theMaterial,
0054                                       const bool                     theIsRootShape) override;
0055 
0056 protected:
0057   NCollection_DataMap<TCollection_AsciiString, occ::handle<XCAFDoc_VisMaterial>> myObjMaterialMap;
0058   // clang-format off
0059   bool myIsSinglePrecision; //!< flag for reading vertex data with single or double floating point precision
0060   // clang-format on
0061 };
0062 
0063 #endif // _RWObj_CafReader_HeaderFile