From 7ffdfed1219d1ae6a8a2779c922eda5e9c6c6c9e Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 11 Feb 2015 11:43:54 +0000 Subject: [PATCH] =?UTF-8?q?EgtGraphics=201.6b2=20:=20-=20spostato=20disegn?= =?UTF-8?q?o=20griglia=20per=20modalit=C3=A0=20hiddenline.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtGraphics.rc | Bin 11580 -> 11580 bytes EgtGraphics.vcxproj | 8 ++++---- OpenGL.h | 1 + SceneBasic.cpp | 11 +++++++---- SceneGrid.cpp | 6 +++--- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 905cc4ffbcc98ea1383c6825dd4bbe1eb354b0fb..05d5b4974735d64f2f499a2f8db9166547c3ef8b 100644 GIT binary patch delta 96 zcmdlJwI^!BFE&P_&4qG;%#22p3%PVRZ&37L+}y-%0ptUP_cKkd63l~0P5vNxV)H$r RZJ08fKS(yPpc~V}4FFnYAdUb4 delta 96 zcmdlJwI^!BFE&QQ&4qG;%#4PU3%PVRZ&37L+}y-%0ptUP_cKkd63l~0P5vNxV)H$r RZJ08fKS(yPpc~V}4FFi@Acg<{ diff --git a/EgtGraphics.vcxproj b/EgtGraphics.vcxproj index fbb119c..8129c45 100644 --- a/EgtGraphics.vcxproj +++ b/EgtGraphics.vcxproj @@ -150,7 +150,7 @@ copy $(TargetPath) \EgtProg\DllD64 Level3 Use - Full + MaxSpeed true true WIN32;I_AM_EGR;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) @@ -162,7 +162,7 @@ copy $(TargetPath) \EgtProg\DllD64 StreamingSIMDExtensions2 - false + true Windows @@ -182,7 +182,7 @@ copy $(TargetPath) \EgtProg\Dll32 Level3 Use - Full + MaxSpeed true true WIN32;I_AM_EGR;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) @@ -193,7 +193,7 @@ copy $(TargetPath) \EgtProg\Dll32 true - false + true NotSet diff --git a/OpenGL.h b/OpenGL.h index 58361ea..2e40e7b 100644 --- a/OpenGL.h +++ b/OpenGL.h @@ -14,5 +14,6 @@ #pragma once #define GLEW_MX +#define NOMINMAX #include "/EgtDev/Extern/GLEW/Include/glew.h" #include "/EgtDev/Extern/GLEW/Include/wglew.h" diff --git a/SceneBasic.cpp b/SceneBasic.cpp index fd1334f..05b0047 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -666,10 +666,6 @@ Scene::Draw( void) glDepthFunc( GL_LEQUAL) ; glEnable( GL_DEPTH_TEST) ; - // disegno griglia senza illuminazione - glDisable( GL_LIGHTING) ; - DrawGrid() ; - // aggiorno il colore di default if ( m_pGeomDB != nullptr) m_pGeomDB->GetDefaultMaterial( m_colDef) ; @@ -682,6 +678,8 @@ Scene::Draw( void) case SM_WIREFRAME : // disabilito illuminazione glDisable( GL_LIGHTING) ; + // disegno griglia senza illuminazione (già impostato) + DrawGrid() ; // imposto disegno wireframe anche per poligoni glPolygonMode( GL_FRONT_AND_BACK, GL_LINE) ; // disegno le geometrie del DB in una sola passata @@ -699,11 +697,16 @@ Scene::Draw( void) DrawGroup( GDB_ID_ROOT, 1, MdStMk( GDB_MD_STD, GDB_ST_ON, GDB_MK_OFF)) ; glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE) ; glDisable( GL_POLYGON_OFFSET_FILL) ; + // disegno griglia senza illuminazione (già impostato) + DrawGrid() ; // seconda passata per tutto in forma 0dim e curve glPolygonMode( GL_FRONT_AND_BACK, GL_LINE) ; DrawGroup( GDB_ID_ROOT, 2, MdStMk( GDB_MD_STD, GDB_ST_ON, GDB_MK_OFF)) ; break ; case SM_SHADING : + // disegno griglia senza illuminazione + glDisable( GL_LIGHTING) ; + DrawGrid() ; // imposto disegno shading per poligoni con davanti e dietro diversificati glPolygonMode( GL_FRONT_AND_BACK, GL_FILL) ; glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE) ; diff --git a/SceneGrid.cpp b/SceneGrid.cpp index 853f061..946a3f2 100644 --- a/SceneGrid.cpp +++ b/SceneGrid.cpp @@ -15,8 +15,8 @@ #include "stdafx.h" #include "Scene.h" #include "EGrUtils.h" - - +#include + using namespace std ; //---------------------------------------------------------------------------- @@ -33,7 +33,7 @@ bool Scene::SetGridGeo( double dSnapStep, int nMinLineSstep, int nMajLineSstep, int nExtSstep) { const double MIN_SNAP_STEP = 0.1 ; - m_dSnapStep = max( fabs( dSnapStep), MIN_SNAP_STEP) ; + m_dSnapStep = std::max( fabs( dSnapStep), MIN_SNAP_STEP) ; m_nMinLineSstep = abs( nMinLineSstep) ; m_nMajLineSstep = abs( nMajLineSstep) ; m_nExtSstep = abs( nExtSstep) ;