EgtGraphics :

- modifiche per sfruttare nuove funzioni di conversione tra riferimenti per Vector3d e Point3d.
This commit is contained in:
DarioS
2022-08-23 11:41:56 +02:00
parent 5e317faba6
commit 7cf97007df
4 changed files with 72 additions and 148 deletions
+16 -32
View File
@@ -275,24 +275,21 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
// recupero il geo-punto
const IGeoPoint3d* pGP = GetGeoPoint3d( pGObj) ;
// recupero il punto
ptSel = pGP->GetPoint() ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( pGP->GetPoint(), frEnt) ;
}
// se vettore
else if ( pGObj->GetType() == GEO_VECT3D) {
// recupero il geo-vettore
const IGeoVector3d* pGV = GetGeoVector3d( pGObj) ;
// recupero il punto
ptSel = pGV->GetBase() ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( pGV->GetBase(), frEnt) ;
}
// se frame
else if ( pGObj->GetType() == GEO_FRAME3D) {
// recupero il geo-frame
const IGeoFrame3d* pGF = GetGeoFrame3d( pGObj) ;
// recupero il punto
ptSel = pGF->GetFrame().Orig() ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( pGF->GetFrame().Orig(), frEnt) ;
}
// se curva
else if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
@@ -310,8 +307,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
MinDistPCInfo mdInfo ;
DistPointCurve dstPtCurve( ptRef, *pCrv) ;
if ( dstPtCurve.GetMinDistInfo( 0, mdInfo)) {
Point3d ptP = mdInfo.ptQ ;
ptP.ToGlob( frEnt) ;
Point3d ptP = GetToGlob( mdInfo.ptQ, frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist)) {
ptSel = ptP ;
nAux = int( mdInfo.dPar) ;
@@ -325,14 +321,12 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
vtExtr *= dTh ;
vtExtr.ToGlob( frEnt) ;
// correggo il punto di riferimento del contrario dell'estrusione
Vector3d vtTemp = vtExtr ;
vtTemp.ToLoc( frEnt) ;
Vector3d vtTemp = GetToLoc( vtExtr, frEnt) ;
// determino il punto più vicino della curva a questo
MinDistPCInfo mdInfo ;
DistPointCurve dstPtCurve( ptRef - vtTemp, *pCrv) ;
if ( dstPtCurve.GetMinDistInfo( 0, mdInfo)) {
Point3d ptP = mdInfo.ptQ ;
ptP.ToGlob( frEnt) ;
Point3d ptP = GetToGlob( mdInfo.ptQ, frEnt) ;
ptP += vtExtr ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist)) {
ptSel = ptP ;
@@ -353,8 +347,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
// lo porto nel frame della superficie
ptRef.ToLoc( frEnt) ;
// recupero la direzione di mira e la porto nel riferimento della superficie
Vector3d vtDir = - m_vtDirCamera ;
vtDir.ToLoc( frEnt) ;
Vector3d vtDir = GetToLoc( -m_vtDirCamera, frEnt) ;
// recupero il raggio del box di ingombro
double dBlRad = 1000 ;
const ObjEGrGraphics* pGraphics = GetObjEGrGraphics( pStm) ;
@@ -371,8 +364,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
if ( ! IntersLineSurfTm( ptMir, vtDir, dLenMir, *pStm, vInfo) || vInfo.size() == 0)
return false ;
// recupero il primo punto
ptSel = vInfo[0].ptI ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( vInfo[0].ptI, frEnt) ;
nAux = vInfo[0].nT ;
}
// se regione
@@ -387,8 +379,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
// lo porto nel frame della regione
ptRef.ToLoc( frEnt) ;
// recupero la direzione di mira e la porto nel riferimento della regione
Vector3d vtDir = - m_vtDirCamera ;
vtDir.ToLoc( frEnt) ;
Vector3d vtDir = GetToLoc( -m_vtDirCamera, frEnt) ;
// recupero il piano della regione
Plane3d plReg ;
plReg.Set( pReg->GetPlanePoint(), pReg->GetNormVersor()) ;
@@ -397,8 +388,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
if ( IntersLinePlane( ptRef, vtDir, INFINITO, plReg, ptInt, false) != ILPT_YES)
return false ;
// assegno il punto
ptSel = ptInt ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( ptInt, frEnt) ;
// determino il chunk
nAux = 0 ;
if ( pReg->GetChunkCount() > 1) {
@@ -429,8 +419,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
// lo porto nel frame della superficie
ptRef.ToLoc( frEnt) ;
// recupero la direzione di mira e la porto nel riferimento della superficie
Vector3d vtDir = - m_vtDirCamera ;
vtDir.ToLoc( frEnt) ;
Vector3d vtDir = GetToLoc( -m_vtDirCamera, frEnt) ;
// recupero il raggio del box di ingombro
double dBlRad = 1000 ;
const ObjEGrGraphics* pGraphics = GetObjEGrGraphics( pStm) ;
@@ -447,8 +436,7 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
if ( ! IntersLineSurfTm( ptMir, vtDir, dLenMir, *pStm, vInfo) || vInfo.size() == 0)
return false ;
// recupero il primo punto
ptSel = vInfo[0].ptI ;
ptSel.ToGlob( frEnt) ;
ptSel = GetToGlob( vInfo[0].ptI, frEnt) ;
nAux = 0 ;
}
// se testo
@@ -505,23 +493,19 @@ Scene::GetPointFromSelect( int nSelId, const Point3d& ptView, Point3d& ptSel, in
double dMinSqDist = INFINITO * INFINITO ;
Point3d ptP ;
// punto iniziale
ptP = pDim->GetStart() ;
ptP.ToGlob( frEnt) ;
ptP = GetToGlob( pDim->GetStart(), frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto sopra iniziale
ptP = pDim->GetOverStart() ;
ptP.ToGlob( frEnt) ;
ptP = GetToGlob( pDim->GetOverStart(), frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto finale
ptP = pDim->GetEnd() ;
ptP.ToGlob( frEnt) ;
ptP = GetToGlob( pDim->GetEnd(), frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto sopra finale
ptP = pDim->GetOverEnd() ;
ptP.ToGlob( frEnt) ;
ptP = GetToGlob( pDim->GetOverEnd(), frEnt) ;
if ( VerifySnapPoint( ptP, ptView, dMinSqDist))
ptSel = ptP ;
// punto medio