Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 09:17:32

0001 // Copyright (c) 2015-2021 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_ObjMaterialMap_HeaderFiler
0015 #define _RWObj_ObjMaterialMap_HeaderFiler
0016 
0017 #include <NCollection_DataMap.hxx>
0018 #include <RWMesh_MaterialMap.hxx>
0019 
0020 //! Material MTL file writer for OBJ export.
0021 class RWObj_ObjMaterialMap : public RWMesh_MaterialMap
0022 {
0023   DEFINE_STANDARD_RTTIEXT(RWObj_ObjMaterialMap, RWMesh_MaterialMap)
0024 public:
0025   //! Main constructor.
0026   Standard_EXPORT RWObj_ObjMaterialMap(const TCollection_AsciiString& theFile);
0027 
0028   //! Destructor, will emit error message if file was not closed.
0029   Standard_EXPORT virtual ~RWObj_ObjMaterialMap();
0030 
0031   //! Add material
0032   Standard_EXPORT virtual TCollection_AsciiString AddMaterial(const XCAFPrs_Style& theStyle)
0033     Standard_OVERRIDE;
0034 
0035   //! Virtual method actually defining the material (e.g. export to the file).
0036   Standard_EXPORT virtual void DefineMaterial(const XCAFPrs_Style&           theStyle,
0037                                               const TCollection_AsciiString& theKey,
0038                                               const TCollection_AsciiString& theName)
0039     Standard_OVERRIDE;
0040 
0041 private:
0042   FILE*                                                               myFile;
0043   NCollection_DataMap<Handle(Image_Texture), TCollection_AsciiString> myImageMap;
0044 };
0045 
0046 #endif // _RWObj_ObjMaterialMap_HeaderFiler