Skip to content

Commit f15458b

Browse files
committed
Variance 6.0
This has been privately available for a while now so it's time to make a public release of the source code. Be careful to pick up the right branch of DesignLibs_GPL to build this.
1 parent f8484e3 commit f15458b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1207
-910
lines changed

Common/Variance/DOE/DOEResults.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Linq;
43

Common/Variance/UI/UIHandlers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ private void aboutMe(object sender, EventArgs e)
1111
if (aboutBox is not {Visible: true})
1212
{
1313
string creditText = "Version " + commonVars.version + ", " +
14-
"© " + commonVars.author + " 2014-2022" + "\r\n\r\n";
14+
"© " + commonVars.author + " 2014-2023" + "\r\n\r\n";
1515
creditText += varianceContext.vc.licenceName;
1616
creditText += "\r\n\r\n";
1717
creditText += "Libraries used:\r\n";
@@ -323,9 +323,9 @@ private void setGlobalUIValues()
323323
num_viewportY.Value = vals[1];
324324
}
325325
}
326-
catch (Exception)
326+
catch
327327
{
328-
328+
// ignored
329329
}
330330
globalUIFrozen = false;
331331
});

Common/Variance/UI/UIHandlers_doe.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Eto.Drawing;
44
using Eto.Forms;
55
using System.Threading.Tasks;
6+
using VeldridEto;
67

78
namespace Variance;
89

@@ -61,7 +62,7 @@ private void doeSettingsChanged()
6162
for (int poly = 0; poly < commonVars.getLayerSettings(i).getFileData().Count; poly++)
6263
{
6364
mcVPSettings[CentralProperties.maxLayersForMC - 1 + (int)CommonVars.twoDTabNames.DOE].addBGPolygon(
64-
poly: UIHelper.myPointFArrayToPointFArray(commonVars.getLayerSettings(i).getFileData()[poly]),
65+
poly: OVPSettings.convertToClosedPointF(commonVars.getLayerSettings(i).getFileData()[poly]),
6566
polyColor: Color.FromArgb(commonVars.getColors().simPreviewColors[i].toArgb()),
6667
alpha: (float)commonVars.getOpacity(CommonVars.opacity_gl.bg),
6768
layerIndex: i

Common/Variance/UI/UIHandlers_geoCore.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
using System.Diagnostics;
44
using System.Threading;
55
using System.Threading.Tasks;
6+
using Clipper2Lib;
67
using Eto.Forms;
78
using gds;
89
using geoCoreLib;
9-
using geoLib;
1010
using geoWrangler;
1111
using oasis;
1212

@@ -154,7 +154,7 @@ private void toGeoCore(int type, string file)
154154

155155
foreach (PreviewShape t in previewShapes)
156156
{
157-
List<GeoLibPointF[]> polys = t.getPoints();
157+
PathsD polys = t.getPoints();
158158
for (int poly = 0; poly < polys.Count; poly++)
159159
{
160160
// No drawn polygons desired.
@@ -163,7 +163,7 @@ private void toGeoCore(int type, string file)
163163
continue;
164164
}
165165

166-
GeoLibPoint[] ePoly = GeoWrangler.resize_to_int(polys[poly], scale);
166+
Path64 ePoly = GeoWrangler.resize_to_int(polys[poly], scale);
167167

168168
gcell_root.addPolygon(ePoly, layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly.
169169
}

Common/Variance/UI/UIHandlers_simulation.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ private async void entropySettingsChanged(object sender)
603603
{
604604
if (comboBox_calcModes.SelectedIndex < 0)
605605
{
606-
comboBox_calcModes.SelectedIndex = (int)geoAnalysis.supported.calcModes.area;
606+
comboBox_calcModes.SelectedIndex = (int)geoAnalysis.Supported.calcModes.area;
607607
}
608608
}
609609
catch (Exception)
@@ -612,7 +612,7 @@ private async void entropySettingsChanged(object sender)
612612
}
613613
if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) < 0)
614614
{
615-
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.area);
615+
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.Supported.calcModes.area);
616616
}
617617

618618
if (commonVars.getReplayMode() == 0)
@@ -693,7 +693,7 @@ private async void entropySettingsChanged(object sender)
693693
}
694694

695695
// Retrieve our settings.
696-
checkBox_perPoly.Enabled = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.area;
696+
checkBox_perPoly.Enabled = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.Supported.calcModes.area;
697697

698698
checkBox_withinMode.Enabled = false;
699699
checkBox_useShortestEdge.Enabled = false;
@@ -711,7 +711,7 @@ private async void entropySettingsChanged(object sender)
711711
commonVars.getSimulationSettings().debugCalc = false;
712712
}
713713

714-
if (comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap)
714+
if (comboBox_calcModes.SelectedIndex == (int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap)
715715
{
716716
if ((bool)checkBox_withinMode.Checked)
717717
{
@@ -742,7 +742,7 @@ private async void entropySettingsChanged(object sender)
742742

743743
switch (comboBox_calcModes.SelectedIndex)
744744
{
745-
case (int)geoAnalysis.supported.calcModes.chord:
745+
case (int)geoAnalysis.Supported.calcModes.chord:
746746
{
747747
checkBox_aChord.Enabled = true;
748748
checkBox_bChord.Enabled = true;
@@ -763,9 +763,9 @@ private async void entropySettingsChanged(object sender)
763763

764764
break;
765765
}
766-
case (int)geoAnalysis.supported.calcModes.area:
766+
case (int)geoAnalysis.Supported.calcModes.area:
767767
{
768-
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.area);
768+
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.Supported.calcModes.area);
769769
if ((bool)checkBox_perPoly.Checked)
770770
{
771771
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.AreaHandler.areaCalcModes.perpoly);
@@ -779,27 +779,27 @@ private async void entropySettingsChanged(object sender)
779779
label_AB.Text = "AND";
780780
break;
781781
}
782-
case (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap:
782+
case (int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap:
783783
{
784784
comboBox_calcModes.SelectedIndexChanged -= entropySettingsChanged;
785785
checkBox_withinMode.Enabled = true;
786-
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap);
786+
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap);
787787
string t;
788788
if ((bool)checkBox_withinMode.Checked)
789789
{
790790
checkBox_useShortestEdge.Enabled = false;
791-
commonVars.calcMode_names[(int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap] = "Compute Enclosure Distribution";
791+
commonVars.calcMode_names[(int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap] = "Compute Enclosure Distribution";
792792
label_AB.Text = "Min Enclosure To";
793793
t = "enclosure";
794794
}
795795
else
796796
{
797797
checkBox_useShortestEdge.Enabled = true;
798-
commonVars.calcMode_names[(int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap] = "Compute Spacing Distribution";
798+
commonVars.calcMode_names[(int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap] = "Compute Spacing Distribution";
799799
label_AB.Text = "Min Space To";
800800
t = "spacing";
801801
}
802-
comboBox_calcModes.SelectedIndex = (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap;
802+
comboBox_calcModes.SelectedIndex = (int)geoAnalysis.Supported.calcModes.enclosure_spacing_overlap;
803803
comboBox_calcModes.SelectedIndexChanged += entropySettingsChanged;
804804
textBox_userGuidance.Text = "The system will report the minimum " + t + " value between the shapes, as a single value per case.\r\nNote that overlap cases will report a negative value to indicate that they are opposite to the case being evaluated";
805805
break;
@@ -808,13 +808,13 @@ private async void entropySettingsChanged(object sender)
808808

809809
switch (comboBox_calcModes.SelectedIndex)
810810
{
811-
case (int)geoAnalysis.supported.calcModes.chord:
812-
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.chord);
811+
case (int)geoAnalysis.Supported.calcModes.chord:
812+
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.Supported.calcModes.chord);
813813
label_AB.Text = "Min Chord With";
814814
textBox_userGuidance.Text = "The system will report multiple chord lengths as : \"AMinTopChord,AMinBottomChord,BMinLeftChord,BMinRightChord\".\r\n\r\nMissing chords or invalid cases for evaluation are reported as 0.0\r\nChords not requested by the user are shown as N/A in the output file.\r\n\r\nShape A is defined by geometric equation A; B is geometric equation B.\r\n\r\nMajor axis : Orient shape A horizontally and B vertically else results will be reversed (top/bottom <> left/right)";
815815
break;
816-
case (int)geoAnalysis.supported.calcModes.angle:
817-
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.angle);
816+
case (int)geoAnalysis.Supported.calcModes.angle:
817+
commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.Supported.calcModes.angle);
818818
label_AB.Text = "Min Angle With";
819819
textBox_userGuidance.Text = "The minimum intersection angle will be reported, in degrees. A lack of intersection will yield a 180-degree value in the output";
820820
break;
@@ -916,7 +916,7 @@ private async void entropySettingsChanged(object sender)
916916

917917
commonVars.getSimulationSettings_nonSim().setDecimal(EntropySettings_nonSim.properties_d.externalCritCond1, Convert.ToDecimal(num_externalCriteria1.Value));
918918

919-
bool multiFieldResult = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.chord;
919+
bool multiFieldResult = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.Supported.calcModes.chord;
920920

921921
comboBox_externalCriteria2.Enabled = extCriteriaActive && multiFieldResult;
922922
int extCrit2 = comboBox_externalCriteria2.SelectedIndex;

0 commit comments

Comments
 (0)