diff --git a/GeomDBTree.cpp b/GeomDBTree.cpp index daba5d5..d5647b7 100644 --- a/GeomDBTree.cpp +++ b/GeomDBTree.cpp @@ -188,9 +188,12 @@ CTestEGrDlg::OnTreeSelChanged( NMHDR* pNMHDR, LRESULT* pResult) void CTestEGrDlg::OutGroupData( int nId) { + // preparo l'intestazione string sOut = "Group " + ToString( nId) + "\r\n" ; + // preparo gli attributi + m_pGeomDB->DumpAttributes( nId, sOut, "\r\n") ; // numero di nodi (figli) - int nNodes = m_pGeomDB->GetGroupNodes( nId) ; + int nNodes = m_pGeomDB->GetGroupObjs( nId) ; sOut += "Nodes : " + ToString( nNodes) + "\r\n" ; // riferimento in globale Frame3d frGlob ; @@ -220,47 +223,12 @@ CTestEGrDlg::OutGeoObjData( int nId) const IGeoObj* pGObj ; if ( ( pGObj = m_pGeomDB->GetGeoObj( nId)) == nullptr) return ; - string sOut ; // preparo l'intestazione - sOut += pGObj->GetTitle() + " " + ToString( nId) + "\r\n" ; - //DumpCaptionData( pGObj->GetType(), nId, sOut) ; - // preparo i dati + string sOut = pGObj->GetTitle() + " " + ToString( nId) + "\r\n" ; + // preparo gli attributi + m_pGeomDB->DumpAttributes( nId, sOut, "\r\n") ; + // preparo i dati geometrici pGObj->Dump( sOut, "\r\n") ; // emissione OutData( sOut) ; } - -//---------------------------------------------------------------------------- -void -CTestEGrDlg::DumpCaptionData( int nType, int nId, string& sOut) -{ - // a seconda del tipo - switch ( nType) { - case GEO_VECT3D : - sOut += "Vector " ; - break ; - case GEO_PNT3D : - sOut += "Point " ; - break ; - case GEO_FRAME3D : - sOut += "Frame " ; - break ; - case CRV_LINE : - sOut += "Line " ; - break ; - case CRV_ARC : - sOut += "Arc " ; - break ; - case CRV_BEZ : - sOut += "CBezier " ; - break ; - case CRV_COMPO : - sOut += "CComposite " ; - break ; - default : - sOut += "NULL " ; - break ; - } - - sOut += ToString( nId) + "\r\n" ; -} \ No newline at end of file diff --git a/TestEGr.rc b/TestEGr.rc index 4063648..ba68d3d 100644 Binary files a/TestEGr.rc and b/TestEGr.rc differ diff --git a/TestEGrDlg.cpp b/TestEGrDlg.cpp index fe1d6f1..bf1f1e8 100644 --- a/TestEGrDlg.cpp +++ b/TestEGrDlg.cpp @@ -168,6 +168,13 @@ CTestEGrDlg::OnInitDialog( void) else LOG_ERROR( m_pLogger, "Error in CreateGeomDB") + // imposto il colore di default + if ( m_pGeomDB != nullptr) { + Color colDef( 0, 0, 0) ; + GetIniColor( "GeomDB", "DefaultColor", colDef) ; + m_pGeomDB->SetDefaultColor( colDef) ; + } + // creo la vista per la sciena if ( ! m_View.Create( this, IDC_SCENE)) LOG_ERROR( m_pLogger, "Error in CreateSceneView") @@ -185,9 +192,9 @@ CTestEGrDlg::OnInitDialog( void) // recupero i colori dello sfondo e li imposto if ( m_View.GetScene() != nullptr) { Color ColorTop( 186, 203, 226) ; - GetIniBackColor( "Scene", "BackTop", ColorTop) ; + GetIniColor( "Scene", "BackTop", ColorTop) ; Color ColorBottom( 102, 102, 102) ; - GetIniBackColor( "Scene", "BackBottom", ColorBottom) ; + GetIniColor( "Scene", "BackBottom", ColorBottom) ; m_View.GetScene()->SetBackground( ColorTop, ColorBottom) ; } @@ -221,7 +228,7 @@ CTestEGrDlg::OnInitDialog( void) //---------------------------------------------------------------------------- bool -CTestEGrDlg::GetIniBackColor( const char* szSection, const char* szKey, Color& colBack) +CTestEGrDlg::GetIniColor( const char* szSection, const char* szKey, Color& cCol) { string sTmp = GetPrivateProfileStringUtf8( szSection, szKey, "", AfxGetApp()->m_pszProfileName) ; if ( ! sTmp.empty()) { @@ -234,7 +241,7 @@ CTestEGrDlg::GetIniBackColor( const char* szSection, const char* szKey, Color& c FromString( vsParams[1], nGreen) ; int nBlue ; FromString( vsParams[2], nBlue) ; - colBack.Set( nRed, nGreen, nBlue) ; + cCol.Set( nRed, nGreen, nBlue) ; return true ; } } diff --git a/TestEGrDlg.h b/TestEGrDlg.h index 2d40341..586f273 100644 --- a/TestEGrDlg.h +++ b/TestEGrDlg.h @@ -50,7 +50,7 @@ class CTestEGrDlg : public CDialog enum ItemReshape { IR_W = 1, IR_H, IR_WH} ; private : - bool GetIniBackColor( const char* szSection, const char* szKey, Color& colBack) ; + bool GetIniColor( const char* szSection, const char* szKey, Color& cCol) ; bool GetIniZoomWinAttrib( const char* szSection, const char* szKey, bool& bOutline, Color& colRect) ; bool GetIniWinPlace( const char* szSection, const char* szKey, WINDOWPLACEMENT& winPlace) ; @@ -65,7 +65,6 @@ class CTestEGrDlg : public CDialog int GetGeoObjImage( int nType) ; void OutGroupData( int nId) ; void OutGeoObjData( int nId) ; - void DumpCaptionData( int nType, int nId, std::string& sOut) ; private : IGeomDB* m_pGeomDB ;