91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.34MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-20
  • 語言: C#
  • 標簽: 計算幾何??凹凸性??C#??

資源簡介

自己用C#實現的關于多邊形方向及頂點凹凸性的判斷的方法。里邊的函數包括了構造多邊形、方向判斷、凹凸性判斷。適合初學者學習參考之用。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Collections;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;



namespace?AnotherSolution
{
????public?partial?class?Form1?:?Form
????{
????????bool?flag?=?false;
????????ArrayList?selectPts?=?new?ArrayList();
????????Point[]?resultPts;
????????bool?first?=?true;

????????int?XL?=?0?XR?=?0?YB?=?0?YT?=?0;??//分別記錄pts中X的最左、最右,Y的最下、最上值
????????Point[]?tempPolygon;

????????Point[]?newPolygon;??//存儲新生成的凸多邊形
????????int[]?flagNum;???????//存儲多邊形頂點的凹凸性,0表示凸頂點,-1表示凹頂點

????????public?Form1()
????????{
????????????InitializeComponent();
????????????tempPolygon?=?new?Point[4];
????????}

????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{

????????}

????????private?void?單擊開始ToolStripMenuItem_Click(object?sender?EventArgs?e)
????????{
????????????flag?=?true;
????????}

????????private?void?Form1_MouseDown(object?sender?MouseEventArgs?e)
????????{
????????????if?(e.Button?==?MouseButtons.Left)
????????????{

????????????????if?(flag?==?false)
????????????????{
????????????????????return;
????????????????}
????????????????Point?pt?=?new?Point(e.X?e.Y);
????????????????if?(first?==?true)
????????????????{
????????????????????selectPts.Add(pt);??//v[0]=pt
????????????????????//??selectPts.Add(pt);??//v[1]=pt
????????????????????first?=?false;
????????????????}
????????????????else
????????????????{
????????????????????selectPts.Add(pt);
????????????????????GetPoints(out?resultPts);
????????????????????Pen?p?=?new?Pen(Color.Blue?1);
????????????????????Graphics?g?=?this.CreateGraphics();
????????????????????g.DrawLine(p?resultPts[selectPts.Count?-?2]?resultPts[selectPts.Count?-?1]);
????????????????}
????????????}
????????????if?(e.Button?==?MouseButtons.Right)
????????????{
????????????????Pen?p?=?new?Pen(Color.Blue?1);
????????????????Graphics?g?=?this.CreateGraphics();
????????????????g.DrawLine(p?resultPts[selectPts.Count?-?1]?resultPts[0]);
????????????????first?=?true;
????????????????selectPts.Clear();

????????????????//????NewConvexPolygon(resultPts?out?tempPolygon);
????????????????//?int?flaggs;
????????????????//?PolygonDirection(resultPts?out?flaggs);
???????????????//?VertexsConvexityConcavity(resultPts);
????????????????PolygonConvexityConcavity(resultPts);
????????????}

????????}

????????Point[]?GetPoints(out?Point[]?pts)
????????{
????????????pts?=?new?Point[selectPts.Count];
????????????for?(int?i?=?0;?i?????????????{
????????????????pts[i]?=?(Point)selectPts[i];
????????????}
????????????return?pts;
????????}

????????private?void?BubbleArray(int[]?transArray)
????????{
????????????int?temp;
????????????for?(int?i?=?0;?i?????????????{
????????????????for?(int?j?=?0;?j??????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????4013??2013-09-29?16:06??AnotherSolution\AnotherSolution\AnotherSolution.csproj

?????文件??????13824??2013-10-06?13:18??AnotherSolution\AnotherSolution\bin\Debug\AnotherSolution.exe

?????文件??????32256??2013-10-06?13:18??AnotherSolution\AnotherSolution\bin\Debug\AnotherSolution.pdb

?????文件??????14328??2013-10-06?13:19??AnotherSolution\AnotherSolution\bin\Debug\AnotherSolution.vshost.exe

?????文件????????490??2009-06-11?05:14??AnotherSolution\AnotherSolution\bin\Debug\AnotherSolution.vshost.exe.manifest

?????文件????4554752??2013-09-29?15:53??AnotherSolution\AnotherSolution\DevComponents.DotNetBar2.dll

?????文件??????10164??2013-10-06?13:18??AnotherSolution\AnotherSolution\Form1.cs

?????文件???????7450??2013-10-02?16:18??AnotherSolution\AnotherSolution\Form1.Designer.cs

?????文件???????6012??2013-10-02?16:18??AnotherSolution\AnotherSolution\Form1.resx

?????文件????????823??2013-10-06?13:19??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.csproj.FileListAbsolute.txt

?????文件????????847??2013-10-02?16:18??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.csproj.GenerateResource.Cache

?????文件??????13824??2013-10-06?13:18??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.exe

?????文件????????180??2013-10-02?16:18??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.Form1.resources

?????文件??????32256??2013-10-06?13:18??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.pdb

?????文件????????180??2013-10-02?12:21??AnotherSolution\AnotherSolution\obj\Debug\AnotherSolution.Properties.Resources.resources

?????文件???????5891??2013-10-02?12:21??AnotherSolution\AnotherSolution\obj\Debug\ResolveAssemblyReference.cache

?????文件????????507??2013-09-29?15:48??AnotherSolution\AnotherSolution\Program.cs

?????文件???????1442??2013-09-29?15:48??AnotherSolution\AnotherSolution\Properties\AssemblyInfo.cs

?????文件???????2859??2013-09-29?15:48??AnotherSolution\AnotherSolution\Properties\Resources.Designer.cs

?????文件???????5612??2013-09-29?15:48??AnotherSolution\AnotherSolution\Properties\Resources.resx

?????文件???????1100??2013-09-29?15:48??AnotherSolution\AnotherSolution\Properties\Settings.Designer.cs

?????文件????????249??2013-09-29?15:48??AnotherSolution\AnotherSolution\Properties\Settings.settings

?????文件????????935??2013-09-29?15:48??AnotherSolution\AnotherSolution.sln

????..A..H.?????17920??2013-10-06?13:19??AnotherSolution\AnotherSolution.suo

?????目錄??????????0??2013-09-29?15:48??AnotherSolution\AnotherSolution\obj\Debug\TempPE

?????目錄??????????0??2013-10-13?15:46??AnotherSolution\AnotherSolution\bin\Debug

?????目錄??????????0??2013-10-13?15:46??AnotherSolution\AnotherSolution\obj\Debug

?????目錄??????????0??2013-10-13?15:46??AnotherSolution\AnotherSolution\bin

?????目錄??????????0??2013-10-13?15:46??AnotherSolution\AnotherSolution\obj

?????目錄??????????0??2013-10-13?15:46??AnotherSolution\AnotherSolution\Properties

............此處省略5個文件信息

評論

共有 條評論