Files
EgtExchange/ExportDxf.h
T
Dario Sassi 0ca47c7bef EgtExchange 1.6i1 :
- in export DXF e STL gestite anche le regioni
- in import BTL aggiunto flag per mettere i pezzi di piatto
- in import BTL aggiynto al pezzo testo con nome.
2015-09-02 13:05:48 +00:00

86 lines
4.4 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 <fstream>
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) {}
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 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 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 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 ;
bool m_bCompoundLayer ;
bool m_bColorByLayer ;
std::ofstream m_OutFile ;
} ;