www.pudn.com > MyImageDB(imageobject).rar > MainFrm.h


// MainFrm.h : interface of the CMainFrame class 
// 
///////////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_MAINFRM_H__1A42EDC0_49EC_4C0C_8911_BAC41993E00A__INCLUDED_) 
#define AFX_MAINFRM_H__1A42EDC0_49EC_4C0C_8911_BAC41993E00A__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
#include "myimagedbview.h" 
#include "datagridview.h" 
#include "include\ado.h" 
#include "colorpalette.h" 
#include "segmentpara.h" 
#include "mymath.h" 
 
 
class CMainFrame : public CFrameWnd 
{ 
	 
protected: // create from serialization only 
	CMainFrame(); 
	DECLARE_DYNCREATE(CMainFrame) 
 
// Attributes 
public: 
	//颜色板用 
	CColorPalette myPaletteBar; 
	CSegmentPara* mySegmentPara; 
 
	BOOL isDbOK, isSegInfoDbOK, isTrainPointDbOK; 
 
	CMyImageDBView* pImageView; 
	CDataGridView* pDataGridView; 
 
    CADODatabase myAdoDb;//数据库; 
    CString strConnection;//连接字符串; 
    CADORecordset *myRs;//图像记录集; 
	CADORecordset *seginfoRs, *trainpointRs; 
	LONG recordCount; 
 
 
	LONG selRow;//选取的行记录; 
	CString selName;//选取的图像文件名; 
	CString selID; 
	CString tableName;//表名,也用于在DOC中打开图像数据; 
	CString seginfoTableName, trainpointTableName;//分割区域表与训练点信息表,这两个表暂时固定表名; 
 
// Operations 
public: 
	void RefreshRs();//刷新图像记录集; 
	void RefreshPointsRs();//刷新训练点记录集; 
	void RefreshTableID(LONG deleteID);//删除指定记录,并重排ID; 
    void RefreshPtTableID(LONG deleteID, CString regionclass);//删除指定记录,并重排ID; 
    CString GetSelectName();//得到选择的图像名字; 
	void OnSegParaChanged();//处理分割参数变化事件,由分割参数面板调用; 
	void AddTrainPoints(CString regionclass, 
		CString imagename, INT posx, INT posy,  
		MyLUV luvcolor, MyLUV minmaxtex);//添加训练点信息至数据库, 
	 
	void AddExistClass(CString regionclass 
		, MyLUV luvcolor, MyLUV minmaxtex);//添加新类信息至数据库, 
    void DelPtInExistClass(CString regionclass);//刷新该所属类所在表(将类记录的训练点数减一,并刷新各相关信息); 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMainFrame) 
	public: 
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 
	protected: 
	virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CMainFrame(); 
#ifdef _DEBUG 
	virtual void AssertValid() const; 
	virtual void Dump(CDumpContext& dc) const; 
#endif 
 
protected:  // control bar embedded members 
 
	MyMath   myMath; 
    CString* ptClassArrToSeg;//当前选择的用于进行分割的点类名; 
	INT      numberInPtClassArrToSeg;//当前选择的用于进行分割的点类的个数; 
	INT      selIDInPtClassArrToSeg;//分割点类列表中的当前选择项索引号; 
	CStatusBar  m_wndStatusBar; 
	CToolBar    m_wndToolBar; 
 
	CSplitterWnd myWndSplitter; 
 
	//数据库连接用; 
	CString dbServer, dbName, userName, passWord; 
 
	BOOL isShowColorToolbar, isShowSegpara; 
 
// Generated message map functions 
protected: 
	//{{AFX_MSG(CMainFrame) 
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 
	afx_msg void OnDbConnect(); 
	afx_msg void OnColorToolbar(); 
	afx_msg void OnUpdateColorToolbar(CCmdUI* pCmdUI); 
	afx_msg void OnRegionsegShow();//显示SegPara窗口; 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MAINFRM_H__1A42EDC0_49EC_4C0C_8911_BAC41993E00A__INCLUDED_)