Code cleanup for Beta 2

git-svn-id: https://triangle.svn.codeplex.com/svn@68260 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
This commit is contained in:
SND\wo80_cp
2012-06-20 19:24:53 +00:00
parent 402672c9e6
commit fcb6057f3d
77 changed files with 611 additions and 451 deletions
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="CheckBoxDark.cs" company="">
// TODO: Update copyright text.
// <copyright file="AngleHistogram.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -18,9 +18,9 @@ namespace MeshExplorer.Controls
/// Displays an angle histogram.
/// </summary>
/// <remarks>
/// The angle histogram is divided into two parts:
/// the minimum angles on the left side (0 to 60 degrees) and
/// the maximum angles on the right (60 to 180 degrees)
/// The angle histogram is divided into two parts: the minimum angles
/// on the left side (0 to 60 degrees) and the maximum angles on the
/// right (60 to 180 degrees).
/// </remarks>
public class AngleHistogram : Control
{
@@ -70,12 +70,18 @@ namespace MeshExplorer.Controls
// The maximum number of angles
int maxAngleCount = 0;
/// <summary>
/// Initializes a new instance of the <see cref="AngleHistogram" /> control.
/// </summary>
public AngleHistogram()
{
this.BackColor = ColorScheme.ColorGray78;
InitializeComponent();
}
/// <summary>
/// Updates the histogram data and invalidates the control.
/// </summary>
public void SetData(int[] dataMin, int[] dataMax)
{
maxAngleCount = 0;
@@ -89,7 +95,6 @@ namespace MeshExplorer.Controls
if (maxAngleCount == 0)
{
this.maxAngles = null;
return;
}
this.Invalidate();
@@ -144,7 +149,9 @@ namespace MeshExplorer.Controls
}
}
/// <summary>
/// Draws the labels on the bottom.
/// </summary>
private void DrawStrings(Graphics g, SizeF fSize, int size, int middle)
{
int fHeight = (int)(fSize.Height + 2);
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ColorScheme.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,7 +13,7 @@ namespace MeshExplorer.Controls
using System.Drawing;
/// <summary>
/// TODO: Update summary.
/// Dark user interface color scheme.
/// </summary>
public static class ColorScheme
{
+20 -15
View File
@@ -1,14 +1,18 @@
// -----------------------------------------------------------------------
// <copyright file="DarkButton.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
namespace MeshExplorer.Controls
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
public class DarkButton : Button
{
@@ -50,20 +54,23 @@ namespace MeshExplorer.Controls
enum eButtonState { Normal, MouseOver, Down }
eButtonState m_State = eButtonState.Normal;
// make sure the control is invalidated(repainted) when the text is changed
// Make sure the control is invalidated when the text is changed.
public override string Text
{
get { return base.Text; }
set { base.Text = value; this.Invalidate(); }
}
//--------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="DarkButton" /> control.
/// </summary>
public DarkButton()
{
InitializeComponent();
}
//--------------------------------------------------------------------------------
#region Control overrides
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
@@ -150,7 +157,6 @@ namespace MeshExplorer.Controls
brushBorder.Dispose();
}
//--------------------------------------------------------------------------------
protected override void OnMouseLeave(System.EventArgs e)
{
m_State = eButtonState.Normal;
@@ -158,7 +164,6 @@ namespace MeshExplorer.Controls
base.OnMouseLeave(e);
}
//--------------------------------------------------------------------------------
protected override void OnMouseEnter(System.EventArgs e)
{
m_State = eButtonState.MouseOver;
@@ -166,7 +171,6 @@ namespace MeshExplorer.Controls
base.OnMouseEnter(e);
}
//--------------------------------------------------------------------------------
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
m_State = eButtonState.MouseOver;
@@ -174,12 +178,13 @@ namespace MeshExplorer.Controls
base.OnMouseUp(e);
}
//--------------------------------------------------------------------------------
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
m_State = eButtonState.Down;
this.Invalidate();
base.OnMouseDown(e);
}
#endregion
}
}
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="CheckBoxDark.cs" company="">
// TODO: Update copyright text.
// <copyright file="DarkCheckBox.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -11,11 +11,11 @@ namespace MeshExplorer.Controls
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Windows.Forms;
using System.Drawing.Text;
/// <summary>
/// TODO: Update summary.
/// Dark checkbox control.
/// </summary>
public class DarkCheckBox : ButtonBase
{
@@ -74,14 +74,14 @@ namespace MeshExplorer.Controls
}
/// <summary>
/// Constructor.
/// Initializes a new instance of the <see cref="DarkCheckBox" /> control.
/// </summary>
public DarkCheckBox()
{
this.BackColor = Color.FromArgb(76, 76, 76);
InitializeComponent();
}
#region Control overrides
protected override void OnPaint(PaintEventArgs e)
@@ -158,6 +158,7 @@ namespace MeshExplorer.Controls
if (this.isChecked)
{
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
e.Graphics.DrawLine(checkMark, 4, newRect.Bottom - boxSize / 2, newRect.Left + boxSize / 2.5f, newRect.Bottom - 2);
e.Graphics.DrawLine(checkMark, newRect.Left + boxSize / 2.6f, newRect.Bottom - 2, newRect.Right, newRect.Top);
}
+17 -5
View File
@@ -1,15 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
// -----------------------------------------------------------------------
// <copyright file="DarkListBox.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
namespace MeshExplorer.Controls
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
/// <summary>
/// Dark listbox control.
/// </summary>
public class DarkListBox : ListBox
{
Font _boldFont;
/// <summary>
/// Initializes a new instance of the <see cref="DarkListBox" /> control.
/// </summary>
public DarkListBox()
{
_boldFont = new Font(base.Font.FontFamily, base.Font.Size, FontStyle.Bold);
+4 -5
View File
@@ -1,6 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="SliderDark.cs" company="">
// TODO: Update copyright text.
// <copyright file="DarkSlider.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// Original code on CodeProject: Owner-drawn trackbar (slider), Michal Brylka
// </copyright>
// -----------------------------------------------------------------------
@@ -14,8 +15,6 @@ namespace MeshExplorer.Controls
using System.Drawing;
using System.Drawing.Drawing2D;
// CodeProject: Owner-drawn trackbar (slider), Michal Brylka
/// <summary>
/// Encapsulates control that visualy displays certain integer value and allows user to change
/// it within desired range. It imitates <see cref="System.Windows.Forms.TrackBar"/> as far as
@@ -194,7 +193,7 @@ namespace MeshExplorer.Controls
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="ColorSlider"/> class.
/// Initializes a new instance of the <see cref="ColorSlider"/> control.
/// </summary>
public DarkSlider()
{
+18 -10
View File
@@ -1,16 +1,21 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Text;
// CodeProject: A .NET Flat TabControl (CustomDraw), Oscar Londono
// -----------------------------------------------------------------------
// <copyright file="DarkTabControl.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// Original code on CodeProject: A .NET Flat TabControl (CustomDraw), Oscar Londono
// </copyright>
// -----------------------------------------------------------------------
namespace MeshExplorer.Controls
{
/// <summary>
/// Summary description for FlatTabControl.
/// </summary>
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Text;
/// <summary>
/// Summary description for FlatTabControl.
/// </summary>
public class DarkTabControl : System.Windows.Forms.TabControl
{
#region Designer
@@ -51,6 +56,9 @@ namespace MeshExplorer.Controls
private const int margin = 5;
private Color backColor = ColorScheme.ColorGray68;
/// <summary>
/// Initializes a new instance of the <see cref="DarkTabControl" /> control.
/// </summary>
public DarkTabControl()
{
// This call is required by the Windows.Forms Form Designer.
+8 -3
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="CheckBoxDark.cs" company="">
// TODO: Update copyright text.
// <copyright file="DarkTextBox.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,9 +13,11 @@ namespace MeshExplorer.Controls
using System.Drawing.Drawing2D;
using System.Windows.Forms;
/// <summary>
/// Dark textbox control.
/// </summary>
public class DarkTextBox : Control
{
#region Designer
/// <summary>
@@ -73,6 +75,9 @@ namespace MeshExplorer.Controls
TextBox textBox;
/// <summary>
/// Initializes a new instance of the <see cref="DarkTextBox" /> control.
/// </summary>
public DarkTextBox()
{
InitializeComponent();
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="DarkToolStripRenderer.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -15,7 +15,7 @@ namespace MeshExplorer.Controls
using System.Drawing.Drawing2D;
/// <summary>
/// TODO: Update summary.
/// Toolstrip render for dark menu.
/// </summary>
public class DarkToolStripRenderer : ToolStripRenderer
{
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="MeshRenderer.cs" company="">
// TODO: Update copyright text.
// <copyright file="RendererControl.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -42,7 +42,17 @@ namespace MeshExplorer.Controls
Timer timer;
public RenderData Data { get { return data; } }
/// <summary>
/// Gets the currently displayed <see cref="RenderData"/>.
/// </summary>
public RenderData Data
{
get { return data; }
}
/// <summary>
/// Indicates whether to show the voronoi diagram or not.
/// </summary>
public bool ShowVoronoi
{
get { return showVoronoi; }
@@ -59,6 +69,9 @@ namespace MeshExplorer.Controls
}
}
/// <summary>
/// Initializes a new instance of the <see cref="RendererControl" /> class.
/// </summary>
public RendererControl()
{
SetStyle(ControlStyles.ResizeRedraw, true);
@@ -81,6 +94,9 @@ namespace MeshExplorer.Controls
};
}
/// <summary>
/// Initialize the graphics buffer (should be called in the forms load event).
/// </summary>
public void Initialize()
{
zoom.Initialize(this.ClientRectangle, this.ClientRectangle);
@@ -91,9 +107,12 @@ namespace MeshExplorer.Controls
this.Invalidate();
}
public void SetData(InputGeometry mesh)
/// <summary>
/// Updates the displayed input data.
/// </summary>
public void SetData(InputGeometry geometry)
{
data.SetData(mesh);
data.SetData(geometry);
meshRenderer = new MeshRenderer(data);
@@ -105,6 +124,10 @@ namespace MeshExplorer.Controls
this.Render();
}
/// <summary>
/// Updates the displayed mesh data.
/// </summary>
/// <param name="initZoom">If true, the zoom will be reset.</param>
public void SetData(Mesh mesh, bool initZoom)
{
data.SetData(mesh);
@@ -128,11 +151,19 @@ namespace MeshExplorer.Controls
this.Render();
}
/// <summary>
/// Updates the displayed input data.
/// </summary>
public void SetData(Mesh mesh)
{
SetData(mesh, false);
}
/// <summary>
/// Zoom to the given location.
/// </summary>
/// <param name="location">The zoom focus.</param>
/// <param name="delta">Indicates whether to zoom in or out.</param>
public void Zoom(PointF location, int delta)
{
if (!initialized) return;
@@ -144,6 +175,9 @@ namespace MeshExplorer.Controls
}
}
/// <summary>
/// Update graphics buffer and zoom after a resize.
/// </summary>
public void HandleResize()
{
zoom.Resize(this.ClientRectangle, data.Bounds);
+2 -5
View File
@@ -26,11 +26,8 @@ namespace MeshExplorer
{
get
{
string s = lbSize.Text;
s = s.Substring(0, s.Length - 3);
int size = 0;
int.TryParse(s, out size);
return size;
int size = (int)darkSlider1.Value;
return 18 * size + 200;
}
}
+146 -146
View File
@@ -29,21 +29,6 @@
private void InitializeComponent()
{
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.menuFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuFileOpen = new System.Windows.Forms.ToolStripMenuItem();
this.menuFileSave = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuFileExport = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuFileQuit = new System.Windows.Forms.ToolStripMenuItem();
this.menuView = new System.Windows.Forms.ToolStripMenuItem();
this.menuViewVoronoi = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuViewLog = new System.Windows.Forms.ToolStripMenuItem();
this.menuTools = new System.Windows.Forms.ToolStripMenuItem();
this.menuToolsGen = new System.Windows.Forms.ToolStripMenuItem();
this.menuToolsCheck = new System.Windows.Forms.ToolStripMenuItem();
this.btnSmooth = new MeshExplorer.Controls.DarkButton();
this.flatTabControl1 = new MeshExplorer.Controls.DarkTabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
@@ -101,17 +86,32 @@
this.label18 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.lbShortcuts = new System.Windows.Forms.Label();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.menuFile = new System.Windows.Forms.ToolStripMenuItem();
this.menuFileOpen = new System.Windows.Forms.ToolStripMenuItem();
this.menuFileSave = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.menuFileExport = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.menuFileQuit = new System.Windows.Forms.ToolStripMenuItem();
this.menuView = new System.Windows.Forms.ToolStripMenuItem();
this.menuViewVoronoi = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.menuViewLog = new System.Windows.Forms.ToolStripMenuItem();
this.menuTools = new System.Windows.Forms.ToolStripMenuItem();
this.menuToolsGen = new System.Windows.Forms.ToolStripMenuItem();
this.menuToolsCheck = new System.Windows.Forms.ToolStripMenuItem();
this.btnMesh = new MeshExplorer.Controls.DarkButton();
this.renderControl1 = new MeshExplorer.Controls.RendererControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.flatTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// splitContainer1
@@ -140,133 +140,6 @@
this.splitContainer1.SplitterWidth = 1;
this.splitContainer1.TabIndex = 0;
//
// menuStrip1
//
this.menuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.menuStrip1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(0);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuFile,
this.menuView,
this.menuTools});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(0);
this.menuStrip1.Size = new System.Drawing.Size(280, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// menuFile
//
this.menuFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.menuFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuFileOpen,
this.menuFileSave,
this.toolStripSeparator3,
this.menuFileExport,
this.toolStripSeparator2,
this.menuFileQuit});
this.menuFile.Name = "menuFile";
this.menuFile.Size = new System.Drawing.Size(37, 24);
this.menuFile.Text = "File";
//
// menuFileOpen
//
this.menuFileOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFileOpen.Name = "menuFileOpen";
this.menuFileOpen.Size = new System.Drawing.Size(141, 22);
this.menuFileOpen.Text = "Open";
this.menuFileOpen.Click += new System.EventHandler(this.menuFileOpen_Click);
//
// menuFileSave
//
this.menuFileSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFileSave.Enabled = false;
this.menuFileSave.Name = "menuFileSave";
this.menuFileSave.Size = new System.Drawing.Size(141, 22);
this.menuFileSave.Text = "Save";
this.menuFileSave.Click += new System.EventHandler(this.menuFileSave_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(138, 6);
//
// menuFileExport
//
this.menuFileExport.Enabled = false;
this.menuFileExport.Name = "menuFileExport";
this.menuFileExport.Size = new System.Drawing.Size(141, 22);
this.menuFileExport.Text = "Export Image";
this.menuFileExport.Click += new System.EventHandler(this.menuFileExport_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);
//
// menuFileQuit
//
this.menuFileQuit.Name = "menuFileQuit";
this.menuFileQuit.Size = new System.Drawing.Size(141, 22);
this.menuFileQuit.Text = "Quit";
this.menuFileQuit.Click += new System.EventHandler(this.menuFileQuit_Click);
//
// menuView
//
this.menuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuViewVoronoi,
this.toolStripSeparator1,
this.menuViewLog});
this.menuView.Name = "menuView";
this.menuView.Size = new System.Drawing.Size(44, 24);
this.menuView.Text = "View";
//
// menuViewVoronoi
//
this.menuViewVoronoi.Enabled = false;
this.menuViewVoronoi.Name = "menuViewVoronoi";
this.menuViewVoronoi.Size = new System.Drawing.Size(162, 22);
this.menuViewVoronoi.Text = "Voronoi Diagram";
this.menuViewVoronoi.Click += new System.EventHandler(this.menuViewVoronoi_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(159, 6);
//
// menuViewLog
//
this.menuViewLog.Name = "menuViewLog";
this.menuViewLog.Size = new System.Drawing.Size(162, 22);
this.menuViewLog.Text = "Show Log";
this.menuViewLog.Click += new System.EventHandler(this.menuViewLog_Click);
//
// menuTools
//
this.menuTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuToolsGen,
this.menuToolsCheck});
this.menuTools.Name = "menuTools";
this.menuTools.Size = new System.Drawing.Size(46, 24);
this.menuTools.Text = "Tools";
//
// menuToolsGen
//
this.menuToolsGen.Name = "menuToolsGen";
this.menuToolsGen.Size = new System.Drawing.Size(157, 22);
this.menuToolsGen.Text = "Input Generator";
this.menuToolsGen.Click += new System.EventHandler(this.menuToolsGenerator_Click);
//
// menuToolsCheck
//
this.menuToolsCheck.Enabled = false;
this.menuToolsCheck.Name = "menuToolsCheck";
this.menuToolsCheck.Size = new System.Drawing.Size(157, 22);
this.menuToolsCheck.Text = "Check Mesh";
this.menuToolsCheck.Click += new System.EventHandler(this.menuToolsCheck_Click);
//
// btnSmooth
//
this.btnSmooth.Enabled = false;
@@ -882,7 +755,7 @@
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(134, 40);
this.label19.TabIndex = 0;
this.label19.Text = "Beta 2 (2012-06-11)\r\nChristian Woltering\r\nMIT";
this.label19.Text = "Beta 2 (2012-06-20)\r\nChristian Woltering\r\nMIT";
//
// label18
//
@@ -914,6 +787,133 @@
this.lbShortcuts.Text = "F3\r\nF4\r\nF5\r\n\r\nF8\r\nF9\r\n\r\nF12";
this.lbShortcuts.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// menuStrip1
//
this.menuStrip1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.menuStrip1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.menuStrip1.GripMargin = new System.Windows.Forms.Padding(0);
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuFile,
this.menuView,
this.menuTools});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(0);
this.menuStrip1.Size = new System.Drawing.Size(280, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// menuFile
//
this.menuFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.menuFile.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuFileOpen,
this.menuFileSave,
this.toolStripSeparator3,
this.menuFileExport,
this.toolStripSeparator2,
this.menuFileQuit});
this.menuFile.Name = "menuFile";
this.menuFile.Size = new System.Drawing.Size(37, 24);
this.menuFile.Text = "File";
//
// menuFileOpen
//
this.menuFileOpen.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFileOpen.Name = "menuFileOpen";
this.menuFileOpen.Size = new System.Drawing.Size(141, 22);
this.menuFileOpen.Text = "Open";
this.menuFileOpen.Click += new System.EventHandler(this.menuFileOpen_Click);
//
// menuFileSave
//
this.menuFileSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuFileSave.Enabled = false;
this.menuFileSave.Name = "menuFileSave";
this.menuFileSave.Size = new System.Drawing.Size(141, 22);
this.menuFileSave.Text = "Save";
this.menuFileSave.Click += new System.EventHandler(this.menuFileSave_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(138, 6);
//
// menuFileExport
//
this.menuFileExport.Enabled = false;
this.menuFileExport.Name = "menuFileExport";
this.menuFileExport.Size = new System.Drawing.Size(141, 22);
this.menuFileExport.Text = "Export Image";
this.menuFileExport.Click += new System.EventHandler(this.menuFileExport_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);
//
// menuFileQuit
//
this.menuFileQuit.Name = "menuFileQuit";
this.menuFileQuit.Size = new System.Drawing.Size(141, 22);
this.menuFileQuit.Text = "Quit";
this.menuFileQuit.Click += new System.EventHandler(this.menuFileQuit_Click);
//
// menuView
//
this.menuView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuViewVoronoi,
this.toolStripSeparator1,
this.menuViewLog});
this.menuView.Name = "menuView";
this.menuView.Size = new System.Drawing.Size(44, 24);
this.menuView.Text = "View";
//
// menuViewVoronoi
//
this.menuViewVoronoi.Enabled = false;
this.menuViewVoronoi.Name = "menuViewVoronoi";
this.menuViewVoronoi.Size = new System.Drawing.Size(162, 22);
this.menuViewVoronoi.Text = "Voronoi Diagram";
this.menuViewVoronoi.Click += new System.EventHandler(this.menuViewVoronoi_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(159, 6);
//
// menuViewLog
//
this.menuViewLog.Name = "menuViewLog";
this.menuViewLog.Size = new System.Drawing.Size(162, 22);
this.menuViewLog.Text = "Show Log";
this.menuViewLog.Click += new System.EventHandler(this.menuViewLog_Click);
//
// menuTools
//
this.menuTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuToolsGen,
this.menuToolsCheck});
this.menuTools.Name = "menuTools";
this.menuTools.Size = new System.Drawing.Size(46, 24);
this.menuTools.Text = "Tools";
//
// menuToolsGen
//
this.menuToolsGen.Name = "menuToolsGen";
this.menuToolsGen.Size = new System.Drawing.Size(157, 22);
this.menuToolsGen.Text = "Input Generator";
this.menuToolsGen.Click += new System.EventHandler(this.menuToolsGenerator_Click);
//
// menuToolsCheck
//
this.menuToolsCheck.Enabled = false;
this.menuToolsCheck.Name = "menuToolsCheck";
this.menuToolsCheck.Size = new System.Drawing.Size(157, 22);
this.menuToolsCheck.Text = "Check Mesh";
this.menuToolsCheck.Click += new System.EventHandler(this.menuToolsCheck_Click);
//
// btnMesh
//
this.btnMesh.Enabled = false;
@@ -960,8 +960,6 @@
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.flatTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
@@ -969,6 +967,8 @@
this.tabPage2.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
}
+18 -1
View File
@@ -73,6 +73,7 @@ namespace MeshExplorer
if (input != null)
{
settings.CurrentFile = "GEN";
HandleNewInput();
}
}
@@ -176,6 +177,22 @@ namespace MeshExplorer
lbNumSeg.Text = input.Segments.Count().ToString();
lbNumTri.Text = "0"; //input.Triangles == null ? "0" : input.Triangles.Length.ToString();
// Statistics labels
lbAreaMin.Text = "-";
lbAreaMax.Text = "-";
lbEdgeMin.Text = "-";
lbEdgeMax.Text = "-";
lbAngleMin.Text = "-";
lbAngleMax.Text = "-";
// Quality labels
lbQualAlphaMin.Text = "-";
lbQualAlphaAve.Text = "-";
lbQualAspectMin.Text = "-";
lbQualAspectAve.Text = "-";
angleHistogram1.SetData(null, null);
// Reset buttons
btnMesh.Enabled = true;
btnMesh.Text = "Triangulate";
@@ -402,7 +419,7 @@ namespace MeshExplorer
if (cbQuality.Checked)
{
btnMesh.Text = "Refine";
btnSmooth.Enabled = true;
//btnSmooth.Enabled = true;
}
}
else if (cbQuality.Checked)
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="IGenerator.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="RandomPoints.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="RandomPoints.cs" company="">
// TODO: Update copyright text.
// <copyright file="RandomPointsCircle.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,7 +13,7 @@ namespace MeshExplorer.Generators
using TriangleNet.Geometry;
/// <summary>
/// Simple random points generator.
/// Simple random points generator (points distributed in a circle).
/// </summary>
public class RandomPointsCircle : IGenerator
{
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="StarInBox.cs" company="">
// TODO: Update copyright text.
// <copyright file="RingPolygon.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,7 +13,7 @@ namespace MeshExplorer.Generators
using TriangleNet.Geometry;
/// <summary>
/// TODO: Update summary.
/// Generates a ring polygon.
/// </summary>
public class RingPolygon : IGenerator
{
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="StarInBox.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,7 +13,7 @@ namespace MeshExplorer.Generators
using TriangleNet.Geometry;
/// <summary>
/// TODO: Update summary.
/// Generates a star contained in a box.
/// </summary>
public class StarInBox : IGenerator
{
+21 -8
View File
@@ -1,5 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="EpsImage.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// Original Matlab code by John Burkardt, Florida State University
// </copyright>
// -----------------------------------------------------------------------
@@ -14,6 +15,7 @@ namespace MeshExplorer.IO
using System.IO;
using TriangleNet;
using TriangleNet.Geometry;
using TriangleNet.Data;
/// <summary>
/// Writes a mesh to an EPS file.
@@ -35,6 +37,12 @@ namespace MeshExplorer.IO
double y_max, y_min;
double x_scale, y_scale;
/// <summary>
/// Export the mesh to EPS format.
/// </summary>
/// <param name="mesh">The current mesh.</param>
/// <param name="filename">The EPS filename.</param>
/// <param name="width">The desired width of the image (currently ignored).</param>
public void Export(Mesh mesh, string filename, int width)
{
// Check file name
@@ -150,6 +158,7 @@ namespace MeshExplorer.IO
StringBuilder labels = new StringBuilder();
Vertex v1, v2, v3;
double x1, y1, x2, y2, x3, y3, xa, ya;
int x_ps, y_ps;
@@ -157,22 +166,26 @@ namespace MeshExplorer.IO
{
eps.WriteLine("newpath");
x1 = tri[0].X; y1 = tri[0].Y;
x2 = tri[1].X; y2 = tri[1].Y;
x3 = tri[2].X; y3 = tri[2].Y;
v1 = tri.GetVertex(0);
v2 = tri.GetVertex(1);
v3 = tri.GetVertex(2);
x1 = v1.X; y1 = v1.Y;
x2 = v2.X; y2 = v2.Y;
x3 = v3.X; y3 = v3.Y;
x_ps = (int)Math.Floor(((x_max - x1) * x_ps_min + (x1 - x_min) * x_ps_max) / (x_max - x_min));
y_ps = (int)Math.Floor(((y_max - y1) * y_ps_min + (y1 - y_min) * y_ps_max) / (y_max - y_min));
eps.WriteLine(" {0} {1} moveto", x_ps, y_ps);
x_ps = (int)Math.Floor(((x_max - x2) * x_ps_min + (x2 - x_min) * x_ps_max) / (x_max - x_min));
y_ps = (int)Math.Floor(((y_max - y2) * y_ps_min + (y2 - y_min) * y_ps_max) / (y_max - y_min));
eps.WriteLine(" {0} {1} lineto", x_ps, y_ps);
x_ps = (int)Math.Floor(((x_max - x3) * x_ps_min + (x3 - x_min) * x_ps_max) / (x_max - x_min));
y_ps = (int)Math.Floor(((y_max - y3) * y_ps_min + (y3 - y_min) * y_ps_max) / (y_max - y_min));
eps.WriteLine(" {0} {1} lineto", x_ps, y_ps);
x_ps = (int)Math.Floor(((x_max - x1) * x_ps_min + (x1 - x_min) * x_ps_max) / (x_max - x_min));
y_ps = (int)Math.Floor(((y_max - y1) * y_ps_min + (y1 - y_min) * y_ps_max) / (y_max - y_min));
eps.WriteLine(" {0} {1} lineto", x_ps, y_ps);
@@ -230,8 +243,8 @@ namespace MeshExplorer.IO
{
eps.WriteLine("newpath");
x1 = seg[0].X; y1 = seg[0].Y;
x2 = seg[1].X; y2 = seg[1].Y;
x1 = seg.GetVertex(0).X; y1 = seg.GetVertex(0).Y;
x2 = seg.GetVertex(1).X; y2 = seg.GetVertex(1).Y;
x_ps = (int)Math.Floor(((x_max - x1) * x_ps_min + (x1 - x_min) * x_ps_max) / (x_max - x_min));
y_ps = (int)Math.Floor(((y_max - y1) * y_ps_min + (y1 - y_min) * y_ps_max) / (y_max - y_min));
+17 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="FileProcessor.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -21,6 +21,11 @@ namespace MeshExplorer.IO
{
static Dictionary<string, IMeshFile> container = new Dictionary<string, IMeshFile>();
/// <summary>
/// Returns true, if the given file contains mesh information.
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static bool ContainsMeshData(string path)
{
IMeshFile provider = GetProviderInstance(path);
@@ -28,6 +33,9 @@ namespace MeshExplorer.IO
return provider.ContainsMeshData(path);
}
/// <summary>
/// Read an input geometry from given file.
/// </summary>
public static InputGeometry Read(string path)
{
IMeshFile provider = GetProviderInstance(path);
@@ -35,6 +43,11 @@ namespace MeshExplorer.IO
return provider.Read(path);
}
/// <summary>
/// Read a mesh from given file.
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static Mesh Import(string path)
{
IMeshFile provider = GetProviderInstance(path);
@@ -42,6 +55,9 @@ namespace MeshExplorer.IO
return provider.Import(path);
}
/// <summary>
/// Save the current mesh to given file.
/// </summary>
public static void Save(string path, Mesh mesh)
{
IMeshFile provider = GetProviderInstance(path);
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="DatFile.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -17,7 +17,7 @@ namespace MeshExplorer.IO.Formats
using TriangleNet;
/// <summary>
/// TODO: Update summary.
/// Read a polygon from DAT file (used by poly2tri).
/// </summary>
public class DatFile : IMeshFile
{
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="UcdFile.cs" company="">
// TODO: Update copyright text.
// <copyright file="JsonFile.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="TriangleFile.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -16,7 +16,7 @@ namespace MeshExplorer.IO.Formats
using TriangleNet;
/// <summary>
/// TODO: Update summary.
/// Read and write files defined in classic Triangle format.
/// </summary>
public class TriangleFile : IMeshFile
{
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="IMeshFormat.cs" company="">
// TODO: Update copyright text.
// <copyright file="IMeshFile.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+6 -6
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ImageWriter.cs" company="">
// TODO: Update copyright text.
// <copyright file="RasterImage.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -31,11 +31,11 @@ namespace MeshExplorer.IO
}
/// <summary>
/// Draws the mesh and writes the image file.
/// Export the mesh to PNG format.
/// </summary>
/// <param name="mesh">The mesh to visualize.</param>
/// <param name="filename">The filename (only PNG supported).</param>
/// <param name="width">The target width of the image (pixel).</param>
/// <param name="mesh">The current mesh.</param>
/// <param name="filename">The PNG filename.</param>
/// <param name="width">The desired width (pixel) of the image.</param>
public void Export(Mesh mesh, string filename, int width)
{
// Get mesh data -- TODO: Use RenderControl's RenderData
+28 -18
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="SvgImage.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,6 +13,8 @@ namespace MeshExplorer.IO
using MeshExplorer.Rendering;
using System.IO;
using TriangleNet;
using TriangleNet.Data;
using TriangleNet.Geometry;
/// <summary>
/// Writes a mesh to an SVG file.
@@ -21,9 +23,12 @@ namespace MeshExplorer.IO
{
float scale = 1f;
int x_offset = 0;
int y_offset = 0;
/// <summary>
/// Export the mesh to SVG format.
/// </summary>
/// <param name="mesh">The current mesh.</param>
/// <param name="filename">The SVG filename.</param>
/// <param name="width">The desired width of the image.</param>
public void Export(Mesh mesh, string filename, int width)
{
// Check file name
@@ -45,11 +50,11 @@ namespace MeshExplorer.IO
var bounds = mesh.Bounds;
float margin = 0.05f * (float)bounds.Width;
scale = width / ((float)bounds.Width + 2 * margin);
x_offset = -(int)((bounds.Xmin - margin) * scale);
y_offset = (int)((bounds.Ymax + margin) * scale);
int x_offset = -(int)((bounds.Xmin - margin) * scale);
int y_offset = (int)((bounds.Ymax + margin) * scale);
int height = (int)((bounds.Height + 2 * margin) * scale);
@@ -79,16 +84,21 @@ namespace MeshExplorer.IO
StringBuilder labels = new StringBuilder();
Vertex v1, v2, v3;
double x1, y1, x2, y2, x3, y3, xa, ya;
foreach (var tri in mesh.Triangles)
{
x1 = scale * tri[0].X;
y1 = scale * tri[0].Y;
x2 = scale * tri[1].X;
y2 = scale * tri[1].Y;
x3 = scale * tri[2].X;
y3 = scale * tri[2].Y;
v1 = tri.GetVertex(0);
v2 = tri.GetVertex(1);
v3 = tri.GetVertex(2);
x1 = scale * v1.X;
y1 = scale * v1.Y;
x2 = scale * v2.X;
y2 = scale * v2.Y;
x3 = scale * v3.X;
y3 = scale * v3.Y;
svg.Write("M {0},{1} L {2},{3} {4},{5} Z ",
x1.ToString("0.0", Util.Nfi), y1.ToString("0.0", Util.Nfi),
@@ -128,10 +138,10 @@ namespace MeshExplorer.IO
foreach (var seg in mesh.Segments)
{
x1 = scale * seg[0].X;
y1 = scale * seg[0].Y;
x2 = scale * seg[1].X;
y2 = scale * seg[1].Y;
x1 = scale * seg.GetVertex(0).X;
y1 = scale * seg.GetVertex(0).Y;
x2 = scale * seg.GetVertex(1).X;
y2 = scale * seg.GetVertex(1).Y;
svg.Write("M {0},{1} L {2},{3} ",
x1.ToString("0.0", Util.Nfi), y1.ToString("0.0", Util.Nfi),
@@ -159,7 +169,7 @@ namespace MeshExplorer.IO
{
circle_size = 2;
}
svg.WriteLine(" <g style=\"fill: #006400\">");
double x, y;
+69 -63
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="MeshRenderer.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -22,11 +22,79 @@ namespace MeshExplorer.Rendering
RenderData data;
RenderColors renderColors;
/// <summary>
/// Initializes a new instance of the <see cref="MeshRenderer" /> class.
/// </summary>
public MeshRenderer(RenderData data)
{
this.data = data;
}
/// <summary>
/// Renders the mesh.
/// </summary>
public void Render(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Edges != null)
{
this.RenderEdges(g);
}
else if (data.Triangles != null)
{
this.RenderTriangles(g);
}
if (data.Segments != null)
{
this.RenderSegments(g);
}
if (data.Points != null)
{
this.RenderPoints(g);
}
}
/// <summary>
/// Renders only the mesh edges (no points or segments).
/// </summary>
public void RenderMesh(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Edges != null)
{
this.RenderEdges(g);
}
else if (data.Triangles != null)
{
this.RenderTriangles(g);
}
}
/// <summary>
/// Renders only points and segments (no mesh triangles).
/// </summary>
public void RenderGeometry(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Segments != null)
{
this.RenderSegments(g);
}
if (data.Points != null)
{
this.RenderPoints(g);
}
}
private void RenderPoints(Graphics g)
{
PointF pt;
@@ -121,67 +189,5 @@ namespace MeshExplorer.Rendering
}
}
}
public void Render(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Edges != null)
{
this.RenderEdges(g);
}
else if (data.Triangles != null)
{
this.RenderTriangles(g);
}
if (data.Segments != null)
{
this.RenderSegments(g);
}
if (data.Points != null)
{
this.RenderPoints(g);
}
}
/// <summary>
/// Renders only the mesh edges (no points or segments).
/// </summary>
public void RenderMesh(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Edges != null)
{
this.RenderEdges(g);
}
else if (data.Triangles != null)
{
this.RenderTriangles(g);
}
}
/// <summary>
/// Renders only points and segments (no mesh triangles).
/// </summary>
public void RenderGeometry(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
this.zoom = zoom;
if (data.Segments != null)
{
this.RenderSegments(g);
}
if (data.Points != null)
{
this.RenderPoints(g);
}
}
}
}
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="RenderColors.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+9 -5
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="MeshDataInternal.cs" company="">
// TODO: Update copyright text.
// <copyright file="RenderData.cs" company="">
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -16,6 +16,9 @@ namespace MeshExplorer.Rendering
using TriangleNet.Data;
using TriangleNet.Geometry;
/// <summary>
/// Stores the current mesh in GDI friendly data structure.
/// </summary>
public class RenderData
{
public PointF[] Points;
@@ -27,6 +30,9 @@ namespace MeshExplorer.Rendering
public int NumberOfInputPoints;
public RectangleF Bounds;
/// <summary>
/// Update input geometry data.
/// </summary>
public void SetData(InputGeometry data)
{
int n = data.Count;
@@ -55,10 +61,8 @@ namespace MeshExplorer.Rendering
}
/// <summary>
///
/// Update mesh data.
/// </summary>
/// <param name="mesh"></param>
/// <remarks>This methods assumes that the mesh.Renumber() has been called.</remarks>
public void SetData(Mesh mesh)
{
mesh.Renumber();
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="VoronoiRenderer.cs" company="">
// Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -24,6 +24,9 @@ namespace MeshExplorer.Rendering
BoundedVoronoi boundedVoro;
RenderColors renderColors;
/// <summary>
/// Initializes a new instance of the <see cref="VoronoiRenderer" /> class.
/// </summary>
public VoronoiRenderer(Mesh mesh)
{
this.mesh = mesh;
@@ -39,6 +42,9 @@ namespace MeshExplorer.Rendering
}
}
/// <summary>
/// Regenerates the voronoi diagram.
/// </summary>
public void Update()
{
if (simpleVoro != null)
@@ -52,12 +58,18 @@ namespace MeshExplorer.Rendering
}
}
/// <summary>
/// Resets the voronoi display.
/// </summary>
public void Reset()
{
simpleVoro = null;
boundedVoro = null;
}
/// <summary>
/// Renders the voronoi diagram.
/// </summary>
public void Render(Graphics g, Zoom zoom, RenderColors renderColors)
{
this.renderColors = renderColors;
+31 -43
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Zoom.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -13,30 +13,45 @@ namespace MeshExplorer.Rendering
using System.Drawing;
/// <summary>
/// Manages the current world to screen transformation
/// Manages the current world to screen transformation.
/// </summary>
public class Zoom
{
// The complete mesh
/// <summary>
/// Gets the screen dimensions (render control).
/// </summary>
Rectangle Screen { get; set; }
// The complete mesh
/// <summary>
/// Gets the world dimensions (mesh).
/// </summary>
RectangleF World { get; set; }
// The current viewport (visible mesh)
public RectangleF Viewport { get; set; }
/// <summary>
/// Gets the current viewport (visible mesh).
/// </summary>
public RectangleF Viewport { get; private set; }
// Current scale (zoom level)
public int Level { get; set; }
/// <summary>
/// Gets the current scale (zoom level)
/// </summary>
public int Level { get; private set; }
// Add a margin to clip region (5% of viewport width on each side)
public float ClipMargin { get; set; }
public float ClipMargin { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="Zoom" /> class.
/// </summary>
public Zoom()
{
Level = -1;
}
/// <summary>
/// Initialize the zoom.
/// </summary>
/// <param name="screen">The screen dimensions.</param>
/// <param name="world">The world dimensions.</param>
public void Initialize(Rectangle screen, RectangleF world)
{
this.Screen = screen;
@@ -74,45 +89,15 @@ namespace MeshExplorer.Rendering
public void Resize(Rectangle screen, RectangleF world)
{
this.Screen = screen;
this.World = world;
this.Level = 1;
// Add a margin so there's some space around the border
float worldMargin = (World.Width < World.Height) ? World.Height * 0.05f : World.Width * 0.05f;
// Get the initial viewport (complete mesh centered on the screen)
float screenRatio = screen.Width / (float)screen.Height;
float worldRatio = World.Width / World.Height;
float scale = (World.Width + worldMargin) / screen.Width;
if (screenRatio > worldRatio)
{
scale = (World.Height + worldMargin) / screen.Height;
}
float centerX = World.X + World.Width / 2;
float centerY = World.Y + World.Height / 2;
// TODO: Add initial margin
this.Viewport = new RectangleF(centerX - screen.Width * scale / 2,
centerY - screen.Height * scale / 2,
screen.Width * scale,
screen.Height * scale);
this.ClipMargin = this.Viewport.Width * 0.05f;
this.World = this.Viewport;
this.Initialize(screen, world);
}
/// <summary>
/// Zoom in or out of the viewport.
/// </summary>
/// <param name="amount">Zoom amount</param>
/// <param name="focusX">Relative x point position</param>
/// <param name="focusY">Relative y point position</param>
/// <param name="focusX">Relative x point position (between 0 and 1)</param>
/// <param name="focusY">Relative y point position (between 0 and 1)</param>
public bool Update(int amount, float focusX, float focusY)
{
float width, height;
@@ -180,6 +165,9 @@ namespace MeshExplorer.Rendering
return true;
}
/// <summary>
/// Check current point (world coordinates) lies inside the viewport.
/// </summary>
public bool ViewportContains(PointF pt)
{
return (pt.X > Viewport.X && pt.X < Viewport.Right
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Settings.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -14,7 +14,7 @@ namespace MeshExplorer
using System.Windows.Forms;
/// <summary>
/// TODO: Update summary.
/// Stores some of the data used in the main application.
/// </summary>
public class Settings
{
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Util.cs" company="">
// TODO: Update copyright text.
// Christian Woltering, Triangle.NET, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="DivConquer.cs">
// <copyright file="Dwyer.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ITriangulator.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Incremental.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="SweepLine.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="BadTriQueue.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Behavior.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Carver.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="BadSubseg.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="BadTriangle.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Osub.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/index.html
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Otri.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/index.html
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+5 -4
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Subseg.cs" company="">
// <copyright file="Segment.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -11,6 +11,7 @@ namespace TriangleNet.Data
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TriangleNet.Geometry;
/// <summary>
/// The subsegment data structure.
@@ -71,9 +72,9 @@ namespace TriangleNet.Data
/// <summary>
/// Gets the segments endpoint.
/// </summary>
public Vertex this[int index]
public Vertex GetVertex(int index)
{
get { return this.vertices[index]; } // TODO: Check range?
return this.vertices[index]; // TODO: Check range?
}
/// <summary>
+14 -4
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Triangle.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -98,11 +98,11 @@ namespace TriangleNet.Data
}
/// <summary>
/// Gets the specified corners vertex id.
/// Gets the specified corners vertex.
/// </summary>
public Vertex this[int index]
public Vertex GetVertex(int index)
{
get { return this.vertices[index]; } // TODO: Check range?
return this.vertices[index]; // TODO: Check range?
}
/// <summary>
@@ -142,6 +142,16 @@ namespace TriangleNet.Data
get { return this.neighbors[2].triangle.id; }
}
/// <summary>
/// Gets a triangles' neighbor.
/// </summary>
/// <param name="index">The neighbor index (0, 1 or 2).</param>
/// <returns>The triangles' neigbbor.</returns>
public ITriangle GetNeighbor(int index)
{
return neighbors[index].triangle == Mesh.dummytri ? null : neighbors[index].triangle;
}
/// <summary>
/// Gets the triangle area constraint.
/// </summary>
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Vertex.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Enums.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Bbox_2.cs" company="">
// TODO: Update copyright text.
// <copyright file="BoundingBox.cs" company="">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Edge.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="EdgeEnumerator.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+13 -3
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ITriangle.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -34,10 +34,13 @@ namespace TriangleNet.Geometry
/// Third vertex id of the triangle.
/// </summary>
int P2 { get; }
/// <summary>
/// Gets the vertex at specified index.
/// Gets a triangles vertex.
/// </summary>
Vertex this[int index] { get; }
/// <param name="index">The vertex index (0, 1 or 2).</param>
/// <returns>The vertex of the specified corner index.</returns>
Vertex GetVertex(int index);
/// <summary>
/// True if the triangle implementation contains neighbor information.
@@ -57,6 +60,13 @@ namespace TriangleNet.Geometry
/// </summary>
int N2 { get; }
/// <summary>
/// Gets a triangles neighbor.
/// </summary>
/// <param name="index">The neighbor index (0, 1 or 2).</param>
/// <returns>The triangles' neigbbor.</returns>
ITriangle GetNeighbor(int index);
/// <summary>
/// Triangle area constraint.
/// </summary>
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="InputGeometry.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Point2.cs" company="">
// <copyright file="Point.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="RegionPointer.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="io.cs" company="">
// <copyright file="DataReader.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="DebugWriter.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="io.cs" company="">
// <copyright file="FileReader.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="io.cs" company="">
// <copyright file="FileWriter.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="IMeshFormat.cs" company="">
// TODO: Update copyright text.
// <copyright file="IGeometryFormat.cs" company="">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="IMeshFormat.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+9 -4
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Triangle.cs" company="">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -60,11 +60,11 @@ namespace TriangleNet.IO
}
/// <summary>
/// Gets the specified corners vertex id.
/// Gets the specified corners vertex.
/// </summary>
public Vertex this[int index]
public Vertex GetVertex(int index)
{
get { return null; } // TODO: throw NotSupportedException?
return null; // TODO: throw NotSupportedException?
}
public bool SupportsNeighbors
@@ -87,6 +87,11 @@ namespace TriangleNet.IO
get { return -1; }
}
public ITriangle GetNeighbor(int index)
{
return null;
}
/// <summary>
/// Gets the triangle area constraint.
/// </summary>
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="TriangleFormat.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ILogger.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// <copyright file="ILog.cs" company="">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ILogger.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// <copyright file="ILogItem.cs" company="">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="SimpleLogger.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// <copyright file="SimpleLog.cs" company="">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="SimpleLogItem.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -12,7 +12,7 @@ namespace TriangleNet.Log
using System.Text;
/// <summary>
/// TODO: Update summary.
/// Represents an item stored in the log.
/// </summary>
public class SimpleLogItem : ILogItem
{
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Mesh.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="NewLocation.cs">
// Original code by Hale Erten and Alper Üngör, http://www.cise.ufl.edu/~ungor/aCute/index.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Primitives.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+2 -2
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Quality.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -204,7 +204,7 @@ namespace TriangleNet
{
if (Primitives.NonRegular(triorg, tridest, triapex, oppoapex) > 0.0)
{
logger.Warning(String.Format("Non-regular pair of triangles found (IDs {0}+{1}).",
logger.Warning(String.Format("Non-regular pair of triangles found (IDs {0}/{1}).",
loop.triangle.id, oppotri.triangle.id), "Quality.CheckDelaunay()");
horrors++;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="Sampler.cs">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+4 -4
View File
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="ISmoother.cs" company="">
// TODO: Update copyright text.
// <copyright file="ISmoother.cs">
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -12,10 +12,10 @@ namespace TriangleNet.Smoothing
using System.Text;
/// <summary>
/// TODO: Update summary.
/// Interface for mesh smoothers.
/// </summary>
public interface ISmoother
{
void Smooth();
}
}
}
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="BoundedVoronoi.cs" company="">
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/index.html
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -1,6 +1,6 @@
// -----------------------------------------------------------------------
// <copyright file="QualityMeasure.cs" company="">
// TODO: Update copyright text.
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
@@ -248,11 +248,11 @@ namespace TriangleNet.Tools
{
for (int j = 0; j < 3; j++)
{
gi = tri[j].id;
gi = tri.GetVertex(j).id;
for (int k = 0; k < 3; k++)
{
gj = tri[k].id;
gj = tri.GetVertex(k).id;
mu = Math.Max(mu, gj - gi);
ml = Math.Max(ml, gi - gj);
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Statistic.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/triangle/
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------
+1 -1
View File
@@ -1,7 +1,7 @@
// -----------------------------------------------------------------------
// <copyright file="Voronoi.cs">
// Original Triangle code by Jonathan Richard Shewchuk, http://www.cs.cmu.edu/~quake/triangle.html
// Triangle.NET code by Christian Woltering, http://home.edo.tu-dortmund.de/~woltering/index.html
// Triangle.NET code by Christian Woltering, http://triangle.codeplex.com/
// </copyright>
// -----------------------------------------------------------------------