随笔分类 - C++
摘要:直线检测 void Hough_1(int, void*) { vector<Vec4i> vec_lines; HoughLinesP(img_canny1, vec_lines, 1, CV_PI / 360.0, hough_thread,1,50); for (size_t k = 0; k
阅读全文
摘要:osg Image转opencv Mat osg::ref_ptr<osg::Image> saveOsgImgObj = new osg::Image(); saveOsgImgObj = captureCallback2Obj->getOsgCameraImage(); cv::Mat open
阅读全文
摘要:osg绘制圆锥体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUti
阅读全文
摘要:osg绘制球体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUtil
阅读全文
摘要:基于BIM IFC osg的塔吊吊装对位模拟系统 osg::Matrix cameraMatrix = osg::Matrix::translate(-centerVec3d) *osg::Matrix::scale(1.0f, 1.0f, sz_value) *osg::Matrix::trans
阅读全文
摘要:osg相机移动时一定要重写 // 得到逆矩阵,标准接口,控制场景 osg::Matrixd CameraController::getInverseMatrix(void) const { std::cout << " getInverseMatrix " << std::endl; osg::Ma
阅读全文
摘要:osg鼠标缩放 bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) { // 得到x的初始屏幕坐标 float mouseX = ea.getX(); // 得到y的初始屏幕坐标 float mouse
阅读全文
摘要:osg鼠标滚轮类型 enum ScrollingMotion { SCROLL_NONE, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN, SCROLL_2D }; ###########################
阅读全文
摘要:osg::AnimationPath enum LoopMode { SWING, LOOP, NO_LOOPING }; #################################
阅读全文
摘要:osg键盘编码 enum KeySymbol { KEY_Space = 0x20, KEY_0 = '0', KEY_1 = '1', KEY_2 = '2', KEY_3 = '3', KEY_4 = '4', KEY_5 = '5', KEY_6 = '6', KEY_7 = '7', KEY
阅读全文
摘要:osg控制相机移动 viewer->getCameraManipulator()->setHomePosition(_homeEye,_homeCenter,_homeUp); osg::Vec3d _homeEye; osg::Vec3d _homeCenter; osg::Vec3d _home
阅读全文
摘要:osg绘制胶囊体 #include <iostream> #include <osgViewer/Viewer> #include <osg/Node> //#include <osgDB/ReadFile> //#include <osgDB/WriteFile> #include <osgUti
阅读全文
摘要:osg抓图、截图、保存图片 #include <osgViewer/Viewer> #include <osgViewer/ViewerBase> #include <osgViewer/GraphicsWindow> #include <osg/Node> #include <osg/Geode>
阅读全文
摘要:osg截取场景图片 #include <osgViewer/Viewer> #include <osgViewer/ViewerBase> #include <osgViewer/GraphicsWindow> #include <osg/Node> #include <osg/Geode> #in
阅读全文
摘要:osg实现三视图 #include <osg/Geode> #include <osg/Geometry> #include <osg/LineWidth> #include <osgViewer/Viewer> #include <osgViewer/CompositeViewer> #inclu
阅读全文
摘要:1、自动计算施工时间 2、自动生成进度计划 3、动态模拟进度计划 解析ifc,基于ifc的施工进度规划、基于ifc的施工模拟、基于BIM ifc的机械臂模拟....... 从19年8月份以后,就再也没开发这个程序了,这两天论文需要,又打开该项目,增加了一些功能,很开心,感谢之前写好的架构,这次开发很
阅读全文
摘要:QDateTime 增加时间 QDateTime finalDate1 = QDateTime::fromString("2021-09-17 00:11:00", "yyyy-MM-dd HH:mm:ss"); QDateTime endTime = finalDate1.addMSecs(120
阅读全文
摘要:v开头的行是顶点数据, v的行表示是顶点数据之空间坐标(position), vt的行表示是顶点数据之纹理坐标(texture coordinate), vn的行表示是顶点数据之法线向量(normal)。 顶点数据(Vertex data):v 几何体顶点(Geometric vertices)vt
阅读全文
摘要:塔吊模拟 //滑车 box_slider = new osg::Box( osg::Vec3(center_x + tower_width*(14.0f), center_y, index_z - tower_height*1.4f + column_width*4.0f), tower_width
阅读全文
摘要:使用自己的三维建模软件绘制塔吊 if (towerPanelObj==nullptr) { towerPanelObj = new TowerPanel(); towerPanelObj->setWindowTitle(u8"塔吊参数"); QIcon iconApp; iconApp.addFil
阅读全文