//---------------------------------------------------------------------------- // EgalWare 2022-2022 //---------------------------------------------------------------------------- // File : ExportThreeJS.h Data : 05.07.22 Versione : 2.4j1 // Contenuto : Dichiarazione della classe ExportThreeJS. // // // // Modifiche : 19.10.22 // // //---------------------------------------------------------------------------- #pragma once #include "/EgtDev/Include/EExExportThreeJS.h" #include "/EgtDev/Include/EGnWriter.h" #include "/EgtDev/Include/EGkColor.h" #include "/EgtDev/Include/EGkIntersSurfTmSurfTm.h" class IGdbIterator ; class IGeoObj ; class Frame3d ; struct sSurfDist { const ISurfTriMesh* SurvAlpha ; double dDistance = 0 ; std::string sName ; }; //---------------------------------------------------------------------------- class ExportThreeJS : public IExportThreeJS { public: virtual bool SetOptions( int nFilter) ; virtual bool Export( IGeomDB* pGDB, int nId, const std::string& sFile, IEGrScene* pScene, bool bUdm) ; public: ExportThreeJS( void) : m_nFilter( EEXFLT_DEFAULT) {} private: bool CreateFolderSpace( const std::string& SFileName, const std::string& sUserPath, const std::string& sLibPath) ; bool HeadAmbient( IEGrScene* pScene, IGeomDB* pGDB, int nId) ; bool FinishAmbient() ; bool CompressAll( const std::string& sFile) ; bool ExportVector3D( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportPoint3D( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportFrame3D( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportLine3D( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportCurveComp3D( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportSTM( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportSFR( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportSBezier(const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportText( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ExportDimension( const std::string& sName, const IGeoObj* pGeoObj, const Frame3d& frFrame, const Color& cCol, const int nIdGroup) ; bool ScanGroup( const IGdbIterator& iIter, IGeomDB* pGDB, const int nIdGroup) ; bool ExportObject( const IGdbIterator& iIter, IGeomDB* pGDB, const int nIdGroup) ; bool TestFilter( int nLev, int nMode, int nStat) ; private: int m_nFilter ; // filtro su livello, modo e stato Writer m_Writer ; // scrittore di file di testo oggetto std::string m_sUdm ; // udm della scena Point3d m_ptMin ; // punto minimo del box3d double m_dimX ; // dimX Box3d Global double m_dimY ; // dimY Box3d Global double m_dimZ ; // dimZ Box3d Global double m_dDistance ; // scala per pan e zoom int m_nCont = 0 ; // contatore per linee interne ai testi Point3d m_ptCamera ; // Camera look at Point3d m_ptCenter ; // Camera center double m_dHalfWidth ; // Lunghezza/2 piano di proiezione (culling) double m_dHalfHeight ; // Altezza/2 piano di proiezione (culling) double m_ZNear ; // Distanza (lungo Z) piano di proiezione da origine (culling) double m_ZFar ; // Distanza (lungo Z) piano di culling da origine (culling) double m_dCameraPhi ; // [0,180] angolo phi in coordinate polari della telecamera double m_dCameraTheta ; // [0, 360) angolo Theta in coordinate polari della telecamera int m_ANG_TOL_STD_DEG = 15 ; // Interpolazione testo Frame3d m_frTHREEJSFrame ; // frame di ThreeJS std::list< sSurfDist> m_lTranspSurf ; // Lista di superfici trasparenti int m_nGroupCount = -1 ; // Contatore del gruppo std::string m_sCodMenu ; // Stringa per la creazione del menu laterale della scena // Parametri... bool m_bShowGrid = true ; // se esportare o meno la griglia dalla scena bool m_bUdm_mm ; // se l'unità di misura è in mm std::string m_sPath ; // Path aggiuntivo dove salvare il file (il vero path è nel LUA) public: static std::string m_sThreeJSAuxDir ; // direttorio librerie };