- 博客(8)
- 资源 (5)
- 收藏
- 关注
原创 std::async实例
std::async是C++11提供的专门处理多线程并行任务的类,里面内嵌了std::thread。 用户在使用时,可以不用关心thread内部处理,只需要关心其返回类型std::future<typename std::result_of<F(Ts...)>::type>。 多说无益,上代码。 #include <typeinfo> #include <iostream> #include <future> #include <chro
2021-05-21 23:46:38
270
原创 enable_shared_from_this使用说明
#include "stdafx.h" #include <memory> #include <string> #include <map> #include <functional> #include <mutex> using namespace std; // refereance https://my.oschina.net/u/4586915/blog/4864592 // 浅析C++智能指针和enable_shared_from_th
2021-05-21 23:35:49
237
原创 Dijkstra算法:出航
#include "stdafx.h" #include <iostream> #include <algorithm> #include <vector> #include <list> #include <set> #include <map> using namespace std; #define Inf 100000 // 表明港口间无通路 typedef int from; typedef int to; typedef .
2021-05-21 23:09:40
208
原创 QT智能指针实例
QT智能指针实例 一直没有合适的项目场景来使用智能指针,现在出现了这么一个场景: 在A类中New了一份内存,并且使用成员函数指针对此内存进行管理;在B类中需要经常使用此内存做一些逻辑处理。现在希望的是: 当在A类中释放此内存块时,对应的B类中指针直接变为空指针。UML类图如下所示: A类即Cppbackend;B类即LayerRander的m_layerPath中的Laye...
2018-03-19 13:32:51
1240
原创 OSG 显示3D模型以及对应模型切层的2D效果
在3D打印中,经常需要将打印仓内进行模型的摆放,在控制软件中模拟并呈现出来。最常用的就是在俯视模型(即2D下)的情况下对模型进行摆放。然后在3D模式下对修改调整位置后的模型进行预览。 首先展示一下效果: 图1为3D下的模型效果 图2为2D下的图形效果 在2D模式下对模型进行旋转平移后,对应的要更新3D模型的显示,其本质还是获取2D模型下的变换矩阵,再设置给3D下的模型。下面来...
2017-10-17 17:52:57
2785
原创 OSG自定义拖拽器
#ifndef _OSG_TRACKBALL_AND_TRANSLATEAXIS_DRAGGER_ #define _OSG_TRACKBALL_AND_TRANSLATEAXIS_DRAGGER_ #include #include #include #include #include /** @class TranslatePlaneDraggerXY [TranslatePla
2017-09-11 17:43:44
3320
1
原创 OSG 对线或者点组成的模型选取
#include "PickHandler.h" #include "ModelShape.h" #include "DraggerNodeVisitor.h" #include #include #include #include PickHandler::PickHandler(osg::Node* ptrSceneNode) : m_X(0.0f) , m_Y(0.
2017-08-31 17:48:48
1850
原创 QT下的并行框架
Concurrent Run for (auto layIdx = 0; layIdx != cli->layerCount();++layIdx) { QFutureWatcher* watcher = new QFutureWatcher(); QObject::connect(watcher,SIGNAL(finished()), this, SLOT
2017-08-14 17:23:44
1349
运用Qzxing调用识别二维码,能识别中文!
2014-08-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅