本文整理汇总了C#中System.Windows.Media.Media3D.Point3D.Concat方法的典型用法代码示例。如果您正苦于以下问题:C# Point3D.Concat方法的具体用法?C# Point3D.Concat怎么用?C# Point3D.Concat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.Point3D
的用法示例。
在下文中一共展示了Point3D.Concat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnFuzzyLinkTest2New_Click
private void btnFuzzyLinkTest2New_Click(object sender, RoutedEventArgs e)
{
try
{
#region Parse Gui
int numFrom;
if (!int.TryParse(txtFuzzyLinkTest2FromCount.Text, out numFrom))
{
MessageBox.Show("Couldn't parse the from count as an integer", this.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
int numTo;
if (!int.TryParse(txtFuzzyLinkTest2ToCount.Text, out numTo))
{
MessageBox.Show("Couldn't parse the to count as an integer", this.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
int maxIntermediate;
if (!int.TryParse(txtFuzzyLinkTest2MaxIntermediate.Text, out maxIntermediate))
{
MessageBox.Show("Couldn't parse the max intermediate as an integer", this.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
int maxFinal;
if (!int.TryParse(txtFuzzyLinkTest2MaxFinal.Text, out maxFinal))
{
MessageBox.Show("Couldn't parse the max final as an integer", this.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
#endregion
btnClear_Click(this, new RoutedEventArgs());
#region Create Neurons
Point3D fromPoint = new Point3D(-1.1, 0, 0);
Point3D toPoint = new Point3D(1.1, 0, 0);
List<INeuron> inNeurons = new List<INeuron>();
// From
inNeurons.Add(new Neuron_ZeroPos(fromPoint)); // old from
Point3D[] fromPositions = new Point3D[numFrom];
for (int cntr = 0; cntr < numFrom; cntr++)
{
fromPositions[cntr] = fromPoint + Math3D.GetRandomVector_Spherical(1d);
inNeurons.Add(new Neuron_NegPos(fromPositions[cntr]));
}
// To
inNeurons.Add(new Neuron_ZeroPos(toPoint)); // old to
Point3D[] toPositions = new Point3D[numTo];
for (int cntr = 0; cntr < numTo; cntr++)
{
toPositions[cntr] = toPoint + Math3D.GetRandomVector_Spherical(1d);
inNeurons.Add(new Neuron_NegPos(toPositions[cntr]));
}
Point3D[] allNew = fromPositions.
Concat(toPositions).
ToArray();
// Draw neurons
List<Tuple<INeuron, SolidColorBrush>> outNeurons;
ModelVisual3D model;
BuildNeuronVisuals(out outNeurons, out model, inNeurons, new NeruonContainerShell(new Point3D(0, 0, 0), Quaternion.Identity, null), _colors);
_debugVisuals.Add(model);
_viewportNeural.Children.Add(model);
#endregion
var existingLinks = new[]
{
Tuple.Create(fromPoint, toPoint, 1d),
};
var newLinks = ItemLinker.FuzzyLink(existingLinks, allNew, maxFinal, maxIntermediate);
#region Draw Links
// Draw links
Model3DGroup posLines = null, negLines = null;
DiffuseMaterial posDiffuse = null, negDiffuse = null;
// Draw initial results
BuildLinkVisual(ref posLines, ref posDiffuse, ref negLines, ref negDiffuse, fromPoint, toPoint, -1d, null, _colors);
// Draw final results
foreach (var result in newLinks)
{
BuildLinkVisual(ref posLines, ref posDiffuse, ref negLines, ref negDiffuse, allNew[result.Item1], allNew[result.Item2], result.Item3 * 4d, null, _colors);
}
//.........这里部分代码省略.........