当前位置: 首页 > news >正文

ArcGIS Pro SDK (九)几何 12 多面体

ArcGIS Pro SDK (九)几何 12 多面体

文章目录

  • ArcGIS Pro SDK (九)几何 12 多面体
    • 1 通过拉伸多边形或折线构建多面体
    • 2 多面体属性
    • 3 构建多面体
    • 4 通过MultipatchBuilderEx构建多面体
    • 5 从另一个多面体构建多面体
    • 6 从 3D 模型文件构建多面体
    • 7 构建 3D 特殊多面体形状
    • 8 创建基本材料
    • 9 使用 JPEG 纹理创建基本材质
    • 10 使用未压缩纹理创建基本材质
    • 11 获取多面体的纹理图像
    • 12 获取多面体的法线坐标
    • 13 获取多面体的法线
    • 14 获取多面体的材质属性

环境:Visual Studio 2022 + .NET6 + ArcGIS Pro SDK 3.0

1 通过拉伸多边形或折线构建多面体

// 构建一个多边形
string json = "{\"hasZ\":true,\"rings\":[[[0,0,0],[0,1,0],[1,1,0],[1,0,0],[0,0,0]]],\"spatialReference\":{\"wkid\":4326}}";
Polygon polygon = PolygonBuilderEx.FromJson(json);// 通过偏移量拉伸多边形以创建多面体
Multipatch multipatch = GeometryEngine.Instance.ConstructMultipatchExtrude(polygon, 2);// 一个不同的多边形
json = "{\"hasZ\":true,\"rings\":[[[0,0,1],[0,1,2],[1,1,3],[1,0,4],[0,0,1]]],\"spatialReference\":{\"wkid\":4326}}";
polygon = PolygonBuilderEx.FromJson(json);// 在 z 值之间拉伸以创建多面体
multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeFromToZ(polygon, -10, 20);// 沿着由坐标定义的轴拉伸以创建多面体
Coordinate3D coord = new Coordinate3D(10, 18, -10);
multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeAlongVector3D(polygon, coord);// 构建一条折线
json = "{\"hasZ\":true,\"paths\":[[[400,800,1000],[800,1400,1500],[1200,800,2000],[1800,1800,2500],[2200,800,3000]]],\"spatialReference\":{\"wkid\":3857}}";
Polyline polyline = PolylineBuilderEx.FromJson(json);// 拉伸到特定 z 值以创建多面体
multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeToZ(polyline, 500);Coordinate3D fromCoord = new Coordinate3D(50, 50, -500);
Coordinate3D toCoord = new Coordinate3D(200, 50, 1000);// 在两个坐标之间拉伸以创建多面体
multipatch = GeometryEngine.Instance.ConstructMultipatchExtrudeAlongLine(polyline, fromCoord, toCoord);

2 多面体属性

// 标准几何属性
bool hasZ = multipatch.HasZ;
bool hasM = multipatch.HasM;
bool hasID = multipatch.HasID;
bool isEmpty = multipatch.IsEmpty;
var sr = multipatch.SpatialReference;// 补丁(部分)的数量
int patchCount = multiPatch.PartCount;
// 点的数量
int pointCount = multiPatch.PointCount;// 作为 MapPoints 获取点
ReadOnlyPointCollection points = multipatch.Points;
// 或作为 3D 坐标获取点
IReadOnlyList<Coordinate3D> coordinates = multipatch.Copy3DCoordinatesToList();// 多面体材料
bool hasMaterials = multiPatch.HasMaterials;
int materialCount = multiPatch.MaterialCount;// 多面体纹理
bool hasTextures = multiPatch.HasTextures;
int textureVertexCount = multiPatch.TextureVertexCount;// 法线
bool hasNormals = multiPatch.HasNormals;// 单个补丁的属性(如果 multipatch.PartCount > 0)
int patchPriority = multiPatch.GetPatchPriority(patchIndex);
PatchType patchType = multiPatch.GetPatchType(patchIndex);// 补丁点
int patchPointCount = multiPatch.GetPatchPointCount(patchIndex);
int pointStartIndex = multiPatch.GetPatchStartPointIndex(patchIndex);
// 补丁点是从 pointStartIndex 到 pointStartIndex + patchPointCount 的 multipatch.Points 中的点 // 如果多面体有材料
if (hasMaterials)
{// 补丁是否有材料?//   如果补丁没有材料,则 materialIndex = -1;//   如果补丁有材料,则 0 <= materialIndex < materialCountint materialIndex = multipatch.GetPatchMaterialIndex(patchIndex);// 单个材料的属性(如果 multipatch.MaterialCount > 0)var color = multipatch.GetMaterialColor(materialIndex);var edgeColor = multipatch.GetMaterialEdgeColor(materialIndex);var edgeWidth = multipatch.GetMaterialEdgeWidth(materialIndex);var shiness = multipatch.GetMaterialShininess(materialIndex);var percent = multipatch.GetMaterialTransparencyPercent(materialIndex);var cullBackFace = multipatch.IsMaterialCullBackFace(materialIndex);// 纹理属性bool isTextured = multipatch.IsMaterialTextured(materialIndex);if (isTextured){int columnCount = multipatch.GetMaterialTextureColumnCount(materialIndex);int rowCount = multipatch.GetMaterialTextureRowCount(materialIndex);int bpp = multipatch.GetMaterialTextureBytesPerPixel(materialIndex);TextureCompressionType compressionType = multipatch.GetMaterialTextureCompressionType(materialIndex);var texture = multipatch.GetMaterialTexture(materialIndex);}
}// 纹理坐标(如果 multipatch.HasTextures = true)
if (hasTextures)
{int numPatchTexturePoints = multiPatch.GetPatchTextureVertexCount(patchIndex);var coordinate2D = multiPatch.GetPatchTextureCoordinate(patchIndex, 0);ICollection<Coordinate2D> textureCoordinates = new List<Coordinate2D>(numPatchTexturePoints);multiPatch.GetPatchTextureCoordinates(patchIndex, ref textureCoordinates);
}// 补丁法线(如果 multipatch.HasNormals = true)
if (hasNormals)
{// 法线坐标的数量 = multipatch.GetPatchPointCount(patchIndex)Coordinate3D patchNormal = multipatch.GetPatchNormal(patchIndex, 0);ICollection<Coordinate3D> normalCoordinates = new List<Coordinate3D>(patchPointCount);multipatch.GetPatchNormals(patchIndex, ref normalCoordinates);
}

3 构建多面体

// 导出为二进制 XML
string binaryXml = multiPatch.ToBinaryXml();// 从二进制 XML 导入 - 方法需要在 MCT 上运行
Multipatch binaryMultipatch = MultipatchBuilderEx.FromBinaryXml(binaryXml);// XML 导出/导入
string xml = multiPatch.ToXml();
Multipatch xmlMultipatch = MultipatchBuilderEx.FromXml(xml);// esriShape 导出/导入
byte[] buffer = multiPatch.ToEsriShape();
Multipatch esriPatch = MultipatchBuilderEx.FromEsriShape(buffer);// 或者使用 GeometryEngine
Multipatch patchImport = GeometryEngine.Instance.ImportFromEsriShape(EsriShapeImportFlags.EsriShapeImportDefaults, buffer, multiPatch.SpatialReference) as Multipatch;

4 通过MultipatchBuilderEx构建多面体

var coords_face1 = new List<Coordinate3D>()
{new Coordinate3D(12.495461061000071,41.902603910000039,62.552700000000186),new Coordinate3D(12.495461061000071,41.902603910000039,59.504700000004959),new Coordinate3D(12.495461061000071,41.902576344000067,59.504700000004959),new Coordinate3D(12.495461061000071,41.902603910000039,62.552700000000186),new Coordinate3D(12.495461061000071,41.902576344000067,59.504700000004959),new Coordinate3D(12.495461061000071,41.902576344000067,62.552700000000186),
};var coords_face2 = new List<Coordinate3D>()
{new Coordinate3D(12.495461061000071, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495461061000071, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902576344000067, 62.552700000000186),
};var coords_face3 = new List<Coordinate3D>()
{new Coordinate3D(12.495488442000067, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902603910000039, 62.552700000000186),
};var coords_face4 = new List<Coordinate3D>()
{new Coordinate3D(12.495488442000067, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902576344000067, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495488442000067, 41.902603910000039, 59.504700000004959),
};var coords_face5 = new List<Coordinate3D>()
{new Coordinate3D(12.495488442000067, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902603910000039, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902603910000039, 59.504700000004959),new Coordinate3D(12.495461061000071, 41.902603910000039, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902603910000039, 62.552700000000186),
};var coords_face6 = new List<Coordinate3D>()
{new Coordinate3D(12.495488442000067, 41.902603910000039, 62.552700000000186),new Coordinate3D(12.495461061000071, 41.902603910000039, 62.552700000000186),new Coordinate3D(12.495461061000071, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902603910000039, 62.552700000000186),new Coordinate3D(12.495461061000071, 41.902576344000067, 62.552700000000186),new Coordinate3D(12.495488442000067, 41.902576344000067, 62.552700000000186),
};var materialRed = new BasicMaterial();
materialRed.Color = System.Windows.Media.Colors.Red;var materialTransparent = new BasicMaterial();
materialTransparent.Color = System.Windows.Media.Colors.White;
materialTransparent.TransparencyPercent = 80;var blueTransparent = new BasicMaterial(materialTransparent);
blueTransparent.Color = System.Windows.Media.Colors.SkyBlue;// 创建补丁对象列表
var patches = new List<Patch>();// 创建多面体构建器对象
var mpb = new ArcGIS.Core.Geometry.MultipatchBuilderEx();// 使用适当的坐标制作每个补丁并添加到补丁列表中
var patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face1;
patches.Add(patch);patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face2;
patches.Add(patch);patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face3;
patches.Add(patch);patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face4;
patches.Add(patch);patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face5;
patches.Add(patch);patch = mpb.MakePatch(PatchType.Triangles);
patch.Coords = coords_face6;
patches.Add(patch);patches[0].Material = materialRed;
patches[1].Material = materialTransparent;
patches[2].Material = materialRed;
patches[3].Material = materialRed;
patches[4].Material = materialRed;
patches[5].Material = blueTransparent;// 将补丁分配给多面体构建器
mpb.Patches = patches;// 检查哪些补丁当前包含该材料
var red = mpb.QueryPatchIndicesWithMaterial(materialRed);
//   red should be [0, 2, 3, 4]// 调用geometry函数获取多面体
multipatch = mpb.ToGeometry() as Multipatch;

5 从另一个多面体构建多面体

// 创建多面体构建器对象
var builder = new ArcGIS.Core.Geometry.MultipatchBuilderEx(multipatch);// 检查一些属性
bool hasM = builder.HasM;
bool hasZ = builder.HasZ;
bool hasID = builder.HasID;
bool isEmpty = builder.IsEmpty;
bool hasNormals = builder.HasNormals;var patches = builder.Patches;
int patchCount = patches.Count;// 如果有补丁
if (patchCount > 0)
{int pointCount = builder.GetPatchPointCount(0);// 替换第一个补丁中的第一个点if (pointCount > 0){// 获取第一个点var pt = builder.GetPoint(0, 0);builder.SetPoint(0, 0, newPoint);}// 检查当前包含纹理的补丁var texture = builder.QueryPatchIndicesWithTexture(brickTextureResource);// 分配纹理材质patches[0].Material = brickMaterialTexture;
}// 更新builder以支持M值
builder.HasM = true;
// 同步补丁属性以匹配builder属性
// 在这种情况下,因为我们刚刚将HasM设置为true,每个补丁现在都将为其坐标集获取一个默认的M值
builder.SynchronizeAttributeAwareness();// 调用ToGeometry获取多面体
multipatch = builder.ToGeometry() as Multipatch;// multipatch.HasM 将为 true

6 从 3D 模型文件构建多面体

try
{var model = ArcGIS.Core.Geometry.MultipatchBuilderEx.From3DModelFile(@"c:\Temp\My3dModelFile.dae");bool modelIsEmpty = model.IsEmpty;
}
catch (FileNotFoundException)
{// 文件未找到
}
catch (ArgumentException)
{// 文件扩展名不受支持或无法读取文件
}

7 构建 3D 特殊多面体形状

var sr = MapView.Active.Map.SpatialReference;var extent = MapView.Active.Extent;
var center = extent.Center;
var centerZ = MapPointBuilderEx.CreateMapPoint(center.X, center.Y, 500, sr);// 立方体
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cube, centerZ, 200, sr);
// 四面体
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Tetrahedron, centerZ, 200, sr);
// 菱形
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Diamond, centerZ, 200, sr);
// 六角形
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Hexagon, centerZ, 200, sr);// 球体框架
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.SphereFrame, centerZ, 200, 0.8, sr);
// 球体
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Sphere, centerZ, 200, 0.8, sr);
// 圆柱体
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cylinder, centerZ, 200, 0.8, sr);
// 圆锥体
multipatch = ArcGIS.Core.Geometry.MultipatchBuilderEx.CreateMultipatch(MultipatchConstructType.Cone, centerZ, 200, 0.8, sr);// 使用builder添加材料或纹理
// 创建一个带有材料的圆锥体
builder = new MultipatchBuilderEx(MultipatchConstructType.Cone, centerZ, 200, 0.8, sr);BasicMaterial faceMaterial = new BasicMaterial();
faceMaterial.Color = System.Windows.Media.Color.FromRgb(255, 0, 0);
faceMaterial.Shininess = 150;
faceMaterial.TransparencyPercent = 50;
faceMaterial.EdgeWidth = 20;foreach (var patch in builder.Patches)patch.Material = faceMaterial;multipatch = builder.ToGeometry() as Multipatch;

8 创建基本材料

// 使用默认值创建BasicMaterial
BasicMaterial material = new BasicMaterial();
System.Windows.Media.Color color = material.Color;         // color = Colors.Black
System.Windows.Media.Color edgeColor = material.EdgeColor; // edgeColor = Colors.Black
int edgeWidth = material.EdgeWidth;                        // edgeWidth = 0
int transparency = material.TransparencyPercent;           // transparency = 0
int shininess = material.Shininess;                        // shininess = 0
bool cullBackFace = material.IsCullBackFace;               // cullBackFace = false// 修改属性
material.Color = System.Windows.Media.Colors.Red;
material.EdgeColor = System.Windows.Media.Colors.Blue;
material.EdgeWidth = 10;
material.TransparencyPercent = 50;
material.Shininess = 25;
material.IsCullBackFace = true;

9 使用 JPEG 纹理创建基本材质

// 将jpeg读取到缓冲区中
// 在3.0版本中需要https://www.nuget.org/packages/Microsoft.Windows.Compatibility
// System.Drawing
System.Drawing.Image image = System.Drawing.Image.FromFile(@"C:\temp\myImageFile.jpg");
MemoryStream memoryStream = new MemoryStream();System.Drawing.Imaging.ImageFormat format = System.Drawing.Imaging.ImageFormat.Jpeg;
image.Save(memoryStream, format);
byte[] imageBuffer = memoryStream.ToArray();var jpgTexture = new JPEGTexture(imageBuffer);// 纹理属性
int bpp = jpgTexture.BytesPerPixel;
int columnCount = jpgTexture.ColumnCount;
int rowCount = jpgTexture.RowCount;// 构建textureResource和material
BasicMaterial material = new BasicMaterial();
material.TextureResource = new TextureResource(jpgTexture);

10 使用未压缩纹理创建基本材质

UncompressedTexture uncompressedTexture1 = new UncompressedTexture(new byte[10 * 12 * 3], 10, 12, 3);// 纹理属性
int bpp = uncompressedTexture1.BytesPerPixel;
int columnCount = uncompressedTexture1.ColumnCount;
int rowCount = uncompressedTexture1.RowCount;// 构建textureResource和material
TextureResource tr = new TextureResource(uncompressedTexture1);
BasicMaterial material = new BasicMaterial();
material.TextureResource = tr;

11 获取多面体的纹理图像

// <summary>
// 此方法获取多面体的材料纹理图像。
// 此方法必须在MCT上调用。使用QueuedTask.Run。
// </summary>
// <param name="multipatch">输入的多面体。</param>
// <param name="patchIndex">获取材料纹理的补丁(部分)索引。</param>
public void GetMultipatchTextureImage(Multipatch multipatch, int patchIndex)
{int materialIndex = multipatch.GetPatchMaterialIndex(patchIndex);if (!multipatch.IsMaterialTextured(materialIndex))return;TextureCompressionType compressionType = multipatch.GetMaterialTextureCompressionType(materialIndex);string ext = compressionType == TextureCompressionType.CompressionJPEG ? ".jpg" : ".dat";byte[] textureBuffer = multipatch.GetMaterialTexture(materialIndex);Stream imageStream = new MemoryStream(textureBuffer);System.Drawing.Image image = System.Drawing.Image.FromStream(imageStream);image.Save(@"C:\temp\myImage" + ext);
}

12 获取多面体的法线坐标

// <summary>
// 此方法获取多面体的法线坐标并执行一些操作。
// 此方法必须在MCT上调用。使用QueuedTask.Run。
// </summary>
// <param name="multipatch">输入的多面体。</param>
// <param name="patchIndex">获取法线的补丁(部分)索引。</param>
public void DoSomethingWithNormalCoordinate(Multipatch multipatch, int patchIndex)
{if (multipatch.HasNormals){// 如果多面体有法线,则法线数量等于点的数量。int numNormals = multipatch.GetPatchPointCount(patchIndex);for (int pointIndex = 0; pointIndex < numNormals; pointIndex++){Coordinate3D normal = multipatch.GetPatchNormal(patchIndex, pointIndex);// 对法线坐标进行一些操作。}}
}

13 获取多面体的法线

// <summary>
// 此方法获取多面体的法线坐标并执行一些操作。
// 此方法必须在MCT上调用。使用QueuedTask.Run。
// </summary>
// <param name="multipatch">输入的多面体。</param>
public void DoSomethingWithNormalCoordinates(Multipatch multipatch)
{if (multipatch.HasNormals){// 只分配一次列表int numPoints = multipatch.PointCount;ICollection<Coordinate3D> normals = new List<Coordinate3D>(numPoints);// 多面体的部分也称为补丁int numPatches = multipatch.PartCount;for (int patchIndex = 0; patchIndex < numPatches; patchIndex++){multipatch.GetPatchNormals(patchIndex, ref normals);// 对这个补丁的法线进行一些操作。}}
}

14 获取多面体的材质属性

public void GetMaterialProperties(Multipatch multipatch, int patchIndex)
{if (multipatch.HasMaterials){// 获取指定补丁的材质索引。int materialIndex = multipatch.GetPatchMaterialIndex(patchIndex);System.Windows.Media.Color color = multipatch.GetMaterialColor(materialIndex);int tranparencyPercent = multipatch.GetMaterialTransparencyPercent(materialIndex);bool isBackCulled = multipatch.IsMaterialCullBackFace(materialIndex);if (multipatch.IsMaterialTextured(materialIndex)){int bpp = multipatch.GetMaterialTextureBytesPerPixel(materialIndex);int columnCount = multipatch.GetMaterialTextureColumnCount(materialIndex);int rowCount = multipatch.GetMaterialTextureRowCount(materialIndex);}}
}

相关文章:

ArcGIS Pro SDK (九)几何 12 多面体

ArcGIS Pro SDK &#xff08;九&#xff09;几何 12 多面体 文章目录 ArcGIS Pro SDK &#xff08;九&#xff09;几何 12 多面体1 通过拉伸多边形或折线构建多面体2 多面体属性3 构建多面体4 通过MultipatchBuilderEx构建多面体5 从另一个多面体构建多面体6 从 3D 模型文件构建…...

二次元手游《交错战线》游戏拆解

交错战线游戏拆解案 游戏亮点即核心趣味 一、关键词&#xff1a; 回合制游戏、二次元、机甲、横板、剧情、养成、异星探索。 二、游戏亮点&#xff1a; 符合目标群体审美的原画。 三、核心趣味&#xff1a; 抽卡、肝或者氪金解锁新皮肤。 核心玩法及系统规则 核心玩法&…...

【BUG】已解决:Downgrade the protobuf package to 3.20.x or lower.

Downgrade the protobuf package to 3.20.x or lower. 目录 Downgrade the protobuf package to 3.20.x or lower. 【常见模块错误】 【解决方案】 欢迎来到英杰社区https://bbs.csdn.net/topics/617804998 欢迎来到我的主页&#xff0c;我是博主英杰&#xff0c;211科班出身…...

Java开发之Redis

1、非关系型数据库、快、高并发、功能强大 2、为什么快&#xff1f;内存单线程 非阻塞的IO多路复用有效的数据类型/结构 3、应用&#xff1a;支持缓存、支持事务、持久化、发布订阅模型、Lua脚本 4、数据类型&#xff1a; 5 种基础数据类型&#xff1a;String&#xff08;字…...

Java面试八股之 Spring Bean的生命周期

Spring Bean的生命周期 实例化&#xff08;Instantiation&#xff09;&#xff1a;Spring容器根据Bean定义信息创建Bean的实例&#xff0c;通常通过无参构造函数进行。 依赖注入&#xff08;Dependency Injection&#xff0c;DI&#xff09;&#xff1a;Spring容器按照Bean定…...

SQL中的函数

目录 前言 一、系统内置函数 1、数学函数 2、日期和时间函数 3、聚合函数 4、字符串函数 二、自定义函数 1、标量函数的创建与调用 2、内嵌表值函数的创建与调用 3、多语句表值函数的创建与调用 前言 函数是由一个或多个 T-SQL 语句组成的子程序&#xff0c;可用于封…...

VSCode | 修改编辑器注释的颜色

1 打开VsCode的设置进入settings.json 2 添加如下代码 "editor.tokenColorCustomizations": {"comments": "#17e917"},3 保存即可生效...

媒体邀约专访与群访的区别?

传媒如春雨&#xff0c;润物细无声&#xff0c;大家好&#xff0c;我是51媒体网胡老师。 媒体邀约中的专访与群访在多个方面存在显著差异&#xff0c;以下是对这两种采访方式的详细比较&#xff1a; 一、定义与形式 专访&#xff1a; 定义&#xff1a;专访是指由媒体记者对单…...

Pycharm2024最新版community社区版下载安装配置,快速上手

第一步&#xff1a;下载 方法1&#xff1a;官网链接 https://www.jetbrains.com/pycharm/download/?sectionwindows .方法2&#xff1a;百度网盘 链接&#xff1a;https://pan.baidu.com/s/1ic2N5hUQ2m1Kmyr5nK9Jxw?pwd76dt 提取码&#xff1a;76dt --来自百度网盘超级…...

服务器选择租用还是托管?托管和租用哪个比较划算

在构建或扩展IT基础设施时&#xff0c;服务器作为关键组件&#xff0c;其选择方式——租用或托管&#xff0c;直接关系到企业的运营成本、灵活性、安全性及长期发展战略。本文将从技术、经济、安全等多个维度&#xff0c;深入解析这两种方案的优缺点&#xff0c;并探讨在何种情…...

智能制造·数字化工厂建设规划方案(65P)

获取完整PPT见下图 更多有关华为研发管理/IPD、MBSE、PLM、ERP、MES、数据治理、数字样机等方面免费解决方案、资料获取&#xff0c;请见下图...

ACM中国图灵大会专题 | 图灵奖得主Manuel Blum教授与仓颉团队交流 | 华为论坛:面向全场景应用编程语言精彩回顾

ACM 中国图灵大会&#xff08;ACM Turing Award Celebration Conference TURC 2024&#xff09;于2024年7月5日至7日在长沙举行。本届大会由ACM主办&#xff0c;in cooperation with CCF&#xff0c;互联网之父Vinton Cerf、中国计算机学会前理事长梅宏院士和廖湘科院士担任学术…...

k8s 公共服务

修改named.conf。修改第13行和第21行 下面是 named.rfc1912 修改位置&#xff0c;在最后 所以用cp -p 复制文件&#xff0c;保留权限 nslookup 回车&#xff0c;server是看哪个dns 在起作用 dns服务器要配置给所有公共服务节点和 k8s 节点 就在网络文件加个DNS2就行了&…...

【数据分析详细教学】全球气温变迁:一个多世纪的数据分析

全球气温变迁&#xff1a;一个多世纪的数据分析 1. 数据集选择与获取 数据可以从NASA的GISTEMP数据集获取&#xff0c;通常提供的格式有TXT和CSV。我们假设数据是以CSV格式提供。 2. 数据预处理 使用Python的pandas库读取数据并进行预处理。 import pandas as pd# 加载数…...

AV1技术学习:Reference Frame System

一、Reference Frames AV1 Codec 允许在其解码的帧缓冲区中最多允许保存 8 帧。对于一个编码帧&#xff0c;可以从解码的帧缓冲区中选择任意 7 个帧作为它的参考帧。编码端可以通过比特流显式地传输参考帧索引&#xff0c;范围从 1到 7。原则上&#xff0c;参考帧索引 1-4 为当…...

数学建模(7)——Logistic模型

一、马尔萨斯人口模型 import numpy as np import matplotlib.pyplot as plt# 初始人口 N0 100 # 人口增长率 r 0.02 # 时间段&#xff08;年&#xff09; t np.linspace(0, 200, 200)# 马尔萨斯人口模型 N N0 * np.exp(r * t)# 绘图 plt.plot(t, N, labelPopulation) plt.…...

“微软蓝屏”事件,给IT行业带来的宝贵经验和教训

“微软蓝屏”事件是指2024年7月19日发生的一次全球性技术故障&#xff0c;主要涉及微软视窗&#xff08;Windows&#xff09;操作系统及其相关应用和服务。 以下是对该事件的详细解析&#xff1a; 一、事件概述 发生时间&#xff1a;2024年7月19日事件影响&#xff1a;全球多个…...

QT总结——图标显示坑

最近写代码遇到一个神仙大坑&#xff0c;我都怀疑我软件是不是坏了&#xff0c;这里记录一下。 写qt工程的时候我们一般会设置图标&#xff0c;这个图标是窗体的图标同时也是任务栏的图标&#xff0c;但是我发现生成的exe没有图标&#xff0c;这个时候就想着给他加一个图标&…...

SQL 注入漏洞详解 - Union 注入

1)漏洞简介 SQL 注入简介 SQL 注入 即是指 Web 应用程序对用户输入数据的合法性没有判断或过滤不严,攻击者可以在 Web 应用程序中事先定义好的查询语句的结尾上添加额外的 SQL 语句,在管理员不知情的情况下实现非法操作,以此来实现欺骗数据库服务器执行非授权的任意查询,…...

Qt创建自定义组件并且promote to之后导致编译错误(CMake)

创建自定组件并且加入到全局(勾选"Global include"选项)后&#xff0c;重新编译&#xff0c;元对象编译器生成的ui_xxxx.h文件中会新加入自定义组件的头文件&#xff1a; 如图所示&#xff0c;编译器提示找不到自定义组件的头文件&#xff1a; Solution: 在CMakeL…...

基于算法竞赛的c++编程(28)结构体的进阶应用

结构体的嵌套与复杂数据组织 在C中&#xff0c;结构体可以嵌套使用&#xff0c;形成更复杂的数据结构。例如&#xff0c;可以通过嵌套结构体描述多层级数据关系&#xff1a; struct Address {string city;string street;int zipCode; };struct Employee {string name;int id;…...

未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?

编辑&#xff1a;陈萍萍的公主一点人工一点智能 未来机器人的大脑&#xff1a;如何用神经网络模拟器实现更智能的决策&#xff1f;RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战&#xff0c;在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…...

手游刚开服就被攻击怎么办?如何防御DDoS?

开服初期是手游最脆弱的阶段&#xff0c;极易成为DDoS攻击的目标。一旦遭遇攻击&#xff0c;可能导致服务器瘫痪、玩家流失&#xff0c;甚至造成巨大经济损失。本文为开发者提供一套简洁有效的应急与防御方案&#xff0c;帮助快速应对并构建长期防护体系。 一、遭遇攻击的紧急应…...

LeetCode - 394. 字符串解码

题目 394. 字符串解码 - 力扣&#xff08;LeetCode&#xff09; 思路 使用两个栈&#xff1a;一个存储重复次数&#xff0c;一个存储字符串 遍历输入字符串&#xff1a; 数字处理&#xff1a;遇到数字时&#xff0c;累积计算重复次数左括号处理&#xff1a;保存当前状态&a…...

什么是库存周转?如何用进销存系统提高库存周转率?

你可能听说过这样一句话&#xff1a; “利润不是赚出来的&#xff0c;是管出来的。” 尤其是在制造业、批发零售、电商这类“货堆成山”的行业&#xff0c;很多企业看着销售不错&#xff0c;账上却没钱、利润也不见了&#xff0c;一翻库存才发现&#xff1a; 一堆卖不动的旧货…...

pikachu靶场通关笔记22-1 SQL注入05-1-insert注入(报错法)

目录 一、SQL注入 二、insert注入 三、报错型注入 四、updatexml函数 五、源码审计 六、insert渗透实战 1、渗透准备 2、获取数据库名database 3、获取表名table 4、获取列名column 5、获取字段 本系列为通过《pikachu靶场通关笔记》的SQL注入关卡(共10关&#xff0…...

均衡后的SNRSINR

本文主要摘自参考文献中的前两篇&#xff0c;相关文献中经常会出现MIMO检测后的SINR不过一直没有找到相关数学推到过程&#xff0c;其中文献[1]中给出了相关原理在此仅做记录。 1. 系统模型 复信道模型 n t n_t nt​ 根发送天线&#xff0c; n r n_r nr​ 根接收天线的 MIMO 系…...

【分享】推荐一些办公小工具

1、PDF 在线转换 https://smallpdf.com/cn/pdf-tools 推荐理由&#xff1a;大部分的转换软件需要收费&#xff0c;要么功能不齐全&#xff0c;而开会员又用不了几次浪费钱&#xff0c;借用别人的又不安全。 这个网站它不需要登录或下载安装。而且提供的免费功能就能满足日常…...

[免费]微信小程序问卷调查系统(SpringBoot后端+Vue管理端)【论文+源码+SQL脚本】

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的微信小程序问卷调查系统(SpringBoot后端Vue管理端)【论文源码SQL脚本】&#xff0c;分享下哈。 项目视频演示 【免费】微信小程序问卷调查系统(SpringBoot后端Vue管理端) Java毕业设计_哔哩哔哩_bilibili 项…...

C++课设:简易日历程序(支持传统节假日 + 二十四节气 + 个人纪念日管理)

名人说:路漫漫其修远兮,吾将上下而求索。—— 屈原《离骚》 创作者:Code_流苏(CSDN)(一个喜欢古诗词和编程的Coder😊) 专栏介绍:《编程项目实战》 目录 一、为什么要开发一个日历程序?1. 深入理解时间算法2. 练习面向对象设计3. 学习数据结构应用二、核心算法深度解析…...