diff --git a/EGrDllMain.cpp b/EGrDllMain.cpp index 7326ab6..691468f 100644 --- a/EGrDllMain.cpp +++ b/EGrDllMain.cpp @@ -44,12 +44,13 @@ DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved) { if ( dwReason == DLL_PROCESS_ATTACH) { - #if defined( NDEBUG) - BOOL IsDbgPresent = FALSE ; - CheckRemoteDebuggerPresent( GetCurrentProcess(), &IsDbgPresent) ; - if ( IsDbgPresent) - return 0 ; - #endif + // Controllo commentato per problemi con VB.NET + //#if defined( NDEBUG) + // BOOL IsDbgPresent = FALSE ; + // CheckRemoteDebuggerPresent( GetCurrentProcess(), &IsDbgPresent) ; + // if ( IsDbgPresent) + // return 0 ; + //#endif s_hModule = hModule ; EGT_TRACE( "EgtGraphics.dll Initializing!\n") ; } diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 2fa6fc5..18c012b 100644 Binary files a/EgtGraphics.rc and b/EgtGraphics.rc differ diff --git a/ObjNewGraphics.cpp b/ObjNewGraphics.cpp index 214692c..ae69087 100644 --- a/ObjNewGraphics.cpp +++ b/ObjNewGraphics.cpp @@ -275,7 +275,7 @@ ObjNewGraphics::EndTriangles( void) bool ObjNewGraphics::Draw( int nStat, int nMark, bool bShowAux) { - if ( m_pScene == nullptr || ! m_pScene->MakeCurrent()) + if ( ! m_bValid || m_pScene == nullptr || ! m_pScene->MakeCurrent()) return false ; // se vuoto non faccio alcunché diff --git a/SceneGeom.cpp b/SceneGeom.cpp index d517132..2ce703a 100644 --- a/SceneGeom.cpp +++ b/SceneGeom.cpp @@ -151,7 +151,15 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, MdStMk siObj) // se non esiste grafica associata, la creo if ( pGeoObj->GetObjGraphics() == nullptr) { - ObjEGrGraphics* pGraphics = CreateObjEGrGraphics( m_bNewWay) ; + // nuova modalità grafica solo per superfici con molti triangoli + const int N_MIN_TRIA_NEWWAY = 100 ; + bool bNewWay = false ; + if ( m_bNewWay && nGeoType == SRF_TRIMESH) { + const ISurfTriMesh* pSTM = GetSurfTriMesh( pGeoObj) ; + if ( pSTM != nullptr && pSTM->GetTriangleNum() > N_MIN_TRIA_NEWWAY) + m_bNewWay = true ; + } + ObjEGrGraphics* pGraphics = CreateObjEGrGraphics( bNewWay) ; if ( pGraphics == nullptr) return false ; pGraphics->SetScene( this) ; @@ -219,9 +227,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, MdStMk siObj) pGraphics->AddColor( cCol) ; pGraphics->AddPolyLine( PL) ; // eventuali segni ausiliari (frecce,...) - Point3d ptStart ; - if ( PL.GetFirstPoint( ptStart)) - pGraphics->AddPoint( ptStart, true) ; + //Point3d ptStart ; + //if ( PL.GetFirstPoint( ptStart)) + // pGraphics->AddPoint( ptStart, true) ; PolyLine PLA ; if ( CalcCurveTipArrow( PL, PLA)) pGraphics->AddPolyLine( PLA, true) ;