daa31dee8e
- gestite le Instance Definition e Instance Reference. - aggiunti dei parametri membro della classe.
75 lines
3.7 KiB
C++
75 lines
3.7 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2023
|
|
//----------------------------------------------------------------------------
|
|
// File : Import3dm.h Data : 23.06.23 Versione : 2.5f1
|
|
// Contenuto : Dichiarazione della classe Import3dm.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 23.06.23 DB Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#define NOMINMAX
|
|
|
|
#include "/EgtDev/Include/EE3Import3dm.h"
|
|
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
|
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
|
#include "/EgtDev/Include/EGkCurve.h"
|
|
#include "/EgtDev/Include/EGkGeoObj.h"
|
|
#include "/EgtDev/Include/EgtPointerOwner.h"
|
|
#include "/EgtDev/Extern/opennurbs/Include/opennurbs.h"
|
|
#include <utility>
|
|
#include <map>
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Import3dm : public IImport3dm
|
|
{
|
|
public :
|
|
bool Import( const std::string& sFile, IGeomDB* pGDB, int nIdGroup,
|
|
double dTextHeight = 2.0, double dExtLine = 5.0, double dArrLen = 5.0, double dTextDist = 2.0,
|
|
bool bLenIsMM = true, int nDecDig = -2, std::string sFont = "ModernPropS.Nfe") override ;
|
|
|
|
private :
|
|
Point3d ConvertPoint( const ON_Point& onPoint)
|
|
{ return Point3d( onPoint.point.x, onPoint.point.y, onPoint.point.z) ; } ;
|
|
Point3d ConvertPoint( const ON_3dPoint& on3dPoint)
|
|
{ return Point3d( on3dPoint.x, on3dPoint.y, on3dPoint.z) ; } ;
|
|
Point3d ConvertPoint( const ON_4dPoint& on4dPoint)
|
|
{ return Point3d( on4dPoint.x, on4dPoint.y, on4dPoint.z) ; } ;
|
|
Point3d ConvertPoint( const ON_3fPoint& on3fPoint)
|
|
{ return Point3d( on3fPoint.x, on3fPoint.y, on3fPoint.z) ; } ;
|
|
Vector3d ConvertVector( const ON_3dVector& onVector)
|
|
{ return Vector3d( onVector.x, onVector.y, onVector.z) ; } ;
|
|
Vector3d ConvertVector( const ON_2dVector& onVector)
|
|
{ return Vector3d( onVector.x, onVector.y, 0) ; } ;
|
|
ICurve* ConvertCurve( const ON_Curve* onCurve) ;
|
|
ISurf* ConvertSurface( const ON_Surface* onSurf, DBLVECTOR* vU = nullptr, DBLVECTOR* vV = nullptr) ;
|
|
ISURFPOVECTOR ConvertExtrusion( const ON_Extrusion* onExtrusion) ;
|
|
ISurfTriMesh* ConvertMesh( const ON_Mesh* onMesh) ;
|
|
std::vector<PtrOwner<IGeoObj>> ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* onDimStyle) ;
|
|
ISURFPOVECTOR ConvertBrep( const ON_Brep* onBrep, const bool bForceTriMesh) ;
|
|
ICurve* ConvertBrepLoop( const ON_BrepLoop* onBrepLoop) ;
|
|
ICurveComposite* ApproxTrim( ICurve* pCrv) ;
|
|
bool ConvertCurveParam( const ON_RevSurface* onRevSurf, ICurve** pCrv) ;
|
|
std::string ConvertONwStringToString( ON_wString ON_wString) ;
|
|
bool ConvertGeometry( const ON_Object* oGeometry, std::vector<PtrOwner<IGeoObj>>& vpGeoObj) ;
|
|
bool ConvertInstanceReference( const ON_InstanceRef* iref, const ON_Xform& xf, std::vector<PtrOwner<IGeoObj>>& vpGeoObj) ;
|
|
|
|
private :
|
|
ONX_Model m_model ;
|
|
IGeomDB* m_pGDB ;
|
|
int m_nIdGroup ;
|
|
std::map< int, std::tuple<const ON_Layer*, ON_UUID, int, int, int>> m_mLayer ; // mappa dei layer con id nel GDB e l'uuid nel modello 3dm, un int per l'indice del layer nel model, un int che indica la profondità del layer ( Root = 0, Part = 1, layer = 2), un int che è l'indice del layer ausiliario se avevo un Part senza layer ( lo aggiungo io e finché non l'ho aggiunto questo int è settato a -1)
|
|
std::map< std::string, int> m_mError_count ;
|
|
double m_dTextHeight ;
|
|
double m_dExtLine ;
|
|
double m_dArrLen ;
|
|
double m_dTextDist ;
|
|
bool m_bLenIsMM ;
|
|
int m_nDecDig ;
|
|
std::string m_sFont ;
|
|
} ; |