当前位置:网站首页>VTK initialization code learning 1
VTK initialization code learning 1
2022-06-26 02:02:00 【ooolmf】
// Dialog initialization function OnInitDialog()
//http://www.manongjc.com/detail/25-owjledgivqlvees.html
CListBox* plistb; // Parameters of the calibrated dialog box , The pointer
BOOL Cmy3DScanMFCDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Set the icon for this dialog . When the application's main window is not a dialog box , The frame will automatically
// Do this
SetIcon(m_hIcon, TRUE); // Set the big icon
SetIcon(m_hIcon, FALSE); // Set up small icons
// TODO: Add additional initialization code here
cv::namedWindow("1", cv::WINDOW_AUTOSIZE);// utilize opencv Create a window
GetDlgItem(IDC_STATIC)->GetWindowRect(&rec1);// Get the rectangular size of the window
cv::resizeWindow("1", rec1.Width(), rec1.Height());// take opencv Window settings and MFC The created rectangle is the same size
HWND hWnd = (HWND)cvGetWindowHandle("1");// take cv Get the handle of the window , Cast to MFC The handle of
HWND hParent = ::GetParent(hWnd);// Capture the parent window handle of the child window , Assign a value to hParent
::SetParent(hWnd, GetDlgItem(IDC_STATIC)->m_hWnd);
::ShowWindow(hParent, SW_HIDE);// Hide parent window
//MyPointCloud mpc
// Create a PCL example , And reset the observation vision of the point cloud
mpc.viewer.reset(new pcl::visualization::PCLVisualizer("3D viewer", false));
// Point cloud reset
mpc.cloud.reset(new pcl::PointCloud<pcl::PointXYZ>);
Set the background color to black
mpc.viewer->setBackgroundColor(0, 0, 0);
//mpc.viewer->addCoordinateSystem(0.05f);
// Create a windows Window static control
CStatic *pclStatic = new CStatic();
LPRECT rect = new CRect;
//PCL Static window
pclStatic = (CStatic*)GetDlgItem(IDC_STATIC2);
// Point cloud window vtkRenderWindow
//renwin The pointer , Point to viewer This window
mpc.renwin = mpc.viewer->getRenderWindow();
// take renwin Parent window of ID, Set to MFC Of pclStatic Of ID.
mpc.renwin->SetParentId(pclStatic->m_hWnd);
// take VTK Some information displayed , close
Just started Qt To write VTK In the program , Always pop up vtkOutputWindow window ,
// Although it has no effect on the program results , But it's very annoying , Taste
// Test image VC In the same way GlobalWarningDisplayOff() Function to close ,
// Only some information can be closed , But cannot close because Qt and VTK Some usage warnings for version update .
// After various verification , All warnings need to be turned off , Need to be in use CMake To configure VTK Installation sln Time selection
// VTK_LEGACY_SILENT by on. If you have installed it ,
// It needs to be reused CMake To configure , And install it again .
mpc.iren->GlobalWarningDisplayOff();
// Specific use process : Create an interleaver iren
//1. Create an interleaver vtkRenderWindowInteractor object iren;
// 2. To object iren Set up SetRenderWindow() Windows that require interaction ;
// 3. To object iren Appoint SetInteractorStyle() Specific ways of interaction , If not specified , The interleaver will use the default interaction mode ;
// 4. To the object iren initialization Initialize, call Start Start interacting ;
// ————————————————
// Copyright notice : This paper is about CSDN Blogger 「 Black mountain old demon's blog 」 The original article of , follow CC 4.0 BY - SA Copyright agreement , For reprint, please attach the original source link and this statement .
// Link to the original text :https ://blog.csdn.net/liushao1031177/article/details/117585653
mpc.iren = vtkRenderWindowInteractor::New();
// This function returns the specified pclStatic The size of the window's border rectangle , Assign a value to rect
pclStatic->GetWindowRect(rect);
// Put control pclStatic The size of the rectangle is calculated , Set the window size of the point cloud equal to pclstatic Size
mpc.renwin->SetSize(rect->right - rect->left, rect->bottom - rect->top);
// take renwein Window location , Set to 00
mpc.renwin->SetPosition(0, 0);
// The interleaver iren Set to point cloud renwin
mpc.iren->SetRenderWindow(mpc.renwin);
mpc.viewer->createInteractor();
mpc.iren->Render();
mpc.renwin->Render();
//dlp initialization , How to call ?????
// The parameter control will be calibrated , The pointer goes to plistb
plistb = ((CListBox*)GetDlgItem(IDC_LIST1));
return TRUE; // Unless you set the focus to the control , Otherwise return to TRUE
}
边栏推荐
猜你喜欢

biggan:large scale gan training for high fidelity natural image synthesis

阳光男孩陈颢天 受邀担任第六季完美童模全球总决赛代言人

Dataframe to list

CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕

Abnova anti GBA monoclonal antibody solution

Wanglaoji pharmaceutical's public welfare activity of "caring for the most lovely people under the scorching sun" was launched in Hangzhou

元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人

一分钟了解同步、异步、阻塞和非阻塞的区别

recv & send

Mot - clé C facile à comprendre statique
随机推荐
Computer shortcut keys commonly used by experts
Make a row of the dataframe a column name
求n乘阶之和
keda 2.7.1 scaledJob 代码简要分析
17.11 std:: atomic continuation, std:: async in-depth discussion
How to efficiently complete daily tasks?
将weishi相机图片进行转换
Wechat circle of friends test point
Application and chemical properties of elastase
Abnova CSV monoclonal antibody solution
The answer skills and examples of practical cases of the second construction company are full of essence
CYCA少儿形体礼仪 乐清市培训成果考核圆满落幕
Difference between app test and web test
PTA class a simulation bomb 10: 1119-1123
如何使用命令将文件夹中的文件名(包括路径)写入到txt文件中
Tengwenze, a hot-blooded boy, was invited to serve as the image ambassador of the global finals of the sixth season perfect children's model
Gun make (3) Rules for makefile
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
Playful girl wangyixuan was invited to serve as the Promotion Ambassador for the global finals of the sixth season perfect children's model
标定。。。