#include "resource.h"
#pragma once
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
HWND m_CTab[2]
LRESULT CALLBACK Tab1_DlgProc(HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK Tab2_DlgProc(HWND, UINT, WPARAM, LPARAM)
BOOL CreateTabDialog(HWND hParent)
void UpdateTab(HWND hParent)
HINSTANCE hInst
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
hInst = hInstance
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC) DlgProc)
return 0
}
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR etat = (LPNMHDR) lParam
switch(Msg)
{
case WM_INITDIALOG:
InitCommonControls()
CreateTabDialog(hWnd)
break
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_QUITTER:
EndDialog(hWnd,IDC_QUITTER)
break
case IDC_APROPOS:
MessageBox(hWnd,"123","A Propos",MB_ICONINFORMATION)
break
}
break
case WM_NOTIFY:
switch(etat->code)
{
case TCN_SELCHANGE:
UpdateTab(hWnd)
break
}
break
case WM_CLOSE:
EndDialog(hWnd,IDC_QUITTER)
break
default:
return(FALSE)
}
return(TRUE)
}
BOOL CreateTabDialog(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
TCITEM tci
m_CTab[0] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB1), hParent, (DLGPROC) Tab1_DlgProc)
m_CTab[1] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB2), hParent, (DLGPROC) Tab2_DlgProc)
tci.mask = TCIF_TEXT
tci.pszText = "Onglet 1"
SendMessage(hTabCtl, TCM_INSERTITEM, 0, (LPARAM) &tci)
tci.pszText = "Onglet 2"
SendMessage(hTabCtl, TCM_INSERTITEM, 1, (LPARAM) &tci)
RECT rcTabCtl
GetWindowRect(hTabCtl, &rcTabCtl)
SendMessage(hTabCtl, TCM_ADJUSTRECT, FALSE, (LPARAM) &rcTabCtl)
MapWindowPoints(NULL, hParent, (LPPOINT) &rcTabCtl, 2)
for(int i = 0i <= 1i++)
{
RECT rcTab
GetWindowRect(m_CTab[i], &rcTab)
int x = (rcTabCtl.left+rcTabCtl.right)/2 - (rcTab.right-rcTab.left)/2
int y = (rcTabCtl.top+rcTabCtl.bottom)/2 - (rcTab.bottom-rcTab.top)/2
SetWindowPos(m_CTab[i], NULL, x, y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOREDRAW)
}
SendMessage(hTabCtl, TCM_SETCURSEL, 0, 0)
UpdateTab(hParent)
return true
}
void UpdateTab(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
int nSelected = SendMessage(hTabCtl, TCM_GETCURSEL, 0, 0)
for(int i = 0i <= 1i++)
ShowWindow(m_CTab[i], (i==nSelected) ? SW_SHOW : SW_HIDE)
}
//tab1
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab1_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MESSAGE:
MessageBox(hDlg,"Juste un ptit message pour dire qu'on est sur l'onglet n?","Onglet 1", MB_ICONINFORMATION)
break
}
break
}
return 0
}
//tab2
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab2_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_COUCOU:
MessageBox(hDlg,"Un ptit COUCOU pour dire que tout marche pour le mieux!","Onglet 2", MB_ICONINFORMATION)
break
}
break
}
return 0
}
#define IDD_DIALOG1 101
#define IDD_DIALOG2 102
#define IDD_TAB1102
#define IDD_TAB2103
#define IDC_TAB11000
#define IDC_TABCTL 1000
#define IDC_CHECK1 1001
#define IDC_RADIO1 1002
#define IDC_MESSAGE 1003
#define IDC_COUCOU 1005
#define IDC_QUITTER 1006
#define IDC_APROPOS 1007
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#include <windows.h>#include "resource.h"
#pragma once
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
HWND m_CTab[2]
LRESULT CALLBACK Tab1_DlgProc(HWND, UINT, WPARAM, LPARAM)
LRESULT CALLBACK Tab2_DlgProc(HWND, UINT, WPARAM, LPARAM)
BOOL CreateTabDialog(HWND hParent)
void UpdateTab(HWND hParent)
HINSTANCE hInst
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
hInst = hInstance
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC) DlgProc)
return 0
}
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR etat = (LPNMHDR) lParam
switch(Msg)
{
case WM_INITDIALOG:
InitCommonControls()
CreateTabDialog(hWnd)
break
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_QUITTER:
EndDialog(hWnd,IDC_QUITTER)
break
case IDC_APROPOS:
MessageBox(hWnd,"123","A Propos",MB_ICONINFORMATION)
break
}
break
case WM_NOTIFY:
switch(etat->code)
{
case TCN_SELCHANGE:
UpdateTab(hWnd)
break
}
break
case WM_CLOSE:
EndDialog(hWnd,IDC_QUITTER)
break
default:
return(FALSE)
}
return(TRUE)
}
BOOL CreateTabDialog(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
TCITEM tci
m_CTab[0] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB1), hParent, (DLGPROC) Tab1_DlgProc)
m_CTab[1] = CreateDialog(hInst, MAKEINTRESOURCE(IDD_TAB2), hParent, (DLGPROC) Tab2_DlgProc)
tci.mask = TCIF_TEXT
tci.pszText = "Onglet 1"
SendMessage(hTabCtl, TCM_INSERTITEM, 0, (LPARAM) &tci)
tci.pszText = "Onglet 2"
SendMessage(hTabCtl, TCM_INSERTITEM, 1, (LPARAM) &tci)
RECT rcTabCtl
GetWindowRect(hTabCtl, &rcTabCtl)
SendMessage(hTabCtl, TCM_ADJUSTRECT, FALSE, (LPARAM) &rcTabCtl)
MapWindowPoints(NULL, hParent, (LPPOINT) &rcTabCtl, 2)
for(int i = 0 i <= 1 i++)
{
RECT rcTab
GetWindowRect(m_CTab[i], &rcTab)
int x = (rcTabCtl.left+rcTabCtl.right)/2 - (rcTab.right-rcTab.left)/2
int y = (rcTabCtl.top+rcTabCtl.bottom)/2 - (rcTab.bottom-rcTab.top)/2
SetWindowPos(m_CTab[i], NULL, x, y, 0, 0, SWP_NOZORDER|SWP_NOSIZE|SWP_NOREDRAW)
}
SendMessage(hTabCtl, TCM_SETCURSEL, 0, 0)
UpdateTab(hParent)
return true
}
void UpdateTab(HWND hParent)
{
HWND hTabCtl = GetDlgItem(hParent, IDC_TABCTL)
int nSelected = SendMessage(hTabCtl, TCM_GETCURSEL, 0, 0)
for(int i = 0 i <= 1 i++)
ShowWindow(m_CTab[i], (i==nSelected) ? SW_SHOW : SW_HIDE)
}
//tab1
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab1_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_MESSAGE:
MessageBox(hDlg,"Juste un ptit message pour dire qu'on est sur l'onglet n?","Onglet 1", MB_ICONINFORMATION)
break
}
break
}
return 0
}
//tab2
#include <windows.h>
#include "resource.h"
LRESULT CALLBACK Tab2_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_COUCOU:
MessageBox(hDlg,"Un ptit COUCOU pour dire que tout marche pour le mieux!","Onglet 2", MB_ICONINFORMATION)
break
}
break
}
return 0
}
#define IDD_DIALOG1 101
#define IDD_DIALOG2 102
#define IDD_TAB1 102
#define IDD_TAB2 103
#define IDC_TAB1 1000
#define IDC_TABCTL 1000
#define IDC_CHECK1 1001
#define IDC_RADIO1 1002
#define IDC_MESSAGE 1003
#define IDC_COUCOU 1005
#define IDC_QUITTER 1006
#define IDC_APROPOS 1007
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
为了做空间后方交会,需要知道影像比例尺、内方位元素、控制点的空间坐标,及其对应像点的像平面坐标。
影像比例尺可以从摄影资料中查取,也可以利用控制点的空间坐标和其对应像点的像平面坐标进行计算。 参数的初值即。在竖直航空摄影且地面控制点大体对称分布的情况下,可按如下方法确定初值:
可在航迹图上找出,或根据控制点坐标通过坐标正反变换求出。 利用角元素近似值计算方向余弦,组成旋转矩阵
下面列出三个矩阵相乘的结果供计算
一个控制点对应的误差方程为
写成矩阵形式为
其中
系数矩阵中的元素均为偏导数。为了计算这些偏导数,引入以下记号:
由于推导过程较为复杂,此处省略,直接给出结果:
对每一个控制点,计算其对应的方程的系数矩阵、常数项,然后联立起来,得:
记为 按最小二乘原理,取权阵为单位阵,则法方程为
这一步骤需要计算出和 按下式可求得的值,即外方位元素的改正数
再将改正数与参数近似值相加,即得后方交会要求解的外方位元素的值。 通常情况下,按以上步骤求得的外方位元素改正数太大,还不能满足实际需求,因此需要迭代。将第7步解得的外方位元素的值作为新的外方位元素近似值,代入第3步,再次开始计算。如此反复,直至外方位元素改正数小于限差为止。通常对角元素设置限差,即。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)