TestEgr 1.5g2 :

- aggiunta gestione opzione visualizzazione direzione su curve.
This commit is contained in:
Dario Sassi
2014-07-28 16:19:51 +00:00
parent 7200847916
commit c1232c6dd4
7 changed files with 47 additions and 0 deletions
BIN
View File
Binary file not shown.
+29
View File
@@ -144,6 +144,7 @@ BEGIN_MESSAGE_MAP( CTestEGrDlg, CDialog)
ON_BN_CLICKED( IDC_IMPORT, OnFileImport)
ON_BN_CLICKED( IDC_EXEC, OnFileExec)
ON_CONTROL_RANGE( BN_CLICKED, IDC_WIREFRAME, IDC_SHADING, OnShowMode)
ON_BN_CLICKED( IDC_SHOWCURVEDIR, OnShowCurveDir)
ON_CONTROL_RANGE( BN_CLICKED, IDC_ZOOM_ALL, IDC_ZOOM_OUT, OnZoom)
ON_CONTROL_RANGE( BN_CLICKED, IDC_VIEW_TOP, IDC_VIEW_ISO, OnView)
ON_BN_CLICKED( IDC_CLOSE, OnClose)
@@ -232,6 +233,13 @@ CTestEGrDlg::OnInitDialog( void)
UpdateShowModeButtons() ;
}
// recupero lo stato di visualizzazione direzione curve
if ( m_View.GetScene() != nullptr) {
bool bCrvDir = ( GetPrivateProfileInt( "Scene", "CurveDir", 0, AfxGetApp()->m_pszProfileName) != 0) ;
m_View.GetScene()->SetShowCurveDirection( bCrvDir) ;
UpdateShowCurveDir() ;
}
// recupero gli angoli di vista e li imposto
if ( m_View.GetScene() != nullptr) {
double dAngVdeg = 0, dAngOdeg = 0 ;
@@ -475,6 +483,7 @@ CTestEGrDlg::OnSize( UINT nType, int cx, int cy)
MoveDlgItem( IDC_WIREFRAME, IP_TR, cx, cy) ;
MoveDlgItem( IDC_HIDDENLINE, IP_TR, cx, cy) ;
MoveDlgItem( IDC_SHADING, IP_TR, cx, cy) ;
MoveDlgItem( IDC_SHOWCURVEDIR, IP_TR, cx, cy) ;
MoveDlgItem( IDC_ZOOM_ALL, IP_TR, cx, cy) ;
MoveDlgItem( IDC_ZOOM_IN, IP_TR, cx, cy) ;
MoveDlgItem( IDC_ZOOM_OUT, IP_TR, cx, cy) ;
@@ -625,6 +634,10 @@ CTestEGrDlg::OnClose( void)
int nShMode = m_View.GetScene()->GetShowMode() ;
WritePrivateProfileInt( "Scene", "ShowMode", nShMode, AfxGetApp()->m_pszProfileName) ;
// salvo stato visualizzazione direzione curve
bool bCrvDir = m_View.GetScene()->GetShowCurveDirection() ;
WritePrivateProfileInt( "Scene", "CurveDir", bCrvDir, AfxGetApp()->m_pszProfileName) ;
// salvo gli angoli di vista
double dAngVdeg, dAngOdeg ;
m_View.GetScene()->GetCamera( &dAngVdeg, &dAngOdeg) ;
@@ -850,6 +863,22 @@ CTestEGrDlg::UpdateShowModeButtons( void)
(( CButton*) GetDlgItem( IDC_SHADING))->SetCheck( ( nSM == SM_SHADING ? BST_CHECKED : BST_UNCHECKED)) ;
}
//----------------------------------------------------------------------------
void
CTestEGrDlg::OnShowCurveDir( void)
{
bool bShow = ( (( CButton*) GetDlgItem( IDC_SHOWCURVEDIR))->GetCheck() == BST_CHECKED) ;
m_View.ShowCurveDir( bShow) ;
}
//----------------------------------------------------------------------------
void
CTestEGrDlg::UpdateShowCurveDir( void)
{
bool bShow = m_View.GetScene()->GetShowCurveDirection() ;
(( CButton*) GetDlgItem( IDC_SHOWCURVEDIR))->SetCheck( ( bShow ? BST_CHECKED : BST_UNCHECKED)) ;
}
//----------------------------------------------------------------------------
void
CTestEGrDlg::OnZoom( UINT nID)
+2
View File
@@ -37,6 +37,7 @@ class CTestEGrDlg : public CDialog
{ return m_View.GetSceneInfo( sInfo) ; }
bool LineExec( const std::string& sLine) ;
void UpdateShowModeButtons( void) ;
void UpdateShowCurveDir( void) ;
void UpdateViewButtons( void) ;
protected :
@@ -52,6 +53,7 @@ class CTestEGrDlg : public CDialog
afx_msg void OnFileImport( void) ;
afx_msg void OnFileExec( void) ;
afx_msg void OnShowMode( UINT nID) ;
afx_msg void OnShowCurveDir( void) ;
afx_msg void OnZoom( UINT nID) ;
afx_msg void OnView( UINT nID) ;
afx_msg void OnCommand( void) ;
+1
View File
@@ -50,5 +50,6 @@ void
UpdateButtons( void)
{
((CTestEGrDlg*)AfxGetMainWnd())->UpdateShowModeButtons() ;
((CTestEGrDlg*)AfxGetMainWnd())->UpdateShowCurveDir() ;
((CTestEGrDlg*)AfxGetMainWnd())->UpdateViewButtons() ;
}
+14
View File
@@ -181,6 +181,9 @@ TestEGrView::Redraw( void)
void
TestEGrView::ShowMode( UINT nID)
{
if ( m_pScene == nullptr)
return ;
switch ( nID) {
case IDC_WIREFRAME :
m_pScene->SetShowMode( SM_WIREFRAME) ;
@@ -199,6 +202,17 @@ TestEGrView::ShowMode( UINT nID)
RedrawWindow() ;
}
//----------------------------------------------------------------------------
void
TestEGrView::ShowCurveDir( bool bShow)
{
if ( m_pScene == nullptr)
return ;
m_pScene->SetShowCurveDirection( bShow) ;
RedrawWindow() ;
}
//----------------------------------------------------------------------------
void
TestEGrView::Zoom( UINT nID)
+1
View File
@@ -25,6 +25,7 @@ class TestEGrView : public CWnd
bool Reshape( int nX, int nY, int nW, int nH) ;
void Redraw( void) ;
void ShowMode( UINT nID) ;
void ShowCurveDir( bool bShow) ;
void Zoom( UINT nID) ;
void View( UINT nID) ;
BIN
View File
Binary file not shown.