Files
TestEGr/TestEGrDlg.h
Dario Sassi 578cbb2b55 TestEgr 1.5j1 :
- aggiornamento per selezione con mouse
- aggiornamento per distanza con punti notevoli.
2014-10-10 06:43:42 +00:00

131 lines
4.9 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : TestEGrDlg.h Data : 29.01.14 Versione : 1.5a1
// Contenuto : Dichiarazione della classe gestione dialogo principale.
//
//
//
// Modifiche : 29.01.14 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "TestEgrView.h"
#include "TestEgrCmd.h"
#include "/EgtDev/Include/EGkColor.h"
class ILogger ;
class IGeomDB ;
class IGdbExecutor ;
class IExcExecutor ;
class ISceExecutor ;
class ICmdParser ;
class IGeoObj ;
//----------------------------------------------------------------------------
class CTestEGrDlg : public CDialog
{
public :
CTestEGrDlg( const std::string& sFileToOpen, ILogger* pLogGen = nullptr,
ILogger* pLogCmd = nullptr, CWnd* pParent = nullptr) ;
~CTestEGrDlg( void) ;
void OutInfo( const std::string& sOut, bool bLog = true) ;
bool GetSceneInfo( std::string& sInfo)
{ return m_View.GetSceneInfo( sInfo) ; }
bool LineExec( const std::string& sLine) ;
void UpdateShowModeButtons( void) ;
void UpdateShowCurveDir( void) ;
void UpdateViewButtons( void) ;
bool SelectIdInTree( int nId)
{ return SelectIdInTree( nId, nullptr) ; }
protected :
virtual BOOL OnInitDialog( void) ;
virtual BOOL PreTranslateMessage( MSG* pMsg) ;
virtual void OnCancel( void) ;
afx_msg void OnSysCommand( UINT nID, LPARAM lParam) ;
afx_msg void OnPaint( void) ;
afx_msg HCURSOR OnQueryDragIcon( void) ;
afx_msg void OnSize( UINT nType, int cx, int cy) ;
afx_msg void OnFileNew( void) ;
afx_msg void OnFileOpen( void) ;
afx_msg void OnFileSave( void) ;
afx_msg void OnFileImport( void) ;
afx_msg void OnFileExport( void) ;
afx_msg void OnFileExec( void) ;
afx_msg void OnShowMode( UINT nID) ;
afx_msg void OnShowCurveDir( void) ;
afx_msg void OnAnalyze( void) ;
afx_msg void OnGetDistance( void) ;
afx_msg void OnZoom( UINT nID) ;
afx_msg void OnView( UINT nID) ;
afx_msg void OnCommand( void) ;
afx_msg void OnClose( void) ;
afx_msg void OnTreeSelChanged( NMHDR* pNMHDR, LRESULT* pResult) ;
afx_msg void OnTreeDoubleClick( NMHDR* pNMHDR, LRESULT* pResult) ;
private :
enum ItemPos { IP_TR = 1, IP_TL, IP_BR, IP_BL} ;
enum ItemReshape { IR_W = 1, IR_H, IR_WH} ;
private :
bool GetViewAngles( const char* szSection, const char* szKey, double& dAngVdeg, double& dAngOdeg) ;
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) ;
bool MoveDlgItem( int nID, int nPos, int cx, int cy) ;
bool ReshapeDlgItem( int nID, int nFlag, int nW, int nH) ;
bool GetWindowRect( CWnd* pWnd, CRect& rect) ;
void OutData( const std::string& sOut, bool bLog = false) ;
// Document
bool PrepareGeomDB( void) ;
bool PrepareExecutor( void) ;
bool ManageModified( void) ;
bool FileNew( void) ;
bool FileOpen( const std::string& sFilePath) ;
bool FileSave( const std::string& sFilePath) ;
bool FileImport( const std::string& sFilePath) ;
bool FileExport( const std::string& sFilePath) ;
bool FileExec( const std::string& sFilePath) ;
void EmitTitle( void) ;
// GeomDBTree
bool PrepareTree( void) ;
bool ClearTree( void) ;
bool LoadTree( void) ;
bool InsertCustomMaterialsInTree( void) ;
bool InsertGroupInTree( int nId, HTREEITEM hParent) ;
bool InsertGeoObjInTree( int nId, IGeoObj* pGeoObj, HTREEITEM hParent) ;
int GetGeoObjImage( int nType) ;
bool SelectIdInTree( int nId, HTREEITEM hParent) ;
int RevertOldIdInTree( void) ;
void OutMaterialData( int nId) ;
void OutGroupData( int nId) ;
void OutGeoObjData( int nId) ;
private :
IGeomDB* m_pGeomDB ;
ILogger* m_pLogGen ;
ILogger* m_pLogCmd ;
ICmdParser* m_pCmdParser ;
TestEGrView m_View ;
TestEGrCmd m_Cmd ;
std::string m_sFileToOpen ;
bool m_bModified ;
std::string m_sFileName ;
HICON m_hIcon ;
CTreeCtrl m_Tree ;
CImageList* m_pImgList ;
int m_nOldIdTree ;
int m_nPrevCx ;
int m_nPrevCy ;
int m_nLeftBarW ;
int m_nRightBarW ;
int m_nBottomBarH ;
DECLARE_MESSAGE_MAP()
} ;