From 38d15bf4121ca1bfade31ac3185ea1306b8a4867 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Tue, 22 Apr 2025 12:00:20 +0200 Subject: [PATCH] EgtExch3dm : - piccola correzione al log errori. --- Import3dm.cpp | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/Import3dm.cpp b/Import3dm.cpp index e5cd5f2..bf3ccde 100644 --- a/Import3dm.cpp +++ b/Import3dm.cpp @@ -1364,14 +1364,17 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o //aggiungo al gruppo: testo, linea e landing if ( ! IsNull( tText) && tText->IsValid()) vpObj.emplace_back( Release( tText)) ; - else + else{ + m_mError_count["annotation"] += 1 ; break ; + } const ON_Curve* onCurve = onLeader->Curve( onDimStyle) ; PtrOwner pCurve( ConvertCurve( onCurve)) ; if ( ! IsNull( pCurve) && pCurve->IsValid()) { vpObj.emplace_back( Release( pCurve)) ; } else { + m_mError_count["annotation"] += 1 ; vpObj.clear() ; break ; } @@ -1387,6 +1390,7 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o vpObj.emplace_back( Release( pCrvL)) ; } else { + m_mError_count["annotation"] += 1 ; vpObj.clear() ; break ; } @@ -1404,8 +1408,10 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o Vector3d vtN = ConvertVector( onPlane.Normal()) ; Vector3d vtDir = ConvertPoint(onPt2) - ConvertPoint(onPt1) ; if ( ! vtDir.Normalize() || - ! vtDir.Rotate( vtN, dAngDeg)) + ! vtDir.Rotate( vtN, dAngDeg)) { + m_mError_count["annotation"] += 1 ; break ; + } Point3d ptP1( ConvertPoint( onPt1)) ; Point3d ptP2( ConvertPoint( onPt2)) ; Point3d ptPDimL( ConvertPoint( onPtDimLine)) ; @@ -1415,14 +1421,18 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o if ( onAnnType == ON::AnnotationType::Aligned) { if ( IsNull( pDim ) || ! pDim->SetStyle( dExtLine, dArrLen, dTextDist, bLenIsMM, nDecDig, sFont, dTextHeight) || - ! pDim->SetLinear( ptP1, ptP2, ptPDimL, vtN, V_NULL, "<>")) + ! pDim->SetLinear( ptP1, ptP2, ptPDimL, vtN, V_NULL, "<>")) { + m_mError_count["annotation"] += 1 ; break ; + } } else if ( onAnnType == ON::AnnotationType::Rotated){ if ( IsNull( pDim ) || ! pDim->SetStyle( dExtLine, dArrLen, dTextDist, bLenIsMM, nDecDig, sFont, dTextHeight) || - ! pDim->SetLinear( ptP1, ptP2, ptPDimL, vtN, vtDir, "<>")) + ! pDim->SetLinear( ptP1, ptP2, ptPDimL, vtN, vtDir, "<>")) { + m_mError_count["annotation"] += 1 ; break ; + } } // inserisco la quota nel DB @@ -1430,8 +1440,10 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o vpObj.emplace_back( Release( pDim)) ; return vpObj ; } - else + else { + m_mError_count["annotation"] += 1 ; break ; + } } case ON::AnnotationType::Angular : case ON::AnnotationType::Angular3pt : { @@ -1455,8 +1467,10 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o vpObj.emplace_back( Release( pDim)) ; return vpObj ; } - else + else { + m_mError_count["annotation"] += 1 ; break ; + } } case ON::AnnotationType::Radius : { const ON_DimRadial* onDimRad = ON_DimRadial::Cast( onAnnot) ; @@ -1475,8 +1489,10 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o vpObj.emplace_back( Release( pDim)) ; return vpObj ; } - else + else { + m_mError_count["annotation"] += 1 ; break ; + } } case ON::AnnotationType::Diameter : { const ON_DimRadial* onDimRad = ON_DimRadial::Cast( onAnnot) ; @@ -1494,14 +1510,16 @@ Import3dm::ConvertAnnotation( const ON_Annotation* onAnnot, const ON_DimStyle* o vpObj.emplace_back( Release( pDim)) ; return vpObj ; } - else + else { + m_mError_count["annotation"] += 1 ; break ; + } } default : + m_mError_count["annotation"] += 1 ; break ; } - m_mError_count["annotation"] += 1 ; return vpObj ; }