Open CASCADE学习|分割

目录

1、添加头文件与源文件

GEOMAlgo_Splitter.h

GEOMAlgo_Splitter.cpp

2、测试

2.1平面分割立方体

2.2以边分面

2.3以面分面


1、添加头文件与源文件

GEOMAlgo_Splitter.h

// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE//// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA//// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com////  File:   GEOMAlgo_Splitter.hxx////  Author: Peter KURNEV#ifndef GEOMAlgo_Splitter_HeaderFile#define GEOMAlgo_Splitter_HeaderFile#include <Standard.hxx>#include <Standard_Macro.hxx>#include <Standard_Boolean.hxx>#include <Standard_Integer.hxx>#include <NCollection_BaseAllocator.hxx>#include <TopAbs_ShapeEnum.hxx>#include <TopoDS_Shape.hxx>#include <TopTools_ListOfShape.hxx>#include <TopTools_MapOfShape.hxx>#include <BOPAlgo_Builder.hxx>//=======================================================================//class    : GEOMAlgo_Splitter//purpose  ://=======================================================================class GEOMAlgo_Splitter : public BOPAlgo_Builder{public:    Standard_EXPORT        GEOMAlgo_Splitter();    Standard_EXPORT        GEOMAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);    Standard_EXPORT        virtual ~GEOMAlgo_Splitter();    Standard_EXPORT        void AddTool(const TopoDS_Shape& theShape);    Standard_EXPORT        const TopTools_ListOfShape& Tools()const;    Standard_EXPORT        void SetLimit(const TopAbs_ShapeEnum aLimit);    Standard_EXPORT        TopAbs_ShapeEnum Limit()const;    Standard_EXPORT        void SetLimitMode(const Standard_Integer aMode);    Standard_EXPORT        Standard_Integer LimitMode()const;    Standard_EXPORT        virtual void Clear();protected:    Standard_EXPORT        virtual void BuildResult(const TopAbs_ShapeEnum theType);    Standard_EXPORT        virtual void PostTreat();protected:    TopTools_ListOfShape myTools;    TopTools_MapOfShape myMapTools;    TopAbs_ShapeEnum myLimit;    Standard_Integer myLimitMode;};#endif

GEOMAlgo_Splitter.cpp

// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE//// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS//// This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version.//// This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU// Lesser General Public License for more details.//// You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA//// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com//// File:        GEOMAlgo_Splitter.cxx// Created:     Thu Sep 06 10:54:04 2012// Author:      Peter KURNEV//              <pkv@irinox>//#include"GEOMAlgo_Splitter.h"#include <TopAbs_ShapeEnum.hxx>#include <TopoDS_Shape.hxx>#include <TopoDS_Compound.hxx>#include <TopoDS_Iterator.hxx>#include <BRep_Builder.hxx>#include <TopTools_MapOfShape.hxx>#include <TopTools_ListOfShape.hxx>#include <TopExp.hxx>staticvoid TreatCompound(const TopoDS_Shape& aC,    TopTools_ListOfShape& aLSX);//=======================================================================//function : //purpose  : //=======================================================================GEOMAlgo_Splitter::GEOMAlgo_Splitter()    :    BOPAlgo_Builder(),    myTools(myAllocator),    myMapTools(100, myAllocator){    myLimit = TopAbs_SHAPE;    myLimitMode = 0;}//=======================================================================//function : //purpose  : //=======================================================================GEOMAlgo_Splitter::GEOMAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator)    :    BOPAlgo_Builder(theAllocator),    myTools(myAllocator),    myMapTools(100, myAllocator){    myLimit = TopAbs_SHAPE;    myLimitMode = 0;}//=======================================================================//function : ~//purpose  : //=======================================================================GEOMAlgo_Splitter::~GEOMAlgo_Splitter(){}//=======================================================================//function : AddTool//purpose  : //=======================================================================void GEOMAlgo_Splitter::AddTool(const TopoDS_Shape& theShape){    if (myMapTools.Add(theShape)) {        myTools.Append(theShape);        //        AddArgument(theShape);    }}//=======================================================================//function : Tools//purpose  : //=======================================================================const TopTools_ListOfShape& GEOMAlgo_Splitter::Tools()const{    return myTools;}//=======================================================================//function : SetLimit//purpose  : //=======================================================================void GEOMAlgo_Splitter::SetLimit(const TopAbs_ShapeEnum aLimit){    myLimit = aLimit;}//=======================================================================//function : Limit//purpose  : //=======================================================================TopAbs_ShapeEnum GEOMAlgo_Splitter::Limit()const{    return myLimit;}//=======================================================================//function : SetLimitMode//purpose  : //=======================================================================void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode){    myLimitMode = aMode;}//=======================================================================//function : LimitMode//purpose  : //=======================================================================Standard_Integer GEOMAlgo_Splitter::LimitMode()const{    return myLimitMode;}//=======================================================================//function : Clear//purpose  : //=======================================================================void GEOMAlgo_Splitter::Clear(){    myTools.Clear();    myMapTools.Clear();    myLimit = TopAbs_SHAPE;    BOPAlgo_Builder::Clear();}//=======================================================================//function : BuildResult//purpose  : //=======================================================================void GEOMAlgo_Splitter::BuildResult(const TopAbs_ShapeEnum theType){    TopAbs_ShapeEnum aType;    BRep_Builder aBB;    TopTools_MapOfShape aM;    TopTools_ListIteratorOfListOfShape aIt, aItIm;    //    aIt.Initialize(myArguments);    for (; aIt.More(); aIt.Next()) {        const TopoDS_Shape& aS = aIt.Value();        aType = aS.ShapeType();        if (aType == theType && !myMapTools.Contains(aS)) {            if (myImages.IsBound(aS)) {                const TopTools_ListOfShape& aLSIm = myImages.Find(aS);                aItIm.Initialize(aLSIm);                for (; aItIm.More(); aItIm.Next()) {                    const TopoDS_Shape& aSIm = aItIm.Value();                    if (aM.Add(aSIm)) {                        aBB.Add(myShape, aSIm);                    }                }            }            else {                if (aM.Add(aS)) {                    aBB.Add(myShape, aS);                }            }        }    }}//=======================================================================//function : PostTreat//purpose  : //=======================================================================void GEOMAlgo_Splitter::PostTreat(){    if (myLimit != TopAbs_SHAPE) {        Standard_Integer i, aNbS;        BRep_Builder aBB;        TopoDS_Compound aC;        TopTools_IndexedMapOfShape aMx;        //        aBB.MakeCompound(aC);        //        TopExp::MapShapes(myShape, myLimit, aMx);        aNbS = aMx.Extent();        for (i = 1; i <= aNbS; ++i) {            const TopoDS_Shape& aS = aMx(i);            aBB.Add(aC, aS);        }        if (myLimitMode) {            Standard_Integer iType, iLimit, iTypeX;            TopAbs_ShapeEnum aType, aTypeX;            TopTools_ListOfShape aLSP, aLSX;            TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;            TopTools_MapOfShape  aM;            //            iLimit = (Standard_Integer)myLimit;            //            // 1. Collect the shapes to process aLSP            aIt.Initialize(myArguments);            for (; aIt.More(); aIt.Next()) {                const TopoDS_Shape& aS = aIt.Value();                if (myMapTools.Contains(aS)) {                    continue;                }                //                aType = aS.ShapeType();                iType = (Standard_Integer)aType;                //                if (iType > iLimit) {                    aLSP.Append(aS);                }                //                else if (aType == TopAbs_COMPOUND) {                    aLSX.Clear();                    //                    TreatCompound(aS, aLSX);                    //                    aItX.Initialize(aLSX);                    for (; aItX.More(); aItX.Next()) {                        const TopoDS_Shape& aSX = aItX.Value();                        aTypeX = aSX.ShapeType();                        iTypeX = (Standard_Integer)aTypeX;                        //                        if (iTypeX > iLimit) {                            aLSP.Append(aSX);                        }                    }                }            }// for (; aIt.More(); aIt.Next()) {            //            aMx.Clear();            TopExp::MapShapes(aC, aMx);            // 2. Add them to aC            aIt.Initialize(aLSP);            for (; aIt.More(); aIt.Next()) {                const TopoDS_Shape& aS = aIt.Value();                if (myImages.IsBound(aS)) {                    const TopTools_ListOfShape& aLSIm = myImages.Find(aS);                    aItIm.Initialize(aLSIm);                    for (; aItIm.More(); aItIm.Next()) {                        const TopoDS_Shape& aSIm = aItIm.Value();                        if (aM.Add(aSIm)) {                            if (!aMx.Contains(aSIm)) {                                aBB.Add(aC, aSIm);                            }                        }                    }                }                else {                    if (aM.Add(aS)) {                        if (!aMx.Contains(aS)) {                            aBB.Add(aC, aS);                        }                    }                }            }        }// if (myLimitMode) {        myShape = aC;    }//if (myLimit!=TopAbs_SHAPE) {    //    Standard_Integer aNbS;    TopoDS_Iterator aIt;    TopTools_ListOfShape aLS;    //    aIt.Initialize(myShape);    for (; aIt.More(); aIt.Next()) {        const TopoDS_Shape& aS = aIt.Value();        aLS.Append(aS);    }    aNbS = aLS.Extent();    if (aNbS == 1) {        myShape = aLS.First();    }    //    //BOPAlgo_Builder::PostTreat();}//=======================================================================//function : TreatCompound//purpose  : //=======================================================================void TreatCompound(const TopoDS_Shape& aC1,    TopTools_ListOfShape& aLSX){    Standard_Integer aNbC1;    TopAbs_ShapeEnum aType;    TopTools_ListOfShape aLC, aLC1;    TopTools_ListIteratorOfListOfShape aIt, aIt1;    TopoDS_Iterator aItC;    //    aLC.Append(aC1);    for (;;) {        aLC1.Clear();        aIt.Initialize(aLC);        for (; aIt.More(); aIt.Next()) {            const TopoDS_Shape& aC = aIt.Value(); //C is compound            //            aItC.Initialize(aC);            for (; aItC.More(); aItC.Next()) {                const TopoDS_Shape& aS = aItC.Value();                aType = aS.ShapeType();                if (aType == TopAbs_COMPOUND) {                    aLC1.Append(aS);                }                else {                    aLSX.Append(aS);                }            }        }        //        aNbC1 = aLC1.Extent();        if (!aNbC1) {            break;        }        //        aLC.Clear();        aIt.Initialize(aLC1);        for (; aIt.More(); aIt.Next()) {            const TopoDS_Shape& aSC = aIt.Value();            aLC.Append(aSC);        }    }// while(1)}//// myErrorStatus// // 0  - Ok// 1  - The object is just initialized// 2  - PaveFiller is failed// 10 - No shapes to process// 30 - SolidBuilder failed

2、测试

2.1平面分割立方体

#include <BRepPrimAPI_MakeBox.hxx>#include"GEOMAlgo_Splitter.h"#include <gp_Pln.hxx>#include <BRepBuilderAPI_MakeFace.hxx>#include <TopExp_Explorer.hxx>#include"Viewer.h"int main(int argc, char* argv[]){    gp_Pnt p0 = gp_Pnt(5, 5, 5);    gp_Dir vnorm = gp_Dir(1, 1, 1);    gp_Pln pln = gp_Pln(p0, vnorm);    TopoDS_Face face = BRepBuilderAPI_MakeFace(pln, -10, 10, -10, 10).Face();    TopoDS_Shape box = BRepPrimAPI_MakeBox(10, 10, 10).Shape();    //启动分割函数    GEOMAlgo_Splitter splitter = GEOMAlgo_Splitter();    //将box作为参数,将面face作为分割工具。    splitter.AddArgument(box);    splitter.AddTool(face);    splitter.Perform();    Viewer vout(50, 50, 500, 500);    //显示分割后的体    for (TopExp_Explorer i(splitter.Shape(), TopAbs_SOLID); i.More(); i.Next())    {        vout << i.Current();    }    vout << face;    vout.StartMessageLoop();    return 0;}

#include <BRepPrimAPI_MakeBox.hxx>#include"GEOMAlgo_Splitter.h"#include <gp_Pln.hxx>#include <BRepBuilderAPI_MakeFace.hxx>#include <TopExp_Explorer.hxx>#include"Viewer.h"int main(int argc, char* argv[]){    gp_Pnt p0 = gp_Pnt(5, 5, 5);    gp_Dir vnorm = gp_Dir(1, 1, 1);    gp_Pln pln = gp_Pln(p0, vnorm);    TopoDS_Face face = BRepBuilderAPI_MakeFace(pln, -10, 10, -10, 10).Face();    TopoDS_Shape box = BRepPrimAPI_MakeBox(10, 10, 10).Shape();    //启动分割函数    GEOMAlgo_Splitter splitter = GEOMAlgo_Splitter();    //将box作为参数,将面face作为分割工具。    splitter.AddArgument(box);    splitter.AddTool(face);    splitter.Perform();    Viewer vout(50, 50, 500, 500);    //显示分割后的体    TopExp_Explorer i(splitter.Shape(), TopAbs_SOLID);    i.Next();    vout << i.Current();    vout << face;    vout.StartMessageLoop();    return 0;}

2.2以边分面

#include <vector>#include <gp_Pnt.hxx>#include <gp_Circ.hxx>#include <gp_Pln.hxx>#include <BRepBuilderAPI_MakeFace.hxx>#include <BRepBuilderAPI_MakeEdge.hxx>#include"Viewer.h"#include"GEOMAlgo_Splitter.h"#include <TopExp_Explorer.hxx>int main(int argc, char* argv[]){    gp_Pnt p0 = gp_Pnt();    gp_Dir vnorm = gp_Dir(1, 0, 0);    gp_Pln pln = gp_Pln(p0, vnorm);    TopoDS_Shape face = BRepBuilderAPI_MakeFace(pln, -10, 10, -10, 10);    gp_Pnt p1 = gp_Pnt(0, 0, 15);    gp_Pnt p2 = gp_Pnt(0, 0, -15);    TopoDS_Shape edge = BRepBuilderAPI_MakeEdge(p1, p2);    //启动分割函数    GEOMAlgo_Splitter splitter = GEOMAlgo_Splitter();     //将面作为参数,将边edge作为分割工具。    splitter.AddArgument(face);    splitter.AddTool(edge);    splitter.Perform();    //显示分割后的体    TopExp_Explorer i(splitter.Shape(), TopAbs_FACE);    i.Next();    Viewer vout(50, 50, 500, 500);    vout << i.Current();    vout << edge;    vout.StartMessageLoop();             return 0;}

2.3以面分面

#include <vector>#include <gp_Pnt.hxx>#include <gp_Circ.hxx>#include <gp_Pln.hxx>#include <BRepBuilderAPI_MakeFace.hxx>#include <BRepBuilderAPI_MakeEdge.hxx>#include"Viewer.h"#include"GEOMAlgo_Splitter.h"#include <TopExp_Explorer.hxx>int main(int argc, char* argv[]){    //第一个面    gp_Pnt p0 = gp_Pnt(5, 5, 5);    gp_Dir vnorm = gp_Dir(1, 1, 1);    gp_Pln pln = gp_Pln(p0, vnorm);    TopoDS_Shape face1 = BRepBuilderAPI_MakeFace(pln, -10, 10, -10, 10);    //工具面    vnorm = gp_Dir(1, 1, 0);    pln = gp_Pln(p0, vnorm);    TopoDS_Shape face2 = BRepBuilderAPI_MakeFace(pln, -20, 20, -20, 20);     //启动分割函数    GEOMAlgo_Splitter splitter = GEOMAlgo_Splitter();     //将面作为参数,将边edge作为分割工具。    splitter.AddArgument(face1);    splitter.AddTool(face2);    splitter.Perform();    //显示分割后的体    TopExp_Explorer i(splitter.Shape(), TopAbs_FACE);    i.Next();    Viewer vout(50, 50, 500, 500);    vout << i.Current();    vout << face2;    vout.StartMessageLoop();             return 0;}

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

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

相关文章

【大厂AI课学习笔记】【2.1 人工智能项目开发规划与目标】(4)数据准备的流程

今天学习的是数据准备的流程。 我们已经知道&#xff0c;数据准备占了AI项目超过一半甚至79%的时间。 那么数据准备&#xff0c;都做些什么&#xff0c;有哪些流程。 1.数据采集 观测数据人工收集调查问卷线上数据库 2.数据清洗 有缺失的数据有重复的数据有内容错误的数据…

51单片机编程应用(C语言):DS1302实时时钟

单片机计时的缺陷&#xff1a; 1.他的精度不高&#xff0c;没有时钟芯片精度高&#xff0c; 2.会占用单片机CPU的时间&#xff0c; 3.单片机的时钟无法掉电继续运行&#xff0c;&#xff08;最大的缺点&#xff09; DS1302芯片内部有备用电池&#xff0c;可以掉电继续计时…

fusion360 操作总结(不断更新)

平移缩放旋转快捷键 画布选择Windows 组合键macOS 组合键平移按住鼠标中键按住鼠标中键缩放滚动鼠标中键滚动鼠标中键动态观察旋转按住 Shift 键并按住鼠标中键按住 Shift 键并按住鼠标中键绕点动态观察按住 Shift 键单击并按住鼠标中键按住 Shift 键单击并按住鼠标中键撤消Ct…

MCU看门狗

目录 一、独立看门狗(IWDG) 1、IWDG 主要作用 2、IWDG 主要特性 3、编程控制 4、注意地方 二、窗口看门狗(WWDG) 1、窗口看门狗作用&#xff1a; 2、窗口看门狗产生复位信号有两个条件&#xff1a; 3、WWDG 框图 4、WWDG 将要复位的时间 5、编程控制 一、独立看门…

STL:优先级队列的实现

STL中优先级队列本质上就是堆。在上一篇博客中讲到过&#xff1a;堆是一种完全二叉树&#xff0c;逻辑结构上看起来像树&#xff0c;但在物理结构中是存储在线性表中。与普通线性表不同的是&#xff0c;堆中数据大小是规律排列的&#xff1a;小堆中每个节点都大于它的父节点&am…

SpringBoot实战:打造企业资产管理系统

✍✍计算机编程指导师 ⭐⭐个人介绍&#xff1a;自己非常喜欢研究技术问题&#xff01;专业做Java、Python、微信小程序、安卓、大数据、爬虫、Golang、大屏等实战项目。 ⛽⛽实战项目&#xff1a;有源码或者技术上的问题欢迎在评论区一起讨论交流&#xff01; ⚡⚡ Java实战 |…

001kafka源码项目gradle报错UnsupportedClassVersionError-kafka-报错-大数据学习

1 报错提示 java.lang.UnsupportedClassVersionError: org/eclipse/jgit/lib/AnyObjectId has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 如…

Linux线程(1)--线程的概念 | 线程控制

目录 前置知识 线程的概念 Linux中对线程的理解 重新定义进程与线程 重谈地址空间 线程的优缺点 线程的优点 线程的缺点 线程异常 线程的用途 Linux线程 VS 进程 线程控制 创建线程 线程等待 线程终止 线程ID的深入理解 前置知识 我们知道一个进程有属于自己的P…

docker (六)-进阶篇-数据持久化最佳实践MySQL部署

容器的数据挂载通常指的是将宿主机&#xff08;虚拟机或物理机&#xff09;上的目录或文件挂载到容器内部 MySQL单节点安装 详情参考docker官网文档 1 创建对应的数据目录、日志目录、配置文件目录(参考二进制安装&#xff0c;需自己建立数据存储目录) mkdir -p /data/mysq…

计算机毕业设计springboot_vue房屋租赁系统_ku668

1.掌握Html&#xff0c;Css&#xff0c;JavaScript等基础编程语言。 2.掌握Vue框架&#xff0c;node环境&#xff0c;数据库等知识。 3.掌握开发系统的基本流程。 …

你了解API测试吗?如何充分的测试一个API?

什么是API&#xff1f; API代表应用程序接口。API是软件系统中的中间层&#xff0c;负责数据源与用户看到的图形用户界面&#xff08;GUI&#xff09;之间的数据通信。换句话说&#xff0c;API是软件的业务层&#xff0c;它在表示层和数据层之间创建连接。 API测试侧重于所谓的…

2.17C语言学习

P1678 烦恼的高考志愿 写完后发现题解里面用的是优先队列或者二分什么的&#xff0c;其实这个题可以贪心&#xff0c;我们把学校的分数线和学生的成绩分别进行排序&#xff0c;然后从前往后遍历&#xff0c;每次比较当前学校的分数与学生成绩的差距和下一个学校的分数与学生成…

re-captioning技术是什么

参考https://zhuanlan.zhihu.com/p/664192860 模型对图片进行caption操作时&#xff0c;输出的标题一般描述图片中的主体&#xff0c;而忽视了背景、常识关系等更为细节的描述。 图片比较重要的细节的描述应当包括&#xff1a; 物体存在的场景。如&#xff1a;在厨房的水槽&am…

Qt之条件变量QWaitCondition详解(从使用到原理分析全)

QWaitCondition内部实现结构图&#xff1a; 相关系列文章 C之Pimpl惯用法 目录 1.简介 2.示例 2.1.全局配置 2.2.生产者Producer 2.3.消费者Consumer 2.4.测试例子 3.原理分析 3.1.辅助函数CreateEvent 3.2.辅助函数WaitForSingleObject 3.3.QWaitConditionEvent …

阿里云服务器服务费怎么计算的?详细报价解析

2024年最新阿里云服务器租用费用优惠价格表&#xff0c;轻量2核2G3M带宽轻量服务器一年61元&#xff0c;折合5元1个月&#xff0c;新老用户同享99元一年服务器&#xff0c;2核4G5M服务器ECS优惠价199元一年&#xff0c;2核4G4M轻量服务器165元一年&#xff0c;2核4G服务器30元3…

001 - Hugo, 创建一个网站

001 - Hugo, 创建一个网站安装hugoWindows系统Macos Hugo博客搭建初始化博客主题安装配置博客各个页面开始创作创建 GitHub Page 仓库本地调试和预览发布内容 教程及鸣谢文字教程视频教程 001 - Hugo, 创建一个网站 这篇文章假设你已经&#xff1a; 了解基本的终端命令行知识&…

黑马鸿蒙教程学习1:Helloworld

今年打算粗略学习下鸿蒙开发&#xff0c;当作兴趣爱好&#xff0c;通过下华为那个鸿蒙开发认证&#xff0c; 发现黑马的课程不错&#xff0c;有视频和完整的代码和课件下载&#xff0c;装个devstudio就行了&#xff0c;建议32G内存。 今年的确是鸿蒙大爆发的一年呀&#xff0c;…

Win32汇编数组学习2

之前学习过win32汇编数组&#xff1b;还不熟悉&#xff1b;继续熟悉&#xff1b; 先做几个基本的对话框&#xff0c;有一个静态文本框&#xff1b; 定义数组之后&#xff0c;用 wsprintf 函数格式化&#xff0c;然后调用 SetDlgItemText 赋值给静态文本框&#xff1b; arr1 …

【力扣hot100】刷题笔记Day5

前言 回学校了&#xff0c;荒废了半天之后打算奋发图强猛猛刷题&#xff0c;找实习&#xff01;赚钱&#xff01;&#xff01; 560. 和为 K 的子数组 - 力扣&#xff08;LeetCode&#xff09; 前缀法 哈希表 这个题解解释比官方清晰&#xff0c;截个图方便看&#xff0c;另一…

OpenCV-42 直方图均匀化

目录 一、直方图均匀化原理 二、直方图均匀化在OpenCV中的运用 一、直方图均匀化原理 直方图均匀化是通过拉伸像素强度的分布范围&#xff0c;使得在0~255灰阶上的分布更加均匀&#xff0c;提高图像的对比度。达到改善图像主管视觉效果的目的。对比度较低的图像适合使用直方…