Qt 5.15.2 三维显示功能

Qt 5.15.2 三维显示功能

三维显示效果:
在这里插入图片描述

.pro项目文件

QT       += core gui opengl 3dcore 3drender 3dinput 3dextrasgreaterThan(QT_MAJOR_VERSION, 4): QT += widgetsCONFIG += c++17# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0SOURCES += \dialog_fbx2glb.cpp \dialog_osgb_to_b3dm.cpp \main.cpp \mainwindow.cpp \scene.cppHEADERS += \dialog_fbx2glb.h \dialog_osgb_to_b3dm.h \mainwindow.h \scene.hFORMS += \dialog_fbx2glb.ui \dialog_osgb_to_b3dm.ui \mainwindow.ui# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetDISTFILES += \images/211.ico \images/Clear2.ico \images/File.ico \images/Open.ico \images/opendir.png \images/openfile.png

Scene.h

#ifndef SCENE_H
#define SCENE_H#include <QObject>
#include <QWidget>#include <Qt3DCore/QEntity>
#include <Qt3DRender/QMesh>
#include <Qt3DRender/QCamera>
#include <Qt3DRender/QPointLight>
#include <Qt3DRender/QDirectionalLight>
#include <Qt3DCore/QTransform>
#include <Qt3DWindow>
#include <QOrbitCameraController>
#include <QFirstPersonCameraController>#include <Qt3DExtras/QForwardRenderer>
#include <Qt3DExtras/QPhongMaterial>
#include <Qt3DExtras/QTorusMesh>
#include <Qt3DExtras/QSphereMesh>#include <QKeyEvent>
#include <QTransform>
#include <QComponent>
#include <QQuaternion>
#include <QInputAspect>class Scene : public QObject
{Q_OBJECT
public:Qt3DCore::QEntity *rootEntity;Qt3DCore::QEntity *model;Qt3DCore::QTransform *transform;Qt3DRender::QDirectionalLight *light;//explicit Scene(Qt3DExtras::Qt3DWindow *, QObject *parent=nullptr);void SetupMesh(Qt3DRender::QMesh *mesh);void StartScene();void Camera(Qt3DExtras::Qt3DWindow *view);void setCameraCenterPoint(QVector3D center);Qt3DCore::QEntity* findChildQEntity(QString objName,Qt3DCore::QEntity* rootEnt);QVector3D computCenterPoint(Qt3DCore::QEntity* first);void initOrbitCameraController(Qt3DCore::QEntity *ent);void initFirstPersonCameraController(Qt3DCore::QEntity *ent);void init3d(Qt3DExtras::Qt3DWindow *view);void NewScene(Qt3DRender::QMesh *);void NewScene2(Qt3DRender::QMesh *mesh);void SetupTransformRoot(Qt3DCore::QEntity* model);void SetupTransform(Qt3DCore::QEntity* modelPrivate);void SetupMaterial(Qt3DCore::QEntity* model);void SetupLighting();//添加新实体Qt3DCore::QEntity* addMeshEntity(Qt3DRender::QMesh *mesh);Qt3DCore::QEntity* addEntity(Qt3DCore::QComponent *comp);//Qt3DCore::QEntity* addNewEntity();//void KeyControls(QKeyEvent *event);void wheelControls(QWheelEvent *event);void mouseControls(QMouseEvent *event);void mousePressControls(QMouseEvent *event);void paintALL();public slots:void LightXChanged(int angle);void LightYChanged(int angle);void LightZChanged(int angle);private:Qt3DExtras::Qt3DWindow *view;unsigned int backgroudColor=0x42f4bc;    //0xffffff;  0x42f4bc//QPoint m_qpRotPosOld;int m_iScloe; //滚动放大缩小尺寸//旋转double m_dRotX;double m_dRotY;double m_dRotZ;//位移double m_dMoveX;double m_dMoveY;double m_dMoveZ;//};#endif // SCENE_H

scene.cpp

#include "scene.h"
#include <cmath>Scene::Scene(Qt3DExtras::Qt3DWindow *view, QObject *parent) : QObject (parent)
{this->view=view;rootEntity = new Qt3DCore::QEntity();SetupTransformRoot(rootEntity);//view->setRootEntity(rootEntity);view->defaultFrameGraph()->setClearColor(QColor(QRgb(this->backgroudColor)));   //0x42f4bcCamera(view);StartScene();//this->initOrbitCameraController(rootEntity);//this->initFirstPersonCameraController();
}void Scene::Camera(Qt3DExtras::Qt3DWindow *view)
{//其中camera是新建的camera实体,lens表示了镜头,这个函数有着四个参数,//第一个参数是视觉域,   45.0f//第二个是分辨率(这里选择了16比9),  16.0f/9.0f//第三个参数是近面摆放位置,   0.1f//最后一个是远面放置位置,    3000.0f//后两个参数的选择当中要特别注意,只有在远近面之间的物体才会显示,所以要是想全部显示出所加入的实体,//那么近面就要足够近,远面就要足够远。// Camera//Qt3DRender::QCamera *cameraEntity = view->camera();Qt3DRender::QCamera *camera = view->camera();camera->lens()->setPerspectiveProjection(45.0f,16.0f/9.0f, 0.1f, 3000.0f);   //近面板0.1f,远面板1000.0fcamera->setViewCenter(QVector3D(-789, -2343, 10));    //0, 0, 0camera->setPosition(QVector3D(-789, -2343, 200));   //0,0,40  -200  5000  相机高度Qt3DInput::QInputAspect *input = new Qt3DInput::QInputAspect();view->registerAspect(input);//input->setCamera(cameraEntity);//使摄像机能左右转动
}void Scene::setCameraCenterPoint(QVector3D center)
{Qt3DRender::QCamera *camera = view->camera();camera->lens()->setPerspectiveProjection(45.0f,16.0f/9.0f, 0.1f, 3000.0f);   //近面板0.1f,远面板1000.0fcamera->setViewCenter(QVector3D(center.x()*1.5, center.y()*1.5, abs(center.z())));    //0, 0, 0camera->setPosition(QVector3D(center.x()*1.5, center.y()*1.5, abs(center.z())*1.5+50));   //0,0,40  -200  5000  相机高度qDebug()<<"camera point="<<camera->position();//Qt3DInput::QInputAspect *input = new Qt3DInput::QInputAspect();view->registerAspect(input);
}Qt3DCore::QEntity* Scene::findChildQEntity(QString objName,Qt3DCore::QEntity* rootEnt)
{for (Qt3DCore::QNode* childNode : rootEnt->childNodes()){QString itemName="";Qt3DCore::QEntity* testObj=dynamic_cast<Qt3DCore::QEntity*>(childNode);if(testObj){itemName=testObj->objectName();if(objName==itemName){return testObj;}}}return nullptr;
}QVector3D Scene::computCenterPoint(Qt3DCore::QEntity* first)
{QVector3D center(0, 0, 0);if(first!=nullptr){// Now iterate over all the components and calculate the center pointint totalSize=0;//for (Qt3DCore::QNode* childNode : first->childNodes()){Qt3DCore::QTransform* tranobj=dynamic_cast<Qt3DCore::QTransform*>(childNode);if(tranobj){center += tranobj->translation();totalSize+=1;}Qt3DRender::QMesh* meshobj=dynamic_cast<Qt3DRender::QMesh*>(childNode);if(meshobj){center += meshobj->geometry()->minExtent();center += meshobj->geometry()->maxExtent();totalSize+=2;}}//center /= totalSize; // compute the center point//定位相机//scene->setCameraCenterPoint(center);//}return center;
}void Scene::init3d(Qt3DExtras::Qt3DWindow *view)
{delete model;//view->defaultFrameGraph()->setClearColor(QColor(QRgb(this->backgroudColor)));Camera(view);this->StartScene();
}void Scene::StartScene()
{model = new Qt3DCore::QEntity(rootEntity);model->setObjectName("救生圈场景模型");//救生圈场景 模型   这个尺寸大小影响显示Qt3DExtras::QTorusMesh *torusMesh = new Qt3DExtras::QTorusMesh(model);torusMesh->setRadius(5);torusMesh->setMinorRadius(1);torusMesh->setRings(100);torusMesh->setSlices(20);model->addComponent(torusMesh);/*Qt3DExtras::QSphereMesh *sphereMesh = new Qt3DExtras::QSphereMesh(model);sphereMesh->setRadius(5);model->addComponent(sphereMesh);QString filename="C:/data/obj/Tile_+005_+006_OBJ/Tile_+005_+006/Tile_+005_+006.obj";//filename="D:\\data\\data3d\fbx\\HCZ.fbx";Qt3DRender::QMesh *mesh = new Qt3DRender::QMesh(model);mesh->setSource(QUrl::fromLocalFile(filename));mesh->setMeshName("objMesh");//mesh->setSource(QUrl("qrc:/data/obj/Tile_+005_+006_OBJ/Tile_+005_+006/Tile_+005_+006.obj"));//mesh->setSource(QUrl(filename));   //file:///model->addComponent(mesh);*///SetupTransform(model);SetupMaterial(model);SetupLighting();}void Scene::NewScene(Qt3DRender::QMesh *mesh)
{delete model;model = new Qt3DCore::QEntity(rootEntity);SetupMesh(mesh);SetupTransform(model);SetupMaterial(model);SetupLighting();
}
void Scene::NewScene2(Qt3DRender::QMesh *mesh)
{delete model;model = new Qt3DCore::QEntity(rootEntity);SetupMesh(mesh);SetupTransform(model);SetupMaterial(model);SetupLighting();
}
Qt3DCore::QEntity* Scene::addMeshEntity(Qt3DRender::QMesh *mesh)
{Qt3DCore::QEntity* newEnt = new Qt3DCore::QEntity(rootEntity);newEnt->addComponent(mesh);return newEnt;
}Qt3DCore::QEntity* Scene::addEntity(Qt3DCore::QComponent *comp)
{Qt3DCore::QEntity* newEnt = new Qt3DCore::QEntity(rootEntity);newEnt->addComponent(comp);return newEnt;
}Qt3DCore::QEntity* Scene::addNewEntity()
{return new Qt3DCore::QEntity(rootEntity);
}void Scene::SetupMesh(Qt3DRender::QMesh *mesh)
{model->addComponent(mesh);
}void Scene::SetupTransformRoot(Qt3DCore::QEntity* model)
{transform = new Qt3DCore::QTransform(model);transform->setScale3D(QVector3D(1, 1, 1));transform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), 0));//transform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0, 1, 0), 0));//transform->setScale(1.0f);//transform->setTranslation(QVector3D(-700.0f,-2100.0f,10.0f));model->addComponent(transform);
}
void Scene::SetupTransform(Qt3DCore::QEntity* modelPrivate)
{Qt3DCore::QTransform* tf = new Qt3DCore::QTransform(modelPrivate);tf->setScale3D(QVector3D(1, 1, 1));tf->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0, 0, 0), 0));//tf->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0, 1, 0), 0));//tf->setScale(1.0f);//tf->setTranslation(QVector3D(-700.0f,-2100.0f,10.0f));modelPrivate->addComponent(tf);
}void Scene::SetupMaterial(Qt3DCore::QEntity* model)
{Qt3DRender::QMaterial *material = new Qt3DExtras::QPhongMaterial(model);model->addComponent(material);
}void Scene::SetupLighting()
{Qt3DCore::QEntity *lightEntity = new Qt3DCore::QEntity(rootEntity);light = new Qt3DRender::QDirectionalLight(lightEntity);light->setColor("white");light->setIntensity(1);light->setWorldDirection(QVector3D(0,0,-1));lightEntity->addComponent(light);
}//接管相机的鼠标操作 盘旋操作
void Scene::initOrbitCameraController(Qt3DCore::QEntity *ent)
{Qt3DExtras::QOrbitCameraController *controller = new Qt3DExtras::QOrbitCameraController(ent);controller->setCamera(view->camera());}
//接管相机的鼠标操作  第一人操作
void Scene::initFirstPersonCameraController(Qt3DCore::QEntity *ent)
{Qt3DExtras::QFirstPersonCameraController *controller=new Qt3DExtras::QFirstPersonCameraController(ent);controller->setCamera(view->camera());
}void Scene::paintALL()
{//对rootEntity 整体操作transform->setTranslation(QVector3D(m_dMoveX,m_dMoveY,m_iScloe));transform->setRotation(QQuaternion(sqrt(m_dRotX*m_dRotX+m_dRotY*m_dRotY),m_dRotX,m_dRotY,m_dRotZ));}//mouse wheel +/-  放大/缩小 功能
void Scene::wheelControls(QWheelEvent *event)
{float scale=2;if(event->angleDelta().x() >0 || event->angleDelta().y()>0){//放大//scale=1.1f;transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y(),transform->translation().z()+scale));}else{   //缩小//scale=0.9f;transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y(),transform->translation().z()-scale));}/*if (event->delta() < 0) {//m_iScloe--;m_iScloe=event->delta();this->paintALL();}else if (event->delta() > 0) {//m_iScloe++;m_iScloe=event->delta();this->paintALL();}*/}void Scene::mousePressControls(QMouseEvent *event)
{if(event->button()==Qt::LeftButton){}
}void Scene::mouseControls(QMouseEvent *event)
{QPoint pos = event->pos();//左键按下+move=>旋转if( event->buttons() & Qt::LeftButton){if (pos.x()  > m_qpRotPosOld.x()){m_dRotX += 1;}else if(pos.x()  < m_qpRotPosOld.x()){m_dRotX -= 1;}if(pos.y()  > m_qpRotPosOld.y()){m_dRotY += 1;}else if(pos.y()  < m_qpRotPosOld.y()){m_dRotY -= 1;}//this->paintALL();}if( event->buttons() & Qt::RightButton)             //右键{   //右键按下+move=>移动if (pos.x()  > m_qpRotPosOld.x()){m_dMoveX += 1;}else if(pos.x()  < m_qpRotPosOld.x()){m_dMoveX -= 1;}if(pos.y()  > m_qpRotPosOld.y()){m_dMoveY -= 1;}else if(pos.y()  < m_qpRotPosOld.y()){m_dMoveY += 1;}//this->paintALL();}//rotateif(event->button() & Qt::RightButton){   //mouse right press and moveing//if(event->type()==QEvent::MouseMove){//event->MouseButtonPressint dy=pos.y()-m_qpRotPosOld.y();int dx=pos.x()-m_qpRotPosOld.x();if(dy>0){transform->setRotationY(transform->rotationY()+1);}else if(dy<0){transform->setRotationY(transform->rotationY()-1);}//if(dx>0){transform->setRotationX(transform->rotationX()+1);}else if(dx<0){transform->setRotationX(transform->rotationX()-1);}}}/**///moveif(event->button() & Qt::LeftButton){   //mouse right press and moveing//if(event->type()==QEvent::MouseMove){//event->MouseButtonPressint dy=pos.y()-m_qpRotPosOld.y();int dx=pos.x()-m_qpRotPosOld.x();if(dy>0){transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y()-2,transform->translation().z()));}else if(dy<0){transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y()+2,transform->translation().z()));}if(dx>0){transform->setTranslation(QVector3D(transform->translation().x()-2,transform->translation().y(),transform->translation().z()));}else if(dx<0){transform->setTranslation(QVector3D(transform->translation().x()+2,transform->translation().y(),transform->translation().z()));}}}//旋转显示窗口//glTranslatef(m_dMoveX, m_dMoveY, m_iScloe);//glRotatef(sqrt(m_dRotX*m_dRotX+m_dRotY*m_dRotY), m_dRotY,m_dRotX,m_dRotZ);m_qpRotPosOld = pos;
}void Scene::KeyControls(QKeyEvent *event){if (event->modifiers().testFlag(Qt::ControlModifier)){//ctrl+方向键if(event->key()==Qt::Key_Up){transform->setRotationX(transform->rotationX()-6);}if(event->key()==Qt::Key_Down){transform->setRotationX(transform->rotationX()+6);}if(event->key()==Qt::Key_Left){transform->setRotationY(transform->rotationY()-6);}if(event->key()==Qt::Key_Right){transform->setRotationY(transform->rotationY()+6);}}else if (event->modifiers().testFlag(Qt::ShiftModifier)) {//shift+方向键 上/下if(event->key()==Qt::Key_Up){  //放大transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y(),transform->translation().z()-2));}if(event->key()==Qt::Key_Down){  //缩小transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y(),transform->translation().z()+2));}}else{//方向键  moveif(event->key()==Qt::Key_Up){transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y()+1,transform->translation().z()));}if(event->key()==Qt::Key_Down){transform->setTranslation(QVector3D(transform->translation().x(),transform->translation().y()-1,transform->translation().z()));}if(event->key()==Qt::Key_Left){transform->setTranslation(QVector3D(transform->translation().x()-1,transform->translation().y(),transform->translation().z()));}if(event->key()==Qt::Key_Right){transform->setTranslation(QVector3D(transform->translation().x()+1,transform->translation().y(),transform->translation().z()));}}
}void Scene::LightXChanged(int angle)
{light->setWorldDirection(QVector3D(angle,light->worldDirection().y(),light->worldDirection().z()));
}void Scene::LightYChanged(int angle)
{light->setWorldDirection(QVector3D(light->worldDirection().x(),angle,light->worldDirection().z()));
}void Scene::LightZChanged(int angle)
{light->setWorldDirection(QVector3D(light->worldDirection().x(),light->worldDirection().y(),angle));
}

本blog地址:https://blog.csdn.net/hsg77

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/216492.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

虚幻学习笔记10—C++函数与蓝图的通信

一、前言 除了上一章C变量与蓝图通信讲的变量能与蓝图通信外&#xff0c;还有函数和枚举也可以和蓝图通信。函数的关键字为”UFUNCTION“、枚举的关键字为”UENUM“。 二、实现 2.1、BlueprintCallable蓝图中调用 该函数时带执行的&#xff0c;带入如下。编译成功后在蓝图中输…

Android 11 适配——整理总结篇

背景 > 经过检测&#xff0c;我们识别到您的应用&#xff0c;目前未适配安卓11&#xff08;API30&#xff09;&#xff0c;请您关注适配截止时间&#xff0c;尽快开展适配工作&#xff0c;避免影响应用正常发布和经营。 > targetSdkVersion30 升级适配工作参考文档&am…

【算法】递归、搜索与回溯算法

文章目录 一. 名词解释1. 递归1.1 什么是递归&#xff1f;1.2 为什么会用到递归&#xff1f;1.3 如何理解递归&#xff1f;1.4 如何写好一个递归&#xff1f; 2. 遍历和搜索3. 回溯和剪枝 二. 递归系列专题1. 汉诺塔问题2. 合并两个有序链表3. 反转链表4. 两两交换链表中的节点…

git自动更新功能

确认权限 因为一般Linux系统网页用的www 或 www-data用户和用户组&#xff0c;所以要实现自动来去&#xff0c;首先要在www用户权限下生成ssh密钥&#xff0c;不然没有权限&#xff0c;其次就是&#xff0c;要把用root用户拉去的代码&#xff0c;批量改成www用户 1. 给www权…

Unity | 渡鸦避难所-2 | 搭建场景并添加碰撞器

1 规范项目结构 上期中在导入一系列的商店资源包后&#xff0c;Assets 目录已经变的混乱不堪 开发过程中&#xff0c;随着资源不断更新&#xff0c;遵循一定的项目结构和设计规范是非常必要的。这可以增加项目的可读性、维护性、扩展性以及提高团队协作效率 这里先做下简单的…

最新鸿蒙HarmonyOS4.0开发登陆的界面1

下载deveco-studio 说明一下&#xff0c;本人只是学习中&#xff0c;现在只是拿着vue及uniapp的经验在一点一点的折腾&#xff0c;不过现在看来&#xff0c;鸿蒙入门并不是很难。也许是自己没有深入下去。 https://developer.harmonyos.com/cn/develop/deveco-studio#download…

Ubuntu 20.04 安装 mysql8 LTS

Ubuntu 20.04 安装 mysql8 LTS sudo apt-get update sudo apt-get install mysql-server -y mysql --version mysql Ver 8.0.35-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu)) Ubuntu20.04 是自带了 MySQL8. 几版本的&#xff0c;低于 20.04 则默认安装是 MySQL5.7.33…

基于Java8构建Docke镜像

基于Java8构建Docke镜像 搜索java8安装包 docker search java8 --no-trunc &#xff0c; --no-trunc展开描述信息 选择拉取 docker pull docker.io/mykro/java8-jre&#xff0c;为了减少磁盘占用&#xff0c;选择jre版本基础镜像 在宿主机创建文件夹iot&#xff0c;并把所需…

IDEA中,光标移动快捷键(Shift + 滚轮前后滚动:当前文件的横向滚动轴滚动。)

除此之外&#xff0c;其他常用的光标移动快捷键包括&#xff1a; Shift 滚轮前后滚动&#xff1a;当前文件的横向滚动轴滚动。Shiftenter&#xff1a;快速将鼠标移动到下一行。Ctrl ]&#xff1a;移动光标到当前所在代码的花括号结束位置。Ctrl 左方向键&#xff1a;光标跳转…

VisualSVN Server的安装全过程

目录 背景: 安装过程&#xff1a; 步骤1&#xff1a; 步骤2&#xff1a; 步骤3&#xff1a; 步骤4&#xff1a; 步骤5&#xff1a; 安装出现的bug&#xff1a; 问题: 解决办法: 总结: 背景: VisualSVN Server 是一款免费的 SVN (Subversion) 服务器软件&#xff0c…

大数据技术8:StarRocks极速全场景MPP数据库

前言&#xff1a;StarRocks原名DorisDB&#xff0c;是新一代极速全场景MPP数据库。StarRocks 是 Apache Doris 的 Fork 版本。StarRocks 连接的多种源。一是通过这个 CDC 或者说通过这个 ETL 的方式去灌到这个 StarRocks 里面&#xff1b;二是还可以去直接的和这些老的 kafka 或…

【报错栏】(vue)Module not found: Error: Can‘t resolve ‘element-ui‘ in xxx

Module not found: Error: Cant resolve element-ui in xxx 报错原因是&#xff1a; 未安装 element-ui 依赖 解决&#xff1a; npm install element-ui 运行

h2-database 安装部署学习

1&#xff0c;下载jar 包 Archive Downloads 进入到下载的包的位置&#xff1a; cd E:\IDE\Java\jre\lib 2&#xff0c;参考以下说明进行数据库创建&#xff1a; Tutorial 执行如下 可以进行创建默认的数据库 设置用户密码 E:\IDE\Java\jre\lib> java -cp h2-2.2.224.…

体系化学习运筹学基础算法的实践和总结

文章目录 引言目标设计目标实践文章汇总经验总结一则预告 引言 眨眼间已经12月了&#xff0c;眼看着2023年马上要过完了。 女朋友最近总说&#xff0c;工作以后感觉时间过的好快。事实上&#xff0c;我也是这么认为的。年纪越大&#xff0c;越会担心35岁危机的降临。所以&…

波奇学Linux:环境变量,本地变量和内建命令

Windows下的环境变量 echo $PATH 查看指令搜索命令路径 在bash命令行输入的指令&#xff0c;系统根据PATH中的路径查询。 增加PATH指令 $PATH等于上面的路径 :表示不同路径分割符 /home/boki/lesson13代表新的路径 相当于一个赋值语句。 相当于指令&#xff0c;可以直接使用…

K8s中pod詳解

目录 Yaml语法解析 Pod pod是如何被创建的 1.创建一个pod 2.创建一个多容器pod 进入容器 3.配置节点标签 4.Pod容器的交互 4.1创建pod&#xff0c;并做本地解析 4.2pod共享进程 4.3pod共享宿主机namespace 5.钩子函数lifecycle 基础指令 # 查看对应资源: 状态 $ kubectl…

数据结构二维数组计算题,以行为主?以列为主?

1.假设以行序为主序存储二维数组Aarray[1..100,1..100]&#xff0c;设每个数据元素占2个存储单元&#xff0c;基地址为10&#xff0c;则LOC[5,5]&#xff08; &#xff09;。 A&#xff0e;808 B&#xff0e;818 C&#xff0e;1010 D&…

〖大前端 - 基础入门三大核心之JS篇(53)〗- 构造函数与类

说明&#xff1a;该文属于 大前端全栈架构白宝书专栏&#xff0c;目前阶段免费&#xff0c;如需要项目实战或者是体系化资源&#xff0c;文末名片加V&#xff01;作者&#xff1a;哈哥撩编程&#xff0c;十余年工作经验, 从事过全栈研发、产品经理等工作&#xff0c;目前在公司…

ffmpeg编解码——数据包(packet)概念(如何正确处理数据包中的显示时间戳pts与解码时间戳dts关系?)

文章目录 FFmpeg编解码——数据包&#xff08;Packet&#xff09;概念1. 数据包&#xff08;Packet&#xff09;简介2. 数据包&#xff08;Packet&#xff09;在FFmpeg中的应用2.1 从媒体文件读取数据包2.2 向媒体文件写入数据包 3. 数据包&#xff08;Packet&#xff09;相关问…

推荐一款好用的包含表格识别的OCR网站

在当今数字化的时代&#xff0c;文字和表格识别已经成为了许多行业的关键技术。无论是处理大量的纸质文档&#xff0c;还是从网络上收集数据&#xff0c;OCR&#xff08;光学字符识别&#xff09;技术都扮演着重要的角色。然而&#xff0c;对于许多用户来说&#xff0c;OCR软件…