b6847a3da7
- miglioria al filtro degli oggetti/gruppi negli Export 3MF, Stl, ThreeJS e Dxf - modifiche di stile minori a Export3dm.
92 lines
5.0 KiB
C++
92 lines
5.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : ExportDxf.h Data : 07.08.14 Versione : 1.5h2
|
|
// Contenuto : Dichiarazione della classe ExportDxf.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 07.08.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EExExportDxf.h"
|
|
#include "/EgtDev/Include/EgtStringBase.h"
|
|
#include "/EgtDev/Include/EGnWriter.h"
|
|
|
|
class IGdbIterator ;
|
|
class IGeoObj ;
|
|
class ICurve ;
|
|
class ICurveLine ;
|
|
class ICurveArc ;
|
|
class Frame3d ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class ExportDxf : public IExportDxf
|
|
{
|
|
public :
|
|
virtual bool SetOptions( int nFilter, int nFlag) ;
|
|
virtual bool Export( IGeomDB* pGDB, int nId, const std::string& sFile) ;
|
|
|
|
public :
|
|
ExportDxf( void) : m_nFilter( EEXFLT_DEFAULT), m_bCompoundLayer( true), m_bColorByLayer( false), m_bAdvancedNames( false) {}
|
|
|
|
private :
|
|
typedef std::pair<std::string,int> LAYDAT ;
|
|
typedef std::vector<LAYDAT> LAYDATVECTOR ;
|
|
|
|
private :
|
|
bool ExportHeader( IGeomDB* pGDB, int nId) ;
|
|
bool ExportTables( IGeomDB* pGDB, int nId) ;
|
|
bool WriteVPortTable( IGeomDB* pGDB, int nId) ;
|
|
bool WriteLinetypesTable( IGeomDB* pGDB, int nId) ;
|
|
bool WriteLayersTable( IGeomDB* pGDB, int nId) ;
|
|
bool FindLayers( const IGdbIterator& iIter, const std::string& sLay, LAYDATVECTOR& vLayDat) ;
|
|
bool WriteLayer( const std::string& sLay, int nFlag, int nCol, const std::string& sLineType) ;
|
|
bool WriteStylesTable( IGeomDB* pGDB, int nId) ;
|
|
bool FindTextStyles( const IGdbIterator& iIter, STRVECTOR& vFontName) ;
|
|
bool WriteStyle( const std::string& sStyle, const std::string& sFont) ;
|
|
bool WriteOtherTables( IGeomDB* pGDB, int nId) ;
|
|
bool ExportBlocks( IGeomDB* pGDB, int nId) ;
|
|
bool ExportEntities( IGeomDB* pGDB, int nId) ;
|
|
bool ExportGdbObject( const IGdbIterator& iIter, const std::string& sLay) ;
|
|
bool ExportGdbGroup( const IGdbIterator& iIter, const std::string& sLay) ;
|
|
bool ExportPoint( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportVector( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportLine( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportArc( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportCrvBezier( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportCrvCompo( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportSFR( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportSTM( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool ExportText( const std::string& sLay, int nCol, const IGeoObj* pGeoObj, const Frame3d& frFrame) ;
|
|
bool AdjustText( std::string& sText) ;
|
|
bool WritePoint( const std::string& sLay, int nCol, const Point3d& ptP, const Vector3d& vtV, const Frame3d& frFrame) ;
|
|
bool WriteLine( const std::string& sLay, int nCol, const ICurveLine* pLine, const Frame3d& frFrame) ;
|
|
bool WriteCircle( const std::string& sLay, int nCol, const ICurveArc* pArc, const Frame3d& frFrame) ;
|
|
bool WriteArc( const std::string& sLay, int nCol, const ICurveArc* pArc, const Frame3d& frFrame) ;
|
|
bool WriteCurve2d( const std::string& sLay, int nCol, const ICurve* pCrv,
|
|
const Frame3d& frPlane, const Frame3d& frFrame) ;
|
|
bool WriteCurve3d( const std::string& sLay, int nCol, const ICurve* pCrv, const Frame3d& frFrame) ;
|
|
bool TestFilter( int nLev, int nMode, int nStat, bool bGroup) ;
|
|
bool CalcGroupFilter( void) ;
|
|
bool WriteItem( int nCode, int nVal) ;
|
|
bool WriteItem( int nCode, double dVal, int nPrec = 6) ;
|
|
bool WriteItem( int nCode, const std::string& sVal) ;
|
|
bool ColorToACI( const Color& cCol, int& nColor) ;
|
|
std::string UpdateLayerName( const IGdbIterator& iIter, const std::string& sLay, bool* pbExact = nullptr) ;
|
|
std::string FontNameToStyle( const std::string& sFontName) ;
|
|
std::string AdjustFontName( const std::string& sFontName) ;
|
|
|
|
private :
|
|
int m_nFilter ; // filtro su livello, modo e stato, se l'oggeto da valutare è un oggetto geometrico
|
|
int m_nGroupFilter ; // filtro su livello, modo e stato, se l'oggetto da valutare è un gruppo
|
|
bool m_bCompoundLayer ;
|
|
bool m_bColorByLayer ;
|
|
bool m_bAdvancedNames ;
|
|
Writer m_Writer ; // scrittore di file di testo
|
|
} ;
|