2922e2f4bd
- adattamenti per libzip.
59 lines
2.3 KiB
C++
59 lines
2.3 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"
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
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 :
|
|
std::string FindFileName() ;
|
|
bool ReadItem( pugi::xml_node node, pugi::xml_node resources) ;
|
|
bool ReadObject( pugi::xml_node resources, int& id, ATTRVECTOR& attributes, DBLVECTOR& vTransform, double& nScaleFactor) ;
|
|
bool ReadComponents( pugi::xml_node node, pugi::xml_node resources, ATTRVECTOR attributes, DBLVECTOR vItemTransform,
|
|
double& nScaleFactor) ;
|
|
bool ReadMesh( pugi::xml_node node, pugi::xml_node resources, int& pid, int& pindex, ATTRVECTOR& attributes, DBLVECTOR& vTransform,
|
|
double& nScaleFactor) ;
|
|
bool ReadMetadataGroup( pugi::xml_node node, ATTRVECTOR& v, MDGCaller caller) ;
|
|
bool ReadFromFile( std::string sFileName, int id, ATTRVECTOR& attributes, DBLVECTOR& vTransform) ;
|
|
|
|
DBLVECTOR ReadTransform( std::string& sTransform, double& nScaleFactor) ;
|
|
Color FindColor( pugi::xml_node resources, int pid, int pindex) ;
|
|
Color ColorConverter( std::string s) ;
|
|
Color ReadMultiPropertiesColor( pugi::xml_node node, pugi::xml_node resources, int pid, int pindex) ;
|
|
Color ReadCompositeMaterialColor( pugi::xml_node node, pugi::xml_node resources, int pid, int pindex) ;
|
|
|
|
private :
|
|
double m_nScaleFactor ;
|
|
zip_t* m_ziparchive ;
|
|
IGeomDB* m_pGDB ;
|
|
int m_nIdGroup ;
|
|
std::unordered_map<std::string, pugi::xml_document> m_AuxDocuments ;
|
|
} ;
|
|
|
|
|
|
|