摘要:
一、概述 恰巧正在做一个多线程通信的项目,具体功能是与下位机交互和文件发送,在子线程中实现命令发送和文件传输。使用movetothread主要遇到以下几个问题: 1. Socket notifiers cannot be enabled or disabled from another thread 阅读全文
摘要:
一、 设计思路 1. 用例图管理 2.困惑点: (1) 在程序编写中,为什么主程序的Shader可以关联到model类中的数据。 解决:在加载数据方面,利用VBO、VAO等,已经将数据通过处理推到GPU上。 二、 代码实现 GLHeader.h #pragma once #include <QOpe 阅读全文
摘要:
1. 着色器编译 2. VAO/VBO绑定 阅读全文
摘要:
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 阅读全文
摘要:
1. 函数模板 目的:使用模板的目的就是能够让程序员编写与类型无关的代码。 语法格式: //class 可以与 typename 互换 template <class 形参名,class 形参名,......> 返回类型 函数名(参数列表) { 函数体 } 示例: #include <iostrea 阅读全文
摘要:
#include <thread> #include <iostream> using namespace std; void ThreadMain() { cout<<"begin subthread main"<<this_thread::get_id()<<endl; for(int i =0 阅读全文
摘要:
格式1: 1. 定义回调函数, void MyCallbackFunc( vtkObject* caller, long unsigned int eventId, void* clientData, void* callData ) { //输出鼠标点击的次数 std::cout<<"You ha 阅读全文
摘要:
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] = { 阅读全文
摘要:
本来要做的是地层模型,没想到阴差阳错做了两个地层,如果继续把周围点连接成面会得到一个中空的地质体。果断放弃,另辟蹊径。 string Trim(string& str) { //str.find_first_not_of(" \t\r\n"),在字符串str中从索引0开始,返回首次不匹配"\t\r\ 阅读全文
摘要:
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 阅读全文