Files
EgtExchange/Import3MF.h
SaraP d4567dc05f EgtExchange 2.3j1 :
- nuova implementazione di Import3MF usando lib3mf.
2021-10-01 15:08:25 +02:00

52 lines
1.9 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
// File : Import3MF.h Data : 29.01.21 Versione : 2.3b1
// Contenuto : Dichiarazione della classe Import3MF.
//
//
//
// Modifiche : 21.01.21 SP Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include <unordered_map>
#include "/EgtDev/Include/EExImport3MF.h"
#include "pugixml.hpp"
#include "/EgtDev/Extern/libzip/Include/zip.h"
#define NOMINMAX
#include "/EgtDev/Extern/Lib3MF/Include/lib3mf_implicit.hpp"
//----------------------------------------------------------------------------
class Import3MF : public IImport3MF
{
private :
typedef std::vector<std::pair<std::string, std::string>> ATTRVECTOR ;
enum MDGCaller { Item = 0, Component = 1, Mesh = 2 } ;
public :
virtual bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup) ;
private :
bool DoImport( const std::string& sFile) ;
bool ReadItem( const Lib3MF::PBuildItem item) ;
bool ReadObject( const Lib3MF::PObject pObj, ATTRVECTOR& vAttr, Lib3MF::sTransform& sTransf) ;
bool ReadComponents( const Lib3MF_uint32& nId, ATTRVECTOR& vAttr, Lib3MF::sTransform& sTransfItem) ;
bool ReadMesh( const Lib3MF_uint32& nId, ATTRVECTOR& vAttr, Lib3MF::sTransform& sTransfr) ;
bool ReadMetaDataGroup( const Lib3MF::PMetaDataGroup pMetaDataGrp, ATTRVECTOR& vAttr, const MDGCaller& caller) ;
bool FindColor( const Lib3MF_uint32& pid, const Lib3MF_uint32& pindex, Color& cCol) ;
private :
double m_nScaleFactor ;
IGeomDB* m_pGDB ;
int m_nIdGroup ;
Lib3MF::PWrapper m_wrapper ;
Lib3MF::PModel m_model ;
} ;