EgtGraphics 2.6h2 :
- modifiche per permettere Mark di tipo 2.
This commit is contained in:
Binary file not shown.
+5
-5
@@ -377,9 +377,9 @@ ObjNewGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
float fSelMarkCol[4] = { 1, 1, 1, 1} ;
|
||||
float fSelMarkBackCol[4] = { 0.75, 0.75, 0.75, 1} ;
|
||||
if ( bSurfSha) {
|
||||
if ( nMark == GDB_MK_ON) {
|
||||
if ( nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) {
|
||||
bStdCol = false ;
|
||||
Color colMark = m_pScene->GetMark() ;
|
||||
Color colMark = m_pScene->GetMark( nMark) ;
|
||||
colMark.SetAlpha( nAlpha) ;
|
||||
colMark.GetFloat( fSelMarkCol) ;
|
||||
Color colMarkBack = GetSurfBackColor( colMark) ;
|
||||
@@ -468,7 +468,7 @@ ObjNewGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
}
|
||||
|
||||
// se marcato e non superficie in shading, disegno halo
|
||||
if ( nMark == GDB_MK_ON && ! bSurfSha) {
|
||||
if ( ( nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) && ! bSurfSha) {
|
||||
// cambio test di depth per non sovrascrivere il disegno appena fatto
|
||||
glDepthFunc( GL_LESS) ;
|
||||
|
||||
@@ -477,7 +477,7 @@ ObjNewGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
glLineWidth( (float) m_pScene->GetMarkLineWidth()) ;
|
||||
|
||||
// colore di marcatura
|
||||
Color colMark = m_pScene->GetMark() ;
|
||||
Color colMark = m_pScene->GetMark( nMark) ;
|
||||
glColor4f( colMark.GetRed(), colMark.GetGreen(), colMark.GetBlue(), colMark.GetAlpha()) ;
|
||||
|
||||
// ciclo di disegno
|
||||
@@ -521,7 +521,7 @@ ObjNewGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
}
|
||||
|
||||
// se necessario, ripristino la normale visualizzazione
|
||||
if ( nStat == GDB_ST_SEL || nMark == GDB_MK_ON) {
|
||||
if ( nStat == GDB_ST_SEL || nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) {
|
||||
glPointSize( (float) m_pScene->GetPointSize()) ;
|
||||
glLineWidth( (float) m_pScene->GetLineWidth()) ;
|
||||
}
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ObjEGrGraphics.h"
|
||||
|
||||
#include "OpenGL.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Definizione di NgAtom
|
||||
@@ -87,7 +87,7 @@ class ObjNewGraphics : public ObjEGrGraphics
|
||||
{ b3Loc = m_b3Loc ; return ! m_b3Loc.IsEmpty() ; }
|
||||
|
||||
public :
|
||||
ObjNewGraphics( void) : m_pScene( nullptr), m_bValid( false) {}
|
||||
ObjNewGraphics( void) : m_pScene( nullptr), m_bValid( false), m_nCurrMode( GL_NONE) {}
|
||||
|
||||
private :
|
||||
bool DeleteVaoVbo( void) ;
|
||||
|
||||
+9
-6
@@ -245,6 +245,9 @@ AdjustColor( const float fCol[4], bool bDark)
|
||||
bool
|
||||
ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlpha, bool bShowAux)
|
||||
{
|
||||
if ( ! m_bValid || m_pScene == nullptr || ! m_pScene->MakeCurrent())
|
||||
return false ;
|
||||
|
||||
// se vuoto non faccio alcunché
|
||||
if ( m_ogaVect.size() == 0)
|
||||
return true ;
|
||||
@@ -262,9 +265,9 @@ ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
float fSelMarkCol[4] = { 1, 1, 1, 1} ;
|
||||
float fSelMarkBackCol[4] = { 0.75, 0.75, 0.75, 1} ;
|
||||
if ( bSurfSha) {
|
||||
if ( nMark == GDB_MK_ON) {
|
||||
if ( nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) {
|
||||
bStdCol = false ;
|
||||
Color colMark = ( ( GetScene() != nullptr) ? GetScene()->GetMark() : Color( 255, 255, 0)) ;
|
||||
Color colMark = m_pScene->GetMark( nMark) ;
|
||||
colMark.SetAlpha( nAlpha) ;
|
||||
colMark.GetFloat( fSelMarkCol) ;
|
||||
Color colMarkBack = GetSurfBackColor( colMark) ;
|
||||
@@ -273,7 +276,7 @@ ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
}
|
||||
else if ( nStat == GDB_ST_SEL) {
|
||||
bStdCol = false ;
|
||||
Color colSelSurf = ( ( GetScene() != nullptr) ? GetScene()->GetSelSurf() : Color( 255, 255, 192)) ;
|
||||
Color colSelSurf = m_pScene->GetSelSurf() ;
|
||||
colSelSurf.SetAlpha( nAlpha) ;
|
||||
colSelSurf.GetFloat( fSelMarkCol) ;
|
||||
Color colSelSurfBack = GetSurfBackColor( colSelSurf) ;
|
||||
@@ -370,7 +373,7 @@ ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
}
|
||||
|
||||
// se marcato e non superficie in shading, disegno halo
|
||||
if ( nMark == GDB_MK_ON && ! bSurfSha) {
|
||||
if ( ( nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) && ! bSurfSha) {
|
||||
// cambio test di depth per non sovrascrivere il disegno appena fatto
|
||||
glDepthFunc( GL_LESS) ;
|
||||
|
||||
@@ -379,7 +382,7 @@ ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
glLineWidth( (float) m_pScene->GetMarkLineWidth()) ;
|
||||
|
||||
// colore di marcatura
|
||||
Color colMark = ( ( GetScene() != nullptr) ? GetScene()->GetMark() : Color( 192, 192, 0)) ;
|
||||
Color colMark = m_pScene->GetMark( nMark) ;
|
||||
glColor4f( colMark.GetRed(), colMark.GetGreen(), colMark.GetBlue(), colMark.GetAlpha()) ;
|
||||
|
||||
// ciclo di disegno
|
||||
@@ -433,7 +436,7 @@ ObjOldGraphics::Draw( int nStat, int nMark, bool bSurfSha, bool bSurf, int nAlph
|
||||
}
|
||||
|
||||
// se necessario, ripristino la normale visualizzazione
|
||||
if ( nStat == GDB_ST_SEL || nMark == GDB_MK_ON) {
|
||||
if ( nStat == GDB_ST_SEL || nMark == GDB_MK_ON || nMark == GDB_MK_ON_2) {
|
||||
glPointSize( (float) m_pScene->GetPointSize()) ;
|
||||
glLineWidth( (float) m_pScene->GetLineWidth()) ;
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ class Scene : public IEGrScene
|
||||
bool SetExtension( const BBox3d& b3Ext) override ;
|
||||
bool UpdateExtension( void) override ;
|
||||
bool SetMark( Color colMark) override ;
|
||||
bool SetMark2( Color colMark) override ;
|
||||
bool SetSelSurf( Color colSelSurf) override ;
|
||||
bool SetLineWidth( int nW) override ;
|
||||
// Grid
|
||||
@@ -228,8 +229,8 @@ class Scene : public IEGrScene
|
||||
double GetFrameLineWidth( void) const
|
||||
{ return m_dFrameLineWidth ; }
|
||||
// Geometry
|
||||
Color GetMark( void) const
|
||||
{ return m_colMark ; }
|
||||
Color GetMark( int nMark) const
|
||||
{ return ( nMark == GDB_MK_ON_2 ? m_colMark2 : m_colMark) ; }
|
||||
Color GetSelSurf( void) const
|
||||
{ return m_colSelSurf ; }
|
||||
|
||||
@@ -345,6 +346,7 @@ class Scene : public IEGrScene
|
||||
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
|
||||
Color m_colDef ; // colore di default
|
||||
Color m_colMark ; // colore per marcatura
|
||||
Color m_colMark2 ; // colore per marcatura di tipo 2
|
||||
Color m_colSelSurf ; // colore di superficie selezionata
|
||||
// Superfici semitrasparenti
|
||||
ASURFVECTOR m_vAlphaSurf ; // vettore temporaneo di superfici semitrasparenti
|
||||
|
||||
@@ -89,6 +89,7 @@ Scene::Scene( void)
|
||||
m_pGeomDB = nullptr ;
|
||||
m_colDef.Set( 0, 0, 0) ;
|
||||
m_colMark.Set( 255, 255, 0) ;
|
||||
m_colMark2.Set( 255, 64, 64) ;
|
||||
m_colSelSurf.Set( 255, 255, 192) ;
|
||||
// Superfici semitrasparenti
|
||||
m_vAlphaSurf.reserve( 100) ;
|
||||
|
||||
@@ -64,6 +64,14 @@ Scene::SetMark( Color colMark)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Scene::SetMark2( Color colMark)
|
||||
{
|
||||
m_colMark2 = colMark ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Scene::SetSelSurf( Color colSelSurf)
|
||||
|
||||
Reference in New Issue
Block a user