From b8545edeff6cbfe886214e9ebbf44e3b400cd1e0 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 3 Jun 2014 13:21:22 +0000 Subject: [PATCH] =?UTF-8?q?EgtGraphics=201.5f1=20:=20-=20a=20parit=C3=A0?= =?UTF-8?q?=20di=20Zdepth=20le=20entit=C3=A0=20disegnate=20dopo=20sovrasci?= =?UTF-8?q?vono=20le=20precedenti=20-=20aggiunta=20visualizzazione=20testi?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtGraphics.rc | Bin 11390 -> 11390 bytes ObjNewGraphics.cpp | 5 +++++ ObjOldGraphics.cpp | 5 +++++ SceneBasic.cpp | 2 +- SceneGeom.cpp | 16 ++++++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 152c6ebbf3580d453ba9fa37676ec8c5514aa32d..67eeda8eeea0126b267027c5f3678b179236368d 100644 GIT binary patch delta 81 zcmewt@h@V-CpJd2&H7@8nI_Lu2w+Ux{9eJGakC${2{Tw&pBX3=F9{U-C4?$e&4RA4 GpBn&&hZ>mx delta 81 zcmewt@h@V-CpJdY&H7@8nI_Lu2w+Uz{9eJGakC${2{Tw&pBX3=F9{U-C4?$e&4RA4 GpBn&%RT_~1 diff --git a/ObjNewGraphics.cpp b/ObjNewGraphics.cpp index dd30fe5..c58ff98 100644 --- a/ObjNewGraphics.cpp +++ b/ObjNewGraphics.cpp @@ -286,6 +286,9 @@ ObjNewGraphics::Draw( int nStat, int nMark) // se marcato, disegno halo if ( nMark == GDB_MK_ON) { + // cambio test di depth per non sovrascrivere il disegno appena fatto + glDepthFunc( GL_LESS) ; + // dimensioni per halo glPointSize( 7) ; glLineWidth( 5) ; @@ -308,6 +311,8 @@ ObjNewGraphics::Draw( int nStat, int nMark) // non si impostano i colori, si usa quello di marcatura } } + // ripristino test di depth + glDepthFunc( GL_LEQUAL) ; } // se necessario, ripristino la normale visualizzazione diff --git a/ObjOldGraphics.cpp b/ObjOldGraphics.cpp index 5c80a6e..eb198da 100644 --- a/ObjOldGraphics.cpp +++ b/ObjOldGraphics.cpp @@ -211,6 +211,9 @@ ObjOldGraphics::Draw( int nStat, int nMark) // se marcato, disegno halo if ( nMark == GDB_MK_ON) { + // cambio test di depth per non sovrascrivere il disegno appena fatto + glDepthFunc( GL_LESS) ; + // dimensioni per halo glPointSize( 7) ; glLineWidth( 5) ; @@ -236,6 +239,8 @@ ObjOldGraphics::Draw( int nStat, int nMark) // non si impostano i colori, si usa quello di marcatura } } + // ripristino test di depth + glDepthFunc( GL_LEQUAL) ; } // se necessario, ripristino la normale visualizzazione diff --git a/SceneBasic.cpp b/SceneBasic.cpp index 1ed269c..5e05c60 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -627,7 +627,7 @@ Scene::Draw( void) return false ; // imposto l'utilizzo dello Zbuffer - glDepthFunc( GL_LESS) ; + glDepthFunc( GL_LEQUAL) ; glEnable( GL_DEPTH_TEST) ; // aggiorno il colore di default diff --git a/SceneGeom.cpp b/SceneGeom.cpp index 2869f39..d2dbbc1 100644 --- a/SceneGeom.cpp +++ b/SceneGeom.cpp @@ -25,6 +25,7 @@ #include "/EgtDev/Include/EGkGeoPoint3d.h" #include "/EgtDev/Include/EGkCurve.h" #include "/EgtDev/Include/EGkSurfTriMesh.h" +#include "/EgtDev/Include/EGkExtText.h" #include "/EgtDev/Include/EGkGdbFunct.h" using namespace std ; @@ -278,6 +279,21 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, MdStMk siObj) } pGraphics->EndTriangles() ; } + // se testo + else if ( nGeoType == EXT_TEXT) { + // recupero il testo + const IExtText* pTXT = GetExtText( pGeoObj) ; + if ( pTXT == nullptr) + return false ; + // calcolo la grafica + POLYLINELIST lstPL ; + pTXT->ApproxWithLines( 0.01, 5, lstPL) ; + pGraphics->Clear() ; + pGraphics->AddColor( cCol) ; + POLYLINELIST::iterator Iter ; + for ( Iter = lstPL.begin() ; Iter != lstPL.end() ; ++ Iter) + pGraphics->AddPolyLine( *Iter) ; + } } // se hiddenline