EgtGeomKernel 1.5c7 :
- migliorata gestione materiale (colore ora caso speciale) - si invalida rappresentazione grafica alla modifica del materiale - spostato comando COUNTER di TSC in EgtGeneral.
This commit is contained in:
Binary file not shown.
+19
-30
@@ -70,10 +70,6 @@ GdbExecutor::SetCmdParser( ICmdParser* pParser)
|
||||
if ( m_pOtherExec != nullptr)
|
||||
m_pOtherExec->SetCmdParser( m_pParser) ;
|
||||
|
||||
// imposto variabili predefinite
|
||||
m_pParser->AddVariable( "$ROOT", GDB_ID_ROOT) ;
|
||||
m_pParser->AddVariable( "$NN", ID_NO) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -94,6 +90,20 @@ GdbExecutor::SetGeomDB( IGeomDB* pGdb)
|
||||
return ( m_pGDB != nullptr) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::AddStandardVariables( void)
|
||||
{
|
||||
// imposto variabili predefinite
|
||||
m_pParser->AddVariable( "$ROOT", GDB_ID_ROOT) ;
|
||||
m_pParser->AddVariable( "$NN", ID_NO) ;
|
||||
// se c'è esecutore dipendente
|
||||
if ( m_pOtherExec != nullptr)
|
||||
return m_pOtherExec->AddStandardVariables() ;
|
||||
else
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR& vsParams)
|
||||
@@ -134,8 +144,8 @@ GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
|
||||
return ExecuteMode( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "STA" || sCmd1 == "STATUS")
|
||||
return ExecuteStatus( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "COL" || sCmd1 == "COLOR")
|
||||
return ExecuteColor( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "MAT" || sCmd1 == "MATERIAL")
|
||||
return ExecuteMaterial( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "NAM" || sCmd1 == "NAME")
|
||||
return ExecuteName( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "INF" || sCmd1 == "INFO")
|
||||
@@ -164,8 +174,6 @@ GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
|
||||
return ExecuteSave( vsParams) ;
|
||||
else if ( sCmd1 == "OUTSCL")
|
||||
return ExecuteOutScl( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "COUNTER")
|
||||
return ExecuteCounter( sCmd2, vsParams) ;
|
||||
else if ( m_pOtherExec != nullptr)
|
||||
return m_pOtherExec->Execute( sCmd1, sCmd2, vsParams) ;
|
||||
|
||||
@@ -1023,7 +1031,7 @@ GdbExecutor::ExecuteStatus( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::ExecuteColor( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
GdbExecutor::ExecuteMaterial( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
{
|
||||
// assegnazione colore di oggetto
|
||||
if ( sCmd2.empty()) {
|
||||
@@ -1041,7 +1049,7 @@ GdbExecutor::ExecuteColor( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
// esecuzione impostazione colore
|
||||
STRVECTOR::iterator Iter ;
|
||||
for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) {
|
||||
if ( ! m_pGDB->SetColor( GetIdParam( *Iter), cCol))
|
||||
if ( ! m_pGDB->SetMaterial( GetIdParam( *Iter), cCol))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
@@ -1056,7 +1064,7 @@ GdbExecutor::ExecuteColor( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
if ( ! GetColorParam( vsParams[0], cCol))
|
||||
return false ;
|
||||
// imposto il colore di default
|
||||
return m_pGDB->SetDefaultColor( cCol) ;
|
||||
return m_pGDB->SetDefaultMaterial( cCol) ;
|
||||
}
|
||||
|
||||
return false ;
|
||||
@@ -1615,22 +1623,3 @@ GdbExecutor::OutGroupScl( int nId, int nFlag)
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::ExecuteCounter( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
{
|
||||
// avvio il counter
|
||||
if ( sCmd2 == "START") {
|
||||
m_Counter.Start() ;
|
||||
}
|
||||
// fermo il counter ed emetto i risultati
|
||||
else if ( sCmd2 == "STOP") {
|
||||
m_Counter.Stop() ;
|
||||
string sOut = " " + ( ( vsParams.size() >= 1) ? vsParams[0] : "ExecTime =") ;
|
||||
sOut += " " + ToString( m_Counter.GetTime(), 2) + " ms" ;
|
||||
LOG_INFO( GetEGkLogger(), sOut.c_str())
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
+6
-5
@@ -23,15 +23,18 @@ class Color ;
|
||||
//----------------------------------------------------------------------------
|
||||
class GdbExecutor : public IGdbExecutor
|
||||
{
|
||||
public :
|
||||
public : // ICmdExecutor
|
||||
virtual bool SetCmdParser( ICmdParser* pParser) ;
|
||||
virtual bool AddExecutor( ICmdExecutor* pOtherExec) ;
|
||||
virtual bool AddStandardVariables( void) ;
|
||||
virtual bool Execute( const std::string& sCmd1, const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
|
||||
public : // IGdbExecutor
|
||||
~GdbExecutor( void) ;
|
||||
virtual bool SetGeomDB( IGeomDB* pGdb) ;
|
||||
|
||||
public :
|
||||
GdbExecutor( void) ;
|
||||
~GdbExecutor( void) ;
|
||||
|
||||
private :
|
||||
bool AddGeoObj( const std::string& sId, const std::string& sIdParent, IGeoObj* pGeoObj) ;
|
||||
@@ -53,7 +56,7 @@ class GdbExecutor : public IGdbExecutor
|
||||
bool ExecuteLevel( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteMode( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteStatus( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteColor( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteMaterial( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteName( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteInfo( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool ExecuteCopy( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
@@ -69,12 +72,10 @@ class GdbExecutor : public IGdbExecutor
|
||||
bool ExecuteSave( const STRVECTOR& vsParams) ;
|
||||
bool ExecuteOutScl( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
bool OutGroupScl( int nId, int nFlag) ;
|
||||
bool ExecuteCounter( const std::string& sCmd2, const STRVECTOR& vsParams) ;
|
||||
|
||||
private :
|
||||
IGeomDB* m_pGDB ;
|
||||
ICmdParser* m_pParser ;
|
||||
ICmdExecutor* m_pOtherExec ;
|
||||
OutScl m_OutScl ;
|
||||
PerformanceCounter m_Counter ;
|
||||
} ;
|
||||
|
||||
+10
@@ -244,3 +244,13 @@ GdbGeo::ToLoc( const Frame3d& frRef)
|
||||
|
||||
return m_pGeoObj->ToLoc( frRef) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbGeo::OnSetMaterial( void)
|
||||
{
|
||||
if ( m_pGeoObj->GetObjGraphics() != nullptr)
|
||||
m_pGeoObj->GetObjGraphics()->Reset() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ class GdbGeo : public GdbObj
|
||||
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
|
||||
virtual bool ToGlob( const Frame3d& frRef) ;
|
||||
virtual bool ToLoc( const Frame3d& frRef) ;
|
||||
virtual bool OnSetMaterial( void) ;
|
||||
|
||||
public :
|
||||
GdbGeo( void) ;
|
||||
|
||||
+23
-2
@@ -246,7 +246,7 @@ GdbGroup::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dC
|
||||
Frame3d frRefLoc = frRef ;
|
||||
frRefLoc.ToLoc( m_gfrFrame.m_frF) ;
|
||||
|
||||
// ciclo sui nodi
|
||||
// ciclo sugli oggetti
|
||||
bool bOk = true ;
|
||||
pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
@@ -287,7 +287,7 @@ GdbGroup::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
|
||||
Vector3d vtNormLoc = vtNorm ;
|
||||
vtNormLoc.ToLoc( m_gfrFrame.m_frF) ;
|
||||
|
||||
// ciclo sui nodi
|
||||
// ciclo sugli oggetti
|
||||
bool bOk = true ;
|
||||
pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
@@ -299,6 +299,27 @@ GdbGroup::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbGroup::OnSetMaterial( void)
|
||||
{
|
||||
// ciclo sugli oggetti
|
||||
bool bOk = true ;
|
||||
GdbObj* pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
// se non ci sono attributi o ci si deve riferire al padre
|
||||
int nMat ;
|
||||
if ( ! pGdbObj->GetMaterial( nMat) || nMat == GDB_MT_PARENT) {
|
||||
if ( ! pGdbObj->OnSetMaterial())
|
||||
bOk = false ;
|
||||
}
|
||||
// passo al prossimo
|
||||
pGdbObj = pGdbObj->GetNext() ;
|
||||
}
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbGroup::GetGlobFrame( Frame3d& frGlob) const
|
||||
|
||||
@@ -41,6 +41,7 @@ class GdbGroup : public GdbObj
|
||||
{ return m_gfrFrame.m_frF.ToGlob( frRef) ; }
|
||||
virtual bool ToLoc( const Frame3d& frRef)
|
||||
{ return m_gfrFrame.m_frF.ToLoc( frRef) ; }
|
||||
virtual bool OnSetMaterial( void) ;
|
||||
|
||||
public :
|
||||
GdbGroup( void) ;
|
||||
|
||||
+42
-9
@@ -422,35 +422,68 @@ GdbIterator::GetCalcStatus( int& nStat) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::SetColor( Color cCol)
|
||||
GdbIterator::SetMaterial( int nMat)
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
return m_pCurrObj->SetColor( cCol) ;
|
||||
// assegno il materiale tramite indice
|
||||
return m_pCurrObj->SetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::GetColor( Color& cCol) const
|
||||
GdbIterator::SetMaterial( Color cCol)
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore
|
||||
return m_pCurrObj->GetColor( cCol) ;
|
||||
// assegno il materiale tramite colore
|
||||
return m_pCurrObj->SetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::GetCalcColor( Color& cCol) const
|
||||
GdbIterator::GetMaterial( int& nMat) const
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore calcolato
|
||||
return m_pCurrObj->GetCalcColor( cCol) ;
|
||||
// recupero l'indice del materiale
|
||||
return m_pCurrObj->GetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::GetMaterial( Color& cCol) const
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore del materiale
|
||||
return m_pCurrObj->GetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::GetCalcMaterial( int& nMat) const
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero l'indice del materiale calcolato
|
||||
return m_pCurrObj->GetCalcMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbIterator::GetCalcMaterial( Color& cCol) const
|
||||
{
|
||||
if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore del materiale calcolato
|
||||
return m_pCurrObj->GetCalcMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+6
-3
@@ -53,9 +53,12 @@ class GdbIterator : public IGdbIterator
|
||||
virtual bool RevertStatus( void) ;
|
||||
virtual bool GetStatus( int& nStat) const ;
|
||||
virtual bool GetCalcStatus( int& nStat) const ;
|
||||
virtual bool SetColor( Color cCol) ;
|
||||
virtual bool GetColor( Color& cCol) const ;
|
||||
virtual bool GetCalcColor( Color& cCol) const ;
|
||||
virtual bool SetMaterial( int nMat) ;
|
||||
virtual bool SetMaterial( Color cCol) ;
|
||||
virtual bool GetMaterial( int& nMat) const ;
|
||||
virtual bool GetMaterial( Color& cCol) const ;
|
||||
virtual bool GetCalcMaterial( int& nMat) const ;
|
||||
virtual bool GetCalcMaterial( Color& cCol) const ;
|
||||
virtual bool SetName( const std::string& sName) ;
|
||||
virtual bool GetName( std::string& sName) const ;
|
||||
virtual bool RemoveName( void) ;
|
||||
|
||||
+63
-6
@@ -439,20 +439,58 @@ GdbObj::GetCalcStatus( int& nStat, int nLev) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::SetColor( Color cCol)
|
||||
GdbObj::SetMaterial( int nMat)
|
||||
{
|
||||
// per ora ammesso solo da padre (da colore si imposta con la SetColor)
|
||||
if ( nMat != GDB_MT_PARENT)
|
||||
return false ;
|
||||
|
||||
// verifico esistenza (con eventuale creazione) degli attributi
|
||||
if ( GetSafeAttribs() == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
m_pAttribs->SetColor( cCol) ;
|
||||
// assegno il materiale
|
||||
m_pAttribs->SetMaterial( nMat) ;
|
||||
|
||||
// notifico l'oggetto vero
|
||||
OnSetMaterial() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::GetColor( Color& cCol) const
|
||||
GdbObj::SetMaterial( Color cCol)
|
||||
{
|
||||
// verifico esistenza (con eventuale creazione) degli attributi
|
||||
if ( GetSafeAttribs() == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il colore (e imposto il materiale da colore)
|
||||
m_pAttribs->SetColor( cCol) ;
|
||||
|
||||
// notifico l'oggetto vero
|
||||
OnSetMaterial() ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::GetMaterial( int& nMat) const
|
||||
{
|
||||
// se non ci sono attributi
|
||||
if ( m_pAttribs == nullptr)
|
||||
return false ;
|
||||
|
||||
// il materiale è definito
|
||||
nMat = m_pAttribs->GetMaterial() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::GetMaterial( Color& cCol) const
|
||||
{
|
||||
// se non ci sono attributi o ci si deve riferire al padre
|
||||
if ( m_pAttribs == nullptr ||
|
||||
@@ -466,13 +504,32 @@ GdbObj::GetColor( Color& cCol) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::GetCalcColor( Color& cCol) const
|
||||
GdbObj::GetCalcMaterial( int& nMat) const
|
||||
{
|
||||
// se non ci sono attributi o ci si deve riferire al padre
|
||||
if ( m_pAttribs == nullptr ||
|
||||
m_pAttribs->GetMaterial() == GDB_MT_PARENT) {
|
||||
if ( GetParent() != nullptr)
|
||||
GetParent()->GetCalcColor( cCol) ;
|
||||
GetParent()->GetCalcMaterial( nMat) ;
|
||||
else
|
||||
nMat = GDB_MT_COLOR ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
// il materiale è definito
|
||||
nMat = m_pAttribs->GetMaterial() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbObj::GetCalcMaterial( Color& cCol) const
|
||||
{
|
||||
// se non ci sono attributi o ci si deve riferire al padre
|
||||
if ( m_pAttribs == nullptr ||
|
||||
m_pAttribs->GetMaterial() == GDB_MT_PARENT) {
|
||||
if ( GetParent() != nullptr)
|
||||
GetParent()->GetCalcMaterial( cCol) ;
|
||||
else
|
||||
cCol.Set() ;
|
||||
return true ;
|
||||
|
||||
@@ -41,6 +41,7 @@ class GdbObj
|
||||
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
|
||||
virtual bool ToGlob( const Frame3d& frRef) = 0 ;
|
||||
virtual bool ToLoc( const Frame3d& frRef) = 0 ;
|
||||
virtual bool OnSetMaterial( void) = 0 ;
|
||||
|
||||
public :
|
||||
GdbObj( void) ;
|
||||
@@ -64,9 +65,12 @@ class GdbObj
|
||||
bool RevertStatus( void) ;
|
||||
bool GetStatus( int& nStat) const ;
|
||||
bool GetCalcStatus( int& nStat, int nLev = 0) const ;
|
||||
bool SetColor( Color cCol) ;
|
||||
bool GetColor( Color& cCol) const ;
|
||||
bool GetCalcColor( Color& cCol) const ;
|
||||
bool SetMaterial( int nMat) ;
|
||||
bool SetMaterial( Color cCol) ;
|
||||
bool GetMaterial( int& nMat) const ;
|
||||
bool GetMaterial( Color& cCol) const ;
|
||||
bool GetCalcMaterial( int& nMat) const ;
|
||||
bool GetCalcMaterial( Color& cCol) const ;
|
||||
bool SetName( const std::string& sName) ;
|
||||
bool GetName( std::string& sName) const ;
|
||||
bool RemoveName( void) ;
|
||||
|
||||
+63
-24
@@ -37,7 +37,7 @@ CreateGeomDB( void)
|
||||
GeomDB::GeomDB( void)
|
||||
{
|
||||
m_GrpRadix.m_nId = GDB_ID_ROOT ;
|
||||
m_GrpRadix.SetColor( Color()) ;
|
||||
m_GrpRadix.SetMaterial( Color()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -52,8 +52,8 @@ GeomDB::Init( void)
|
||||
{
|
||||
// imposto numero minimo buckets del map degli Id
|
||||
m_IdManager.Init( 1024) ;
|
||||
// imposto colore di default
|
||||
m_GrpRadix.SetColor( Color()) ;
|
||||
// imposto materiale di default
|
||||
m_GrpRadix.SetMaterial( Color()) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -128,8 +128,8 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
// recupero la linea
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
return false ;
|
||||
// deve essere il colore di default
|
||||
if ( sLine != "COL_DEF")
|
||||
// deve essere il materiale di default
|
||||
if ( sLine != "MAT_DEF")
|
||||
return false ;
|
||||
// recupero la riga successiva
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
@@ -140,7 +140,7 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
// 4 parametri
|
||||
if ( vsParams.size() != 4)
|
||||
return false ;
|
||||
// leggo il colore
|
||||
// leggo il materiale come colore
|
||||
int nRed ;
|
||||
if ( ! FromString( vsParams[0], nRed))
|
||||
return false ;
|
||||
@@ -154,7 +154,7 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
if ( ! FromString( vsParams[3], nAlpha))
|
||||
return false ;
|
||||
Color colDef( nRed, nGreen, nBlue, nAlpha) ;
|
||||
return SetDefaultColor( colDef) ;
|
||||
return SetDefaultMaterial( colDef) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -247,12 +247,12 @@ GeomDB::SaveHeader( ostream& osOut) const
|
||||
{
|
||||
// intestazione
|
||||
osOut << "START" << endl ;
|
||||
osOut << "GeomDB,1.5.3.5;" << endl ;
|
||||
osOut << "GeomDB,1.5.3.7;" << endl ;
|
||||
|
||||
// colore di default
|
||||
osOut << "COL_DEF" << endl ;
|
||||
// materiale di default come colore
|
||||
osOut << "MAT_DEF" << endl ;
|
||||
Color colDef( 0, 0, 0, 0) ;
|
||||
GetDefaultColor( colDef) ;
|
||||
GetDefaultMaterial( colDef) ;
|
||||
osOut << ToString( colDef.GetIntRed()) ;
|
||||
osOut << "," << ToString( colDef.GetIntGreen()) ;
|
||||
osOut << "," << ToString( colDef.GetIntBlue()) ;
|
||||
@@ -946,7 +946,7 @@ GeomDB::GetCalcStatus( int nId, int& nStat) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::SetDefaultColor( Color cCol)
|
||||
GeomDB::SetDefaultMaterial( Color cCol)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
@@ -954,12 +954,12 @@ GeomDB::SetDefaultColor( Color cCol)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
return pGdbObj->SetColor( cCol) ;
|
||||
return pGdbObj->SetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetDefaultColor( Color& cCol) const
|
||||
GeomDB::GetDefaultMaterial( Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
@@ -967,46 +967,85 @@ GeomDB::GetDefaultColor( Color& cCol) const
|
||||
return false ;
|
||||
|
||||
// recupero il colore
|
||||
return pGdbObj->GetColor( cCol) ;
|
||||
return pGdbObj->GetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::SetColor( int nId, Color cCol)
|
||||
GeomDB::SetMaterial( int nId, int nMat)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
return pGdbObj->SetColor( cCol) ;
|
||||
// assegno il materiale tramite indice
|
||||
return pGdbObj->SetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetColor( int nId, Color& cCol) const
|
||||
GeomDB::SetMaterial( int nId, Color cCol)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il materiale tramite colore
|
||||
return pGdbObj->SetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetMaterial( int nId, int& nMat) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore
|
||||
return pGdbObj->GetColor( cCol) ;
|
||||
// recupero l'indice del materiale
|
||||
return pGdbObj->GetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcColor( int nId, Color& cCol) const
|
||||
GeomDB::GetMaterial( int nId, Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore calcolato
|
||||
return pGdbObj->GetCalcColor( cCol) ;
|
||||
// recupero il colore del materiale
|
||||
return pGdbObj->GetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcMaterial( int nId, int& nMat) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero l'indice del materiale calcolato
|
||||
return pGdbObj->GetCalcMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcMaterial( int nId, Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore del materiale calcolato
|
||||
return pGdbObj->GetCalcMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -79,11 +79,14 @@ class GeomDB : public IGeomDB
|
||||
virtual bool RevertStatus( int nId) ;
|
||||
virtual bool GetStatus( int nId, int& nStat) const ;
|
||||
virtual bool GetCalcStatus( int nId, int& nStat) const ;
|
||||
virtual bool SetDefaultColor( Color cCol) ;
|
||||
virtual bool GetDefaultColor( Color& cCol) const ;
|
||||
virtual bool SetColor( int nId, Color cCol) ;
|
||||
virtual bool GetColor( int nId, Color& cCol) const ;
|
||||
virtual bool GetCalcColor( int nId, Color& cCol) const ;
|
||||
virtual bool SetDefaultMaterial( Color cCol) ;
|
||||
virtual bool GetDefaultMaterial( Color& cCol) const ;
|
||||
virtual bool SetMaterial( int nId, int nMat) ;
|
||||
virtual bool SetMaterial( int nId, Color cCol) ;
|
||||
virtual bool GetMaterial( int nId, int& nMat) const ;
|
||||
virtual bool GetMaterial( int nId, Color& cCol) const ;
|
||||
virtual bool GetCalcMaterial( int nId, int& nMat) const ;
|
||||
virtual bool GetCalcMaterial( int nId, Color& cCol) const ;
|
||||
virtual bool SetName( int nId, const std::string& sName) ;
|
||||
virtual bool GetName( int nId, std::string& sName) const ;
|
||||
virtual bool RemoveName( int nId) ;
|
||||
|
||||
@@ -43,6 +43,9 @@ OutScl::Open( const string& sOutScl)
|
||||
m_ofFile.open( stringtoW( sOutScl)) ;
|
||||
if ( ! m_ofFile.good())
|
||||
return false ;
|
||||
// inizializzo
|
||||
m_sMaterial.clear() ;
|
||||
m_sPartLay.clear() ;
|
||||
// scrivo linee iniziali
|
||||
Start() ;
|
||||
New() ;
|
||||
|
||||
Reference in New Issue
Block a user