From 1636334642bc14ebba2374d603df5126384695a4 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 13 Feb 2014 18:14:35 +0000 Subject: [PATCH] EgtGraphics : - versioni release con ottimizzazione /Ox ; - varie migliorie. --- EGrDllMain.cpp | 6 ++-- EgtGraphics.rc | Bin 7490 -> 11390 bytes EgtGraphics.vcxproj | 17 +++++++---- EgtGraphics.vcxproj.filters | 3 ++ SceneBasic.cpp | 2 +- SceneGeom.cpp | 57 ++++++++++++++++++++++-------------- 6 files changed, 53 insertions(+), 32 deletions(-) diff --git a/EGrDllMain.cpp b/EGrDllMain.cpp index 2fd70c5..1b3bbf8 100644 --- a/EGrDllMain.cpp +++ b/EGrDllMain.cpp @@ -13,9 +13,9 @@ //--------------------------- Include ---------------------------------------- #include "stdafx.h" -#include <\EgtDev\Include\EGrDllMain.h> -#include <\EgtDev\Include\EGnGetModuleVer.h> -#include <\EgtDev\Include\EgtTrace.h> +#include "/EgtDev/Include/EGrDllMain.h" +#include "/EgtDev/Include/EGnGetModuleVer.h" +#include "/EgtDev/Include/EgtTrace.h" //--------------------------- Costanti ---------------------------------------- #if defined( _WIN64) diff --git a/EgtGraphics.rc b/EgtGraphics.rc index 791695fb5a1bee57008f9fe03b4946a0993f075f..106f38bb739a1f0c9a36aed12f4556ca13b19e75 100644 GIT binary patch delta 72 zcmX?P^)F(>36aS%yb;W13?`GydGkT^=9j#JtYAhUw=~n_JFFaF+2^bf*+{mpEKu3g LjGIr0RB-?RBk&bd delta 16 XcmewtamZ@J36aTWIue^@RFXIVLJS5; diff --git a/EgtGraphics.vcxproj b/EgtGraphics.vcxproj index 7817673..9c150ea 100644 --- a/EgtGraphics.vcxproj +++ b/EgtGraphics.vcxproj @@ -94,6 +94,7 @@ WIN32;I_AM_EGR;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true false + true Windows @@ -105,7 +106,7 @@ copy $(TargetDir)$(TargetName).lib \EgtDev\Lib\ copy $(TargetPath) \EgtProg\Dll32 - _UNICODE;UNICODE;_DEB32;%(PreprocessorDefinitions) + _UNICODE;UNICODE;_DEBUG;_DEB32;%(PreprocessorDefinitions) @@ -116,6 +117,7 @@ copy $(TargetPath) \EgtProg\Dll32 WIN32;I_AM_EGR;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true false + true Windows @@ -127,20 +129,21 @@ copy $(TargetDir)$(TargetName).lib \EgtDev\Lib\ copy $(TargetPath) \EgtProg\Dll64 - _UNICODE;UNICODE;_DEB32;%(PreprocessorDefinitions) + _UNICODE;UNICODE;_DEBUG;_DEB64;%(PreprocessorDefinitions) Level3 Use - MaxSpeed + Full true true WIN32;I_AM_EGR;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true Speed AnySuitable + true Windows @@ -153,14 +156,14 @@ copy $(TargetPath) \EgtProg\Dll64 copy $(TargetPath) \EgtProg\Dll32 - _UNICODE;UNICODE;NDEB32;%(PreprocessorDefinitions) + _UNICODE;UNICODE;NDEBUG;NDEB32;%(PreprocessorDefinitions) Level3 Use - MaxSpeed + Full true true WIN32;I_AM_EGR;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) @@ -168,6 +171,7 @@ copy $(TargetPath) \EgtProg\Dll32 Speed AnySuitable false + true Windows @@ -180,12 +184,13 @@ copy $(TargetPath) \EgtProg\Dll32 copy $(TargetPath) \EgtProg\Dll64 - _UNICODE;UNICODE;NDEB32;%(PreprocessorDefinitions) + _UNICODE;UNICODE;NDEBUG;NDEB64;%(PreprocessorDefinitions) + diff --git a/EgtGraphics.vcxproj.filters b/EgtGraphics.vcxproj.filters index d1c022d..ea4dbd0 100644 --- a/EgtGraphics.vcxproj.filters +++ b/EgtGraphics.vcxproj.filters @@ -30,6 +30,9 @@ File di intestazione + + File di intestazione + diff --git a/SceneBasic.cpp b/SceneBasic.cpp index 1303389..94d9251 100644 --- a/SceneBasic.cpp +++ b/SceneBasic.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2013-2014 //---------------------------------------------------------------------------- -// File : Scene.cpp Data : 03.02.14 Versione : 1.5b1 +// File : SceneBasic.cpp Data : 03.02.14 Versione : 1.5b1 // Contenuto : Implementazione della classe gestione scena. // // diff --git a/SceneGeom.cpp b/SceneGeom.cpp index c2ac939..b417cc4 100644 --- a/SceneGeom.cpp +++ b/SceneGeom.cpp @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- // EgalTech 2013-2014 //---------------------------------------------------------------------------- -// File : EgrSceneGeom.cpp Data : 10.02.14 Versione : 1.5b1 +// File : SceneGeom.cpp Data : 10.02.14 Versione : 1.5b1 // Contenuto : Implementazione della gestione geometria della classe scena. // // @@ -23,38 +23,52 @@ using namespace std ; +//------------------------------ Constants ----------------------------------- +const int OGLMAT_DIM = 16 ; -/*------------------------------------------------------------------------------------------*/ + +//---------------------------------------------------------------------------- +bool +FrameToOpenGlMatrix( const Frame3d& frFrame, double Matrix[OGLMAT_DIM]) +{ + if ( frFrame.GetType() == Frame3d::ERR) + return false ; + + Matrix[0] = frFrame.VersX().x ; + Matrix[1] = frFrame.VersX().y ; + Matrix[2] = frFrame.VersX().z ; + Matrix[3] = 0 ; + Matrix[4] = frFrame.VersY().x ; + Matrix[5] = frFrame.VersY().y ; + Matrix[6] = frFrame.VersY().z ; + Matrix[7] = 0 ; + Matrix[8] = frFrame.VersZ().x ; + Matrix[9] = frFrame.VersZ().y ; + Matrix[10] = frFrame.VersZ().z ; + Matrix[11] = 0 ; + Matrix[12] = frFrame.Orig().x ; + Matrix[13] = frFrame.Orig().y ; + Matrix[14] = frFrame.Orig().z ; + Matrix[15] = 1 ; + + return true ; +} + +//---------------------------------------------------------------------------- bool Scene::DrawGroup( int nId) { // recupero il riferimento del gruppo Frame3d frFrame ; - //if ( ! m_pGeomDB->GetGroupGlobFrame( nId, frFrame)) if ( ! m_pGeomDB->GetGroupFrame( nId, frFrame)) return false ; // se non è identità, lo imposto nello stack delle matrici MODELVIEW di OpenGL bool bMatrix = ( frFrame.GetType() != Frame3d::TOP || ! frFrame.Orig().IsSmall()) ; if ( bMatrix) { glPushMatrix() ; - double Matrix[16] ; - Matrix[0] = frFrame.VersX().x ; - Matrix[1] = frFrame.VersX().y ; - Matrix[2] = frFrame.VersX().z ; - Matrix[3] = 0 ; - Matrix[4] = frFrame.VersY().x ; - Matrix[5] = frFrame.VersY().y ; - Matrix[6] = frFrame.VersY().z ; - Matrix[7] = 0 ; - Matrix[8] = frFrame.VersZ().x ; - Matrix[9] = frFrame.VersZ().y ; - Matrix[10] = frFrame.VersZ().z ; - Matrix[11] = 0 ; - Matrix[12] = frFrame.Orig().x ; - Matrix[13] = frFrame.Orig().y ; - Matrix[14] = frFrame.Orig().z ; - Matrix[15] = 1 ; - glMultMatrixd( Matrix) ; + double Matrix[OGLMAT_DIM] ; + if ( FrameToOpenGlMatrix( frFrame, Matrix)) + glMultMatrixd( Matrix) ; } // creo un iteratore PtrOwner pIter( CreateGdbIterator()) ; @@ -75,7 +89,6 @@ Scene::DrawGroup( int nId) pCurve->ApproxWithLines( 0.1, 5, PL) ; glBegin( GL_LINE_STRIP) ; for ( bFound = PL.GetFirstPoint( ptP) ; bFound ; bFound = PL.GetNextPoint( ptP)) { - //ptP.ToGlob( frFrame) ; glVertex3f( (GLfloat)ptP.x, (GLfloat)ptP.y, (GLfloat)ptP.z) ; } glEnd() ;