EgtGraphics 2.5g1 :

- aggiunta gestione Stipple per GeoPoint3d, GeoVector3d e GeoCurve.
This commit is contained in:
DarioS
2023-07-10 11:16:17 +02:00
parent 1704b40c17
commit 00a81d6e04
9 changed files with 244 additions and 124 deletions
+17 -10
View File
@@ -276,6 +276,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
// calcolo la grafica
pGraphics->Clear() ;
pGraphics->AddColor( siObj.colObj) ;
int nFactor, nPattern ;
if ( iIter.GetStipple( nFactor, nPattern) && nFactor != 0)
pGraphics->AddLineStipple( nFactor, nPattern) ;
PolyLine PL ;
if ( pVector->GetDrawWithArrowHead( 0.1, 10, PL))
pGraphics->AddPolyLine(PL) ;
@@ -291,6 +294,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
// calcolo la grafica
pGraphics->Clear() ;
pGraphics->AddColor( siObj.colObj) ;
int nFactor, nPattern ;
if ( iIter.GetStipple( nFactor, nPattern) && nFactor != 0)
pGraphics->AddLineStipple( nFactor, nPattern) ;
pGraphics->AddPoint( pPoint->GetPoint()) ;
}
// se riferimento
@@ -321,6 +327,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
pCurve->ApproxWithLines( EPS_SMALL, ANG_TOL_GRAPH_DEG, ICurve::APL_SPECIAL, PL) ;
pGraphics->Clear() ;
pGraphics->AddColor( siObj.colObj) ;
int nFactor, nPattern ;
if ( iIter.GetStipple( nFactor, nPattern) && nFactor != 0)
pGraphics->AddLineStipple( nFactor, nPattern) ;
pGraphics->AddPolyLine( PL) ;
// eventuali segni ausiliari (mark, frecce, ...)
Vector3d vtRef ;
@@ -725,17 +734,15 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
Frame3d frTxr ;
iIter.GetTextureFrame( frTxr) ;
// creo piano per la S
GLfloat PlaneS[4] ;
PlaneS[0] = GLfloat( frTxr.VersX().x / dTextDimS) ;
PlaneS[1] = GLfloat( frTxr.VersX().y / dTextDimS) ;
PlaneS[2] = GLfloat( frTxr.VersX().z / dTextDimS) ;
PlaneS[3] = GLfloat( - frTxr.VersX() * ( frTxr.Orig() - ORIG) / dTextDimS) ;
GLfloat PlaneS[4] { GLfloat( frTxr.VersX().x / dTextDimS),
GLfloat( frTxr.VersX().y / dTextDimS),
GLfloat( frTxr.VersX().z / dTextDimS),
GLfloat( -frTxr.VersX() * ( frTxr.Orig() - ORIG) / dTextDimS)} ;
// creo piano per la T
GLfloat PlaneT[4] ;
PlaneT[0] = GLfloat( frTxr.VersY().x / dTextDimT) ;
PlaneT[1] = GLfloat( frTxr.VersY().y / dTextDimT) ;
PlaneT[2] = GLfloat( frTxr.VersY().z / dTextDimT) ;
PlaneT[3] = GLfloat( - frTxr.VersY() * ( frTxr.Orig() - ORIG) / dTextDimT) ;
GLfloat PlaneT[4] { GLfloat( frTxr.VersY().x / dTextDimT),
GLfloat( frTxr.VersY().y / dTextDimT),
GLfloat( frTxr.VersY().z / dTextDimT),
GLfloat( -frTxr.VersY() * ( frTxr.Orig() - ORIG) / dTextDimT)} ;
// setto generazione automatica coordinate S e T per texture
glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR) ;
glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR) ;