DXF笔记:多义线线宽模拟实现

2023-11-22 00:20

本文主要是介绍DXF笔记:多义线线宽模拟实现,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

线宽模拟思路

参看之前的文章:DXF笔记:多义线线宽的绘制思路

示例代码

演示了实现思路,展示了核心代码,因为依赖了其他一些代码,所以不能直接运行。

//osg图元项 shanql 2022.8.12
struct tagOsgPrimitiveItem
{tagOsgPrimitiveItem() :m_bFillMode(false){}osg::ref_ptr<osg::Vec3dArray> m_pVertextArray; //图元顶点数组osg::PrimitiveSet::Mode m_enPrimitiveMode; //图元类型,如线,三角形等bool m_bFillMode; //是否为填充模式//如果是直线,这个保存着直线原始起末点AcGePoint3d m_ptLineStart;AcGePoint3d m_ptLineEnd;
};/*
* @brief 获取GeomArc的散列点
* @author shanql
* @date 2022.8.11
*/
static osg::ref_ptr<osg::Vec3dArray> GetGeomArcSamplePoint(std::shared_ptr<GeomArc> pGeomArc)
{if (!pGeomArc){UEASSERT(false, _T("object type is not symbol arc"));return nullptr;}double dStartAngle = pGeomArc->GetStartAngle() / PI * 180;double dEndAngle = pGeomArc->GetEndAngle() / PI * 180;double dRadius = pGeomArc->GetRadius();std::vector<osg::Vec3d> vlist;double end;double start;if (dStartAngle > dEndAngle){start = dStartAngle;end = dEndAngle + 360;}else {start = dStartAngle;end = dEndAngle;}double theta = 5.0; // we generate polyline from "spokes" at theta degrees at arc's center// 		if (_useAccuracy) {
// 			// we generate points on a polyline where each point lies on the arc, thus the maximum error occurs at the midpoint of each line segment where it lies furthest inside the arc
// 			// If we divide the segment in half and connect the bisection point to the arc's center, we have two rightangled triangles with
// 			// one side=r-maxError, hypotenuse=r, and internal angle at center is half the angle we will step with:
// 			double maxError=min(_maxError,_radius); // Avoid offending acos() in the edge case where allowable deviation is greater than radius.
// 			double newtheta=acos( (_radius-maxError) / _radius);
// 			newtheta=osg::RadiansToDegrees(newtheta)*2.0;
// 			//cout<<"r="<<_radius<<" _me="<<_maxError<<" (_radius-_maxError)="<<(_radius-_maxError)<<" newtheta="<<newtheta<<endl;
// 			// Option to only use the new accuracy code when it would improve on the accuracy of the old method
// 			if (_improveAccuracyOnly) {
// 				theta=min(newtheta,theta);
// 			} else {
// 				theta=newtheta;
// 			}
// 		}int numsteps = (int)((end - start) / theta);//cout<<"arc theta="<<osg::RadiansToDegrees(theta)<<" end="<<end<<" start="<<start<<" numsteps="<<numsteps<<" e-s/theta="<<((end-start)/theta)<<" end-start="<<(end-start)<<endl;if (numsteps * theta < (end - start)) numsteps++;numsteps = max(numsteps, 2); // Whatever else, minimum representation of an arc is a straightlinedouble angle_step = (end - start) / 180 * PI;angle_step /= (double)numsteps;//拆分圆弧AcGePoint3d tmpCenter = pGeomArc->GetCenter();osg::Vec3d a(tmpCenter.x, tmpCenter.y, tmpCenter.z);osg::Vec3d b;AcGePoint3d tempPt;double angle1 = start / 180 * PI;AcGeVector3d mNormal = pGeomArc->GetNormal();pGeomArc->GetStartPoint(tempPt);vlist.push_back(osg::Vec3d(tempPt.x, tempPt.y, tempPt.z));for (int r = 0; r < numsteps; r++){tempPt.rotateBy(angle_step, mNormal, tmpCenter);b = osg::Vec3d(tempPt.x, tempPt.y, tempPt.z);vlist.push_back(b);}//设置顶点数组osg::ref_ptr<osg::Vec3dArray> pVertextArray = new osg::Vec3dArray();for (auto it = vlist.begin(); it != vlist.end(); ++it){pVertextArray->push_back(*it);}return pVertextArray;
}/*
* @brief 模拟多义线的线宽
* @details 带线宽的直线拆分成三角形或四边形,带线宽且等宽的弧线拆分
*	成三角带(非等宽的弧线有些复杂,暂不处理宽度)
* @param pGeomPolyline 多义线指针
* @param[out] mRtOsgPrimitiveList osg的图元列表
*/
static void SimulationLineWidthForPolyline(const std::shared_ptr<GeomPolyline>& pGeomPolyline,SmartPtrVector(tagOsgPrimitiveItem)& mRtOsgPrimitiveList)
{if (!pGeomPolyline){return;}AcGePoint3dArray& mGMPtArray = pGeomPolyline->GetPointArray();if (mGMPtArray.length() <= 1)//至少要两个顶点{return;}double dDefLineWidth = pGeomPolyline->GetDiameter(); //使用各个点的起点端点宽度//带线宽的直线拆分成三角形或四边形,带线宽且等宽的弧线拆分成三角带(非等宽的弧线不处理宽度)SmartPtrVector(tagOsgPrimitiveItem) mOsgPrimitiveList; //需要绘制的osg图元列表AcGePoint3d ptFirst = mGMPtArray.at(0);for (int i = 1; i < mGMPtArray.length(); ++i){double dBugle = pGeomPolyline->GetPtBugleAt(i - 1);double dStartWidth = pGeomPolyline->GetStartWidthAt(i - 1);double dEndWidth = pGeomPolyline->GetEndWidthAt(i - 1);if (MY_DOUBLE_EQ(dStartWidth, 0.0)&& MY_DOUBLE_EQ(dEndWidth, 0.0))//仿照autocad, 这种情况就要使用固定宽度{dStartWidth = dDefLineWidth;dEndWidth = dDefLineWidth;}const AcGePoint3d& ptSecond = mGMPtArray.at(i);if (MY_DOUBLE_EQ(dBugle, 0.0)) //凸度为0,直线{if (MY_DOUBLE_GT(dStartWidth, 0.0) || MY_DOUBLE_GT(dEndWidth, 0.0)) //多边形模拟线宽{//与直线垂直的方向AcGeVector3d vecOffsetDir = (ptSecond - ptFirst).rotateBy(PI / 2.0, AcGeVector3d::kZAxis);vecOffsetDir.normalize();//点1osg::ref_ptr<osg::Vec3dArray> pVertextArray = new osg::Vec3dArray();if (MY_DOUBLE_EQ(dStartWidth, 0.0)){pVertextArray->push_back(osg::Vec3d(ptFirst.x, ptFirst.y, ptFirst.z));}else{AcGePoint3d ptTemp = ptFirst + vecOffsetDir * dStartWidth / 2.0;pVertextArray->push_back(osg::Vec3d(ptTemp.x, ptTemp.y, ptTemp.z));}//点2if (MY_DOUBLE_EQ(dEndWidth, 0.0)){pVertextArray->push_back(osg::Vec3d(ptSecond.x, ptSecond.y, ptSecond.z));}else{AcGePoint3d ptTemp = ptSecond + vecOffsetDir * dEndWidth / 2.0;pVertextArray->push_back(osg::Vec3d(ptTemp.x, ptTemp.y, ptTemp.z));}//均处理成4个点,后续处理拐角时好处理if (MY_DOUBLE_GT(dEndWidth, 0.0)){AcGePoint3d ptTemp = ptSecond + (-vecOffsetDir) * dEndWidth / 2.0;pVertextArray->push_back(osg::Vec3d(ptTemp.x, ptTemp.y, ptTemp.z));}else{//线宽为0时,此点会上一顶点相同pVertextArray->push_back(osg::Vec3d(ptSecond.x, ptSecond.y, ptSecond.z));}if (MY_DOUBLE_GT(dStartWidth, 0.0)){AcGePoint3d ptTemp = ptFirst + (-vecOffsetDir) * dStartWidth / 2.0;pVertextArray->push_back(osg::Vec3d(ptTemp.x, ptTemp.y, ptTemp.z));}else{//线宽为0时,此点会上一顶点相同pVertextArray->push_back(osg::Vec3d(ptFirst.x, ptFirst.y, ptFirst.z));}auto pOneOsgPrim = std::make_shared<tagOsgPrimitiveItem>();pOneOsgPrim->m_bFillMode = true;
//				if (pVertextArray->size() == 3)
//				{
//					pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::TRIANGLES;
//				}
//				else
//				{
//					pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::QUADS;
//				}pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::QUADS;pOneOsgPrim->m_pVertextArray = pVertextArray;pOneOsgPrim->m_ptLineStart = ptFirst;pOneOsgPrim->m_ptLineEnd = ptSecond;mRtOsgPrimitiveList.push_back(pOneOsgPrim);}else{osg::ref_ptr<osg::Vec3dArray> pVertextArray = new osg::Vec3dArray();pVertextArray->push_back(osg::Vec3d(ptFirst.x, ptFirst.y, ptFirst.z));pVertextArray->push_back(osg::Vec3d(ptSecond.x, ptSecond.y, ptSecond.z));auto pOneOsgPrim = std::make_shared<tagOsgPrimitiveItem>();pOneOsgPrim->m_bFillMode = false;pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::LINES;pOneOsgPrim->m_pVertextArray = pVertextArray;pOneOsgPrim->m_ptLineStart = ptFirst;pOneOsgPrim->m_ptLineEnd = ptSecond;mRtOsgPrimitiveList.push_back(pOneOsgPrim);}}else //弧线{double dRadian = atan(fabs(dBugle)) * 4.0; //圆弧的弧度值AcGeVector3d vecNormal = AcGeVector3d::kZAxis; //圆弧法向量AcGePoint3d ptMiddle = (ptFirst + ptSecond.asVector()) / 2.0;if (MY_DOUBLE_LT(dBugle, 0.0))//负的凸度值表示弧是以顺时针方向从选择的顶点至下一个顶点{vecNormal = -vecNormal;}AcGePoint3d ptCenter;AcGeVector3d vecRefDir;if (MY_DOUBLE_EQ(dRadian, PI))//==180度 半圆{//创建圆弧ptCenter = ptMiddle;vecRefDir = ptFirst - ptMiddle;}else{AcGeVector3d offsetDir = ptFirst - ptMiddle;offsetDir.normalize();double dOffsetValue = 0.0;if (MY_DOUBLE_GT(dRadian, PI)) //>180度,优弧{dOffsetValue = ptMiddle.distanceTo(ptFirst) / std::tan(PI - dRadian / 2.0);offsetDir.rotateBy(PI / 2.0, vecNormal);}else //< 180度{dOffsetValue = ptMiddle.distanceTo(ptFirst) / std::tan(dRadian / 2.0);offsetDir.rotateBy(-PI / 2.0, vecNormal);}//创建圆弧ptCenter = ptMiddle + dOffsetValue * offsetDir;vecRefDir = ptFirst - ptCenter;}double dRadius = ptCenter.distanceTo(ptFirst);if (MY_DOUBLE_GT(dStartWidth, 0.0) //暂只支持等宽的圆弧线&& MY_DOUBLE_EQ(dStartWidth, dEndWidth)&& MY_DOUBLE_GT(dRadius, dStartWidth / 2.0)){auto pSmallGeomArc = std::make_shared<GeomArc>(ptCenter,vecNormal,vecRefDir,dRadius - dStartWidth / 2.0,0.0,dRadian);auto pLargeGeomArc = std::make_shared<GeomArc>(ptCenter,vecNormal,vecRefDir,dRadius + dStartWidth / 2.0,0.0,dRadian);auto pSmallVec3Array = GetGeomArcSamplePoint(pSmallGeomArc);auto pLargeVec3Array = GetGeomArcSamplePoint(pLargeGeomArc);if (pSmallVec3Array&& pLargeVec3Array&& pSmallVec3Array->size() > 0&& pLargeVec3Array->size() > 0){osg::ref_ptr<osg::Vec3dArray> pStripVec3Array = new osg::Vec3dArray();int nSmallArraySize = int(pSmallVec3Array->size());int nLargeArraySize = int(pLargeVec3Array->size());int sm = 0, la = 0;while (sm < nSmallArraySize){pStripVec3Array->push_back(pSmallVec3Array->at(sm));if (la < nLargeArraySize){pStripVec3Array->push_back(pLargeVec3Array->at(la));}else{break;}++sm;++la;}//构造三角带if (pStripVec3Array->size() >= 3){auto pOneOsgPrim = std::make_shared<tagOsgPrimitiveItem>();pOneOsgPrim->m_bFillMode = true;pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::TRIANGLE_STRIP;pOneOsgPrim->m_pVertextArray = pStripVec3Array;mRtOsgPrimitiveList.push_back(pOneOsgPrim);}//若有剩余顶点,构造扇形三角形osg::ref_ptr<osg::Vec3dArray> pFanVec3Array = new osg::Vec3dArray();if (sm < nSmallArraySize){pFanVec3Array->push_back(pLargeVec3Array->at(nLargeArraySize - 1));while (sm < nSmallArraySize){pFanVec3Array->push_back(pSmallVec3Array->at(sm));}}else if (la < nLargeArraySize){pFanVec3Array->push_back(pSmallVec3Array->at(nSmallArraySize - 1));while (la < nLargeArraySize){pFanVec3Array->push_back(pLargeVec3Array->at(la));}}if (pFanVec3Array->size() >= 3){auto pOneOsgPrim = std::make_shared<tagOsgPrimitiveItem>();pOneOsgPrim->m_bFillMode = true;pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::TRIANGLE_FAN;pOneOsgPrim->m_pVertextArray = pFanVec3Array;mRtOsgPrimitiveList.push_back(pOneOsgPrim);}}}else{auto pGeomArc = std::make_shared<GeomArc>(ptCenter,vecNormal,vecRefDir,ptCenter.distanceTo(ptFirst),0.0,dRadian);auto pVec3Array = GetGeomArcSamplePoint(pGeomArc);auto pOneOsgPrim = std::make_shared<tagOsgPrimitiveItem>();pOneOsgPrim->m_bFillMode = false;pOneOsgPrim->m_enPrimitiveMode = osg::PrimitiveSet::LINE_STRIP;pOneOsgPrim->m_pVertextArray = pVec3Array;mRtOsgPrimitiveList.push_back(pOneOsgPrim);}}ptFirst = ptSecond; //绘制下一根线}
}void CreatePloyline(std::shared_ptr<GeomPolyline> pGeomPolyline, osg::ref_ptr<osg::Geode>& pRtOsgGeode)
{if (NULL == pRtOsgGeode)return;try{if (!pGeomPolyline){return /*nullptr*/;}//模拟线宽处理SmartPtrVector(tagOsgPrimitiveItem) mOsgPrimitiveList; //需要绘制的osg图元列表SimulationLineWidthForPolyline(pGeomPolyline, mOsgPrimitiveList);if (mOsgPrimitiveList.size() <= 0){return;}//处理下相邻直线(已用三角形或四边形模拟了线宽)之间的拐角std::shared_ptr<tagOsgPrimitiveItem> pPrevPrimitiveItem;for (auto it = mOsgPrimitiveList.begin(); it != mOsgPrimitiveList.end(); ++it){auto pPrimitiveItem = *it;if (!pPrimitiveItem || !pPrimitiveItem->m_pVertextArray){pPrevPrimitiveItem = nullptr;continue;}//无宽度或非直线(有线宽的直线会使用osg::PrimitiveSet::TRIANGLES或QUADS来模拟)if (pPrimitiveItem->m_pVertextArray->size() <= 2|| (pPrimitiveItem->m_enPrimitiveMode != osg::PrimitiveSet::TRIANGLES && pPrimitiveItem->m_enPrimitiveMode != osg::PrimitiveSet::QUADS)){pPrevPrimitiveItem = nullptr;continue;}if (!pPrevPrimitiveItem){pPrevPrimitiveItem = pPrimitiveItem;continue;}std::shared_ptr<tagOsgPrimitiveItem> pCurPrimitiveItem = pPrimitiveItem;osg::ref_ptr<osg::Vec3dArray> pPrevLine = pPrevPrimitiveItem->m_pVertextArray;osg::ref_ptr<osg::Vec3dArray> pCurLine = pCurPrimitiveItem->m_pVertextArray;if (!pPrevLine || !pCurLine){pPrevPrimitiveItem = pPrimitiveItem;continue;}//判断相连的直线是否拐角AcGeVector3d prevLineDir = pPrevPrimitiveItem->m_ptLineEnd - pPrevPrimitiveItem->m_ptLineStart;AcGeVector3d curLineDir = pCurPrimitiveItem->m_ptLineEnd - pCurPrimitiveItem->m_ptLineStart;if (prevLineDir.isCodirectionalTo(curLineDir)) //两直线平行,不用考虑方向{pPrevPrimitiveItem = pPrimitiveItem;continue;}//AB 与A1B1相交于O1,//CD 与C1D1相交于O2,osg::Vec3d& ptA = pPrevLine->at(0);osg::Vec3d& ptB = pPrevLine->at(1);osg::Vec3d& ptA1 = pCurLine->at(0);osg::Vec3d& ptB1 = pCurLine->at(1);AcGeVector3d vecLineABDir(ptB.x() - ptA.x(),ptB.y() - ptA.y(),ptB.z() - ptA.z());vecLineABDir.normalize();AcGeVector3d vecLineA1B1Dir(ptB1.x() - ptA1.x(),ptB1.y() - ptA1.y(),ptB1.z() - ptA1.z());vecLineA1B1Dir.normalize();AcGePoint3d ptCrossO1;BOOL bIsTrueCross = FALSE;if (!Calculator::Instance().GetLineIntersectionNParallel(AcGePoint3d(ptA.x(), ptA.y(), ptA.z()),vecLineABDir,AcGePoint3d(ptA1.x(), ptA1.y(), ptA1.z()),vecLineA1B1Dir,ptCrossO1, bIsTrueCross)){pPrevPrimitiveItem = pCurPrimitiveItem;continue;}osg::Vec3d& ptC = pPrevLine->at(pPrevLine->size()-2);osg::Vec3d& ptD = pPrevLine->at(pPrevLine->size()-1);osg::Vec3d& ptC1 = pCurLine->at(pCurLine->size()-2);osg::Vec3d& ptD1 = pCurLine->at(pCurLine->size()-1);AcGeVector3d vecLineCDDir(ptD.x() - ptC.x(),ptD.y() - ptC.y(),ptD.z() - ptC.z());vecLineCDDir.normalize();AcGeVector3d vecLineC1D1Dir(ptD1.x() - ptC1.x(),ptD1.y() - ptC1.y(),ptD1.z() - ptC1.z());vecLineC1D1Dir.normalize();AcGePoint3d ptCrossO2;if (!Calculator::Instance().GetLineIntersectionNParallel(AcGePoint3d(ptC.x(), ptC.y(), ptC.z()),vecLineCDDir,AcGePoint3d(ptC1.x(), ptC1.y(), ptC1.z()),vecLineC1D1Dir,ptCrossO2, bIsTrueCross)){pPrevPrimitiveItem = pCurPrimitiveItem;continue;}//使用斜角连接,将点B、点A1替换成交点O1; 点C、点D1替换成交点O2。ptB = osg::Vec3d(ptCrossO1.x, ptCrossO1.y, ptCrossO1.z);ptA1 = osg::Vec3d(ptCrossO1.x, ptCrossO1.y, ptCrossO1.z);ptC = osg::Vec3d(ptCrossO2.x, ptCrossO2.y, ptCrossO2.z);ptD1 = osg::Vec3d(ptCrossO2.x, ptCrossO2.y, ptCrossO2.z);pPrevPrimitiveItem = pCurPrimitiveItem;}//开始绘制for (auto it = mOsgPrimitiveList.begin(); it != mOsgPrimitiveList.end(); ++it){auto pPrimitiveItem = *it;if (!pPrimitiveItem || !pPrimitiveItem->m_pVertextArray){continue;}osg::ref_ptr<osg::Geometry> pGeom = new osg::Geometry();pGeom->setVertexArray(pPrimitiveItem->m_pVertextArray);pGeom->addPrimitiveSet(new osg::DrawArrays(pPrimitiveItem->m_enPrimitiveMode,0, pPrimitiveItem->m_pVertextArray->size()));//填充模式if (pPrimitiveItem->m_bFillMode){osg::PolygonMode* pPolyMode = new osg::PolygonMode(osg::PolygonMode::Face::FRONT_AND_BACK,osg::PolygonMode::Mode::LINE);pGeom->getOrCreateStateSet()->setAttributeAndModes(pPolyMode,osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);}pRtOsgGeode->addDrawable(pGeom);}}catch ( ... ){}}

运行对比

  • 未处理拐角的情况
    在这里插入图片描述
  • 拐角改为斜角连接
    在这里插入图片描述
  • autocad与当前实现演示对比
    上图为autocad2007显示图,下图为当前实现的显示图。当前实现未处理不等宽的圆弧,其他的模拟的还可以。
    在这里插入图片描述

在这里插入图片描述

这篇关于DXF笔记:多义线线宽模拟实现的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/406107

相关文章

hdu1043(八数码问题,广搜 + hash(实现状态压缩) )

利用康拓展开将一个排列映射成一个自然数,然后就变成了普通的广搜题。 #include<iostream>#include<algorithm>#include<string>#include<stack>#include<queue>#include<map>#include<stdio.h>#include<stdlib.h>#include<ctype.h>#inclu

【C++】_list常用方法解析及模拟实现

相信自己的力量,只要对自己始终保持信心,尽自己最大努力去完成任何事,就算事情最终结果是失败了,努力了也不留遗憾。💓💓💓 目录   ✨说在前面 🍋知识点一:什么是list? •🌰1.list的定义 •🌰2.list的基本特性 •🌰3.常用接口介绍 🍋知识点二:list常用接口 •🌰1.默认成员函数 🔥构造函数(⭐) 🔥析构函数 •🌰2.list对象

【Prometheus】PromQL向量匹配实现不同标签的向量数据进行运算

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,阿里云开发者社区专家博主,CSDN全栈领域优质创作者,掘金优秀博主,51CTO博客专家等。 🏆《博客》:Python全栈,前后端开发,小程序开发,人工智能,js逆向,App逆向,网络系统安全,数据分析,Django,fastapi

让树莓派智能语音助手实现定时提醒功能

最初的时候是想直接在rasa 的chatbot上实现,因为rasa本身是带有remindschedule模块的。不过经过一番折腾后,忽然发现,chatbot上实现的定时,语音助手不一定会有响应。因为,我目前语音助手的代码设置了长时间无应答会结束对话,这样一来,chatbot定时提醒的触发就不会被语音助手获悉。那怎么让语音助手也具有定时提醒功能呢? 我最后选择的方法是用threading.Time

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

usaco 1.2 Transformations(模拟)

我的做法就是一个一个情况枚举出来 注意计算公式: ( 变换后的矩阵记为C) 顺时针旋转90°:C[i] [j]=A[n-j-1] [i] (旋转180°和270° 可以多转几个九十度来推) 对称:C[i] [n-j-1]=A[i] [j] 代码有点长 。。。 /*ID: who jayLANG: C++TASK: transform*/#include<

C#实战|大乐透选号器[6]:实现实时显示已选择的红蓝球数量

哈喽,你好啊,我是雷工。 关于大乐透选号器在前面已经记录了5篇笔记,这是第6篇; 接下来实现实时显示当前选中红球数量,蓝球数量; 以下为练习笔记。 01 效果演示 当选择和取消选择红球或蓝球时,在对应的位置显示实时已选择的红球、蓝球的数量; 02 标签名称 分别设置Label标签名称为:lblRedCount、lblBlueCount

Kubernetes PodSecurityPolicy:PSP能实现的5种主要安全策略

Kubernetes PodSecurityPolicy:PSP能实现的5种主要安全策略 1. 特权模式限制2. 宿主机资源隔离3. 用户和组管理4. 权限提升控制5. SELinux配置 💖The Begin💖点点关注,收藏不迷路💖 Kubernetes的PodSecurityPolicy(PSP)是一个关键的安全特性,它在Pod创建之前实施安全策略,确保P

【学习笔记】 陈强-机器学习-Python-Ch15 人工神经网络(1)sklearn

系列文章目录 监督学习:参数方法 【学习笔记】 陈强-机器学习-Python-Ch4 线性回归 【学习笔记】 陈强-机器学习-Python-Ch5 逻辑回归 【课后题练习】 陈强-机器学习-Python-Ch5 逻辑回归(SAheart.csv) 【学习笔记】 陈强-机器学习-Python-Ch6 多项逻辑回归 【学习笔记 及 课后题练习】 陈强-机器学习-Python-Ch7 判别分析 【学

系统架构师考试学习笔记第三篇——架构设计高级知识(20)通信系统架构设计理论与实践

本章知识考点:         第20课时主要学习通信系统架构设计的理论和工作中的实践。根据新版考试大纲,本课时知识点会涉及案例分析题(25分),而在历年考试中,案例题对该部分内容的考查并不多,虽在综合知识选择题目中经常考查,但分值也不高。本课时内容侧重于对知识点的记忆和理解,按照以往的出题规律,通信系统架构设计基础知识点多来源于教材内的基础网络设备、网络架构和教材外最新时事热点技术。本课时知识