EgtExch3dm :

- piccola correzione al log errori.
This commit is contained in:
Daniele Bariletti
2025-04-22 12:00:20 +02:00
parent becf06ffed
commit 38d15bf412
+27 -9
View File
@@ -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<ICurve> 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 ;
}