EgtGraphics :

- gestione punti notevoli delle quotature.
This commit is contained in:
Dario Sassi
2020-01-02 08:26:55 +00:00
parent a7bc25e723
commit 43e1db36fa
3 changed files with 154 additions and 2 deletions
+44
View File
@@ -25,6 +25,7 @@
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
#include "/EgtDev/Include/EGkExtText.h"
#include "/EgtDev/Include/EGkExtDimension.h"
#include "/EgtDev/Include/EGkIntersLinePlane.h"
#include "/EgtDev/Include/EGkIntersLineSurfTm.h"
#include "/EgtDev/Include/EGkGdbConst.h"
@@ -458,5 +459,48 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
ptSel = ptP ;
}
}
// se quotatura
else if ( pGObj->GetType() == EXT_DIMENSION) {
// recupero la quotatura
const IExtDimension* pDim = GetExtDimension( pGObj) ;
// verifico sia valida
if ( pDim->IsValid()) {
// cerco il punto
double dMinSqDist = INFINITO * INFINITO ;
Point3d ptP ;
// punto iniziale
ptP = pDim->GetStart() ;
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto sopra iniziale
ptP = pDim->GetOverStart() ;
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto finale
ptP = pDim->GetEnd() ;
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto sopra finale
ptP = pDim->GetOverEnd() ;
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto medio
if ( pDim->GetMidPoint( ptP)) {
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
}
// centro
if ( pDim->GetCenterPoint( ptP)) {
ptP.ToGlob( frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
}
}
}
return true ;
}