摘要: 一、概述 恰巧正在做一个多线程通信的项目,具体功能是与下位机交互和文件发送,在子线程中实现命令发送和文件传输。使用movetothread主要遇到以下几个问题: 1. Socket notifiers cannot be enabled or disabled from another thread 阅读全文
posted @ 2024-02-26 15:03 二先生- 阅读(1002) 评论(0) 推荐(0) 编辑
摘要: 一、 设计思路 1. 用例图管理 2.困惑点: (1) 在程序编写中,为什么主程序的Shader可以关联到model类中的数据。 解决:在加载数据方面,利用VBO、VAO等,已经将数据通过处理推到GPU上。 二、 代码实现 GLHeader.h #pragma once #include <QOpe 阅读全文
posted @ 2023-07-13 11:46 二先生- 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1. 着色器编译 2. VAO/VBO绑定 阅读全文
posted @ 2023-02-06 13:50 二先生- 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 1. 区别与应用 2. 示例 struct A{}; class B : A{};//private继承 struct C : B{}; //public继承 struct A//定义一个struct { char c1; int n2; double db3; }; A a={'p',7,3.14 阅读全文
posted @ 2023-01-04 11:52 二先生- 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 1. 函数模板 目的:使用模板的目的就是能够让程序员编写与类型无关的代码。 语法格式: //class 可以与 typename 互换 template <class 形参名,class 形参名,......> 返回类型 函数名(参数列表) { 函数体 } 示例: #include <iostrea 阅读全文
posted @ 2022-11-10 09:30 二先生- 阅读(36) 评论(0) 推荐(0) 编辑
摘要: #include <thread> #include <iostream> using namespace std; void ThreadMain() { cout<<"begin subthread main"<<this_thread::get_id()<<endl; for(int i =0 阅读全文
posted @ 2022-07-18 17:07 二先生- 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 格式1: 1. 定义回调函数, void MyCallbackFunc( vtkObject* caller, long unsigned int eventId, void* clientData, void* callData ) { //输出鼠标点击的次数 std::cout<<"You ha 阅读全文
posted @ 2022-06-13 09:14 二先生- 阅读(429) 评论(0) 推荐(0) 编辑
摘要: int main() { const int num_points = 5; static float x[num_points][3] = { {0,0,0},{1,0,0},{1,1,0},{0,1,0},{0.5,0.5,1} }; static vtkIdType pts[4][3] = { 阅读全文
posted @ 2022-04-16 15:12 二先生- 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 本来要做的是地层模型,没想到阴差阳错做了两个地层,如果继续把周围点连接成面会得到一个中空的地质体。果断放弃,另辟蹊径。 string Trim(string& str) { //str.find_first_not_of(" \t\r\n"),在字符串str中从索引0开始,返回首次不匹配"\t\r\ 阅读全文
posted @ 2022-04-16 15:11 二先生- 阅读(41) 评论(0) 推荐(0) 编辑
摘要: int main() { int i; static float x[8][3] = { {0,0,0},{1,0,0},{1,1,0},{0,1,0}, {0,0,1},{1,0,1},{1,1,1},{0,1,1} }; static vtkIdType pts[6][4] = { {0,1,2 阅读全文
posted @ 2022-04-15 14:57 二先生- 阅读(186) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示