EgtGeomKernel 2.6c2 :
- modifiche a SurfTriMesh per flag visualizzazione spigoli vivi in shading - modifiche a VolZmap per flag visualizzazione spigoli vivi in shading - aggiunte funzioni PreSave, PostSave e PostLoad per consentire di convertire nuovi parametri delle entità in info prima del salvataggio e riprenderli alla lettura.
This commit is contained in:
+53
-12
@@ -14,10 +14,11 @@
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "VolZmap.h"
|
||||
#include "DistPointLine.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "GdbGeo.h"
|
||||
#include "NgeWriter.h"
|
||||
#include "NgeReader.h"
|
||||
#include "DistPointLine.h"
|
||||
#include "GeoConst.h"
|
||||
#include "/EgtDev/Include/EGkIntersLinePlane.h"
|
||||
#include "/EgtDev/Include/EGkUiUnits.h"
|
||||
@@ -34,7 +35,8 @@ GEOOBJ_REGISTER( VOL_ZMAP, NGE_V_ZMP, VolZmap) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
VolZmap::VolZmap(void)
|
||||
: m_nStatus( TO_VERIFY), m_nTempProp{0,0}, m_dTempParam{0.0,0.0}, m_dStep( 10.0), m_nMapNum( 0), m_nShape( GENERIC), m_nVoxNumPerBlock( N_VOXBLOCK),
|
||||
: m_nStatus( TO_VERIFY), m_nTempProp{0,0}, m_dTempParam{0.0,0.0}, m_bShowEdges( false),
|
||||
m_dStep( 10.0), m_nMapNum( 0), m_nShape( GENERIC), m_nVoxNumPerBlock( N_VOXBLOCK),
|
||||
m_nDexVoxRatio( 1), m_nNumBlock( 0), m_nConnectedCompoCount( 0), m_nCurrTool( -1),
|
||||
m_dToolLinTol( LIN_TOL_STD), m_dToolAngTolDeg( ANG_TOL_APPROX_DEG)
|
||||
{
|
||||
@@ -60,8 +62,16 @@ bool
|
||||
VolZmap::Clear( void)
|
||||
{
|
||||
m_nStatus = TO_VERIFY ;
|
||||
m_nTempProp[0] = 0 ;
|
||||
m_nTempProp[1] = 0 ;
|
||||
m_dTempParam[0] = 0.0 ;
|
||||
m_dTempParam[1] = 0.0 ;
|
||||
m_bShowEdges = false ;
|
||||
m_dStep = 10.0 ;
|
||||
m_nMapNum = 0 ;
|
||||
m_nShape = GENERIC ;
|
||||
m_nVoxNumPerBlock = N_VOXBLOCK ;
|
||||
m_nDexVoxRatio = 1 ;
|
||||
m_nNumBlock = 0 ;
|
||||
m_nConnectedCompoCount = 0 ;
|
||||
m_MapFrame.Reset() ;
|
||||
@@ -73,17 +83,12 @@ VolZmap::Clear( void)
|
||||
m_dMaxZ[i] = 0 ;
|
||||
m_Values[i].clear() ;
|
||||
}
|
||||
m_dStep = EPS_SMALL ;
|
||||
m_nTempProp[0] = 0 ;
|
||||
m_nTempProp[1] = 0 ;
|
||||
m_dTempParam[0] = 0.0 ;
|
||||
m_dTempParam[1] = 0.0 ;
|
||||
m_vTool.resize( 1) ;
|
||||
m_nCurrTool = 0 ;
|
||||
m_dToolLinTol = LIN_TOL_STD ;
|
||||
m_dToolAngTolDeg = ANG_TOL_APPROX_DEG ;
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
// imposto ri-creazione della grafica
|
||||
m_OGrMgr.Clear() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -150,6 +155,7 @@ VolZmap::CopyFrom( const VolZmap& vzmSrc)
|
||||
m_nTempProp[1] = vzmSrc.m_nTempProp[1] ;
|
||||
m_dTempParam[0] = vzmSrc.m_dTempParam[0] ;
|
||||
m_dTempParam[1] = vzmSrc.m_dTempParam[1] ;
|
||||
m_bShowEdges = vzmSrc.m_bShowEdges ;
|
||||
|
||||
// dimensiono membri legati ai blocchi
|
||||
m_BlockToUpdate = vzmSrc.m_BlockToUpdate ;
|
||||
@@ -175,7 +181,7 @@ VolZmap::CopyFrom( const VolZmap& vzmSrc)
|
||||
bool
|
||||
VolZmap::ResetGraphics( void)
|
||||
{
|
||||
m_OGrMgr.Reset() ;
|
||||
m_OGrMgr.Clear() ;
|
||||
for ( int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount)
|
||||
m_BlockToUpdate[nCount] = true ;
|
||||
return true ;
|
||||
@@ -318,6 +324,27 @@ VolZmap::Save( NgeWriter& ngeOut) const
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::PreSave( GdbGeo& Wrapper) const
|
||||
{
|
||||
// salvo il flag di visualizzazione spigoli vivi anche in shading (default false)
|
||||
if ( m_bShowEdges)
|
||||
Wrapper.SetInfo( GDB_SI_SHOWEDGES, true) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::PostSave( GdbGeo& Wrapper) const
|
||||
{
|
||||
// elimino eventuali info aggiunte nella PreSave
|
||||
Wrapper.RemoveInfo( GDB_SI_SHOWEDGES) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Load( NgeReader& ngeIn)
|
||||
@@ -430,6 +457,20 @@ VolZmap::Load( NgeReader& ngeIn)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::PostLoad( GdbGeo& Wrapper)
|
||||
{
|
||||
// recupero eventuale flag di visualizzazione spigoli vivi anche in shading
|
||||
bool bVal ;
|
||||
if ( Wrapper.GetInfo( GDB_SI_SHOWEDGES, bVal)) {
|
||||
m_bShowEdges = bVal ;
|
||||
Wrapper.RemoveInfo( GDB_SI_SHOWEDGES) ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GetLocalBBox( BBox3d& b3Loc, int nFlag) const
|
||||
@@ -1620,12 +1661,12 @@ VolZmap::SetToModifyDexelBlocks( int nGrid, int nDex, int nInt)
|
||||
bool
|
||||
VolZmap::IsMapPartABox( int nMap, int nInfI, int nSupI, int nInfJ, int nSupJ, double& dMinZ, double& dMaxZ)
|
||||
{
|
||||
if ( ! m_bIsBox)
|
||||
return true ;
|
||||
dMinZ = m_dMaxZ[nMap] ;
|
||||
dMaxZ = m_dMinZ[nMap] ;
|
||||
for ( int i = nInfI ; i < nSupI ; ++ i) {
|
||||
for ( int j = nInfJ ; j < nSupJ ; ++ j) {
|
||||
if ( ! m_bIsBox)
|
||||
return true ;
|
||||
int n = j * m_nNx[nMap] + i ;
|
||||
int nSize = int( m_Values[nMap][n].size()) ;
|
||||
if ( nSize > 1)
|
||||
|
||||
Reference in New Issue
Block a user