diff --git a/Common/Variance/UI/MainForm.cs b/Common/Variance/UI/MainForm.cs index ea3d021..e842ad1 100644 --- a/Common/Variance/UI/MainForm.cs +++ b/Common/Variance/UI/MainForm.cs @@ -11,6 +11,7 @@ using Eto.Forms; using Eto.Veldrid; using geoWrangler; +using shapeEngine; using Veldrid; using VeldridEto; using PixelFormat = Veldrid.PixelFormat; @@ -29,6 +30,7 @@ public partial class MainForm private VarianceContextGUI varianceContext; private Command quitCommand, helpCommand, aboutCommand, clearLayer, copyLayer, pasteLayer, newSim, openSim, revertSim, saveSim, saveAsSim; + private Command expExpandersCommand, collExpandersCommand; private List notList, booleanList; @@ -42,10 +44,10 @@ private void setupUIDataContext(List notList_, List booleanList_ DataContext = new UIStringLists { subShapeList = commonVars.subshapes, - shapes = commonVars.getAvailableShapes(), - noiseTypeList = commonVars.getNoiseTypes(), - subShapePos = commonVars.getAvailableSubShapePositions(), - tipLocs = commonVars.getAvailableTipsLocations(), + shapes = ShapeLibrary.getAvailableShapes(CentralProperties.shapeTable), + noiseTypeList = NoiseC.noiseTypes, + subShapePos = ShapeSettings.getAvailableSubShapePositions(), + tipLocs = ShapeSettings.getAvailableTipsLocations(), rngTypeList = commonRNG.rngTypes, externalTypeList = commonVars.getExternalTypes(), externalFilterList = commonVars.getExternalFilterList(), @@ -54,7 +56,7 @@ private void setupUIDataContext(List notList_, List booleanList_ openGLMode = commonVars.getOpenGLModeList(), notList = notList_, fallOffList = RayCast.fallOffList, - polyFillList = commonVars.getPolyFillTypes(), + polyFillList = ShapeSettings.getPolyFillTypes(), geoCoreStructureList = commonVars.structureList, geoCoreLDList = commonVars.activeStructure_LayerDataTypeList, geoCoreStructureList_exp = commonVars.structureList_exp, @@ -197,6 +199,15 @@ private void loadPrefs() { } + try + { + varianceContext.vc.expandUI = Convert.ToBoolean(prefs.Descendants("expandUI").First().Value); + } + catch (Exception) + { + } + + varianceContext.vc.rngMappingEquations.Clear(); varianceContext.vc.rngMappingEquations.Add("Box-Muller"); try @@ -607,6 +618,8 @@ private void savePrefs() prefsXML.Root.Add(new XElement("friendlyNumber", varianceContext.vc.friendlyNumber)); + prefsXML.Root.Add(new XElement("expandUI", varianceContext.vc.expandUI)); + string equationString = ""; for (int i = 0; i < commonVars.rngCustomMapping.Count; i++) { @@ -833,10 +846,7 @@ private void uiVars() simulationSettingsGroupBoxHeight = 180; userGuidanceWidth = 395; userGuidanceHeight = simulationOutputGroupBoxHeight + simulationSettingsGroupBoxHeight + 22; - - simButtonWidth = 64; - simButtonHeight = 55; - + replayNumWidth = 80; multiThreadWarnWidth = 300; @@ -1588,7 +1598,7 @@ private void setup_tabs() tabPage_2D_PASearch_table = new TableLayout(); tabPage_2D_PASearch_scrollable = new Scrollable {Content = tabPage_2D_PASearch_table}; - tabPage_2D_PASearch = new TabPage {Text = "PA Search", Content = tabPage_2D_PASearch_scrollable}; + tabPage_2D_PASearch = new TabPage {Text = "Process Assumptions Search", Content = tabPage_2D_PASearch_scrollable}; tabControl_2D_simsettings.Pages.Add(tabPage_2D_PASearch); @@ -1597,7 +1607,7 @@ private void setup_tabs() private void setup_layout() { // mainPanel is tab UI. - Panel mainPanel = new() {Size = new Size(920, 800), Content = mainTable}; + Panel mainPanel = new() {Size = new Size(920, 750), Content = mainTable}; // force the UI out to contain the panel. Hope this will be redundant eventually with the table UI. // rightPanel will take viewport and controls. Panel rightPanel = new(); @@ -1717,6 +1727,12 @@ private void commands() saveAsSim = new Command { MenuText = "Save As", ToolBarText = "Save As", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.S }; saveAsSim.Executed += saveAsHandler; + + expExpandersCommand = new Command {MenuText = "Unfold All", ToolBarText = "Unfold All", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.X }; + expExpandersCommand.Executed += expandExpanders; + + collExpandersCommand = new Command {MenuText = "Fold All", ToolBarText = "Fold All", Shortcut = Application.Instance.CommonModifier | Keys.Shift | Keys.C }; + collExpandersCommand.Executed += collapseExpanders; // create menu Menu = new MenuBar @@ -1724,7 +1740,8 @@ private void commands() Items = { //File submenu new ButtonMenuItem { Text = "&File", Items = { newSim, openSim, revertSim, saveSim, saveAsSim } }, - new ButtonMenuItem { Text = "&Edit", Items = { copyLayer, pasteLayer, clearLayer } } + new ButtonMenuItem { Text = "&Edit", Items = { copyLayer, pasteLayer, clearLayer } }, + new ButtonMenuItem { Text = "&View", Items = { expExpandersCommand, collExpandersCommand } }, }, QuitItem = quitCommand, HelpItems = { @@ -1742,26 +1759,21 @@ private void setup_buttons(TableCell tc) tc.Control = TableLayout.AutoSized(p, centered: true); TableLayout buttons_table = new(); - p.Content = buttons_table; + p.Content = TableLayout.AutoSized(buttons_table); buttons_table.Rows.Add(new TableRow()); - - btn_singleCPU = new Button {Text = "Single\r\nCPU"}; - btn_singleCPU.Click += monteCarloSingleThreadEventHandler; - setSize(btn_singleCPU, simButtonWidth, simButtonHeight); - // buttons_table.Rows[0].Cells.Add(new TableCell() { Control = btn_singleCPU }); - - btn_multiCPU = new Button {Text = "Multi\r\nCPU"}; - setSize(btn_multiCPU, simButtonWidth, simButtonHeight); - btn_multiCPU.Click += monteCarloMultipleThreadEventHandler; - buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_multiCPU }); + + btn_Run = new Button {Text = "Run"}; + //setSize(btn_Run, simButtonWidth, simButtonHeight); + btn_Run.Click += monteCarloMultipleThreadEventHandler; + buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_Run }); btn_Cancel = new Button {Text = "Cancel"}; - setSize(btn_Cancel, simButtonWidth, simButtonHeight); - btn_Cancel.Click += btnCancel; + // setSize(btn_Cancel, simButtonWidth, simButtonHeight); + //btn_Cancel.Click += btnCancel; buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_Cancel }); btn_STOP = new Button {Text = "STOP"}; - setSize(btn_STOP, simButtonWidth, simButtonHeight); + //setSize(btn_STOP, simButtonWidth, simButtonHeight); btn_STOP.Click += btnSTOP; buttons_table.Rows[0].Cells.Add(new TableCell { Control = btn_STOP }); } diff --git a/Common/Variance/UI/UIHandlers.cs b/Common/Variance/UI/UIHandlers.cs index 6e0f781..905fee5 100644 --- a/Common/Variance/UI/UIHandlers.cs +++ b/Common/Variance/UI/UIHandlers.cs @@ -15,15 +15,15 @@ private void aboutMe(object sender, EventArgs e) creditText += varianceContext.vc.licenceName; creditText += "\r\n\r\n"; creditText += "Libraries used:\r\n"; - creditText += " Eto.Forms : UI framework\r\n\thttps://github.com/picoe/Eto/wiki\r\n"; + creditText += " Eto.Forms : UI framework\r\n\thttps://github.com/picoe/Eto\r\n"; creditText += " Eto.Veldrid : Eto Veldrid viewport\r\n\thttps://github.com/picoe/Eto.Veldrid\r\n"; creditText += " DesignLibs : Design libraries\r\n\thttps://github.com/philstopford/DesignLibs_GPL\r\n"; - creditText += " clipperLib : geometry processing, area, SVG output reference\r\n\thttp://sourceforge.net/projects/polyclipping/\r\n"; + creditText += " Clipper2 : geometry processing\r\n\thttps://github.com/AngusJohnson/Clipper2\r\n"; creditText += " KD-Sharp : for spacing/enclosure\r\n\thttps://code.google.com/p/kd-sharp/\r\n"; creditText += " LibTessDotNet : for Delauney triangulation (tone inversion of n polygons)\r\n\thttps://github.com/speps/LibTessDotNet\r\n"; creditText += " Mersenne Twister : \r\n\thttp://www.centerspace.net/resources/free-stuff/mersenne-twister\r\n"; - creditText += " ExpressionParser : \r\n\thttp://lundin.info/mathparser\r\n"; - creditText += " MiscUtil : \r\n\thttp://yoda.arachsys.com/csharp/miscutil/\r\n"; + creditText += " ExpressionParser : \r\n\thttps://github.com/plundin/Mathparser\r\n"; + creditText += " MiscUtil : \r\n\thttps://github.com/loory/MiscUtil\r\n"; aboutBox = new CreditsScreen(this, creditText); } Point location = new(Location.X + (Width - aboutBox.Width) / 2, @@ -93,9 +93,7 @@ private void mcPreviewSettingsChanged(object sender, EventArgs e) private void mainTabChanged(object sender, EventArgs e) { - btn_singleCPU.Enabled = false; - - btn_multiCPU.Enabled = false; + btn_Run.Enabled = false; btn_STOP.Enabled = false; // statusProgressBar.Visible = false; @@ -423,4 +421,26 @@ private void getComment() globalUIFrozen = false; }); } + + private void collapseExpanders(object sender, EventArgs e) + { + changeExpanders(false); + } + + private void expandExpanders(object sender, EventArgs e) + { + changeExpanders(true); + } + + private void changeExpanders(bool toState) + { + gadgets_exp.Expanded = toState; + expander_gadgets.Expanded = toState; + twoD_LayerUISetup_biasEtch_expanders(toState); + twoD_LayerUISetup_boolean_expanders(toState); + twoD_LayerUISetup_geoCore_expanders(toState); + twoD_LayerUISetup_litho_expanders(toState); + twoD_LayerUISetup_layoutOriginParameters_expanders(toState); + twoD_LayerUISetup_subShape_expanders(toState); + } } \ No newline at end of file diff --git a/Common/Variance/UI/UIHandlers_doe.cs b/Common/Variance/UI/UIHandlers_doe.cs index a3d4cc8..b2d3fb3 100644 --- a/Common/Variance/UI/UIHandlers_doe.cs +++ b/Common/Variance/UI/UIHandlers_doe.cs @@ -164,14 +164,16 @@ private void doeSettingsChanged() int colorIndex = tile % varianceContext.vc.colors.resultColors.Length; // map our result into the available colors. PointF[] currentTile = tilePoly.ToArray(); int length = currentTile.Length; + int col1 = col; + int row1 = row; #if !VARIANCESINGLETHREADED Parallel.For(0, length, pt => #else for (int pt = 0; pt < length; pt++) #endif { - currentTile[pt].X += (float)(col * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.colPitch)); - currentTile[pt].Y += (float)(row * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowPitch)); + currentTile[pt].X += (float)(col1 * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.colPitch)); + currentTile[pt].Y += (float)(row1 * commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowPitch)); } #if !VARIANCESINGLETHREADED ); diff --git a/Common/Variance/UI/UIHandlers_email.cs b/Common/Variance/UI/UIHandlers_email.cs index c4ec8e3..ae7db83 100644 --- a/Common/Variance/UI/UIHandlers_email.cs +++ b/Common/Variance/UI/UIHandlers_email.cs @@ -1,5 +1,7 @@ using System; using System.Globalization; +using EmailNS; +using Error; namespace Variance; @@ -19,7 +21,7 @@ private void emailSettingsChanged(object sender, EventArgs e) varianceContext.vc.host = commonVars.getNonSimulationSettings().host = text_server.Text; varianceContext.vc.emailPwd = commonVars.getNonSimulationSettings().emailPwd = varianceContext.vc.aes.EncryptToString(text_emailPwd.Text); varianceContext.vc.port = commonVars.getNonSimulationSettings().port = num_port.Value.ToString(CultureInfo.InvariantCulture); - varianceContext.vc.ssl = commonVars.getNonSimulationSettings().ssl = (bool)checkBox_SSL.Checked; + varianceContext.vc.ssl = commonVars.getNonSimulationSettings().ssl = (bool)checkBox_SSL.Checked!; bool emailOK = validateEmailSettings(); checkBox_EmailCompletion.Enabled = emailOK; @@ -32,7 +34,14 @@ private void emailSettingsChanged(object sender, EventArgs e) private void emailTest(object sender, EventArgs e) { - Email.Send(varianceContext.vc.host, varianceContext.vc.port, varianceContext.vc.ssl, "Variance Email Test", "Testing 1 2 3", varianceContext.vc.emailAddress, varianceContext.vc.aes.DecryptString(varianceContext.vc.emailPwd)); + try + { + Email.Send(varianceContext.vc.host, varianceContext.vc.port, varianceContext.vc.ssl, "Variance Email Test", "Testing 1 2 3", varianceContext.vc.emailAddress, varianceContext.vc.aes.DecryptString(varianceContext.vc.emailPwd)); + } + catch (Exception ex) + { + ErrorReporter.showMessage_OK(ex.Message, "Error sending mail"); + } } } \ No newline at end of file diff --git a/Common/Variance/UI/UIHandlers_file.cs b/Common/Variance/UI/UIHandlers_file.cs index 7a9568c..751adcb 100644 --- a/Common/Variance/UI/UIHandlers_file.cs +++ b/Common/Variance/UI/UIHandlers_file.cs @@ -263,6 +263,7 @@ private void pNew(bool prompt) commonVars.setGCCDV(varianceContext.vc.geoCoreCDVariation); commonVars.setLayerPreviewDOETile(varianceContext.vc.layerPreviewDOETile); commonVars.setFriendly(varianceContext.vc.friendlyNumber); + commonVars.setExpandedUI(varianceContext.vc.expandUI); setupGUI(); resetViewPorts(); set2DSelectedIndex(storeIndex); @@ -337,7 +338,8 @@ await Application.Instance.InvokeAsync(() => MultiSelect = false, Filters = { - new FileFilter("Layout Files (*.gds; *.gdsii; *.oas; *.oasis; *.gds.gz; *.gdsii.gz; *.oas.gz; *.oasis.gz)", ".gds", ".gdsii", "*.oas", "*.oasis", ".gds.gz", ".gdsii.gz", "*.oas.gz", "*.oasis.gz") + new FileFilter("Layout Files (*.gds; *.gdsii; *.oas; *.oasis; *.gds.gz; *.gdsii.gz; *.oas.gz; *.oasis.gz)", ".gds", ".gdsii", "*.oas", "*.oasis", ".gds.gz", ".gdsii.gz", "*.oas.gz", "*.oasis.gz" + , ".GDS", ".GDSII", "*.OAS", "*.OASIS", ".GDS.GZ", ".GDSII.GZ", "*.OAS.GZ", "*.OASIS.GZ") } }; @@ -387,13 +389,13 @@ await Application.Instance.InvokeAsync(() => commonVars.getLayerSettings(settingsIndex).setString(EntropyLayerSettings.properties_s.file, commonVars.getGeoCoreHandler(settingsIndex).getFilename()); // Clear tracking for external point data. commonVars.getLayerSettings(settingsIndex).setReloaded(false); + try { comboBox_structureList_geoCore.SelectedIndex = commonVars.getGeoCoreHandler(settingsIndex).getGeo().activeStructure; } catch (Exception) { - } try { @@ -471,7 +473,7 @@ private bool layoutLoad(int settingsIndex, string filename) { commonVars.getGeoCoreHandler(settingsIndex).updateGeoCoreHandler(filename, GeoCore.fileType.oasis); } - + return commonVars.getGeoCoreHandler(settingsIndex).isValid(); } default: @@ -487,7 +489,7 @@ private void iDRMFileChooser_Handler(object sender, EventArgs e) MultiSelect = false, Filters = { - new FileFilter("CSV Files (*.csv)", ".csv") + new FileFilter("CSV Files (*.csv)", ".csv", ".CSV") } }; bool reading = false; @@ -534,7 +536,7 @@ private void QuiltFileChooser_Handler(object sender, EventArgs e) MultiSelect = false, Filters = { - new FileFilter("CSV Files (*.csv)", ".csv") + new FileFilter("CSV Files (*.csv)", ".csv", ".CSV") } }; bool reading = false; diff --git a/Common/Variance/UI/UIHandlers_geoCore.cs b/Common/Variance/UI/UIHandlers_geoCore.cs index 15dc196..0e63544 100644 --- a/Common/Variance/UI/UIHandlers_geoCore.cs +++ b/Common/Variance/UI/UIHandlers_geoCore.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Eto.Forms; @@ -28,10 +27,10 @@ private async void exportActiveLayerToLayout() Title = "Enter file to save", Filters = { - new FileFilter("GDS file", "*.gds", ".gdsii"), - new FileFilter("GDS file, GZIP compressed", "*.gds.gz", "*.gdsii.gz"), - new FileFilter("OAS file", "*.oas", "*.oasis"), - new FileFilter("OAS file. GZIP compressed", "*.oas.gz", "*.oasis.gz") + new FileFilter("GDS file", "*.gds", ".gdsii", "*.GDS", ".GDSII"), + new FileFilter("GDS file, GZIP compressed", "*.gds.gz", "*.gdsii.gz", "*.GDS.GZ", "*.GDSII.GZ"), + new FileFilter("OAS file", "*.oas", "*.oasis", "*.OAS", "*.OASIS"), + new FileFilter("OAS file. GZIP compressed", "*.oas.gz", "*.oasis.gz", "*.OAS.GZ", "*.OASIS.GZ") } }; if (sfd.ShowDialog(ParentWindow) != DialogResult.Ok) @@ -166,7 +165,7 @@ private void toGeoCore(int type, string file) GeoLibPoint[] ePoly = GeoWrangler.resize_to_int(polys[poly], scale); - gcell_root.addPolygon(ePoly.ToArray(), layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. + gcell_root.addPolygon(ePoly, layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. } } diff --git a/Common/Variance/UI/UIHandlers_layer.cs b/Common/Variance/UI/UIHandlers_layer.cs index ffdfb1e..b752bff 100644 --- a/Common/Variance/UI/UIHandlers_layer.cs +++ b/Common/Variance/UI/UIHandlers_layer.cs @@ -167,8 +167,8 @@ private void customRNGContextMenu() private void omitLayerCheckboxChanged(object sender, EventArgs e) { // Establish which sender raised the event so that we can push the value to the correct layer. - int index = Array.IndexOf(cB_omit, sender); - setOmitLayer(index, (bool)((CheckBox)sender).Checked); + int index = Array.IndexOf(cB_omit, (CheckBox)sender); + setOmitLayer(index, (bool)((CheckBox)sender).Checked!); } private void setOmitLayer(int index, bool status) @@ -196,7 +196,7 @@ private void bgLayerCheckboxChanged(int settingsIndex) { for (int i = 0; i < cB_bg.Length; i++) { - if ((bool)cB_bg[i].Checked && cB_bg[i].Enabled) + if ((bool)cB_bg[i].Checked! && cB_bg[i].Enabled) { commonVars.getLayerSettings(settingsIndex).setIntArrayValue(EntropyLayerSettings.properties_intarray.bglayers, i, 1); } diff --git a/Common/Variance/UI/UIHandlers_prefs.cs b/Common/Variance/UI/UIHandlers_prefs.cs index ff12814..7368b7b 100644 --- a/Common/Variance/UI/UIHandlers_prefs.cs +++ b/Common/Variance/UI/UIHandlers_prefs.cs @@ -357,15 +357,15 @@ private void preferencesChange(object sender, EventArgs e) return; } utilsUIFrozen = true; - varianceContext.vc.geoCoreCDVariation = (bool)checkBox_geoCore_enableCDVariation.Checked; + varianceContext.vc.geoCoreCDVariation = (bool)checkBox_geoCore_enableCDVariation.Checked!; commonVars.setGCCDV((bool)checkBox_geoCore_enableCDVariation.Checked); - varianceContext.vc.layerPreviewDOETile = (bool)checkBox_geoCore_tileLayerPreview.Checked; + varianceContext.vc.layerPreviewDOETile = (bool)checkBox_geoCore_tileLayerPreview.Checked!; commonVars.setLayerPreviewDOETile((bool)checkBox_geoCore_tileLayerPreview.Checked); - varianceContext.vc.AA = (bool)checkBox_OGLAA.Checked; + varianceContext.vc.AA = (bool)checkBox_OGLAA.Checked!; commonVars.setOpenGLProp(CommonVars.properties_gl.aa, (bool)checkBox_OGLAA.Checked); - varianceContext.vc.FilledPolygons = (bool)checkBox_OGLFill.Checked; + varianceContext.vc.FilledPolygons = (bool)checkBox_OGLFill.Checked!; commonVars.setOpenGLProp(CommonVars.properties_gl.fill, (bool)checkBox_OGLFill.Checked); - varianceContext.vc.drawPoints = (bool)checkBox_OGLPoints.Checked; + varianceContext.vc.drawPoints = (bool)checkBox_OGLPoints.Checked!; commonVars.setOpenGLProp(CommonVars.properties_gl.points, (bool)checkBox_OGLPoints.Checked); varianceContext.vc.openGLZoomFactor = Convert.ToInt32(num_zoomSpeed.Value); commonVars.setGLInt(CommonVars.gl_i.zoom, Convert.ToInt32(num_zoomSpeed.Value)); @@ -396,8 +396,11 @@ private void resetColors(object sender, EventArgs e) private void miscSettingsChanged(object sender, EventArgs e) { - varianceContext.vc.friendlyNumber = (bool)checkBox_friendlyNumbers.Checked; + varianceContext.vc.friendlyNumber = (bool)checkBox_friendlyNumbers.Checked!; commonVars.setFriendly(varianceContext.vc.friendlyNumber); + + varianceContext.vc.expandUI = (bool) checkBox_expandUI.Checked!; + commonVars.setExpandedUI(varianceContext.vc.expandUI); } } \ No newline at end of file diff --git a/Common/Variance/UI/UIHandlers_setup.cs b/Common/Variance/UI/UIHandlers_setup.cs index dbc059c..1b6f136 100644 --- a/Common/Variance/UI/UIHandlers_setup.cs +++ b/Common/Variance/UI/UIHandlers_setup.cs @@ -61,12 +61,10 @@ private void setupGUI() checkBox_aChord.Enabled = false; checkBox_bChord.Enabled = false; - - btn_singleCPU.Enabled = false; - + btn_Cancel.Enabled = false; - btn_multiCPU.Enabled = false; + btn_Run.Enabled = false; btn_STOP.Enabled = false; // statusProgressBar.Visible = false; diff --git a/Common/Variance/UI/UIHandlers_simulation.cs b/Common/Variance/UI/UIHandlers_simulation.cs index 8342d10..55ce179 100644 --- a/Common/Variance/UI/UIHandlers_simulation.cs +++ b/Common/Variance/UI/UIHandlers_simulation.cs @@ -242,8 +242,7 @@ private void simRunningUI() // Activate stop button to enable run abort. btn_STOP.Enabled = true; // Deactivate run button(s) since we're running a batch task. - btn_singleCPU.Enabled = false; - btn_multiCPU.Enabled = false; + btn_Run.Enabled = false; // Block out UI elements groupBox_setOutput.Enabled = false; groupBox_simSettings.Enabled = false; @@ -389,13 +388,11 @@ private void startButtonCheck() { Application.Instance.Invoke(() => { - btn_multiCPU.Enabled = false; - btn_singleCPU.Enabled = false; + btn_Run.Enabled = false; if (getMainSelectedIndex() == (int)CommonVars.upperTabNames.Implant) { - btn_multiCPU.Enabled = true; - btn_singleCPU.Enabled = true; + btn_Run.Enabled = true; } else { @@ -417,13 +414,11 @@ private void startButtonCheck() if (aEqtn && bEqtn) { - btn_singleCPU.Enabled = true; - btn_multiCPU.Enabled = true; + btn_Run.Enabled = true; } else { - btn_singleCPU.Enabled = false; - btn_multiCPU.Enabled = false; + btn_Run.Enabled = false; } } }); @@ -523,6 +518,7 @@ private void addSettingsHandlers() checkBox_SSL.CheckedChanged += emailSettingsChanged; checkBox_friendlyNumbers.CheckedChanged += miscSettingsChanged; + checkBox_expandUI.CheckedChanged += miscSettingsChanged; button_replay.Click += replayLoadCSV; checkBox_replay.CheckedChanged += replayChanged; @@ -607,7 +603,7 @@ private async void entropySettingsChanged(object sender) { if (comboBox_calcModes.SelectedIndex < 0) { - comboBox_calcModes.SelectedIndex = (int)CommonVars.calcModes.area; + comboBox_calcModes.SelectedIndex = (int)geoAnalysis.supported.calcModes.area; } } catch (Exception) @@ -616,17 +612,15 @@ private async void entropySettingsChanged(object sender) } if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) < 0) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)CommonVars.calcModes.area); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.area); } if (commonVars.getReplayMode() == 0) { int mainIndex = getMainSelectedIndex(); int twoDIndex = getSubTabSelectedIndex(); - - btn_singleCPU.Enabled = false; - - btn_multiCPU.Enabled = false; + + btn_Run.Enabled = false; btn_STOP.Enabled = false; // statusProgressBar.Visible = false; if (mainIndex != (int)CommonVars.upperTabNames.twoD) @@ -699,7 +693,7 @@ private async void entropySettingsChanged(object sender) } // Retrieve our settings. - checkBox_perPoly.Enabled = comboBox_calcModes.SelectedIndex == (int)CommonVars.calcModes.area; + checkBox_perPoly.Enabled = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.area; checkBox_withinMode.Enabled = false; checkBox_useShortestEdge.Enabled = false; @@ -717,28 +711,28 @@ private async void entropySettingsChanged(object sender) commonVars.getSimulationSettings().debugCalc = false; } - if (comboBox_calcModes.SelectedIndex == (int)CommonVars.calcModes.enclosure_spacing_overlap) + if (comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap) { if ((bool)checkBox_withinMode.Checked) { if ((bool)checkBox_useShortestEdge.Checked) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.spacingCalcModes.enclosure); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosure); } else { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.spacingCalcModes.enclosureOld); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosureOld); } } else { if ((bool)checkBox_useShortestEdge.Checked) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.spacingCalcModes.spacing); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacing); } else { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.spacingCalcModes.spacingOld); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacingOld); } } } @@ -748,64 +742,64 @@ private async void entropySettingsChanged(object sender) switch (comboBox_calcModes.SelectedIndex) { - case (int)CommonVars.calcModes.chord: + case (int)geoAnalysis.supported.calcModes.chord: { checkBox_aChord.Enabled = true; checkBox_bChord.Enabled = true; - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.chordCalcElements.a + (int)CommonVars.chordCalcElements.b); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.ChordHandler.chordCalcElements.a + (int)geoAnalysis.ChordHandler.chordCalcElements.b); if (!(bool)checkBox_aChord.Checked && !(bool)checkBox_bChord.Checked) { checkBox_aChord.Checked = true; // force a default if the user is being silly. } if (!(bool)checkBox_aChord.Checked) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) - (int)CommonVars.chordCalcElements.a); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) - (int)geoAnalysis.ChordHandler.chordCalcElements.a); } if (!(bool)checkBox_bChord.Checked) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) - (int)CommonVars.chordCalcElements.b); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) - (int)geoAnalysis.ChordHandler.chordCalcElements.b); } break; } - case (int)CommonVars.calcModes.area: + case (int)geoAnalysis.supported.calcModes.area: { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)CommonVars.calcModes.area); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.area); if ((bool)checkBox_perPoly.Checked) { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.areaCalcModes.perpoly); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.AreaHandler.areaCalcModes.perpoly); textBox_userGuidance.Text = "The minimum overlap area will be calculated and reported."; } else { - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)CommonVars.areaCalcModes.all); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.subMode, (int)geoAnalysis.AreaHandler.areaCalcModes.all); textBox_userGuidance.Text = "The total overlap area of all polygons in the layers will be calculated and reported."; } label_AB.Text = "AND"; break; } - case (int)CommonVars.calcModes.enclosure_spacing_overlap: + case (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap: { comboBox_calcModes.SelectedIndexChanged -= entropySettingsChanged; checkBox_withinMode.Enabled = true; - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)CommonVars.calcModes.enclosure_spacing_overlap); + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap); string t; if ((bool)checkBox_withinMode.Checked) { checkBox_useShortestEdge.Enabled = false; - commonVars.calcMode_names[(int)CommonVars.calcModes.enclosure_spacing_overlap] = "Compute Enclosure Distribution"; + commonVars.calcMode_names[(int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap] = "Compute Enclosure Distribution"; label_AB.Text = "Min Enclosure To"; t = "enclosure"; } else { checkBox_useShortestEdge.Enabled = true; - commonVars.calcMode_names[(int)CommonVars.calcModes.enclosure_spacing_overlap] = "Compute Spacing Distribution"; + commonVars.calcMode_names[(int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap] = "Compute Spacing Distribution"; label_AB.Text = "Min Space To"; t = "spacing"; } - comboBox_calcModes.SelectedIndex = (int)CommonVars.calcModes.enclosure_spacing_overlap; + comboBox_calcModes.SelectedIndex = (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap; comboBox_calcModes.SelectedIndexChanged += entropySettingsChanged; 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"; break; @@ -814,13 +808,13 @@ private async void entropySettingsChanged(object sender) switch (comboBox_calcModes.SelectedIndex) { - case (int)CommonVars.calcModes.chord: - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)CommonVars.calcModes.chord); + case (int)geoAnalysis.supported.calcModes.chord: + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.chord); label_AB.Text = "Min Chord With"; 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)"; break; - case (int)CommonVars.calcModes.angle: - commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)CommonVars.calcModes.angle); + case (int)geoAnalysis.supported.calcModes.angle: + commonVars.getSimulationSettings().setValue(EntropySettings.properties_i.oType, (int)geoAnalysis.supported.calcModes.angle); label_AB.Text = "Min Angle With"; 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"; break; @@ -922,7 +916,7 @@ private async void entropySettingsChanged(object sender) commonVars.getSimulationSettings_nonSim().setDecimal(EntropySettings_nonSim.properties_d.externalCritCond1, Convert.ToDecimal(num_externalCriteria1.Value)); - bool multiFieldResult = comboBox_calcModes.SelectedIndex == (int)CommonVars.calcModes.chord; + bool multiFieldResult = comboBox_calcModes.SelectedIndex == (int)geoAnalysis.supported.calcModes.chord; comboBox_externalCriteria2.Enabled = extCriteriaActive && multiFieldResult; int extCrit2 = comboBox_externalCriteria2.SelectedIndex; @@ -965,8 +959,7 @@ private async void entropySettingsChanged(object sender) // Ensure we set controls according to run state if (commonVars.isSimRunning()) { - btn_singleCPU.Enabled = false; - btn_multiCPU.Enabled = false; + btn_Run.Enabled = false; btn_STOP.Enabled = true; } } diff --git a/Common/Variance/UI/UIHandlers_updating.cs b/Common/Variance/UI/UIHandlers_updating.cs index 61c9948..d711f72 100644 --- a/Common/Variance/UI/UIHandlers_updating.cs +++ b/Common/Variance/UI/UIHandlers_updating.cs @@ -5,6 +5,7 @@ using System.Timers; using Eto.Drawing; using Eto.Forms; +using shapeEngine; namespace Variance; @@ -40,12 +41,12 @@ private void updateImplantPreview() #if !VARIANCESINGLETHREADED Parallel.For(0, limit, point => #else - for (Int32 point = 0; point < tmpPoints.Count(); point++) + for (Int32 point = 0; point < tmpPoints.Count(); point++) #endif - { - tmpPoints[point] = new PointF((float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getResistShapes()[1].getPoints()[0][point].X, - (float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getResistShapes()[1].getPoints()[0][point].Y); - } + { + tmpPoints[point] = new PointF((float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getResistShapes()[1].getPoints()[0][point].X, + (float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getResistShapes()[1].getPoints()[0][point].Y); + } #if !VARIANCESINGLETHREADED ); #endif @@ -74,12 +75,12 @@ private void updateImplantPreview() #if !VARIANCESINGLETHREADED Parallel.For(0, limit, point => #else - for (Int32 point = 0; point < tmpPoints.Count(); point++) + for (Int32 point = 0; point < tmpPoints.Count(); point++) #endif - { - tmpPoints[point] = new PointF((float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getLine(Results_implant.lines.min).getPoints()[0][point].X, - (float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getLine(Results_implant.lines.min).getPoints()[0][point].Y); - } + { + tmpPoints[point] = new PointF((float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getLine(Results_implant.lines.min).getPoints()[0][point].X, + (float)entropyControl.getImplantResultPackage().getImplantPreviewResult().getLine(Results_implant.lines.min).getPoints()[0][point].Y); + } #if !VARIANCESINGLETHREADED ); #endif @@ -224,20 +225,20 @@ private void updateSettingsUIFromSettings() switch (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType)) { - case (int)CommonVars.calcModes.area: + case (int)geoAnalysis.supported.calcModes.area: checkBox_perPoly.Enabled = true; - checkBox_perPoly.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.areaCalcModes.perpoly; + checkBox_perPoly.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.AreaHandler.areaCalcModes.perpoly; break; - case (int)CommonVars.calcModes.enclosure_spacing_overlap: + case (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap: checkBox_withinMode.Enabled = true; - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacing || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacingOld) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacing || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacingOld) { checkBox_useShortestEdge.Enabled = true; } - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosure || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosureOld) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosure || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosureOld) { checkBox_withinMode.Checked = true; } @@ -246,7 +247,7 @@ private void updateSettingsUIFromSettings() checkBox_withinMode.Checked = false; } - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosure || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacing) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosure || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacing) { checkBox_useShortestEdge.Checked = true; } @@ -255,13 +256,13 @@ private void updateSettingsUIFromSettings() checkBox_useShortestEdge.Checked = false; } break; - case (int)CommonVars.calcModes.chord: + case (int)geoAnalysis.supported.calcModes.chord: checkBox_aChord.Enabled = true; checkBox_bChord.Enabled = true; - checkBox_aChord.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) != (int)CommonVars.chordCalcElements.b; - checkBox_bChord.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) >= (int)CommonVars.chordCalcElements.b; + checkBox_aChord.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) != (int)geoAnalysis.ChordHandler.chordCalcElements.b; + checkBox_bChord.Checked = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) >= (int)geoAnalysis.ChordHandler.chordCalcElements.b; break; - case (int)CommonVars.calcModes.angle: + case (int)geoAnalysis.supported.calcModes.angle: break; } @@ -540,6 +541,7 @@ private void updateUtilsValues() checkBox_perJob.Checked = varianceContext.vc.perJob; checkBox_EmailCompletion.Checked = varianceContext.vc.completion; checkBox_friendlyNumbers.Checked = varianceContext.vc.friendlyNumber; + checkBox_expandUI.Checked = varianceContext.vc.expandUI; num_zoomSpeed.Value = varianceContext.vc.openGLZoomFactor; num_bgOpacity.Value = varianceContext.vc.BGOpacity; num_fgOpacity.Value = varianceContext.vc.FGOpacity; @@ -831,14 +833,16 @@ private void drawSimulationPanelHandler(bool doPASearch) int length = commonVars.getSimPreview().getLayerPreviewShapePoly(layer, poly).Length; PointF[] tmpPoints = new PointF[length]; + int poly1 = poly; + int layer1 = layer; #if !VARIANCESINGLETHREADED Parallel.For(0, length, point => #else for (Int32 point = 0; point < length; point++) #endif - { - tmpPoints[point] = new PointF((float)commonVars.getSimPreview().getLayerPreviewShapePoly(layer, poly)[point].X, (float)commonVars.getSimPreview().getLayerPreviewShapePoly(layer, poly)[point].Y); - } + { + tmpPoints[point] = new PointF((float)commonVars.getSimPreview().getLayerPreviewShapePoly(layer1, poly1)[point].X, (float)commonVars.getSimPreview().getLayerPreviewShapePoly(layer1, poly1)[point].Y); + } #if !VARIANCESINGLETHREADED ); #endif @@ -877,7 +881,7 @@ private void drawSimulationPanelHandler(bool doPASearch) int colorIndex = poly % varianceContext.vc.colors.resultColors.Length; // map our result into the available colors. totalPoints += commonVars.getSimPreview().getPoints(poly).Length; - if (commonVars.getSimPreview().getPoints(poly).Length == 2 || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.chord || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.angle || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.enclosure_spacing_overlap) + if (commonVars.getSimPreview().getPoints(poly).Length == 2 || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.chord || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.angle || commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap) { mcVPSettings[CentralProperties.maxLayersForMC - 1 + (int)CommonVars.twoDTabNames.settings].addLine( line: UIHelper.myPointFArrayToPointFArray(commonVars.getSimPreview().getPoints(poly)), @@ -1177,7 +1181,7 @@ private List generate_shapes(int settingsIndex) // User has a shape chosen so we can draw a preview if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == - (int) CommonVars.shapeNames.none) + (int) CentralProperties.shapeNames.none) { return previewShapes; } @@ -1192,9 +1196,9 @@ private List generate_shapes(int settingsIndex) } // Get the drawn polygons. if ( - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.rect || - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE || - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.rect || + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE || + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN ) { PreviewShape pShape1 = new(commonVars, settingsIndex, subShapeIndex: 0, mode: 0, doPASearch: false, previewMode: true, currentRow: 0, currentCol: 0); diff --git a/Common/Variance/UI/UIHandlers_viewport.cs b/Common/Variance/UI/UIHandlers_viewport.cs index ac5c96a..9c06e03 100644 --- a/Common/Variance/UI/UIHandlers_viewport.cs +++ b/Common/Variance/UI/UIHandlers_viewport.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using Eto.Drawing; using Eto.Forms; @@ -58,7 +57,7 @@ private void saveViewportSVG_File() private static void saveViewportSVG(ref OVPSettings vpSettings, string svgFileName) { - SVGBuilder svg = new(); + SVGBuilder.SVGBuilder svg = new(); // The polygons in the viewport are stored flipped due to drawing convention. We need to flip them here for SVG to match drawn viewport. @@ -289,7 +288,7 @@ private void saveViewportLayout(ref OVPSettings vpSettings, bool useLineList, bo #if !SVGSINGLETHREADED ); #endif - gcell_root.addPolygon(ePoly.ToArray(), layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. + gcell_root.addPolygon(ePoly, layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. } } @@ -338,7 +337,7 @@ private void saveViewportLayout(ref OVPSettings vpSettings, bool useLineList, bo #if !SVGSINGLETHREADED ); #endif - gcell_root.addPath(ePoly.ToArray(), layerIndex + 1, 0); + gcell_root.addPath(ePoly, layerIndex + 1, 0); } } @@ -387,7 +386,7 @@ private void saveViewportLayout(ref OVPSettings vpSettings, bool useLineList, bo #if !SVGSINGLETHREADED ); #endif - gcell_root.addPolygon(ePoly.ToArray(), layerIndex + 1, 0); + gcell_root.addPolygon(ePoly, layerIndex + 1, 0); } } diff --git a/Common/Variance/UI/commonUIVars.cs b/Common/Variance/UI/commonUIVars.cs index f41f609..657c0ee 100644 --- a/Common/Variance/UI/commonUIVars.cs +++ b/Common/Variance/UI/commonUIVars.cs @@ -53,7 +53,7 @@ public class UIStringLists public ObservableCollection rngMapping { get; set; } } - private const int viewportSize = 484; + private const int viewportSize = 10; private bool[] geoGBVisible, subShapeGBVisible, booleanGBVisible; @@ -120,7 +120,6 @@ public class UIStringLists resultFieldWidth, commentBoxWidth, commentBoxHeight, label_Height, - simButtonWidth, simButtonHeight, replayNumWidth ; @@ -140,7 +139,7 @@ public class UIStringLists private CheckBox[] cB_omit; private NumericStepper num_viewportZoom, num_viewportX, num_viewportY; - private Button btn_singleCPU, btn_multiCPU, btn_STOP, btn_Cancel; + private Button btn_Run, btn_STOP, btn_Cancel; private TabControl tabControl_main, tabControl_2D_simsettings; private TabPage tab_1DCalc, tabPage2, tabPage_implant, tabPage_utilities, tabPage_2D_Settings, tabPage_2D_DOE, tabPage_2D_PASearch, tabPage_2D_experiment; diff --git a/Common/Variance/UI/implantUI.cs b/Common/Variance/UI/implantUI.cs index 5fb7300..d1032fb 100644 --- a/Common/Variance/UI/implantUI.cs +++ b/Common/Variance/UI/implantUI.cs @@ -329,7 +329,7 @@ private void doImplantShadowing(object sender, EventArgs e) commonVars.getImplantSimulationSettings().setValue(EntropySettings.properties_i.nCases, Convert.ToInt32(num_implantNumOfCases.Value)); commonVars.getImplantSimulationSettings().setValue(EntropySettings.properties_i.cSeg, Convert.ToInt32(num_implantCornerSegments.Value)); - if ((bool)checkBox_CSV_implant.Checked) + if ((bool)checkBox_CSV_implant.Checked!) { commonVars.getImplantSettings_nonSim().setInt(EntropySettings_nonSim.properties_i.csv, 1); } @@ -338,7 +338,7 @@ private void doImplantShadowing(object sender, EventArgs e) commonVars.getImplantSettings_nonSim().setInt(EntropySettings_nonSim.properties_i.csv, 0); } - if ((bool)checkBox_external_implant.Checked) + if ((bool)checkBox_external_implant.Checked!) { comboBox_externalTypes_implant.Enabled = true; commonVars.getImplantSettings_nonSim().setInt(EntropySettings_nonSim.properties_i.external, 1); diff --git a/Common/Variance/UI/layerUI_common.cs b/Common/Variance/UI/layerUI_common.cs index 822222a..c3f6cc5 100644 --- a/Common/Variance/UI/layerUI_common.cs +++ b/Common/Variance/UI/layerUI_common.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; -using System.Linq; using color; using Eto.Drawing; using Eto.Forms; using geoLib; +using shapeEngine; namespace Variance; @@ -357,8 +357,8 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) listBox_layers.SelectedIndex = selectedLayer; - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE && - !(bool)cB_geoCore_shapeEngine.Checked) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && + !(bool)cB_geoCore_shapeEngine.Checked!) { cB_FlipH.Checked = false; cB_FlipV.Checked = false; @@ -381,13 +381,13 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) cB_FlipV.Enabled = true; commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.flipH, 0); - if ((bool)cB_FlipH.Checked) + if ((bool)cB_FlipH.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.flipH, 1); } commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.flipV, 0); - if ((bool)cB_FlipV.Checked) + if ((bool)cB_FlipV.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.flipV, 1); } @@ -435,10 +435,10 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) // Enable control requires various checks to ensure it is appropriate. These complicated checks are below and commented. if ( num_subshape_hl.Value != 0 && - num_subshape_vl.Value != 0 && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.GEOCORE && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.none || - commonVars.getGeoCoreHandler(settingsIndex).isValid() && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE || - commonVars.getLayerSettings(settingsIndex).isReloaded() && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE || - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN + num_subshape_vl.Value != 0 && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.GEOCORE && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.none || + commonVars.getGeoCoreHandler(settingsIndex).isValid() && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE || + commonVars.getLayerSettings(settingsIndex).isReloaded() && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE || + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN ) { // Also tweak 'show drawn' here. @@ -508,7 +508,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) commonVars.getLayerSettings(settingsIndex).setFileData(new List { defaultPointArray }); } - if ((bool)cB_geoCore_shapeEngine.Checked) + if ((bool)cB_geoCore_shapeEngine.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.gCSEngine, 1); } @@ -517,7 +517,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.gCSEngine, 0); } - if ((bool)cB_geoCore_shapeEngine_perPoly.Checked) + if ((bool)cB_geoCore_shapeEngine_perPoly.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.perPoly, 1); } @@ -526,7 +526,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.perPoly, 0); } - if ((bool)cB_geoCore_layoutReference.Checked) + if ((bool)cB_geoCore_layoutReference.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.refLayout, 1); } @@ -535,12 +535,12 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.refLayout, 0); } - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) // layout option selected. + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) // layout option selected. { do2DLayerUI_geoCore(settingsIndex); } - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN) { do2DLayerUI_Boolean(settingsIndex); } @@ -549,7 +549,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) bool[] warnArray = { false, false, false }; - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.none || commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.rect) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.none || commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.rect) { layer_clampSubShape2(minHLength: 0, maxHLength: 1000000, @@ -570,7 +570,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) maxVOffset: 1000000 ); - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.none) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.none) { num_subshape_hl.Value = 0; num_subshape_vl.Value = 0; @@ -590,59 +590,59 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) } - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.shape1Tip, comboBox_tipLocations2.SelectedIndex); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.shape2Tip, comboBox_tipLocations3.SelectedIndex); - warnArray[0] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) == 0; + warnArray[0] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) == 0; // Boolean and geoCore have their own handling for this. - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.GEOCORE && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.BOOLEAN) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.GEOCORE && commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.BOOLEAN) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.shape0Tip, comboBox_tipLocations.SelectedIndex); } // Subshape 2 offsets contingent on shape selection choice if ( - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.none && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.rect && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.GEOCORE && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.BOOLEAN + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.none && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.rect && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.GEOCORE && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.BOOLEAN ) { layer_clampSubShape(minHLength: 0.01, maxHLength: 1000000, minVLength: 0.01, maxVLength: 1000000, minHOffset: -1000000, maxHOffset: 1000000, minVOffset: -1000000, maxVOffset: 1000000); commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.shape1Tip, comboBox_tipLocations2.SelectedIndex); - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Xshape) // Limit offsets of subshape 2 for X-shape. + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Xshape) // Limit offsets of subshape 2 for X-shape. { do2DLayerUI_X(settingsIndex); } - else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Tshape) // Disabled horizontal offset of subshape 2 for T-shape. + else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Tshape) // Disabled horizontal offset of subshape 2 for T-shape. { do2DLayerUI_T(settingsIndex); } - else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Lshape) // Disable horizontal and vertical offsets of subshape 2 for L-shape + else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Lshape) // Disable horizontal and vertical offsets of subshape 2 for L-shape { do2DLayerUI_L(settingsIndex); } - else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Ushape) // U-shape + else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Ushape) // U-shape { do2DLayerUI_U(settingsIndex); } - else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Sshape) // S-shape + else if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Sshape) // S-shape { do2DLayerUI_S(settingsIndex); } @@ -650,15 +650,15 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) { num_subshape2_ho.Enabled = true; num_subshape2_vo.Enabled = true; - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); } - warnArray[1] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength) == 0; + warnArray[1] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 1) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1) == 0; - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Sshape) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Sshape) { - warnArray[2] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength) == 0; + warnArray[2] = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 2) == 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 2) == 0; } } @@ -694,7 +694,7 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) do2DLayerUI_litho(settingsIndex, updateUI); // If we have a geoCore layer, and it's tagged for DOE, and we have the layer preview based on the DOE extraction, we need to trigger the tile extraction. - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE && commonVars.getSimulationSettings().getDOESettings().getLayerAffected(settingsIndex) == 1 && commonVars.getLayerPreviewDOETile()) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && commonVars.getSimulationSettings().getDOESettings().getLayerAffected(settingsIndex) == 1 && commonVars.getLayerPreviewDOETile()) { // Need a tile extraction update entropyControl.EntropyRun(numberOfCases: 1, csvFile: null, useThreads: false, doPASearch: false); @@ -733,9 +733,9 @@ private void do2DLayerUI(int settingsIndex, bool updateUI = false) } } - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE || - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN || - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.none) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE || + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN || + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.none) { warnNeeded = false; } @@ -765,10 +765,10 @@ private void set_shape_type_ui(int settingsIndex) { // Any configuration beyond the first couple requires a second shape to be defined so we need to display that part of the interface. if ( - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.none && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.rect && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.GEOCORE && - commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.BOOLEAN + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.none && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.rect && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.GEOCORE && + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.BOOLEAN ) { // Let's display the subshape 2 section if a shape configuration is chosen that requires it. @@ -778,7 +778,7 @@ private void set_shape_type_ui(int settingsIndex) num_subshape2_vo.Enabled = true; comboBox_tipLocations2.Enabled = true; - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Sshape) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Sshape) { num_subshape3_hl.Enabled = true; num_subshape3_vl.Enabled = true; @@ -862,7 +862,7 @@ private void do2DLayerUI_edgeSlide(int settingsIndex) cB_edgeSlide.Enabled = true; num_edgeSlideTension.Enabled = true; - if ((bool)cB_edgeSlide.Checked) + if ((bool)cB_edgeSlide.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.edgeSlide, 1); num_edgeSlideTension.Enabled = true; @@ -883,7 +883,7 @@ private void do2DLayerUI_edgeSlide(int settingsIndex) private void do2DLayerUI_Boolean(int settingsIndex) { comboBox_subShapeRef.SelectedIndex = 0; - comboBox_posSubShape.SelectedIndex = (int)CommonVars.subShapeLocations.BL; + comboBox_posSubShape.SelectedIndex = (int)ShapeSettings.subShapeLocations.BL; comboBox_subShapeRef.Enabled = false; comboBox_posSubShape.Enabled = false; @@ -948,7 +948,7 @@ private void do2DLayerUI_geoCore(int settingsIndex) // Disable subshapes comboBox_subShapeRef.SelectedIndex = 0; - comboBox_posSubShape.SelectedIndex = (int)CommonVars.subShapeLocations.BL; + comboBox_posSubShape.SelectedIndex = (int)ShapeSettings.subShapeLocations.BL; comboBox_subShapeRef.Enabled = false; comboBox_posSubShape.Enabled = false; @@ -979,7 +979,7 @@ private void do2DLayerUI_geoCore(int settingsIndex) commonVars.subshapes[settingsIndex].Clear(); commonVars.subshapes[settingsIndex].Add("1"); comboBox_subShapeRef.SelectedIndex = 0; - comboBox_posSubShape.SelectedIndex = (int)CommonVars.subShapeLocations.BL; + comboBox_posSubShape.SelectedIndex = (int)ShapeSettings.subShapeLocations.BL; if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0) { @@ -1111,7 +1111,7 @@ private void do2DLayerUI_geoCore(int settingsIndex) comboBox_lDList_geoCore.SelectedIndexChanged += twoDLayerEventHandler_exp; comboBox_structureList_geoCore.SelectedIndexChanged += twoDLayerEventHandler_exp; - commonVars.getSimulationSettings().getDOESettings().setLayerAffected(settingsIndex, (bool)cB_DOE_geoCore.Checked ? 1 : 0); + commonVars.getSimulationSettings().getDOESettings().setLayerAffected(settingsIndex, (bool)cB_DOE_geoCore.Checked! ? 1 : 0); } private void do2DLayerUI_X(int settingsIndex) @@ -1127,10 +1127,10 @@ private void do2DLayerUI_X(int settingsIndex) maxVOffset: 1000000 ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); num_subshape3_hl.Value = 0; num_subshape3_vl.Value = 0; @@ -1138,13 +1138,13 @@ private void do2DLayerUI_X(int settingsIndex) num_subshape3_vo.Value = 0; const decimal minSS2VOffset = 1; - decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); + decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); - decimal minSS2HOffset = -(commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); + decimal minSS2HOffset = -(commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 1) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0)); const decimal maxSS2HOffset = -1; - decimal minSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) + 2 * 0.01m; - decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - 2 * 0.01m; + decimal minSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) + 2 * 0.01m; + decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - 2 * 0.01m; if (maxSS2VLength < 0) { maxSS2VLength = 0.02m; @@ -1160,15 +1160,15 @@ private void do2DLayerUI_X(int settingsIndex) maxVOffset: (double)maxSS2VOffset ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); num_subshape2_ho.Enabled = true; num_subshape2_vo.Enabled = true; @@ -1187,10 +1187,10 @@ private void do2DLayerUI_T(int settingsIndex) maxVOffset: 1000000 ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); num_subshape3_hl.Value = 0; num_subshape3_vl.Value = 0; @@ -1199,28 +1199,28 @@ private void do2DLayerUI_T(int settingsIndex) const decimal minSS2HLength = 0.01m; const decimal minSS2VLength = 0.02m; - decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - 2 * 0.01m; - decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); + decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - 2 * 0.01m; + decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); layer_clampSubShape2(minHLength: (double)minSS2HLength, maxHLength: 1000000, minVLength: (double)minSS2VLength, maxVLength: (double)maxSS2VLength, - minHOffset: (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength), - maxHOffset: (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength), + minHOffset: (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0), + maxHOffset: (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0), minVOffset: 1, maxVOffset: (double)maxSS2VOffset ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); num_subshape2_ho.Enabled = false; num_subshape2_vo.Enabled = true; @@ -1228,10 +1228,10 @@ private void do2DLayerUI_T(int settingsIndex) private void do2DLayerUI_L(int settingsIndex) { - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); num_subshape3_hl.Value = 0; num_subshape3_vl.Value = 0; @@ -1240,10 +1240,10 @@ private void do2DLayerUI_L(int settingsIndex) const decimal minSS2HLength = 0; const decimal minSS2VLength = 0; - decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength); + decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0); - decimal minSS2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); - decimal maxSS2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); + decimal minSS2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0); + decimal maxSS2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0); decimal minSS2VOffset = 0; decimal maxSS2VOffset = 0; @@ -1257,15 +1257,15 @@ private void do2DLayerUI_L(int settingsIndex) maxVOffset: (double)maxSS2VOffset ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); num_subshape2_ho.Enabled = false; num_subshape2_vo.Enabled = false; @@ -1284,10 +1284,10 @@ private void do2DLayerUI_U(int settingsIndex) maxVOffset: 1000000 ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); num_subshape3_hl.Value = 0; num_subshape3_vl.Value = 0; @@ -1296,11 +1296,11 @@ private void do2DLayerUI_U(int settingsIndex) const decimal minSS2HLength = 0.02m; const decimal minSS2VLength = 0.02m; - decimal maxSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) - 0.02m; - decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - 0.02m; + decimal maxSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) - 0.02m; + decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - 0.02m; - decimal ss2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) - 0.02m; - decimal ss2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); + decimal ss2HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 1) - 0.02m; + decimal ss2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); layer_clampSubShape2(minHLength: (double)minSS2HLength, maxHLength: (double)maxSS2HLength, @@ -1312,15 +1312,15 @@ private void do2DLayerUI_U(int settingsIndex) maxVOffset: (double)ss2VOffset ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); num_subshape2_ho.Enabled = true; num_subshape2_vo.Enabled = false; @@ -1339,18 +1339,18 @@ private void do2DLayerUI_S(int settingsIndex) maxVOffset: 1000000 ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(num_subshape_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(num_subshape_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(num_subshape_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(num_subshape_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape_hl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape_ho.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape_vl.Value), 0); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape_vo.Value), 0); const decimal minSS2HLength = 0.01m; - decimal maxSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) - 0.01m; + decimal maxSS2HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) - 0.01m; const decimal minSS2VLength = 0.02m; - decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - 0.01m; + decimal maxSS2VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - 0.01m; const decimal ss2HOffset = 0; const decimal minSS2VOffset = 0.01m; - decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); + decimal maxSS2VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); layer_clampSubShape2(minHLength: (double)minSS2HLength, maxHLength: (double)maxSS2HLength, minVLength: (double)minSS2VLength, @@ -1362,12 +1362,12 @@ private void do2DLayerUI_S(int settingsIndex) ); const decimal minSS3HLength = 0.01m; - decimal maxSS3HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) - 0.01m; + decimal maxSS3HLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) - 0.01m; const decimal minSS3VLength = 0.02m; - decimal maxSS3VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - 0.01m; - decimal ss3HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength); + decimal maxSS3VLength = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - 0.01m; + decimal ss3HOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 2); const decimal minSS3VOffset = 0.01m; - decimal maxSS3VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength); + decimal maxSS3VOffset = commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0) - commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 2); layer_clampSubShape3(minHLength: (double)minSS3HLength, maxHLength: (double)maxSS3HLength, minVLength: (double)minSS3VLength, @@ -1378,15 +1378,15 @@ private void do2DLayerUI_S(int settingsIndex) maxVOffset: (double)maxSS3VOffset ); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(num_subshape2_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(num_subshape2_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(num_subshape2_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(num_subshape2_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape2_hl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape2_vl.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape2_ho.Value), 1); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape2_vo.Value), 1); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(num_subshape3_hl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(num_subshape3_vl.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(num_subshape3_ho.Value)); - commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(num_subshape3_vo.Value)); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(num_subshape3_hl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(num_subshape3_vl.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(num_subshape3_ho.Value), 2); + commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(num_subshape3_vo.Value), 2); commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.shape2Tip, comboBox_tipLocations3.SelectedIndex); @@ -1409,7 +1409,7 @@ private void do2DLayerUI_litho(int settingsIndex, bool updateUI) commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.lwr2, Convert.ToDecimal(num_lithoLWR2.Value)); commonVars.getLayerSettings(settingsIndex).setDecimal(EntropyLayerSettings.properties_decimal.lwr2Freq, Convert.ToDecimal(num_lithoLWR2Freq.Value)); commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.lwr2Type, comboBox_LWR2NoiseType.SelectedIndex); - if ((bool)cB_layer_LWRPreview.Checked) + if ((bool)cB_layer_LWRPreview.Checked!) { commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.lwrPreview, 1); } @@ -1474,7 +1474,7 @@ private void do2DLayerUI_litho(int settingsIndex, bool updateUI) continue; } - if ((bool)cB_OLRX_Av[i].Checked) + if ((bool)cB_OLRX_Av[i].Checked!) { commonVars.getLayerSettings(settingsIndex).setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, i, 1); } @@ -1483,7 +1483,7 @@ private void do2DLayerUI_litho(int settingsIndex, bool updateUI) commonVars.getLayerSettings(settingsIndex).setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, i, 0); } - if ((bool)cB_layer_OLRY_Av[i].Checked) + if ((bool)cB_layer_OLRY_Av[i].Checked!) { commonVars.getLayerSettings(settingsIndex).setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, i, 1); } @@ -1625,7 +1625,7 @@ private void do2DLayerUI_litho(int settingsIndex, bool updateUI) commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.xOL_av, 0); } - if ((bool)cB_overlayYReference_Av.Checked) + if ((bool)cB_overlayYReference_Av.Checked!) { if (updateUI) { @@ -1786,7 +1786,7 @@ private void setOmitLayerCheckboxes_EnableStatus() private void showDrawn(int settingsIndex) { - bool showDrawn = (bool)cB_ShowDrawn.Checked; + bool showDrawn = (bool)cB_ShowDrawn.Checked!; commonVars.getLayerSettings(settingsIndex).setInt(EntropyLayerSettings.properties_i.showDrawn, showDrawn ? 1 : 0); doShowDrawn(settingsIndex); } @@ -1811,27 +1811,27 @@ private void updateGroupBoxVisibility(int layer) booleanGBVisible[layer] = false; if ( - commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.none && - commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.GEOCORE && - commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CommonVars.shapeNames.BOOLEAN + commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.none && + commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.GEOCORE && + commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) != (int)CentralProperties.shapeNames.BOOLEAN ) { subShapeGBVisible[layer] = true; } - if (commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { geoGBVisible[layer] = true; } - if (commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN) + if (commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN) { booleanGBVisible[layer] = true; } if (subShapeGBVisible[layer]) { - layerShapeProperties_tcPanel.Content = gB_subShapes; + layerShapeProperties_tcPanel.Content = expander_subShapes; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); comboBox_tipLocations.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shape0Tip); comboBox_tipLocations2.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shape1Tip); @@ -1839,7 +1839,7 @@ private void updateGroupBoxVisibility(int layer) } else if (geoGBVisible[layer]) { - layerShapeProperties_tcPanel.Content = gB_layer_geoCore; + layerShapeProperties_tcPanel.Content = expander_layer_geoCore; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); comboBox_tipLocations_geoCore.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shape0Tip); comboBox_polyFill_geoCore.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.fill); @@ -1863,7 +1863,7 @@ private void updateGroupBoxVisibility(int layer) } else if (booleanGBVisible[layer]) { - layerShapeProperties_tcPanel.Content = gB_layerBoolean; + layerShapeProperties_tcPanel.Content = expander_layerBoolean; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); comboBox_TipLocations_boolean.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.shape0Tip); comboBox_BooleanOpA.SelectedIndex = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.bLayerOpA); diff --git a/Common/Variance/UI/layerUI_setup.cs b/Common/Variance/UI/layerUI_setup.cs index 2e30c15..0e16b31 100644 --- a/Common/Variance/UI/layerUI_setup.cs +++ b/Common/Variance/UI/layerUI_setup.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Eto.Forms; +using shapeEngine; namespace Variance; @@ -8,6 +9,8 @@ public partial class MainForm { private TableLayout layerProperties_tl; private TableCell layerProperties_tc; + private GroupBox gadgets_gb; + private Expander gadgets_exp, expander_gadgets; private void twoD_LayerUISetup() { @@ -104,6 +107,16 @@ private void twoD_LayerUISetup_exp() layerUI_topRow_setup(tl_toprow); + tl.Rows.Add(new TableRow()); + TableCell row2TC = new(); + tl.Rows[^1].Cells.Add(row2TC); + + TableLayout tl_2row = new(); + Panel tl_2panel = new() { Content = tl_2row }; + row2TC.Control = tl_2panel; + + layerUI_row2_setup(tl_2row); + // Need to inject another table here for the LOP content. tl.Rows.Add(new TableRow()); @@ -141,20 +154,6 @@ private void twoD_LayerUISetup_exp() tl.Rows[^1].Cells.Add(lithoTC); twoD_LayerUISetup_litho(lithoTC); - // Button export - tl.Rows.Add(new TableRow()); - TableCell exportTC = new(); - tl.Rows[^1].Cells.Add(exportTC); - - TableLayout exportTL = new(); - Panel pExportTL = new() {Content = exportTL}; - exportTC.Control = pExportTL; - exportTL.Rows.Add(new TableRow()); - - Button exportToLayout = new() {Text = "Export to Layout"}; - exportTL.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(exportToLayout) }); - exportToLayout.Click += exportActiveLayerToLayout; - tl.Rows[^1].Cells.Add(new TableCell { Control = null, ScaleWidth = true }); // padding. }); } @@ -170,13 +169,13 @@ private void set_ui_from_settings(int settingsIndex) geoGBVisible[settingsIndex] = false; booleanGBVisible[settingsIndex] = false; - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN) { booleanGBVisible[settingsIndex] = true; subShapeGBVisible[settingsIndex] = false; } - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { geoGBVisible[settingsIndex] = true; subShapeGBVisible[settingsIndex] = false; @@ -230,18 +229,18 @@ private void set_ui_from_settings(int settingsIndex) } cB_omit[settingsIndex].Checked = commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.omit) == 1; cB_ShowDrawn.Checked = commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.showDrawn) == 1; - num_subshape_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); - num_subshape_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength); - num_subshape_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset); - num_subshape_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset); - num_subshape2_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength); - num_subshape2_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); - num_subshape2_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset); - num_subshape2_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset); - num_subshape3_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength); - num_subshape3_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength); - num_subshape3_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset); - num_subshape3_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset); + num_subshape_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0); + num_subshape_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0); + num_subshape_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0); + num_subshape_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0); + num_subshape2_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 1); + num_subshape2_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); + num_subshape2_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 1); + num_subshape2_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 1); + num_subshape3_hl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horLength, 2); + num_subshape3_vl.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verLength, 2); + num_subshape3_ho.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 2); + num_subshape3_vo.Value = (double)commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 2); try { comboBox_layerShape.SelectedIndex = commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex); @@ -267,7 +266,7 @@ private void set_ui_from_settings(int settingsIndex) // Layout handling textBox_fileLocation_geoCore.Text = commonVars.getLayerSettings(settingsIndex).getString(EntropyLayerSettings.properties_s.file); - if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { if (commonVars.isCopyPrepped()) { @@ -474,23 +473,32 @@ private void setLayerPropertiesContent(ref Panel _control) private void layerUI_topRow_setup(TableLayout tl) { - layerShapeProperties = new Panel(); - layerShapeProperties_tcPanel = new Panel(); - tl.Rows.Add(new TableRow()); TableCell tc0 = new(); - tl.Rows[0].Cells.Add(tc0); + tl.Rows[^1].Cells.Add(tc0); layerGadgets_setup(tc0); + tl.Rows[^1].Cells.Add(new TableCell() {ScaleWidth = true}); + } + + private void layerUI_row2_setup(TableLayout tl) + { + layerShapeProperties = new Panel(); + layerShapeProperties_tcPanel = new Panel(); + TableCell tc1 = new(); - tl.Rows[0].Cells.Add(tc1); + tl.Rows.Add(new TableRow()); + + tl.Rows[^1].Cells.Add(tc1); + + tl.Rows[^1].Cells.Add(new TableCell() {ScaleWidth = true}); layerProperties_tl = new TableLayout(); layerProperties_tc = new TableCell(); layerProperties_tl.Rows.Add(new TableRow()); - layerProperties_tl.Rows[0].Cells.Add(layerProperties_tc); + layerProperties_tl.Rows[^1].Cells.Add(layerProperties_tc); layerShapeProperties.Content = layerProperties_tl; @@ -510,12 +518,12 @@ private void layerGadgets_setup(TableCell tc) layerGadgets_table.Rows.Add(new TableRow()); layerGadgets_row1(layerGadgets_table); - layerGadgets_row2(layerGadgets_table); layerGadgets_table.Rows.Add(new TableRow()); - GroupBox gadgets_gb = new() {Text = "Layer", Content = TableLayout.AutoSized(layerGadgets_table)}; - tc.Control = gadgets_gb; + gadgets_gb = new() {Content = TableLayout.AutoSized(layerGadgets_table)}; + gadgets_exp = new() {Header = "Layer", Content = gadgets_gb, Expanded = true }; + tc.Control = gadgets_exp; } private void layerGadgets_row1(TableLayout layerGadgets_table) @@ -527,12 +535,12 @@ private void layerGadgets_row1(TableLayout layerGadgets_table) // Table layout within row 1 TableLayout row0_tl = new(); - gadgets_tr0.Cells[0].Control = row0_tl; + gadgets_tr0.Cells[^1].Control = row0_tl; row0_tl.Rows.Add(new TableRow()); // Table layout within cell. TableCell gadgets_tr0_0 = new(); - row0_tl.Rows[0].Cells.Add(gadgets_tr0_0); + row0_tl.Rows[^1].Cells.Add(gadgets_tr0_0); TableLayout gadgets_tr0_0_tl = new(); gadgets_tr0_0.Control = gadgets_tr0_0_tl; @@ -540,42 +548,22 @@ private void layerGadgets_row1(TableLayout layerGadgets_table) gadgets_tr0_0_tl.Rows.Add(new TableRow()); cB_Layer = new CheckBox {Text = "Enabled", ToolTip = "If checked, include the layer in the simulation"}; - gadgets_tr0_0_tl.Rows[0].Cells.Add(new TableCell { Control = cB_Layer }); + gadgets_tr0_0_tl.Rows[^1].Cells.Add(new TableCell { Control = cB_Layer }); text_layerName = new TextBox {ToolTip = "Layer name. If blank, the layer number will be used"}; - gadgets_tr0_0_tl.Rows[0].Cells.Add(new TableCell { Control = text_layerName }); - gadgets_tr0_0_tl.Rows[0].Cells[^1].ScaleWidth = true; - } - - private void layerGadgets_row2(TableLayout layerGadgets_table) - { - // Outer table, row 2 - TableRow gadgets_tr1 = new(); - layerGadgets_table.Rows.Add(gadgets_tr1); - gadgets_tr1.Cells.Add(new TableCell()); - - // Table layout within row 2 - TableLayout row1_tl = new(); - gadgets_tr1.Cells[0].Control = row1_tl; - row1_tl.Rows.Add(new TableRow()); - - // Table layout within cell. - TableCell gadgets_tr1_0 = new(); - row1_tl.Rows[0].Cells.Add(gadgets_tr1_0); - - TableLayout gadgets_tr1_0_tl = new(); - gadgets_tr1_0.Control = gadgets_tr1_0_tl; - - gadgets_tr1_0_tl.Rows.Add(new TableRow()); + gadgets_tr0_0_tl.Rows[^1].Cells.Add(new TableCell { Control = text_layerName }); comboBox_layerShape = new DropDown { DataContext = DataContext, SelectedIndex = 0, ToolTip = "Type of shape to generate" }; comboBox_layerShape.BindDataContext(c => c.DataStore, (UIStringLists m) => m.shapes); - gadgets_tr1_0_tl.Rows[0].Cells.Add(new TableCell { Control = comboBox_layerShape }); - } + gadgets_tr0_0_tl.Rows[^1].Cells.Add(new TableCell { Control = comboBox_layerShape }); + gadgets_tr0_0_tl.Rows[^1].Cells[^1].ScaleWidth = true; + gadgets_tr0.Cells.Add(new TableCell() {ScaleWidth = true}); + } + private void layerGadgets2(TableCell tc) { TableLayout layerGadgets2_table = new(); @@ -584,8 +572,14 @@ private void layerGadgets2(TableCell tc) layerGadgets2_row1(layerGadgets2_table); Panel p = new() {Content = layerGadgets2_table}; - GroupBox gadgets_gb = new() {Text = "Misc", Content = p}; - tc.Control = gadgets_gb; + gadgets_gb = new() {Content = p}; + expander_gadgets = new() + { + Header = "Misc", + Content = gadgets_gb, + Expanded = true + }; + tc.Control = expander_gadgets; } private void layerGadgets2_row1(TableLayout layerGadgets2_table) @@ -642,5 +636,12 @@ private void layerGadgets2_row1(TableLayout layerGadgets2_table) cB_layer_LWRPreview = new CheckBox {Text = "Show LWR", ToolTip = "Preview of LWR"}; gadgets_tr1_0_tl.Rows[^1].Cells.Add(new TableCell { Control = cB_layer_LWRPreview }); + + gadgets_tr1_0_tl.Rows.Add(new TableRow()); + + Button exportToLayout = new() {Text = "Export to Layout"}; + gadgets_tr1_0_tl.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(exportToLayout) }); + exportToLayout.Click += exportActiveLayerToLayout; + } } \ No newline at end of file diff --git a/Common/Variance/UI/layerUI_setup_bias.cs b/Common/Variance/UI/layerUI_setup_bias.cs index f223182..d2ed251 100644 --- a/Common/Variance/UI/layerUI_setup_bias.cs +++ b/Common/Variance/UI/layerUI_setup_bias.cs @@ -6,7 +6,8 @@ namespace Variance; public partial class MainForm { // 2D Layer Bias Etch - private GroupBox groupBox_etchandbias, groupBox_etchandbias_reg, groupBox_etchandbias_prox; + private Expander expander_etchandbias, expander_etchandbias_reg, expander_etchandbias_prox; + private GroupBox groupBox_etchandbias , groupBox_etchandbias_reg, groupBox_etchandbias_prox; private NumericStepper num_sidebias, num_hTipbias, num_vTipbias, num_hTipNVar, num_vTipNVar, num_hTipPVar, num_vTipPVar, num_pitchDepBias, num_pitchDepBiasIsoDistance, num_pitchDepBiasSideRays, num_proxBiasFallOffMultiplier; @@ -16,19 +17,32 @@ public partial class MainForm private DropDown comboBox_proxBiasFallOff; + private void twoD_LayerUISetup_biasEtch_expanders(bool toState) + { + expander_etchandbias.Expanded = toState; + expander_etchandbias_reg.Expanded = toState; + expander_etchandbias_prox.Expanded = toState; + } + private void twoD_LayerUISetup_biasEtch(TableCell tc) { Application.Instance.Invoke(() => { TableLayout groupBox_layer_etchandbias_table = new(); - groupBox_etchandbias = new GroupBox + groupBox_etchandbias = new GroupBox() { - Text = "Bias and Etch Parameters", Content = groupBox_layer_etchandbias_table + Content = groupBox_layer_etchandbias_table + }; + expander_etchandbias = new() + { + Header = "Bias and Etch Parameters", + Content = groupBox_etchandbias, + Expanded = true }; TableLayout t = new(); t.Rows.Add(new TableRow()); - t.Rows[0].Cells.Add(new TableCell { Control = groupBox_etchandbias }); + t.Rows[0].Cells.Add(new TableCell { Control = expander_etchandbias }); t.Rows[0].Cells.Add(new TableCell { Control = new Panel(), ScaleWidth = true }); Panel p = new() {Content = t}; @@ -43,10 +57,19 @@ private void twoD_LayerUISetup_biasEtch(TableCell tc) private void bias_row1(TableLayout etchandbias_table) { TableLayout regBias_table = new(); - groupBox_etchandbias_reg = new GroupBox {Text = "Regular", Content = regBias_table}; + groupBox_etchandbias_reg = new () + { + Content = regBias_table + }; + expander_etchandbias_reg = new () + { + Header = "Regular", + Content = groupBox_etchandbias_reg, + Expanded = true + }; TableRow tr = new(); etchandbias_table.Rows.Add(tr); - tr.Cells.Add(new TableCell { Control = groupBox_etchandbias_reg }); + tr.Cells.Add(new TableCell { Control = expander_etchandbias_reg }); tr.Cells.Add(new TableCell { Control = null }); // Outer table, row 1 @@ -114,7 +137,7 @@ private void bias_row1_2(TableLayout outerTable) setSize(num_hTipbias, 55); nestedTable.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(num_hTipbias) }); - lbl_hTipPVar = new Label {Text = "Var +", ToolTip = "Positive 3-sigma bias variation for left/right tips."}; + lbl_hTipPVar = new Label {Text = "Variation: +", ToolTip = "Positive 3-sigma bias variation for left/right tips."}; lbl_hTipPVar.MouseDoubleClick += hTipPVar_RNG; nestedTable.Rows[^1].Cells.Add(new TableCell { Control = lbl_hTipPVar }); @@ -162,7 +185,7 @@ private void bias_row1_2(TableLayout outerTable) setSize(num_vTipbias, 55); nestedTable.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(num_vTipbias) }); - lbl_vTipPVar = new Label {Text = "Var +", ToolTip = "Positive 3-sigma bias variation for top/bottom tips."}; + lbl_vTipPVar = new Label {Text = "Variation: +", ToolTip = "Positive 3-sigma bias variation for top/bottom tips."}; lbl_vTipPVar.MouseDoubleClick += vTipPVar_RNG; nestedTable.Rows[^1].Cells.Add(new TableCell { Control = lbl_vTipPVar }); @@ -196,10 +219,16 @@ private void bias_row1_2(TableLayout outerTable) private void bias_row2(TableLayout etchandbias_table) { TableLayout proxBias_table = new(); - groupBox_etchandbias_prox = new GroupBox {Text = "Proximity", Content = proxBias_table}; + groupBox_etchandbias_prox = new () {Content = proxBias_table}; + expander_etchandbias_prox = new() + { + Header = "Proximity", + Content = groupBox_etchandbias_prox, + Expanded = commonVars.getExpandedUI() + }; TableRow tr = new(); etchandbias_table.Rows.Add(tr); - tr.Cells.Add(new TableCell { Control = groupBox_etchandbias_prox }); + tr.Cells.Add(new TableCell { Control = expander_etchandbias_prox }); tr.Cells.Add(new TableCell { Control = null }); // Outer table, row 2 diff --git a/Common/Variance/UI/layerUI_setup_boolean.cs b/Common/Variance/UI/layerUI_setup_boolean.cs index 13af545..fe4d1dc 100644 --- a/Common/Variance/UI/layerUI_setup_boolean.cs +++ b/Common/Variance/UI/layerUI_setup_boolean.cs @@ -5,25 +5,35 @@ namespace Variance; public partial class MainForm { // 2D Layer Boolean + private Expander expander_layerBoolean; private GroupBox gB_layerBoolean; private DropDown comboBox_BooleanOpAB, comboBox_BooleanOpA, comboBox_BooleanOpB, comboBox_TipLocations_boolean; private RadioButton[] rB_BooleanA, rB_BooleanB; private Label lbl_TipLocations_boolean, lbl_rayExtension; private NumericStepper num_rayExtension; + private void twoD_LayerUISetup_boolean_expanders(bool toState) + { + expander_layerBoolean.Expanded = toState; + } + private void twoD_LayerUISetup_boolean() { Application.Instance.Invoke(() => { TableLayout groupBox_layerBoolean_table = new(); - gB_layerBoolean = new GroupBox {Content = groupBox_layerBoolean_table, Text = "Boolean"}; + gB_layerBoolean = new() {Content = groupBox_layerBoolean_table}; + expander_layerBoolean = new () {Content = gB_layerBoolean, + Header = "Boolean", + Expanded = true + }; rB_BooleanA = new RadioButton[CentralProperties.maxLayersForMC]; rB_BooleanB = new RadioButton[CentralProperties.maxLayersForMC]; boolean_table(groupBox_layerBoolean_table); - layerShapeProperties_tcPanel.Content = gB_layerBoolean; + layerShapeProperties_tcPanel.Content = expander_layerBoolean; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); }); diff --git a/Common/Variance/UI/layerUI_setup_geocore.cs b/Common/Variance/UI/layerUI_setup_geocore.cs index fc310b8..e3adabc 100644 --- a/Common/Variance/UI/layerUI_setup_geocore.cs +++ b/Common/Variance/UI/layerUI_setup_geocore.cs @@ -5,7 +5,7 @@ namespace Variance; public partial class MainForm { // 2D Layer GeoCore - private GroupBox gB_layer_lithography; + private Expander expander_layer_geoCore; private GroupBox gB_layer_geoCore; private Button btn_chooseFile_geoCore, btn_globalApply_geoCore; private DropDown comboBox_lDList_geoCore, comboBox_structureList_geoCore, comboBox_polyFill_geoCore, comboBox_tipLocations_geoCore; @@ -16,16 +16,25 @@ public partial class MainForm private NumericStepper num_geoCore_keyHoleSizing; private Label lbl_geoCore_keyHoleSizing; + private void twoD_LayerUISetup_geoCore_expanders(bool toState) + { + expander_layer_geoCore.Expanded = toState; + } + private void twoD_LayerUISetup_geoCore() { Application.Instance.Invoke(() => { TableLayout geoCore_table = new(); - gB_layer_geoCore = new GroupBox {Content = geoCore_table, Text = "Layout Controls"}; + gB_layer_geoCore = new () {Content = geoCore_table}; + expander_layer_geoCore = new () {Content = gB_layer_geoCore, + Header = "Layout Controls", + Expanded = true + }; geocore_table(geoCore_table); - layerShapeProperties_tcPanel.Content = gB_layer_geoCore; + layerShapeProperties_tcPanel.Content = expander_layer_geoCore; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); }); diff --git a/Common/Variance/UI/layerUI_setup_litho.cs b/Common/Variance/UI/layerUI_setup_litho.cs index f09a1b3..77a0889 100644 --- a/Common/Variance/UI/layerUI_setup_litho.cs +++ b/Common/Variance/UI/layerUI_setup_litho.cs @@ -4,6 +4,9 @@ namespace Variance; public partial class MainForm { + private GroupBox gB_layer_lithography; + private Expander expander_lithography, expander_overlay, expander_overlayX, expander_overlayY, expander_rounding, expander_lwr, expander_LWR, expander_LWR2, expander_cdu, expander_SCDU, expander_TCDU, expander_litmisc; + // 2D Layer Litho private NumericStepper num_lithoICRR, num_lithoOCRR, num_lithoCDUSide, num_lithoHorOverlay, num_lithoVerOverlay, num_lithoICV, num_lithoOCV, num_lithoCDUTips, num_lithoLWR, num_lithoLWRFreq, num_lithoLWR2, num_lithoLWR2Freq, num_lithoWobble, num_coeff1, num_coeff2; @@ -28,16 +31,36 @@ public partial class MainForm private Panel pnl_overlayRefX, pnl_overlayRefY; + private void twoD_LayerUISetup_litho_expanders(bool toState) + { + expander_lithography.Expanded = toState; + expander_overlay.Expanded = toState; + expander_overlayX.Expanded = toState; + expander_overlayY.Expanded = toState; + expander_rounding.Expanded = toState; + expander_lwr.Expanded = toState; + expander_LWR.Expanded = toState; + expander_LWR2.Expanded = toState; + expander_cdu.Expanded = toState; + expander_SCDU.Expanded = toState; + expander_TCDU.Expanded = toState; + expander_litmisc.Expanded = toState; + } + private void twoD_LayerUISetup_litho(TableCell tc) { Application.Instance.Invoke(() => { TableLayout lithography_table = new(); - gB_layer_lithography = new GroupBox {Text = "Lithography Parameters", Content = lithography_table}; + gB_layer_lithography = new GroupBox {Content = lithography_table}; + expander_lithography = new() {Header = "Lithography Parameters", + Content = gB_layer_lithography, + Expanded = true + }; TableLayout t = new(); t.Rows.Add(new TableRow()); - t.Rows[^1].Cells.Add(new TableCell { Control = gB_layer_lithography }); + t.Rows[^1].Cells.Add(new TableCell { Control = expander_lithography }); t.Rows[^1].Cells.Add(new TableCell { Control = new Panel(), ScaleWidth = true }); Panel p = new() {Content = t}; @@ -45,11 +68,8 @@ private void twoD_LayerUISetup_litho(TableCell tc) litho_icr_ocr(lithography_table); litho_lwr(lithography_table); - litho_lwr2(lithography_table); - litho_scdu(lithography_table); - litho_tcdu(lithography_table); - litho_xol(lithography_table); - litho_yol(lithography_table); + litho_cdu(lithography_table); + litho_ol(lithography_table); }); } @@ -73,9 +93,15 @@ private void litho_icr_ocr(TableLayout lithography_table) lithography_table.Rows[^1].Cells.Add(new TableCell { Control = outer }); - GroupBox groupBox_rounding = new() {Text = "Rounding"}; + GroupBox groupBox_rounding = new(); + expander_rounding = new() + { + Header = "Rounding", + Content = groupBox_rounding, + Expanded = commonVars.getExpandedUI() + }; // Table layout within cell. - TableCell leftCol_tc = new() {Control = groupBox_rounding}; + TableCell leftCol_tc = new() {Control = expander_rounding}; tl_leftCol.Rows[^1].Cells.Add(leftCol_tc); /* @@ -97,9 +123,15 @@ private void litho_icr_ocr(TableLayout lithography_table) }; */ - groupBox_misc = new GroupBox {Text = "Misc"}; + groupBox_misc = new GroupBox(); + expander_litmisc = new() + { + Header = "Misc", + Content = groupBox_misc, + Expanded = commonVars.getExpandedUI() + }; - TableCell rightCol_tc = new() {Control = groupBox_misc}; + TableCell rightCol_tc = new() {Control = expander_litmisc}; tl_rightCol.Rows[^1].Cells.Add(rightCol_tc); @@ -132,7 +164,7 @@ private void litho_icr_ocr(TableLayout lithography_table) lbl_lithoICV = new Label { - Text = "Var", ToolTip = "3-sigma inner vertex (concave) corner rounding radius variation." + Text = "Variation", ToolTip = "3-sigma inner vertex (concave) corner rounding radius variation." }; lbl_lithoICV.MouseDoubleClick += ICV_RNG; rounding_table.Rows[^1].Cells.Add(new TableCell()); @@ -171,7 +203,7 @@ private void litho_icr_ocr(TableLayout lithography_table) lbl_lithoOCV = new Label { - Text = "Var", ToolTip = "3-sigma outer vertex (concave) corner rounding radius variation." + Text = "Variation", ToolTip = "3-sigma outer vertex (concave) corner rounding radius variation." }; lbl_lithoOCV.MouseDoubleClick += OCV_RNG; rounding_table.Rows[^1].Cells.Add(new TableCell()); @@ -254,6 +286,25 @@ private void litho_icr_ocr(TableLayout lithography_table) } private void litho_lwr(TableLayout lithography_table) + { + TableLayout outer_tl = new(); + Panel outer = new() {Content = outer_tl}; + GroupBox outer_gb = new() {Content = outer}; + expander_lwr = new() + { + Header = "Line Width Roughness (LWR)", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; + outer_tl.Rows.Add(new TableRow()); + lithography_table.Rows.Add(new TableRow()); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_lwr }); + + litho_lwr1(outer_tl); + litho_lwr2(outer_tl); + } + + private void litho_lwr1(TableLayout lithography_table) { TableRow lit_lwr = new(); lithography_table.Rows.Add(lit_lwr); @@ -262,9 +313,15 @@ private void litho_lwr(TableLayout lithography_table) tl.Rows.Add(new TableRow()); Panel outer = new() {Content = tl}; - GroupBox outer_gb = new() {Text = "LWR", Content = outer}; + GroupBox outer_gb = new() {Content = outer}; + expander_LWR = new() + { + Header = "Line Width Roughess (LWR)", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; - lit_lwr.Cells.Add(new TableCell { Control = outer_gb }); + lit_lwr.Cells.Add(new TableCell { Control = expander_LWR }); TableLayout left_tl = new(); left_tl.Rows.Add(new TableRow()); @@ -300,7 +357,7 @@ private void litho_lwr(TableLayout lithography_table) setSize(num_lithoLWR, 55); upper_tl.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(num_lithoLWR) }); - lbl_lithoLWRFreq = new Label {Text = "Freq", ToolTip = "Frequency of LWR"}; + lbl_lithoLWRFreq = new Label {Text = "Frequency", ToolTip = "Frequency of LWR"}; upper_tl.Rows[^1].Cells.Add(new TableCell { Control = lbl_lithoLWRFreq }); num_lithoLWRFreq = new NumericStepper @@ -359,9 +416,15 @@ private void litho_lwr2(TableLayout lithography_table) tl.Rows.Add(new TableRow()); Panel outer = new() {Content = tl}; - GroupBox outer_gb = new() {Content = outer, Text = "LWR2"}; + GroupBox outer_gb = new() {Content = outer}; + expander_LWR2 = new() + { + Content = outer_gb, + Header = "Line Width Roughess (LWR) 2", + Expanded = commonVars.getExpandedUI() + }; - lit_lwr.Cells.Add(new TableCell { Control = outer_gb }); + lit_lwr.Cells.Add(new TableCell { Control = expander_LWR2 }); TableLayout left_tl = new(); left_tl.Rows.Add(new TableRow()); @@ -397,7 +460,7 @@ private void litho_lwr2(TableLayout lithography_table) setSize(num_lithoLWR2, 55); upper_tl.Rows[^1].Cells.Add(new TableCell { Control = TableLayout.AutoSized(num_lithoLWR2) }); - lbl_lithoLWR2Freq = new Label {Text = "Freq", ToolTip = "Frequency of LWR"}; + lbl_lithoLWR2Freq = new Label {Text = "Frequency", ToolTip = "Frequency of LWR"}; upper_tl.Rows[^1].Cells.Add(new TableCell { Control = lbl_lithoLWR2Freq }); num_lithoLWR2Freq = new NumericStepper @@ -445,13 +508,38 @@ private void litho_lwr2(TableLayout lithography_table) } } + private void litho_cdu(TableLayout lithography_table) + { + TableLayout outer_tl = new(); + Panel outer = new() {Content = outer_tl}; + GroupBox outer_gb = new() {Content = outer}; + expander_cdu = new() + { + Header = "Critical Dimension Uniformity (CDU)", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; + outer_tl.Rows.Add(new TableRow()); + lithography_table.Rows.Add(new TableRow()); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_cdu }); + + litho_scdu(outer_tl); + litho_tcdu(outer_tl); + } + // SCDU private void litho_scdu(TableLayout lithography_table) { TableLayout outer_tl = new(); Panel outer = new() {Content = outer_tl}; - GroupBox outer_gb = new() {Text = "Side CDU", Content = outer}; + GroupBox outer_gb = new() {Content = outer}; + expander_SCDU = new() + { + Header = "Side CD Uniformity", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; TableLayout tc_tl = new(); outer_tl.Rows.Add(new TableRow()); @@ -460,7 +548,7 @@ private void litho_scdu(TableLayout lithography_table) // Outer table, row 1 lithography_table.Rows.Add(new TableRow()); - lithography_table.Rows[^1].Cells.Add(new TableCell { Control = outer_gb }); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_SCDU }); // Table layout within cell. TableCell tc_0 = new(); @@ -535,7 +623,13 @@ private void litho_tcdu(TableLayout lithography_table) TableLayout outer_tl = new(); Panel outer = new() {Content = outer_tl}; - GroupBox outer_gb = new() {Text = "Tips CDU", Content = outer}; + GroupBox outer_gb = new() {Content = outer}; + expander_TCDU = new() + { + Header = "Tips CD Uniformity", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; TableLayout tc_tl = new(); outer_tl.Rows.Add(new TableRow()); outer_tl.Rows[0].Cells.Add(new TableCell { Control = tc_tl }); @@ -543,7 +637,7 @@ private void litho_tcdu(TableLayout lithography_table) // Outer table, row 1 lithography_table.Rows.Add(new TableRow()); - lithography_table.Rows[^1].Cells.Add(new TableCell { Control = outer_gb }); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_TCDU }); // Table layout within cell. TableCell tc_0 = new(); @@ -610,11 +704,36 @@ private void litho_tcdu(TableLayout lithography_table) } // XOL, XOLR, XCOL + + private void litho_ol(TableLayout lithography_table) + { + TableLayout outer_tl = new(); + Panel outer = new() {Content = outer_tl}; + GroupBox outer_gb = new() {Content = outer}; + expander_overlay = new() + { + Header = "Overlay", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; + outer_tl.Rows.Add(new TableRow()); + lithography_table.Rows.Add(new TableRow()); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_overlay }); + + litho_xol(outer_tl); + litho_yol(outer_tl); + } private void litho_xol(TableLayout lithography_table) { TableLayout outer_tl = new(); Panel outer = new() {Content = outer_tl}; - GroupBox outer_gb = new() {Text = "Horizontal Overlay", Content = outer}; + GroupBox outer_gb = new() {Content = outer}; + expander_overlayX = new() + { + Header = "Horizontal Overlay", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; outer_tl.Rows.Add(new TableRow()); TableLayout left_tl = new(); @@ -634,7 +753,7 @@ private void litho_xol(TableLayout lithography_table) // Outer table, row 1 lithography_table.Rows.Add(new TableRow()); - lithography_table.Rows[^1].Cells.Add(new TableCell { Control = outer_gb }); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_overlayX }); // Table layout within cell. TableCell sigma_tc = new(); @@ -769,7 +888,13 @@ private void litho_yol(TableLayout lithography_table) { TableLayout outer_tl = new(); Panel outer = new() {Content = outer_tl}; - GroupBox outer_gb = new() {Text = "Vertical Overlay", Content = outer}; + GroupBox outer_gb = new() {Content = outer}; + expander_overlayY = new() + { + Header = "Vertical Overlay", + Content = outer_gb, + Expanded = commonVars.getExpandedUI() + }; outer_tl.Rows.Add(new TableRow()); TableLayout left_tl = new(); @@ -789,7 +914,7 @@ private void litho_yol(TableLayout lithography_table) // Outer table, row 1 lithography_table.Rows.Add(new TableRow()); - lithography_table.Rows[^1].Cells.Add(new TableCell { Control = outer_gb }); + lithography_table.Rows[^1].Cells.Add(new TableCell { Control = expander_overlayY }); // Table layout within cell. TableCell sigma_tc = new(); diff --git a/Common/Variance/UI/layerUI_setup_lop.cs b/Common/Variance/UI/layerUI_setup_lop.cs index 05defcb..6f15860 100644 --- a/Common/Variance/UI/layerUI_setup_lop.cs +++ b/Common/Variance/UI/layerUI_setup_lop.cs @@ -1,25 +1,36 @@ using Eto.Forms; +using shapeEngine; namespace Variance; public partial class MainForm { // 2D Layer Layout Origin Parameters + private Expander expander_LOP; private GroupBox groupBox_LOP; private DropDown comboBox_subShapeRef, comboBox_posSubShape; private Label lbl_subShapeRef, lbl_globalHorOffset, lbl_globalVerOffset, lbl_rotation, lbl_posSubShape; private NumericStepper num_globalHorOffset, num_globalVerOffset, num_rotation; + private void twoD_LayerUISetup_layoutOriginParameters_expanders(bool toState) + { + expander_LOP.Expanded = toState; + } + private void twoD_LayerUISetup_layoutOriginParameters(TableCell tc) { Application.Instance.Invoke(() => { TableLayout groupBox_layer_LOP_table = new(); - groupBox_LOP = new GroupBox {Text = "Layout Origin Parameters", Content = groupBox_layer_LOP_table}; + groupBox_LOP = new() {Content = groupBox_layer_LOP_table}; + expander_LOP = new () {Header = "Layout Origin Parameters", + Content = groupBox_LOP, + Expanded = true + }; TableLayout t = new(); t.Rows.Add(new TableRow()); - t.Rows[0].Cells.Add(new TableCell { Control = groupBox_LOP }); + t.Rows[0].Cells.Add(new TableCell { Control = expander_LOP }); t.Rows[0].Cells.Add(new TableCell { Control = new Panel(), ScaleWidth = true }); Panel p = new() {Content = t}; @@ -81,7 +92,7 @@ private void lop_row1(TableLayout LOP_table) comboBox_posSubShape = new DropDown { DataContext = DataContext, - SelectedIndex = (int) CommonVars.subShapeLocations.BL, + SelectedIndex = (int) ShapeSettings.subShapeLocations.BL, ToolTip = "Which element of the subshape to use for placement with respect to the world origin" }; comboBox_posSubShape.BindDataContext(c => c.DataStore, (UIStringLists m) => m.subShapePos); @@ -112,7 +123,7 @@ private void lop_row2(TableLayout LOP_table) lbl_globalHorOffset = new Label { - Text = "Global Hor Offset", Width = 120, ToolTip = "Horizontal offset from the world origin" + Text = "Global Horizontal Offset", ToolTip = "Horizontal offset from the world origin" }; tl_0.Rows[^1].Cells.Add(new TableCell { Control = lbl_globalHorOffset }); @@ -123,7 +134,7 @@ private void lop_row2(TableLayout LOP_table) lbl_globalVerOffset = new Label { - Text = "Global Ver Offset", Width = 120, ToolTip = "Horizontal offset from the world origin" + Text = "Global Vertical Offset", ToolTip = "Horizontal offset from the world origin" }; tl_0.Rows[^1].Cells.Add(new TableCell { Control = lbl_globalVerOffset }); diff --git a/Common/Variance/UI/layerUI_setup_subshape.cs b/Common/Variance/UI/layerUI_setup_subshape.cs index e88d5b6..d028d59 100644 --- a/Common/Variance/UI/layerUI_setup_subshape.cs +++ b/Common/Variance/UI/layerUI_setup_subshape.cs @@ -5,7 +5,8 @@ namespace Variance; public partial class MainForm { // 2D Layer Shapes - private GroupBox gB_subShapes; + private Expander expander_subShapes; + private GroupBox groupBox_subShapes; private NumericStepper num_subshape_hl, num_subshape2_hl, num_subshape3_hl, num_subshape_ho, num_subshape2_ho, num_subshape3_ho, @@ -15,19 +16,27 @@ public partial class MainForm private Label lbl_subshape_hl, lbl_subshape_ho, lbl_subshape_vl, lbl_subshape_vo, lbl_tipLocations; private DropDown comboBox_tipLocations, comboBox_tipLocations2, comboBox_tipLocations3; + private void twoD_LayerUISetup_subShape_expanders(bool toState) + { + expander_subShapes.Expanded = toState; + } + private void twoD_LayerUISetup_subShape() { Application.Instance.Invoke(() => { TableLayout groupBox_layerSubShapes_table = new(); - gB_subShapes = new GroupBox + groupBox_subShapes = new() {Content = TableLayout.AutoSized(groupBox_layerSubShapes_table)}; + expander_subShapes = new () { - Content = TableLayout.AutoSized(groupBox_layerSubShapes_table), Text = "SubShapes" + Content = groupBox_subShapes, + Header = "SubShapes", + Expanded = true }; subshapes_row1(groupBox_layerSubShapes_table); - layerShapeProperties_tcPanel.Content = gB_subShapes; + layerShapeProperties_tcPanel.Content = expander_subShapes; setLayerPropertiesContent(ref layerShapeProperties_tcPanel); }); diff --git a/Common/Variance/UI/paSearchUI.cs b/Common/Variance/UI/paSearchUI.cs index b818a26..6e37eaf 100644 --- a/Common/Variance/UI/paSearchUI.cs +++ b/Common/Variance/UI/paSearchUI.cs @@ -240,7 +240,7 @@ private void updatePASearchUI(int layer) { cb_searchPA[layer, i].Checked = false; } - num_searchPA_UpperLimit[layer, i].Enabled = (bool)cb_searchPA[layer, i].Checked; + num_searchPA_UpperLimit[layer, i].Enabled = (bool)cb_searchPA[layer, i].Checked!; commonVars.getPASearch().setUpperLimit(layer, i, (decimal)num_searchPA_UpperLimit[layer, i].Value); commonVars.getPASearch().setPASearchable(layer, i, (bool)cb_searchPA[layer, i].Checked); @@ -260,7 +260,7 @@ private void updatePASearchUI() for (int i = 0; i < groupBox_passCaseValues.Length; i++) { - num_passCaseValues[i].Enabled = (bool)cb_passCaseValues[i].Checked; + num_passCaseValues[i].Enabled = (bool)cb_passCaseValues[i].Checked!; rb_passValueRadioButtons[i, 0].Enabled = (bool)cb_passCaseValues[i].Checked; rb_passValueRadioButtons[i, 1].Enabled = (bool)cb_passCaseValues[i].Checked; @@ -268,7 +268,7 @@ private void updatePASearchUI() commonVars.getPASearch().filterIsMaxValue[i] = rb_passValueRadioButtons[i, 1].Checked; } - bool chordMode = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.chord; + bool chordMode = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.chord; for (int i = 0; i < groupBox_passCaseValues.Length; i++) { if (!chordMode) @@ -276,7 +276,7 @@ private void updatePASearchUI() groupBox_passCaseValues[i].Enabled = false; cb_passCaseValues[i].Checked = false; } - commonVars.getPASearch().useFilter[i] = (bool)cb_passCaseValues[i].Checked; + commonVars.getPASearch().useFilter[i] = (bool)cb_passCaseValues[i].Checked!; } if (!chordMode) { diff --git a/Common/Variance/UI/utilsUI.cs b/Common/Variance/UI/utilsUI.cs index 8a7ab7d..1afb174 100644 --- a/Common/Variance/UI/utilsUI.cs +++ b/Common/Variance/UI/utilsUI.cs @@ -17,7 +17,7 @@ public partial class MainForm : Form private CheckBox checkBox_EmailCompletion, checkBox_perJob, checkBox_SSL, checkBox_geoCore_enableCDVariation, checkBox_geoCore_tileLayerPreview, checkBox_OGLAA, checkBox_OGLFill, checkBox_OGLPoints, - checkBox_friendlyNumbers; + checkBox_friendlyNumbers, checkBox_expandUI; private Button button_emailTest, utilitiesBtn_Summary, btn_resetColors, btn_rngMapping_Add, btn_rngMapping_Edit, btn_rngMapping_Remove; @@ -41,7 +41,8 @@ public partial class MainForm : Form private ListBox listBox_rngCustomMapping; - private GroupBox groupBox_utilities, groupBox_settings, groupBox_email, groupBox_openGL, prefs_geoCore, groupBox_rng, groupBox_misc; + private Expander expander_misc; + private GroupBox groupBox_utilities, groupBox_settings, groupBox_email, groupBox_openGL, prefs_geoCore, groupBox_rng, groupBox_misc ; private void utilsUISetup() { @@ -146,9 +147,13 @@ private void settings_utilsUISetup() private void email_settings_utilsUISetup(TableCell tc) { TableLayout groupBox_email_table = new(); - groupBox_email = new GroupBox {Text = "Email Settings", Content = groupBox_email_table}; + groupBox_email = new GroupBox {Content = groupBox_email_table}; + Expander expander_email = new() {Header = "Email Settings", + Content = groupBox_email, + Expanded = true + }; - tc.Control = groupBox_email; + tc.Control = expander_email; groupBox_email_table.Rows.Add(new TableRow()); @@ -235,8 +240,12 @@ private void email_settings_utilsUISetup(TableCell tc) private void geoCore_settings_utilsUISetup(TableCell tc) { TableLayout prefs_geoCore_table = new(); - prefs_geoCore = new GroupBox {Text = "GDS/Oasis", Content = prefs_geoCore_table}; - tc.Control = prefs_geoCore; + prefs_geoCore = new GroupBox {Content = prefs_geoCore_table}; + Expander prefs_gc_exp = new Expander() {Header = "GDS/Oasis", + Content = prefs_geoCore, + Expanded = true + }; + tc.Control = prefs_gc_exp; prefs_geoCore_table.Rows.Add(new TableRow()); checkBox_geoCore_enableCDVariation = new CheckBox {Text = "Allow CD/bias variation"}; @@ -261,8 +270,12 @@ private void misc_settings_utilsUISetup(TableCell tc) tl.Rows.Add(new TableRow()); // padding TableLayout groupBox_misc_table = new(); - groupBox_misc = new GroupBox {Text = "Misc", Content = groupBox_misc_table}; - tc0.Control = groupBox_misc; + groupBox_misc = new () {Content = groupBox_misc_table}; + expander_misc = new () {Header = "Misc", + Content = groupBox_misc, + Expanded = true + }; + tc0.Control = expander_misc; groupBox_misc_table.Rows.Add(new TableRow()); TableCell row0 = new(); @@ -279,6 +292,13 @@ private void miscRow0(TableCell tc) tl.Rows.Add(new TableRow()); + checkBox_expandUI = new CheckBox {Text = "Start with expanded interface"}; + tl.Rows[^1].Cells.Add(new TableCell { Control = checkBox_expandUI }); + + tl.Rows[^1].Cells.Add(new TableCell { Control = null }); // padding + + tl.Rows.Add(new TableRow()); + checkBox_friendlyNumbers = new CheckBox {Text = "Friendly Numbers"}; tl.Rows[^1].Cells.Add(new TableCell { Control = checkBox_friendlyNumbers }); diff --git a/Common/Variance/Variance.csproj b/Common/Variance/Variance.csproj index 9355845..b56386a 100644 --- a/Common/Variance/Variance.csproj +++ b/Common/Variance/Variance.csproj @@ -20,10 +20,9 @@ - - + - + @@ -33,13 +32,17 @@ + + + + diff --git a/Common/Variance/chaos/chaosEngine.cs b/Common/Variance/chaos/chaosEngine.cs index c3334db..6936cd2 100644 --- a/Common/Variance/chaos/chaosEngine.cs +++ b/Common/Variance/chaos/chaosEngine.cs @@ -1,15 +1,16 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; using System.Threading.Tasks; -using ClipperLib1; +using Clipper2Lib; +using geoAnalysis; using geoWrangler; +using shapeEngine; namespace Variance; -using Path = List; -using Paths = List>; +using Path = List; +using Paths = List>; internal class ChaosEngine { @@ -78,7 +79,7 @@ private List preFlight(Paths aPath, Paths bPath) #if !CHAOSSINGLETHREADED ); #endif - List returnPaths = new() {aPath.ToList(), bPath.ToList()}; + List returnPaths = new() {aPath, bPath}; return returnPaths; } @@ -91,208 +92,26 @@ private Path reOrderPath(string shapeRef, int pathIndex) throw new Exception("reOrderPath: No shapeRef supplied!"); } - Path sourcePath = shapeRef.ToUpper() == "A" ? booleanPaths[0][pathIndex].ToList() : booleanPaths[1][pathIndex].ToList(); + Path sourcePath = shapeRef.ToUpper() == "A" ? booleanPaths[0][pathIndex] : booleanPaths[1][pathIndex]; - Path returnPath = GeoWrangler.clockwiseAndReorder(sourcePath); + Path returnPath = GeoWrangler.clockwiseAndReorderXY(sourcePath); return returnPath; } - public static Paths customBoolean(int firstLayerOperator, Paths firstLayer, int secondLayerOperator, Paths secondLayer, int booleanFlag, double resolution, double extension) - { - return pCustomBoolean(firstLayerOperator, firstLayer, secondLayerOperator, secondLayer, booleanFlag, resolution, extension); - } - private static Paths pCustomBoolean(int firstLayerOperator, Paths firstLayer, int secondLayerOperator, Paths secondLayer, int booleanFlag, double resolution, double extension) - { - // In principle, 'rigorous' handling is only needed where the cutter is fully enclosed by the subject polygon. - // The challenge is to know whether this is the case or not. - // Possibility would be an intersection test and a vertex count and location comparison from before and after, to see whether anything changed. - bool rigorous = GeoWrangler.enclosed(firstLayer, secondLayer); // this is not a strict check because the enclosure can exist either way for this situation. - - // Need a secondary check because keyholed geometry could be problematic. - // Both paths will be reviewed; first one to have a keyhole will trigger the rigorous process. - if (!rigorous) - { - try - { - rigorous = GeoWrangler.enclosed(firstLayer, customSizing: 1, extension: extension, strict: true); // force a strict check. - - if (!rigorous) - { - // Need a further check because keyholed geometry in B could be problematic. - rigorous = GeoWrangler.enclosed(secondLayer, customSizing: 1, extension: extension, strict: true); // force a strict check. - } - } - catch (Exception) - { - // No big deal - carry on. - } - } - - Paths ret = layerBoolean(firstLayerOperator, firstLayer, secondLayerOperator, secondLayer, booleanFlag, preserveColinear: true); - - ret = GeoWrangler.gapRemoval(ret, extension: extension).ToList(); - - bool holes = false; - - foreach (Path t in ret) - { - holes = !Clipper.Orientation(t); - bool gwHoles = !GeoWrangler.isClockwise(t); - if (holes != gwHoles) - { - } - if (holes) - { - break; - } - } - - // Apply the keyholing and rationalize. - if (holes) - { - Fragmenter f = new(resolution * CentralProperties.scaleFactorForOperation); - ret = f.fragmentPaths(ret); - Paths merged = GeoWrangler.makeKeyHole(ret, extension:extension); - - int count = merged.Count; -#if !CHAOSSINGLETHREADED - Parallel.For(0, count, i => -#else - for (int i = 0; i < count; i++) -#endif - { - merged[i] = GeoWrangler.clockwise(merged[i]); - } -#if !CHAOSSINGLETHREADED - ); -#endif - // Squash any accidental keyholes - not ideal, but best option found so far. - Clipper c1 = new() {PreserveCollinear = true}; - c1.AddPaths(merged, PolyType.ptSubject, true); - c1.Execute(ClipType.ctUnion, ret); - ret = GeoWrangler.stripColinear(ret, 1.0); - } - - ret = GeoWrangler.sliverRemoval(ret, extension: extension); // experimental to try and remove any slivers. - - if (rigorous && !holes) - { - int count = ret.Count; -#if !CHAOSSINGLETHREADED - Parallel.For(0, count, i => -#else - for (int i = 0; i < count; i++) -#endif - { - ret[i] = GeoWrangler.clockwise(ret[i]); - ret[i] = GeoWrangler.close(ret[i]); - } -#if !CHAOSSINGLETHREADED - ); -#endif - // Return here because the attempt to rationalize the geometry below also screws things up, it seems. - return GeoWrangler.stripColinear(ret, 1.0); - } - - IntRect bounds = ClipperBase.GetBounds(ret); - - Path bound = new() - { - new IntPoint(bounds.left, bounds.bottom), - new IntPoint(bounds.left, bounds.top), - new IntPoint(bounds.right, bounds.top), - new IntPoint(bounds.right, bounds.bottom), - new IntPoint(bounds.left, bounds.bottom) - }; - - Clipper c = new(); - - c.AddPaths(ret, PolyType.ptSubject, true); - c.AddPath(bound, PolyType.ptClip, true); - - Paths simple = new(); - c.Execute(ClipType.ctIntersection, simple); - - return GeoWrangler.clockwiseAndReorder(simple); - } - - private Paths layerBoolean(EntropySettings simulationSettings, int firstLayer, int secondLayer, int booleanFlag, bool preserveColinear = true) + private Paths pLayerBoolean(EntropySettings simulationSettings, int firstLayer, int secondLayer, int booleanFlag, bool preserveColinear = true) { Paths firstLayerPaths = GeoWrangler.pathsFromPointFs(simShapes[firstLayer].getPoints(), CentralProperties.scaleFactorForOperation); Paths secondLayerPaths = GeoWrangler.pathsFromPointFs(simShapes[secondLayer].getPoints(), CentralProperties.scaleFactorForOperation); - return layerBoolean(simulationSettings.getOperatorValue(EntropySettings.properties_o.layer, firstLayer), firstLayerPaths, + Paths ret = GeoWrangler.LayerBoolean(simulationSettings.getOperatorValue(EntropySettings.properties_o.layer, firstLayer), firstLayerPaths, simulationSettings.getOperatorValue(EntropySettings.properties_o.layer, secondLayer), secondLayerPaths, booleanFlag, preserveColinear); - } - - private static Paths layerBoolean(int firstLayerOperator, Paths firstLayerPaths, int secondLayerOperator, Paths secondLayerPaths, int booleanFlag, bool preserveColinear) - { - if (firstLayerOperator == 1) // NOT layer handling - { - try - { - firstLayerPaths = GeoWrangler.invertTone(firstLayerPaths).ToList(); - } - catch (Exception) - { - // Something blew up. - } - firstLayerPaths[0] = GeoWrangler.close(firstLayerPaths[0]); - } - - - if (secondLayerOperator == 1) // NOT layer handling - { - try - { - secondLayerPaths = GeoWrangler.invertTone(secondLayerPaths).ToList(); - } - catch (Exception) - { - // Something blew up. - } - secondLayerPaths[0] = GeoWrangler.close(secondLayerPaths[0]); - } - if (firstLayerPaths[0].Count <= 1) - { - return secondLayerPaths.ToList(); - } - return secondLayerPaths[0].Count <= 1 ? firstLayerPaths.ToList() : layerBoolean(firstLayerPaths, secondLayerPaths, booleanFlag, preserveColinear: preserveColinear); + return ret; } - - private static Paths layerBoolean(Paths firstPaths, Paths secondPaths, int booleanFlag, bool preserveColinear = true) - { - string booleanType = "AND"; - if (booleanFlag == 1) - { - booleanType = "OR"; - } - - // important - if we don't do this, we lose the fragmentation on straight edges. - Clipper c = new() {PreserveCollinear = preserveColinear}; - - c.AddPaths(firstPaths, PolyType.ptSubject, true); - c.AddPaths(secondPaths, PolyType.ptClip, true); - - Paths outputPoints = new(); - - switch (booleanType) - { - case "AND": - c.Execute(ClipType.ctIntersection, outputPoints, PolyFillType.pftEvenOdd, PolyFillType.pftEvenOdd); - break; - case "OR": - c.Execute(ClipType.ctUnion, outputPoints, PolyFillType.pftEvenOdd, PolyFillType.pftEvenOdd); - break; - } - - return outputPoints; // Return our first list of points as the result of the boolean. - } - - private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true) + + private Paths[] pLayerBoolean(CommonVars commonVars, bool preserveColinear = true) { // Boolean is structured as: // Process two layers to get the interaction of two layers. @@ -320,13 +139,13 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true switch (inputLayerEnabled[i * 2]) { case true when inputLayerEnabled[i * 2 + 1]: - twoLayerResults[i] = layerBoolean(simulationSettings, i * 2, i * 2 + 1, simulationSettings.getOperatorValue(EntropySettings.properties_o.twoLayer, i), preserveColinear: preserveColinear).ToList(); + twoLayerResults[i] = pLayerBoolean(simulationSettings, i * 2, i * 2 + 1, simulationSettings.getOperatorValue(EntropySettings.properties_o.twoLayer, i), preserveColinear: preserveColinear); break; case true when !inputLayerEnabled[i * 2 + 1]: - twoLayerResults[i] = layerBoolean(simulationSettings, i * 2, i * 2, 0, preserveColinear: preserveColinear); + twoLayerResults[i] = pLayerBoolean(simulationSettings, i * 2, i * 2, 0, preserveColinear: preserveColinear); break; case false when inputLayerEnabled[i * 2 + 1]: - twoLayerResults[i] = layerBoolean(simulationSettings, i * 2 + 1, i * 2 + 1, 0, preserveColinear: preserveColinear); + twoLayerResults[i] = pLayerBoolean(simulationSettings, i * 2 + 1, i * 2 + 1, 0, preserveColinear: preserveColinear); break; default: twoLayerResults[i] = new Paths(); @@ -384,22 +203,22 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true { if (doLayer4Boolean[i] == 0 && twoLayerResults[i * 2].Count > 0 && twoLayerResults[i * 2 + 1].Count > 0) { - fourLayerResults[i] = layerBoolean( + fourLayerResults[i] = GeoWrangler.LayerBoolean( firstPaths: twoLayerResults[i * 2], secondPaths: twoLayerResults[i * 2 + 1], booleanFlag: simulationSettings.getOperatorValue(EntropySettings.properties_o.fourLayer, i), preserveColinear: preserveColinear - ).ToList(); + ); } else { switch (doLayer4Boolean[i]) { case -1: - fourLayerResults[i] = twoLayerResults[i * 2].ToList(); + fourLayerResults[i] = twoLayerResults[i * 2]; break; case 1: - fourLayerResults[i] = twoLayerResults[i * 2 + 1].ToList(); + fourLayerResults[i] = twoLayerResults[i * 2 + 1]; break; case 0: if (twoLayerResults[i * 2].Count > 0) @@ -410,7 +229,7 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true } else { - fourLayerResults[i] = twoLayerResults[i * 2].ToList(); + fourLayerResults[i] = twoLayerResults[i * 2]; } } else if (twoLayerResults[i * 2 + 1].Count > 0) @@ -421,7 +240,7 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true } else { - fourLayerResults[i] = twoLayerResults[i * 2 + 1].ToList(); + fourLayerResults[i] = twoLayerResults[i * 2 + 1]; } } else @@ -499,22 +318,22 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true { if (doLayer8Boolean[i] == 0 && fourLayerResults[i * 2].Count > 0 && fourLayerResults[i * 2 + 1].Count > 0) { - eightLayerResults[i] = layerBoolean( + eightLayerResults[i] = GeoWrangler.LayerBoolean( firstPaths: fourLayerResults[i * 2], secondPaths: fourLayerResults[i * 2 + 1], booleanFlag: simulationSettings.getOperatorValue(EntropySettings.properties_o.eightLayer, i), preserveColinear: preserveColinear - ).ToList(); + ); } else { switch (doLayer8Boolean[i]) { case -1: - eightLayerResults[i] = fourLayerResults[i * 2].ToList(); + eightLayerResults[i] = fourLayerResults[i * 2]; break; case 1: - eightLayerResults[i] = fourLayerResults[i * 2 + 1].ToList(); + eightLayerResults[i] = fourLayerResults[i * 2 + 1]; break; case 0: if (fourLayerResults[i * 2].Count > 0) @@ -525,7 +344,7 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true } else { - eightLayerResults[i] = fourLayerResults[i * 2].ToList(); + eightLayerResults[i] = fourLayerResults[i * 2]; } } else if (fourLayerResults[i * 2 + 1].Count > 0) @@ -536,7 +355,7 @@ private Paths[] layerBoolean(CommonVars commonVars, bool preserveColinear = true } else { - eightLayerResults[i] = fourLayerResults[i * 2 + 1].ToList(); + eightLayerResults[i] = fourLayerResults[i * 2 + 1]; } } else @@ -584,7 +403,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, { if (i < CentralProperties.maxLayersForMC / 2) { - sgRemove_a = commonVars.getLayerSettings(i).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN; + sgRemove_a = commonVars.getLayerSettings(i).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN; } } @@ -595,13 +414,13 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, if (i >= CentralProperties.maxLayersForMC / 2) { - sgRemove_b = commonVars.getLayerSettings(i).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN; + sgRemove_b = commonVars.getLayerSettings(i).getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN; } } - bool preserveColinear = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.enclosure_spacing_overlap; + bool preserveColinear = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)supported.calcModes.enclosure_spacing_overlap; - booleanPaths = layerBoolean(commonVars, preserveColinear); + booleanPaths = pLayerBoolean(commonVars, preserveColinear); if (sgRemove_a) { @@ -622,11 +441,11 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, { switch (simulationSettings.getValue(EntropySettings.properties_i.oType)) { - case (int)CommonVars.calcModes.area: // area + case (int)supported.calcModes.area: // area try { - bool perPoly = simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.areaCalcModes.perpoly; - AreaHandler aH = new(aPaths: booleanPaths[0], bPaths: booleanPaths[1], maySimplify: true, perPoly); + bool perPoly = simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)AreaHandler.areaCalcModes.perpoly; + AreaHandler aH = new(aPaths: booleanPaths[0], bPaths: booleanPaths[1], maySimplify: true, perPoly, CentralProperties.scaleFactorForOperation); // Sum the areas by polygon returned. result = (Convert.ToDouble(result) + aH.area).ToString(CultureInfo.InvariantCulture); listOfOutputPoints.AddRange(aH.listOfOutputPoints); @@ -638,14 +457,19 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, } break; - case (int)CommonVars.calcModes.enclosure_spacing_overlap: // spacing (or enclosure) - DistanceHandler dH = new(aPaths: booleanPaths[0], bPaths: booleanPaths[1], simulationSettings, previewMode); // in preview mode, raycaster inside this engine will run threaded along the emit edge. + case (int)supported.calcModes.enclosure_spacing_overlap: // spacing (or enclosure) + DistanceHandler dH = new(simulationSettings.debugCalc, + aPaths: booleanPaths[0], + bPaths: booleanPaths[1], + simulationSettings.getValue(EntropySettings.properties_i.subMode), + CentralProperties.scaleFactorForOperation, + previewMode ); // in preview mode, raycaster inside this engine will run threaded along the emit edge. // Store minimum case for the per polygon system. if (result == null) { result = dH.distanceString; - listOfOutputPoints = dH.resultPaths.ToList(); + listOfOutputPoints = dH.resultPaths; } else { @@ -653,7 +477,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, if (Convert.ToDouble(dH.distanceString) < Convert.ToDouble(result)) { result = dH.distanceString; - listOfOutputPoints = dH.resultPaths.ToList(); + listOfOutputPoints = dH.resultPaths; } } @@ -665,7 +489,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, int pt = t.Count - 1; while (pt > 0) { - t.Add(new IntPoint(t[pt])); + t.Add(new Point64(t[pt])); pt--; } } @@ -678,7 +502,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, break; - case (int)CommonVars.calcModes.chord: // chord + case (int)supported.calcModes.chord: // chord // ReSharper disable once ConvertIfStatementToNullCoalescingAssignment if (result == null) { @@ -688,20 +512,20 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, double[] fraggedResult = new double[4]; fraggedResult[0] = fraggedResult[1] = fraggedResult[2] = fraggedResult[3] = 0.0; - Path tmpPath = new() {new IntPoint(0, 0)}; - listOfOutputPoints.Add(tmpPath.ToList()); - listOfOutputPoints.Add(tmpPath.ToList()); - listOfOutputPoints.Add(tmpPath.ToList()); - listOfOutputPoints.Add(tmpPath.ToList()); + Path tmpPath = new() {new Point64(0, 0)}; + listOfOutputPoints.Add(tmpPath); + listOfOutputPoints.Add(tmpPath); + listOfOutputPoints.Add(tmpPath); + listOfOutputPoints.Add(tmpPath); try { - Paths aPath = booleanPaths[0].ToList(); - Paths bPath = booleanPaths[1].ToList(); - List cleanedPaths = preFlight(aPath, bPath).ToList(); - aPath = cleanedPaths[0].ToList(); - bPath = cleanedPaths[1].ToList(); - ChordHandler cH = new(aPath, bPath, simulationSettings); + Paths aPath = booleanPaths[0]; + Paths bPath = booleanPaths[1]; + List cleanedPaths = preFlight(aPath, bPath); + aPath = cleanedPaths[0]; + bPath = cleanedPaths[1]; + ChordHandler cH = new(aPath, bPath, simulationSettings.getResolution(), CentralProperties.scaleFactorForOperation, simulationSettings.getValue(EntropySettings.properties_i.subMode)); // Fragment our result. char[] resultSeparators = { ',' }; // CSV separator for splitting results for comparison. @@ -718,15 +542,15 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, ); #endif fraggedResult[0] = cH.aChordLengths[0] / CentralProperties.scaleFactorForOperation; - listOfOutputPoints[0] = cH.a_chordPaths[0].ToList(); + listOfOutputPoints[0] = cH.a_chordPaths[0]; fraggedResult[1] = cH.aChordLengths[1] / CentralProperties.scaleFactorForOperation; - listOfOutputPoints[1] = cH.a_chordPaths[1].ToList(); + listOfOutputPoints[1] = cH.a_chordPaths[1]; fraggedResult[2] = cH.bChordLengths[0] / CentralProperties.scaleFactorForOperation; - listOfOutputPoints[2] = cH.b_chordPaths[0].ToList(); + listOfOutputPoints[2] = cH.b_chordPaths[0]; fraggedResult[3] = cH.bChordLengths[1] / CentralProperties.scaleFactorForOperation; - listOfOutputPoints[3] = cH.b_chordPaths[1].ToList(); + listOfOutputPoints[3] = cH.b_chordPaths[1]; - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) != (int)CommonVars.chordCalcElements.b) + if (simulationSettings.getValue(EntropySettings.properties_i.subMode) != (int)ChordHandler.chordCalcElements.b) { result = fraggedResult[0] + "," + fraggedResult[1]; } @@ -735,7 +559,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, result = "N/A,N/A"; } - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) >= (int)CommonVars.chordCalcElements.b) + if (simulationSettings.getValue(EntropySettings.properties_i.subMode) >= (int)ChordHandler.chordCalcElements.b) { result += "," + fraggedResult[2] + "," + fraggedResult[3]; } @@ -751,18 +575,18 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, } break; - case (int)CommonVars.calcModes.angle: // angle + case (int)supported.calcModes.angle: // angle for (int layerAPoly = 0; layerAPoly < layerAPathCount_orig; layerAPoly++) { for (int layerBPoly = 0; layerBPoly < layerBPathCount_orig; layerBPoly++) { try { - angleHandler agH = new(layerAPath: booleanPaths[0], layerBPath: booleanPaths[1]); + angleHandler agH = new(layerAPath: booleanPaths[0], layerBPath: booleanPaths[1], CentralProperties.scaleFactorForOperation); if (result == null) { result = agH.minimumIntersectionAngle.ToString(CultureInfo.InvariantCulture); - listOfOutputPoints = agH.resultPaths.ToList(); + listOfOutputPoints = agH.resultPaths; } else { @@ -770,7 +594,7 @@ private void pChaosEngine(CommonVars commonVars, List simShapes_, { result = agH.minimumIntersectionAngle.ToString(CultureInfo.InvariantCulture); listOfOutputPoints.Clear(); - listOfOutputPoints = agH.resultPaths.ToList(); + listOfOutputPoints = agH.resultPaths; } } outputValid = true; // mark that we're good for the callsite diff --git a/Common/Variance/chaos/chaosEngine_implant.cs b/Common/Variance/chaos/chaosEngine_implant.cs index c2f6ce3..d2e767d 100644 --- a/Common/Variance/chaos/chaosEngine_implant.cs +++ b/Common/Variance/chaos/chaosEngine_implant.cs @@ -2,15 +2,16 @@ using System.Collections.Generic; using System.Globalization; using System.Threading.Tasks; -using ClipperLib1; +using Clipper2Lib; using geoLib; using geoWrangler; +using shapeEngine; using utility; namespace Variance; -using Path = List; -using Paths = List>; +using Path = List; +using Paths = List>; internal class ChaosEngine_implant { @@ -123,13 +124,13 @@ private void pChaosEngine_implant(ChaosSettings_implant chaosSettings, EntropySe List implant_MLS = new(); EntropyLayerSettings mls = new(); mls.setInt(EntropyLayerSettings.properties_i.edgeSlide, 0); // we don't want the edge slide in this situation. - mls.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CommonVars.shapeNames.rect); + mls.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CentralProperties.shapeNames.rect); double resistWidth = implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.w) + implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.wV) * chaosSettings.getValue(ChaosSettings_implant.properties.resistCDVar); - mls.setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(resistWidth)); + mls.setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(resistWidth), 0); double resistHeight = implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.h) + implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.hV) * chaosSettings.getValue(ChaosSettings_implant.properties.resistHeightVar); - mls.setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(resistHeight) * 2.0m); // double since we're making an ellipse and clipping later. + mls.setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(resistHeight) * 2.0m, 0); // double since we're making an ellipse and clipping later. mls.setDecimal(EntropyLayerSettings.properties_decimal.oCR, Convert.ToDecimal(implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.cRR) + implantCalcSettings.getDouble(EntropyImplantSettings.properties_d.cV) * chaosSettings.getValue(ChaosSettings_implant.properties.resistTopCRRVar))); - mls.setInt(EntropyLayerSettings.properties_i.posIndex, (int)CommonVars.subShapeLocations.C); + mls.setInt(EntropyLayerSettings.properties_i.posIndex, (int)ShapeSettings.subShapeLocations.C); mls.setInt(EntropyLayerSettings.properties_i.enabled, 1); implant_MLS.Add(mls); @@ -144,31 +145,32 @@ private void pChaosEngine_implant(ChaosSettings_implant chaosSettings, EntropySe Path sourcePath = new(); for (int pt = 0; pt < ms.getPoints().Length; pt++) { - double x = ms.getPoints()[pt].X - Convert.ToDouble(mls.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2.0f; + double x = ms.getPoints()[pt].X - Convert.ToDouble(mls.getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0)) / 2.0f; double y = ms.getPoints()[pt].Y - resistHeight; - sourcePath.Add(new IntPoint((long)(x * CentralProperties.scaleFactorForOperation), + sourcePath.Add(new Point64((long)(x * CentralProperties.scaleFactorForOperation), (long)(y * CentralProperties.scaleFactorForOperation))); } Paths source = new() {sourcePath}; // Build our mask polygon from the bounds and 0,0 reference. Curiously, Clipper's top/bottom bounds are flipped from what might be expected. - IntRect bounds = ClipperBase.GetBounds(source); + Rect64 bounds = Clipper.GetBounds(source); Path maskPoly = new() { - new IntPoint(0, 0), - new IntPoint(0, bounds.bottom), - new IntPoint(bounds.right, bounds.bottom), - new IntPoint(bounds.right, 0), - new IntPoint(0, 0) + new Point64(0, 0), + new Point64(0, bounds.bottom), + new Point64(bounds.right, bounds.bottom), + new Point64(bounds.right, 0), + new Point64(0, 0) }; // Get our region extracted using the mask. - Clipper c = new() {PreserveCollinear = false}; - c.AddPath(sourcePath, PolyType.ptSubject, true); - c.AddPath(maskPoly, PolyType.ptClip, true); + Clipper64 c = new() {PreserveCollinear = false}; + c.AddSubject(sourcePath); + c.AddClip(maskPoly); Paths solution = new(); - c.Execute(ClipType.ctIntersection, solution, PolyFillType.pftEvenOdd, PolyFillType.pftEvenOdd); + c.Execute(ClipType.Intersection, FillRule.EvenOdd, solution); + solution = GeoWrangler.reOrderXY(solution); if (solution.Count == 0) { diff --git a/Common/Variance/engines/angleHandler.cs b/Common/Variance/engines/angleHandler.cs deleted file mode 100644 index 1367c39..0000000 --- a/Common/Variance/engines/angleHandler.cs +++ /dev/null @@ -1,215 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using ClipperLib1; -using geoWrangler; -using utility; - -namespace Variance; - -using Path = List; -using Paths = List>; - -internal class angleHandler -{ - public double minimumIntersectionAngle { get; private set; } - private Paths listOfOutputPoints; - public Paths resultPaths { get; private set; } // will only have one path, for minimum angle. - - private void ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt) - { - pt.Z = -1; // Tag our intersection points. - } - - // Distance functions to drive scale-up of intersection marker if needed. - private double minDistance = 10.0; - - public angleHandler(Paths layerAPath, Paths layerBPath) - { - angleHandlerLogic(layerAPath, layerBPath); - } - - private void angleHandlerLogic(Paths layerAPath, Paths layerBPath) - { - listOfOutputPoints = new Paths(); - resultPaths = new Paths(); - Path resultPath = new(); - Clipper c = new() {ZFillFunction = ZFillCallback}; - c.AddPaths(layerAPath, PolyType.ptSubject, true); - c.AddPaths(layerBPath, PolyType.ptClip, true); - - // Boolean AND of the two levels for the area operation. - c.Execute(ClipType.ctIntersection, listOfOutputPoints); - - // Set initial output value for the case there are no intersections - minimumIntersectionAngle = 180.0; // no intersection angle. - - double tmpVal = listOfOutputPoints.Sum(t => Clipper.Area(t)); - if (tmpVal == 0.0) - { - // No overlap - // Set output path and avoid heavy lifting - resultPath.Add(new IntPoint(0, 0)); - resultPaths.Add(resultPath); - } - else - { - double temporaryResult = 180.0; - Path temporaryPath = new() {new IntPoint(0, 0), new IntPoint(0, 0), new IntPoint(0, 0)}; - foreach (Path t in listOfOutputPoints) - { - Path overlapPath = GeoWrangler.clockwise(t); - - int pt = 0; - while (pt < overlapPath.Count) - { - if (overlapPath[pt].Z == -1) - { - // intersection point found - let's get our three points to find the angle. - // http://en.wikipedia.org/wiki/Law_of_cosines - IntPoint interSection_B; - IntPoint interSection_C; - IntPoint interSection_A; - if (pt == 0) - { - // Find preceding not-identical point. - int refPt = overlapPath.Count - 1; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt--; - if (refPt == 0) - { - break; - } - } - interSection_B = overlapPath[refPt]; // map to last point - interSection_C = overlapPath[pt]; - // Find following not-identical point. - refPt = 0; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt++; - if (refPt == overlapPath.Count - 1) - { - break; - } - } - interSection_A = overlapPath[refPt]; - } - else if (pt == overlapPath.Count - 1) // last point in the list - { - // Find preceding not-identical point. - int refPt = pt; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt--; - if (refPt == 0) - { - break; - } - } - interSection_B = overlapPath[refPt]; - interSection_C = overlapPath[pt]; - // Find following not-identical point. - refPt = 0; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt++; - if (refPt == overlapPath.Count - 1) - { - break; - } - } - interSection_A = overlapPath[0]; // map to the first point - } - else - { - // Find preceding not-identical point. - int refPt = pt; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt--; - if (refPt == 0) - { - break; - } - } - interSection_B = overlapPath[refPt]; - interSection_C = overlapPath[pt]; - // Find following not-identical point. - refPt = pt; - while (Math.Abs(GeoWrangler.distanceBetweenPoints(overlapPath[refPt], overlapPath[pt])) == 0) - { - refPt++; - if (refPt == overlapPath.Count - 1) - { - break; - } - } - interSection_A = overlapPath[refPt]; - } - - IntPoint cBVector = new(interSection_B.X - interSection_C.X, interSection_B.Y - interSection_C.Y); - IntPoint cAVector = new(interSection_A.X - interSection_C.X, interSection_A.Y - interSection_C.Y); - - long xComponents = cBVector.X * cAVector.X; - long yComponents = cBVector.Y * cAVector.Y; - - long scalarProduct = xComponents + yComponents; - - double cBMagnitude = Math.Sqrt(Utils.myPow(cBVector.X, 2) + Utils.myPow(cBVector.Y, 2)); - double cAMagnitude = Math.Sqrt(Utils.myPow(cAVector.X, 2) + Utils.myPow(cAVector.Y, 2)); - - double theta = Math.Abs(Utils.toDegrees(Math.Acos(scalarProduct / (cBMagnitude * cAMagnitude)))); // Avoid falling into a trap with negative angles. - - if (theta < temporaryResult) - { - temporaryResult = theta; - temporaryPath.Clear(); - temporaryPath.Add(new IntPoint(interSection_A.X, interSection_A.Y)); - temporaryPath.Add(new IntPoint(interSection_C.X, interSection_C.Y)); - temporaryPath.Add(new IntPoint(interSection_B.X, interSection_B.Y)); - } - } - pt++; - } - } - minimumIntersectionAngle = temporaryResult; - - // Check our temporary path to see if we need to scale it up. - double distance = GeoWrangler.distanceBetweenPoints(temporaryPath[0], temporaryPath[1]) / CentralProperties.scaleFactorForOperation; - IntPoint distanceIntPoint = GeoWrangler.intPoint_distanceBetweenPoints(temporaryPath[0], temporaryPath[1]); // A to C - if (distance < minDistance) - { - double X = temporaryPath[0].X; - double Y = temporaryPath[0].Y; - if (temporaryPath[1].X != temporaryPath[0].X) - { - X = temporaryPath[1].X + distanceIntPoint.X * (minDistance / distance); - } - if (temporaryPath[1].Y != temporaryPath[0].Y) - { - Y = temporaryPath[1].Y + distanceIntPoint.Y * (minDistance / distance); - } - temporaryPath[0] = new IntPoint((long)X, (long)Y); - } - distance = GeoWrangler.distanceBetweenPoints(temporaryPath[2], temporaryPath[1]) / CentralProperties.scaleFactorForOperation; - distanceIntPoint = GeoWrangler.intPoint_distanceBetweenPoints(temporaryPath[2], temporaryPath[1]); // B to C - if (distance < minDistance) - { - double X = temporaryPath[2].X; - double Y = temporaryPath[2].Y; - if (temporaryPath[1].Y != temporaryPath[2].Y) - { - Y = temporaryPath[1].Y + distanceIntPoint.Y * (minDistance / distance); - } - if (temporaryPath[1].X != temporaryPath[2].X) - { - X = temporaryPath[1].X + distanceIntPoint.X * (minDistance / distance); - } - temporaryPath[2] = new IntPoint((long)X, (long)Y); - } - resultPaths.Add(temporaryPath.ToList()); - } - } -} \ No newline at end of file diff --git a/Common/Variance/engines/areaHandler.cs b/Common/Variance/engines/areaHandler.cs deleted file mode 100644 index 1bd14f7..0000000 --- a/Common/Variance/engines/areaHandler.cs +++ /dev/null @@ -1,79 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using ClipperLib1; - -namespace Variance; - -using Paths = List>; - -internal class AreaHandler -{ - public double area { get; private set; } - public Paths listOfOutputPoints { get; private set; } - - private void ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt) - { - pt.Z = -1; // Tag our intersection points. - } - - public AreaHandler(Paths aPaths, Paths bPaths, bool maySimplify, bool perPoly, double scaleFactorForPointF = CentralProperties.scaleFactorForOperation) - { - areaHandlerLogic(aPaths, bPaths, scaleFactorForPointF, maySimplify, perPoly); - } - - private void areaHandlerLogic(Paths aPaths, Paths bPaths, double scaleFactorForPointF, bool maySimplify, bool perPoly) - { - Paths tmpPaths = new(); - listOfOutputPoints = new Paths(); - - // callsite may not want simplified geometry. - Clipper c = new() {PreserveCollinear = !maySimplify, ZFillFunction = ZFillCallback}; - - c.AddPaths(aPaths, PolyType.ptSubject, true); - - c.AddPaths(bPaths, PolyType.ptClip, true); - - // Boolean AND of the two levels for the area operation. - try - { - c.Execute(ClipType.ctIntersection, tmpPaths); //, firstLayerFillType, secondLayerFillType); - } - catch (Exception) - { - // Will handle downstream. - } - - double tmpVal = 0.0; - if (perPoly) - { - tmpVal = -1.0f; - } - - int polyCount = tmpPaths.Count; - for (int poly = 0; poly < polyCount; poly++) - { - if (perPoly) - { - double tmpVal2 = Clipper.Area(tmpPaths[poly]); - if (!(tmpVal <= -0.0001f) && !(tmpVal2 < tmpVal)) - { - continue; - } - - tmpVal = tmpVal2; - listOfOutputPoints.Clear(); - listOfOutputPoints.Add(tmpPaths[poly].ToList()); - } - else - { - tmpVal += Clipper.Area(tmpPaths[poly]); - // Append the result output to the resultPoints list. - listOfOutputPoints.Add(tmpPaths[poly].ToList()); - } - } - // Sum the areas by polygon. - area = tmpVal / (scaleFactorForPointF * scaleFactorForPointF); - } -} \ No newline at end of file diff --git a/Common/Variance/engines/chordHandler.cs b/Common/Variance/engines/chordHandler.cs deleted file mode 100644 index 4695d34..0000000 --- a/Common/Variance/engines/chordHandler.cs +++ /dev/null @@ -1,557 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using ClipperLib1; -using geoWrangler; -using KDTree; - -namespace Variance; - -using Path = List; -using Paths = List>; - -internal class ChordHandler -{ - private Path a; - private Path b; - public Paths a_chordPaths { get; private set; }// 0 is top, 1 is bottom - public Paths b_chordPaths { get; private set; } // 0 is left, 1 is right - public double[] aChordLengths { get; private set; } - public double[] bChordLengths { get; private set; } - private int aPath_maxX_index; - private int bPath_maxY_index; - private int aPath_minX_index; - private int bPath_minY_index; - private KDTree aTree; - private KDTree bTree; - - private void ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt) - { - pt.Z = -1; // Tag our intersection points. - } - - private void doPathA() - { - aChordLengths[0] = 0.0; - aChordLengths[1] = 0.0; - - int pt = 0; // will set based on start condition checks - - Path testPath = new(); - // Gather all of our points on the top edge for the nearest neighbor search - while (pt <= aPath_maxX_index) - { - testPath.Add(new IntPoint(a[pt])); - pt++; - } - - Clipper c = new() {ZFillFunction = ZFillCallback, PreserveCollinear = true}; - c.AddPath(testPath, PolyType.ptSubject, false); - c.AddPath(b, PolyType.ptClip, true); - PolyTree polyTree_bottom = new(); - c.Execute(ClipType.ctIntersection, polyTree_bottom); - Paths bottomChords = Clipper.OpenPathsFromPolyTree(polyTree_bottom); // potentially more than one chord. - - // Now we evaluate the lower edge - // We have to start from the max index because it could be shared between top and bottom chords. - pt = aPath_maxX_index; - testPath.Clear(); - c.Clear(); - - bool aDone = false; - - while (!aDone) - { - pt %= a.Count; - testPath.Add(new IntPoint(a[pt])); - if (pt == aPath_minX_index) - { - aDone = true; - } - pt++; - } - - c.AddPath(testPath, PolyType.ptSubject, false); - c.AddPath(b, PolyType.ptClip, true); - PolyTree polyTree_top = new(); - c.Execute(ClipType.ctIntersection, polyTree_top); - Paths topChords = Clipper.OpenPathsFromPolyTree(polyTree_top); // potentially more than one chord. - - // Now let's see what we have. - - double minBottomChordLength = 0; - Path bottomChord = new() {new IntPoint(0, 0)}; - // safety in case we have no chords on the top. - foreach (Path t in bottomChords) - { - // Does this chord segment actually belong to the 'B' geometry. - bool bottomEdgeIsFromA = true; - // First point and last point might not be matched to original geometry (imperfect intersection) - for (int bCPt = 1; bCPt < t.Count - 1; bCPt++) - { - NearestNeighbour pIter = aTree.NearestNeighbors(new double[] { t[bCPt].X, t[bCPt].Y }, 1); - while (pIter.MoveNext()) - { - if (!(pIter.CurrentDistance > 0)) - { - continue; - } - - bottomEdgeIsFromA = false; - break; - } - if (!bottomEdgeIsFromA) - { - break; - } - } - - if (!bottomEdgeIsFromA) - { - continue; - } - - // skip if false case - if (bottomChords.Count != 1 && (bottomChords.Count <= 1 || t[0].Z != -1 || t[^1].Z != -1)) - { - continue; - } - - double chordLength = 0; - // Assess length of each chord and only report the minimum length one. - for (int chordpt = 0; chordpt < t.Count - 1; chordpt++) - { - chordLength += GeoWrangler.distanceBetweenPoints(t[chordpt], t[chordpt + 1]); - } - - if (minBottomChordLength != 0 && !(chordLength < minBottomChordLength)) - { - continue; - } - - minBottomChordLength = chordLength; - bottomChord = t; - } - - double minTopChordLength = 0; - Path topChord = new() {new IntPoint(0, 0)}; - // safety in case we have no chords on the top. - foreach (Path t in topChords) - { - // Does this chord segment actually belong to the 'B' geometry. - bool topEdgeIsFromA = true; - // First point and last point might not be matched to original geometry (imperfect intersection) - for (int tCPt = 1; tCPt < t.Count - 1; tCPt++) - { - NearestNeighbour pIter = aTree.NearestNeighbors(new double[] { t[tCPt].X, t[tCPt].Y }, 1); - while (pIter.MoveNext()) - { - if (!(pIter.CurrentDistance > 0)) - { - continue; - } - - topEdgeIsFromA = false; - break; - } - if (!topEdgeIsFromA) - { - break; - } - } - - if (!topEdgeIsFromA) - { - continue; - } - - // skip if false case - if (topChords.Count != 1 && (topChords.Count <= 1 || t[0].Z != -1 || t[^1].Z != -1)) - { - continue; - } - - double chordLength = 0; - // Assess length of each chord and only report the minimum length one. - for (int chordpt = 0; chordpt < t.Count - 1; chordpt++) - { - chordLength += GeoWrangler.distanceBetweenPoints(t[chordpt], t[chordpt + 1]); - } - - if (minTopChordLength != 0 && !(chordLength < minTopChordLength)) - { - continue; - } - - minTopChordLength = chordLength; - topChord = t; - } - - aChordLengths[0] = minTopChordLength; - a_chordPaths.Add(topChord.ToList()); - - aChordLengths[1] = minBottomChordLength; - a_chordPaths.Add(bottomChord.ToList()); - } - - private void doPathB() - { - bChordLengths[0] = 0.0; - bChordLengths[1] = 0.0; - - int pt = 0; // will set based on start condition checks - - Path testPath = new(); - - // Gather all of our points on the left edge - while (pt <= bPath_maxY_index) - { - testPath.Add(new IntPoint(b[pt])); - pt++; - } - - pt = Math.Max(0, pt - 1); - - Clipper c = new() {PreserveCollinear = true, ZFillFunction = ZFillCallback}; - c.AddPath(testPath, PolyType.ptSubject, false); - c.AddPath(a, PolyType.ptClip, true); - PolyTree polyTree_right = new(); - c.Execute(ClipType.ctIntersection, polyTree_right); - Paths rightChords = Clipper.OpenPathsFromPolyTree(polyTree_right); // potentially more than one chord. - - // Now we evaluate the right edge - // We have to start from the max index because it could be shared between top and bottom chords. - testPath.Clear(); - c.Clear(); - - bool bDone = false; - - while (!bDone) - { - pt %= b.Count; - testPath.Add(new IntPoint(b[pt])); - if (pt == bPath_minY_index) - { - bDone = true; - } - pt++; - } - - c.ZFillFunction = ZFillCallback; - c.AddPath(testPath, PolyType.ptSubject, false); - c.AddPath(a, PolyType.ptClip, true); - PolyTree polyTree_left = new(); - c.Execute(ClipType.ctIntersection, polyTree_left); - Paths leftChords = Clipper.OpenPathsFromPolyTree(polyTree_left); // potentially more than one chord. - - // Now let's see what we have. - - double minRightChordLength = 0; - Path rightChord = new() {new IntPoint(0, 0)}; - // safety in case we have no chords on the right. - - foreach (Path t in rightChords) - { - // Does this chord segment actually belong to the 'B' geometry. - bool rightEdgeIsFromB = true; - // First point and last point might not be matched to original geometry (imperfect intersection) - for (int rCPt = 1; rCPt < t.Count - 1; rCPt++) - { - NearestNeighbour pIter = bTree.NearestNeighbors(new double[] { t[rCPt].X, t[rCPt].Y }, 1); - while (pIter.MoveNext()) - { - if (!(pIter.CurrentDistance > 0)) - { - continue; - } - - rightEdgeIsFromB = false; - break; - } - if (!rightEdgeIsFromB) - { - break; - } - } - - if (!rightEdgeIsFromB) - { - continue; - } - - // skip if false case - if (rightChords.Count != 1 && (rightChords.Count <= 1 || t[0].Z != -1 || t[^1].Z != -1)) - { - continue; - } - - double chordLength = 0; - // Assess length of each chord and only report the minimum length one. - for (int chordpt = 0; chordpt < t.Count - 1; chordpt++) - { - chordLength += GeoWrangler.distanceBetweenPoints(t[chordpt], t[chordpt + 1]); - } - - if (minRightChordLength != 0 && !(chordLength < minRightChordLength)) - { - continue; - } - - minRightChordLength = chordLength; - rightChord = t; - } - - double minLeftChordLength = 0; - Path leftChord = new() {new IntPoint(0, 0)}; - // safety in case we have no chords on the left. - foreach (Path t in leftChords) - { - // Does this chord segment actually belong to the 'B' geometry. - bool leftEdgeIsFromB = true; - // First point and last point might not be matched to original geometry (imperfect intersection) - for (int lCPt = 1; lCPt < t.Count - 1; lCPt++) - { - NearestNeighbour pIter = bTree.NearestNeighbors(new double[] { t[lCPt].X, t[lCPt].Y }, 1); - while (pIter.MoveNext()) - { - if (!(pIter.CurrentDistance > 0)) - { - continue; - } - - leftEdgeIsFromB = false; - break; - } - if (!leftEdgeIsFromB) - { - break; - } - } - - if (!leftEdgeIsFromB) - { - continue; - } - - // skip if false case - if (leftChords.Count != 1 && (leftChords.Count <= 1 || t[0].Z != -1 || t[^1].Z != -1)) - { - continue; - } - - double chordLength = 0; - // Assess length of each chord and only report the minimum length one. - for (int chordpt = 0; chordpt < t.Count - 1; chordpt++) - { - chordLength += GeoWrangler.distanceBetweenPoints(t[chordpt], t[chordpt + 1]); - } - - if (minLeftChordLength != 0 && !(chordLength < minLeftChordLength)) - { - continue; - } - - minLeftChordLength = chordLength; - leftChord = t; - } - - bChordLengths[0] = minLeftChordLength; - b_chordPaths.Add(leftChord.ToList()); - - bChordLengths[1] = minRightChordLength; - b_chordPaths.Add(rightChord.ToList()); - - } - - public ChordHandler(Paths aSource, Paths bSource, EntropySettings simulationSettings) - { - chordHandlerLogic(aSource, bSource, simulationSettings); - } - - private void chordHandlerLogic(Paths aSource, Paths bSource, EntropySettings simulationSettings) - { - a_chordPaths = new Paths(2) {new() {new IntPoint(0, 0)}, new() {new IntPoint(0, 0)}}; - b_chordPaths = new Paths(2) {new() {new IntPoint(0, 0)}, new() {new IntPoint(0, 0)}}; - aChordLengths = new[] {0.0, 0.0}; - bChordLengths = new[] {0.0, 0.0}; - - List cHList = new(); - for (int aIndex = 0; aIndex < aSource.Count; aIndex++) - { - for (int bIndex = 0; bIndex < bSource.Count; bIndex++) - { - try - { - cHList.Add(new ChordHandler(aIndex, aSource, bIndex, bSource, simulationSettings)); - } - catch (Exception) - { - // Don't care about raised exceptions. - } - } - } - - /* Review results to extract minimum cases. - - Some additional explanation is needed here. We can have cases where no chord is registered (i.e. zero is reported). However, if we only - ever checked for a value less than the reported chord length, we'd never have anything other than zero. - - So, in the checks below, the condition against zero is there to take any non-zero value that is reported; then we apply the minimum value from there. - */ - - foreach (ChordHandler t in cHList) - { - for (int resultIndex = 0; resultIndex < 2; resultIndex++) - { - // Extract 'a' results only if non-zero - if (t.aChordLengths[resultIndex] != 0.0) - { - // We have either our first non-zero chord length or a chord length lower than previously recorded. - if (aChordLengths[resultIndex] == 0.0 || t.aChordLengths[resultIndex] < aChordLengths[resultIndex]) - { - aChordLengths[resultIndex] = t.aChordLengths[resultIndex]; - a_chordPaths[resultIndex] = t.a_chordPaths[resultIndex].ToList(); - } - } - - // Extract 'b' results only if non-zero - if (t.bChordLengths[resultIndex] == 0.0 || bChordLengths[resultIndex] != 0.0 && - !(t.bChordLengths[resultIndex] < - bChordLengths[resultIndex])) - { - continue; - } - - // We have either our first non-zero chord length or a chord length lower than previously recorded. - bChordLengths[resultIndex] = t.bChordLengths[resultIndex]; - b_chordPaths[resultIndex] = t.b_chordPaths[resultIndex].ToList(); - } - } - } - - private ChordHandler(int aPathIndex, Paths aSource, int bPathIndex, Paths bSource, EntropySettings simulationSettings) - { - pChordHandlerLogic(aPathIndex, aSource, bPathIndex, bSource, simulationSettings); - } - - private void pChordHandlerLogic(int aPathIndex, Paths aSource, int bPathIndex, Paths bSource, EntropySettings simulationSettings) - { - a = aSource[aPathIndex].ToList(); - b = bSource[bPathIndex].ToList(); - - // Get our chord path storage sorted out. - a_chordPaths = new Paths(2); - b_chordPaths = new Paths(2); - - aChordLengths = new[] { 0.0, 0.0 }; - bChordLengths = new[] { 0.0, 0.0 }; - - // Max and min indices for each path. - // We'll use these for our chord within the edge checks. - aPath_maxX_index = GeoWrangler.MaxX(a); - bPath_maxY_index = GeoWrangler.MaxY(b); - aPath_minX_index = GeoWrangler.MinX(a); - bPath_minY_index = GeoWrangler.MinY(b); - - // Set up KDTrees for edge inspection. - aTree = new KDTree(2, a.Count); - for (int aPt = 0; aPt < a.Count; aPt++) - { - aTree.AddPoint(new double[] { a[aPt].X, a[aPt].Y }, new IntPoint(a[aPt].X, a[aPt].Y)); - } - bTree = new KDTree(2, b.Count); - for (int bPt = 0; bPt < b.Count; bPt++) - { - bTree.AddPoint(new double[] { b[bPt].X, b[bPt].Y }, new IntPoint(b[bPt].X, b[bPt].Y)); - } - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) != (int)CommonVars.chordCalcElements.b) - { - try - { - doPathA(); - } - catch (Exception) - { - } - } - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) >= (int)CommonVars.chordCalcElements.b) - { - try - { - doPathB(); - } - catch (Exception) - { - } - } - - double cutOffValue = simulationSettings.getResolution() * CentralProperties.scaleFactorForOperation / 10; // arbitrary cut-off since rounding errors don't always mean 0 for a glancing contact. - - for (int r = 0; r < 2; r++) - { - if (aChordLengths[r] <= cutOffValue) - { - aChordLengths[r] = 0; - } - - if (bChordLengths[r] <= cutOffValue) - { - bChordLengths[r] = 0; - } - } - - // So this is where things get a little tricky. It can be the case that we have 'left/right' chords reported for only one of top/bottom, and vice versa. - // This is a natural consequence of the line clipping and we need to manage the output accordingly. - // Things otherwise break quite badly because we end up reporting invalid chords (see the chord_4 test case) - // As such, we need to perform some inspection and tag certain configurations as invalid. - // Note that this cross-setting can be confusing at first glance. - - bool aChordsValid = true; - bool bChordsValid = true; - - // We also need to be mindful of the user option for which chords to inspect. We should only need to wrangle this in case all chords are being requested. - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) > (int)CommonVars.chordCalcElements.b) - { - /* - * If top > 0 and bottom == 0, can't have left or right chords - no bisection - * If top == 0 and bottom > 0, can't have left or right chords - no bisection. - * If top == 0 and bottom == 0, can have left or right chords. - * - */ - - if ( - aChordLengths[0] > 0 && aChordLengths[1] == 0 || - aChordLengths[1] > 0 && aChordLengths[0] == 0 - ) - - { - bChordsValid = false; - } - else - { - if (aChordLengths[0] == 0 && aChordLengths[1] == 0) - { - aChordsValid = false; - } - } - } - - if (!aChordsValid) - { - a_chordPaths[0] = new Path {new(0, 0)}; - a_chordPaths[1] = new Path {new(0, 0)}; - aChordLengths = new double[] { 0, 0 }; - } - - if (bChordsValid) - { - return; - } - - b_chordPaths[0] = new Path {new(0, 0)}; - b_chordPaths[1] = new Path {new(0, 0)}; - bChordLengths = new double[] { 0, 0 }; - } -} \ No newline at end of file diff --git a/Common/Variance/engines/distanceHandler.cs b/Common/Variance/engines/distanceHandler.cs deleted file mode 100644 index 5b05ea0..0000000 --- a/Common/Variance/engines/distanceHandler.cs +++ /dev/null @@ -1,726 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using ClipperLib1; -using Error; -using geoLib; -using geoWrangler; -using KDTree; -using utility; - -namespace Variance; - -using Path = List; -using Paths = List>; - -internal class DistanceHandler -{ - private const bool debug = false; - public Paths resultPaths { get; private set; } - private double resultDistance; - public string distanceString { get; private set; } - private bool invert; - - private void ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt) - { - pt.Z = -1; // Tag our intersection points. - } - - private class spaceResult - { - public bool done { get; set; } // to flag early return. - public double distance { get; set; } - public Paths resultPaths { get; set; } - - public spaceResult() - { - resultPaths = new Paths(); - } - } - - public DistanceHandler(Paths aPaths, Paths bPaths, EntropySettings simulationSettings, bool runThreaded) - { - distanceHandlerLogic(aPaths, bPaths, simulationSettings, runThreaded); - } - - private void distanceHandlerLogic(Paths aPaths, Paths bPaths, EntropySettings simulationSettings, bool runThreaded) - { - resultPaths = new Paths(); - // Safety check for no active layers. - if (aPaths.Count == 1 && aPaths[0].Count == 1 || - bPaths.Count == 1 && bPaths[0].Count == 1) - { - Path tempPath = new() {new IntPoint(0, 0)}; - resultPaths.Add(tempPath.ToList()); - distanceString = "N/A"; - } - else - { - invert = true; - // Experimental check to see whether we can simplify this approach. - bool isEnclosed = GeoWrangler.enclosed(aPaths, bPaths); - - - if (!isEnclosed) - { - // Overlap method sets result fields. - overlap(aPaths, bPaths, simulationSettings, runThreaded); - } - else - { - spaceResult result = fastKDTree(aPaths, bPaths, simulationSettings); - - resultDistance = result.distance; - resultPaths = result.resultPaths; - } - - distanceString = resultDistance.ToString(CultureInfo.InvariantCulture); - } - } - - private spaceResult fastKDTree(Paths aPaths, Paths bPaths, EntropySettings simulationSettings) - { - int numberOfPoints = 0; - double currentMinimum = 0; - Path minimumDistancePath = new(); - bool resultNeedsInversion = false; - - double refArea = 0; - - foreach (Path t in bPaths) - { - numberOfPoints += t.Count; - refArea += Clipper.Area(t); - } - // KDTree to store the points from our target shape(s) - KDTree pTree = new(2, numberOfPoints); - - for (int shapeA = 0; shapeA < aPaths.Count; shapeA++) - { - foreach (Path t in bPaths) - { - for (int pointB = 0; pointB < t.Count; pointB++) - { - try - { - pTree.AddPoint(new double[] { t[pointB].X, t[pointB].Y }, new GeoLibPointF(t[pointB].X, t[pointB].Y)); - } - catch (Exception ex) - { - ErrorReporter.showMessage_OK("Oops", "jobEngine() KDTree error: " + ex); - } - } - } - - // Do we need to invert the result? - Clipper c = new() {PreserveCollinear = true}; - Paths oCheck = new(); - c.AddPaths(bPaths, PolyType.ptClip, true); - c.AddPath(aPaths[shapeA], PolyType.ptSubject, true); - c.Execute(ClipType.ctUnion, oCheck); - - double oCheckArea = oCheck.Sum(t => Clipper.Area(t)); - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosure || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosureOld) // negative value since we're fully inside a containing polygon. - { - resultNeedsInversion = Math.Abs(Math.Abs(oCheckArea) - Math.Abs(refArea)) > double.Epsilon; - } - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacing || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacingOld) // negative value since we're fully outside a containing polygon. - { - resultNeedsInversion = Math.Abs(Math.Abs(oCheckArea) - Math.Abs(refArea)) < double.Epsilon; - } - - // We can query here for the minimum distance for each shape combination. - for (int pointA = 0; pointA < aPaths[shapeA].Count; pointA++) - { - // '1' forces a single nearest neighbor to be returned. - NearestNeighbour pIter = pTree.NearestNeighbors(new double[] { aPaths[shapeA][pointA].X, aPaths[shapeA][pointA].Y }, 1); - while (pIter.MoveNext()) - { - double currentDistance = pIter.CurrentDistance; - - if ((shapeA != 0 || pointA != 0) && !(currentDistance < currentMinimum)) - { - continue; - } - - minimumDistancePath.Clear(); - minimumDistancePath.Add(new IntPoint(aPaths[shapeA][pointA])); - minimumDistancePath.Add(new IntPoint((pIter.Current.X + aPaths[shapeA][pointA].X) / 2.0f, (pIter.Current.Y + aPaths[shapeA][pointA].Y) / 2.0f)); - minimumDistancePath.Add(new IntPoint(pIter.Current.X, pIter.Current.Y)); - currentMinimum = currentDistance; - } - } - } - - spaceResult result = new() - { - resultPaths = new Paths {minimumDistancePath}, - // k-d tree distance is the squared distance. Need to scale and sqrt - distance = Math.Sqrt(currentMinimum / Utils.myPow(CentralProperties.scaleFactorForOperation, 2)) - }; - - if (resultNeedsInversion) - { - result.distance *= -1; - } - - return result; - } - - private void overlap(Paths aPaths, Paths bPaths, EntropySettings simulationSettings, bool runThreaded) - { - bool completeOverlap = false; - foreach (Path layerAPath in aPaths) - { - foreach (Path layerBPath in bPaths) - { - Paths overlapShape = new(); - - // Check for complete overlap - Clipper c = new() {PreserveCollinear = true}; - // Try a union and see whether the point count of the perimeter changes. This might break for re-entrant cases, but those are problematic anyway. - Paths fullOverlapCheck = new(); - c.AddPath(layerAPath, PolyType.ptSubject, true); - c.AddPath(layerBPath, PolyType.ptClip, true); - c.Execute(ClipType.ctUnion, fullOverlapCheck); - double aArea = Math.Abs(Clipper.Area(layerAPath)); - double bArea = Math.Abs(Clipper.Area(layerBPath)); - double uArea = fullOverlapCheck.Sum(t => Clipper.Area(t)); - uArea = Math.Abs(uArea); - - // If overlap area matches either of the input areas, we have a full overlap - if (Math.Abs(aArea - uArea) < double.Epsilon || Math.Abs(bArea - uArea) < double.Epsilon) - { - completeOverlap = true; - } - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacing || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacingOld) // spacing - { - // Perform an area check in case of overlap. - // Overlap means X/Y negative space needs to be reported. - AreaHandler aH = new(new Paths { layerAPath }, new Paths { layerBPath }, maySimplify: false, perPoly: false, scaleFactorForPointF: 1.0); - overlapShape = aH.listOfOutputPoints;//.ToList(); - } - - if (!completeOverlap && (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosure || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosureOld)) // enclosure - { - // Need to find the region outside our enclosure shape. We use the modifier to handle this. - c.Clear(); - c.ZFillFunction = ZFillCallback; - c.StrictlySimple = true; - c.PreserveCollinear = true; - // Try cutting layerB from layerA - c.AddPath(layerAPath, PolyType.ptSubject, true); - c.AddPath(layerBPath, PolyType.ptClip, true); - c.Execute(ClipType.ctDifference, overlapShape); - } - - if (completeOverlap || !overlapShape.Any()) - { - continue; - } - - spaceResult result = doPartialOverlap(overlapShape, layerAPath, layerBPath, simulationSettings, runThreaded); - if (!result.done || resultPaths.Any() && !(result.distance < resultDistance)) - { - continue; - } - - resultPaths = result.resultPaths; - resultDistance = result.distance; - } - } - } - - private spaceResult doPartialOverlap(Paths overlapShape, Path aPath, Path bPath, EntropySettings simulationSettings, bool runThreaded) - { - spaceResult result = new(); - - // KDTree to store the points from our input shape(s) - int aPathCount = aPath.Count; - int bPathCount = bPath.Count; - KDTree aTree = new(2, aPathCount); - KDTree bTree = new(2, bPathCount); - for (int pt = 0; pt < aPathCount; pt++) - { - aTree.AddPoint(new double[] { aPath[pt].X, aPath[pt].Y }, new GeoLibPointF(aPath[pt].X, aPath[pt].Y)); - } - for (int pt = 0; pt < bPathCount; pt++) - { - bTree.AddPoint(new double[] { bPath[pt].X, bPath[pt].Y }, new GeoLibPointF(bPath[pt].X, bPath[pt].Y)); - } - - int oCount = overlapShape.Count; - - try - { - // Process the overlap shape polygon(s) to evaluate the overlap. - for (int poly = 0; poly < oCount; poly++) - { - // Brute force decomposition of the overlap shape into A and B edge contributions. - // ClipperLib isn't robust for this, so we have to brute force it : line clipping fails and PointInPolygon is unreliable. - - int ptCount = overlapShape[poly].Count; - bool[] residesOnAEdge = new bool[ptCount]; - bool[] residesOnBEdge = new bool[ptCount]; - - for (int pt = 0; pt < ptCount; pt++) - { - residesOnAEdge[pt] = false; - residesOnBEdge[pt] = false; - if (overlapShape[poly][pt].Z == -1) - { - residesOnAEdge[pt] = true; - residesOnBEdge[pt] = true; - } - else - { - // Use the KDTree approach to find the nearest neighbor on each input shape to the point on the overlap geometry. - // Minimum distance wins ownership. - var aIter = aTree.NearestNeighbors(new double[] { overlapShape[poly][pt].X, overlapShape[poly][pt].Y }, 1); - aIter.MoveNext(); - double distanceToAEdge = Math.Sqrt(aIter.CurrentDistance); - var bIter = bTree.NearestNeighbors(new double[] { overlapShape[poly][pt].X, overlapShape[poly][pt].Y }, 1); - bIter.MoveNext(); - double distanceToBEdge = Math.Sqrt(bIter.CurrentDistance); - if (distanceToAEdge < distanceToBEdge) - { - // This overlap point is close to a point on A, so tag it and move to the next overlap point. - residesOnAEdge[pt] = true; - } - else - { - // This overlap point is close to a point on B, so tag it and move to the next overlap point. - residesOnBEdge[pt] = true; - } - } - } - - // Now we need to construct our Paths for the overlap edges, based on the true/false case for each array. - Paths aOverlapEdge = new(); - Paths bOverlapEdge = new(); - - Path tempPath = new(); - for (int i = 0; i < ptCount; i++) - { - if (residesOnAEdge[i]) - { - tempPath.Add(new IntPoint(overlapShape[poly][i])); - } - else // not found on A edge, probably resides on B edge, but we'll check that separately to keep code readable. - { - // If we have a tempPath with more than a single point in it, we have been creating a segment. - // Since we haven't found this point in the A edge, commit the segment and clear the temporary path. - if (tempPath.Count < 1) - { - continue; - } - - // We have some points, but now we're getting a new segment. - aOverlapEdge.Add(tempPath.ToList()); - tempPath.Clear(); - } - } - if (tempPath.Count > 1) - { - aOverlapEdge.Add(tempPath.ToList()); - } - - tempPath.Clear(); - for (int i = 0; i < ptCount; i++) - { - if (residesOnBEdge[i]) - { - tempPath.Add(new IntPoint(overlapShape[poly][i])); - } - else - { - if (tempPath.Count <= 1) - { - continue; - } - - // We have some points, but now we're getting a new segment. - bOverlapEdge.Add(tempPath.ToList()); - tempPath.Clear(); - } - } - if (tempPath.Count > 1) - { - bOverlapEdge.Add(tempPath.ToList()); - } - - // Walk our edges to figure out the overlap. - foreach (spaceResult tResult in aOverlapEdge.SelectMany(t => bOverlapEdge.Select(t1 => overlapAssess(simulationSettings, overlapShape[poly], t, t1, aPath, bPath, runThreaded)).Where(tResult => result.resultPaths.Count == 0 || tResult.distance > result.distance))) - { - result.distance = tResult.distance; - result.resultPaths = tResult.resultPaths; - } - } - } - catch (Exception e) - { - ErrorReporter.showMessage_OK(e.ToString(), "Oops"); - } - result.done = true; - if (!simulationSettings.debugCalc) - { - result.distance = -result.distance / CentralProperties.scaleFactorForOperation; - } - return result; - } - - private spaceResult overlapAssess(EntropySettings simulationSettings, Path overlapPoly, Path aOverlapEdge, Path bOverlapEdge, Path aPath, Path bPath, bool runThreaded) - { - spaceResult result = new(); - double maxDistance_orthogonalFallback = 0; // fallback for the overlap case of orthogonal geometry, where self-intersections occur. - int maxDistance_fallbackIndex = 0; - double maxDistance = 0; // for the overlap cases. - - double lengthA = 0; - double lengthB = 0; - Path extractedPath = new(); - bool usingAEdge = false; - - /* Prior to 1.7, we used the edge from the layerB combination to raycast. This was not ideal. - We should have used the shortest edge. 1.7 adds an option to make this the behavior, and the old - approach is retained for now as well. - */ - - IntPoint shortestPathBeforeStartPoint = new(0, 0); - IntPoint shortestPathAfterEndPoint = new(0, 0); - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacing) - { - // Find the shortest edge length and use that for the projection reference - // Calculate lengths and check. - for (int pt = 0; pt < aOverlapEdge.Count - 1; pt++) - { - lengthA += Math.Sqrt(Utils.myPow(aOverlapEdge[pt + 1].X - aOverlapEdge[pt].X, 2) + Utils.myPow(aOverlapEdge[pt + 1].Y - aOverlapEdge[pt].Y, 2)); - } - for (int pt = 0; pt < bOverlapEdge.Count - 1; pt++) - { - lengthB += Math.Sqrt(Utils.myPow(bOverlapEdge[pt + 1].X - bOverlapEdge[pt].X, 2) + Utils.myPow(bOverlapEdge[pt + 1].Y - bOverlapEdge[pt].Y, 2)); - } - - extractedPath = bOverlapEdge; // need a default in case of equivalent lengths - - if (extractedPath.Count == 0) - { - // No common overlap. - result.distance = 0; - return result; - } - - // Here we need to go back to our input polygons to derive the edge segment normal for the start/end of each edge. - if (lengthA < lengthB) - { - usingAEdge = true; - extractedPath = aOverlapEdge; - int startIndex = aPath.FindIndex(p => p.Equals(extractedPath[0])); - if (startIndex == 0) - { - startIndex = aPath.Count - 1; - } - if (startIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double startDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], aPath[0]); - startIndex = 0; - for (int pt = 1; pt < aPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], aPath[pt]); - if (!(distanceCheck < startDistanceCheck)) - { - continue; - } - - startDistanceCheck = distanceCheck; - startIndex = pt; - } - } - - int endIndex = aPath.FindIndex(p => p.Equals(extractedPath[^1])); - if (endIndex == aPath.Count - 1) - { - endIndex = 0; - } - if (endIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double endDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], aPath[0]); - endIndex = 0; - for (int pt = 1; pt < aPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], aPath[pt]); - if (!(distanceCheck < endDistanceCheck)) - { - continue; - } - - endDistanceCheck = distanceCheck; - endIndex = pt; - } - } - - shortestPathBeforeStartPoint = new IntPoint(aPath[startIndex]); - shortestPathAfterEndPoint = new IntPoint(aPath[endIndex]); - } - else - { - int startIndex = bPath.FindIndex(p => p.Equals(extractedPath[0])); - if (startIndex == 0) - { - startIndex = bPath.Count - 1; - } - if (startIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double startDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], bPath[0]); - startIndex = 0; - - for (int pt = 1; pt < bPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], bPath[pt]); - if (!(distanceCheck < startDistanceCheck)) - { - continue; - } - - startDistanceCheck = distanceCheck; - startIndex = pt; - } - } - - int endIndex = bPath.FindIndex(p => p.Equals(extractedPath[^1])); - if (endIndex == bPath.Count - 1) - { - endIndex = 0; - } - if (endIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double endDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], bPath[0]); - endIndex = 0; - for (int pt = 1; pt < bPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], bPath[pt]); - if (!(distanceCheck < endDistanceCheck)) - { - continue; - } - - endDistanceCheck = distanceCheck; - endIndex = pt; - } - } - - shortestPathBeforeStartPoint = new IntPoint(bPath[startIndex]); - shortestPathAfterEndPoint = new IntPoint(bPath[endIndex]); - } - } - - if (simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.spacingOld || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosure || simulationSettings.getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.spacingCalcModes.enclosureOld) - { - - extractedPath = bOverlapEdge; - - if (extractedPath.Count == 0) // No common edge. - { - result.distance = 0; - return result; - } - - int startIndex = bPath.FindIndex(p => p.Equals(extractedPath[0])); - if (startIndex == 0) - { - startIndex = bPath.Count - 1; - } - if (startIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double startDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], bPath[0]); - startIndex = 0; - for (int pt = 1; pt < bPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[0], bPath[pt]); - if (!(distanceCheck < startDistanceCheck)) - { - continue; - } - - startDistanceCheck = distanceCheck; - startIndex = pt; - } - } - - int endIndex = bPath.FindIndex(p => p.Equals(extractedPath[^1])); - if (endIndex == bPath.Count - 1) - { - endIndex = 0; - } - if (endIndex == -1) - { - // Failed to find it cheaply. Let's try a different approach. - double endDistanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], bPath[0]); - for (int pt = 1; pt < bPath.Count; pt++) - { - double distanceCheck = GeoWrangler.distanceBetweenPoints(extractedPath[^1], bPath[pt]); - endIndex = 0; - if (!(distanceCheck < endDistanceCheck)) - { - continue; - } - - endDistanceCheck = distanceCheck; - endIndex = pt; - } - } - - try - { - shortestPathBeforeStartPoint = new IntPoint(bPath[startIndex]); - } - catch (Exception) - { - ErrorReporter.showMessage_OK("distanceHandler: shortestPathBeforeStartPoint failed.", "Oops"); - } - try - { - shortestPathAfterEndPoint = new IntPoint(bPath[endIndex]); - } - catch (Exception) - { - ErrorReporter.showMessage_OK("distanceHandler: shortestPathAfterEndPoint failed.", "Oops"); - } - } - - // No blurry rays, so no point running the inner loop threaded. We thread the outer loop (the emission edge raycast), though. Testing showed small performance improvement for this approach. - RayCast rc = new(extractedPath, overlapPoly, CentralProperties.scaleFactorForOperation * CentralProperties.scaleFactorForOperation, runThreaded, invert, 0, true, false, shortestPathBeforeStartPoint, shortestPathAfterEndPoint); - - if (debug || simulationSettings.debugCalc) - { - result.done = true; - result.resultPaths = rc.getRays(); - result.distance = -1; - return result; - } - - Paths clippedLines = rc.getClippedRays(); - - bool validOverlapFound = false; - - // Need to scan for the maximum path length to record the overlap. - for (int line = 0; line < clippedLines.Count; line++) - { - double lineLength = rc.getRayLength(line); - // With the new LER implementation, normals can be fired in problematic directions. - // Valid overlaps don't have start and end points on the same polygon. - // Happily, we feed this polygon-wise, which makes the evaluation much easier. - bool validOverlap = true; - - double startPointCheck_A_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][0], aOverlapEdge[0]); - double endPointCheck_A_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][1], aOverlapEdge[0]); - foreach (IntPoint t in aOverlapEdge) - { - double temp_startPointCheck_A_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][0], t); - double temp_endPointCheck_A_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][1], t); - if (temp_startPointCheck_A_dist < startPointCheck_A_dist) - { - startPointCheck_A_dist = temp_startPointCheck_A_dist; - } - if (temp_endPointCheck_A_dist < endPointCheck_A_dist) - { - endPointCheck_A_dist = temp_endPointCheck_A_dist; - } - } - - double startPointCheck_B_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][0], bOverlapEdge[0]); - double endPointCheck_B_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][1], bOverlapEdge[0]); - foreach (IntPoint t in bOverlapEdge) - { - double temp_startPointCheck_B_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][0], t); - double temp_endPointCheck_B_dist = GeoWrangler.distanceBetweenPoints(clippedLines[line][1], t); - if (temp_startPointCheck_B_dist < startPointCheck_B_dist) - { - startPointCheck_B_dist = temp_startPointCheck_B_dist; - } - if (temp_endPointCheck_B_dist < endPointCheck_B_dist) - { - endPointCheck_B_dist = temp_endPointCheck_B_dist; - } - } - - bool ortho = clippedLines[line][0].X == clippedLines[line][1].X || clippedLines[line][0].Y == clippedLines[line][1].Y; - - double threshold = 1500; // arbitrary, dialed in by hand. - - if (ortho || usingAEdge && startPointCheck_A_dist < threshold && endPointCheck_A_dist < threshold || !usingAEdge && startPointCheck_B_dist < threshold && endPointCheck_B_dist < threshold - ) - { - // This is a special situation, it turns out. - // There is one specific scenario where this overlap case (start and end on the same geometry) is valid - orthogonal shapes with a bisection. - // The orthogonal shapes cause the rays to hit the opposite side of the shape. We don't want to reject this. - if (!(lineLength > maxDistance_orthogonalFallback)) - { - continue; - } - - maxDistance_fallbackIndex = line; - maxDistance_orthogonalFallback = lineLength; - } - else - { - if (usingAEdge && startPointCheck_A_dist < threshold && endPointCheck_B_dist > threshold || - !usingAEdge && startPointCheck_B_dist < threshold && endPointCheck_A_dist > threshold) - { - validOverlap = false; - } - - if (!validOverlap || !(lineLength > maxDistance)) - { - continue; - } - - validOverlapFound = true; - maxDistance = lineLength; - Path tempPath = new() - { - new IntPoint(clippedLines[line][0]), - new IntPoint(clippedLines[line][0]), - new IntPoint(clippedLines[line][clippedLines[line].Count - 1]) - }; - result.resultPaths.Clear(); - result.resultPaths.Add(tempPath); - } - } - - try - { - if (clippedLines.Any() && !validOverlapFound || maxDistance_orthogonalFallback > maxDistance) - { - // Couldn't find a valid overlap so assume the orthogonal fallback is needed. - maxDistance = maxDistance_orthogonalFallback; - Path tempPath = new() - { - new IntPoint(clippedLines[maxDistance_fallbackIndex][0]), - new IntPoint(clippedLines[maxDistance_fallbackIndex][0]), - new IntPoint( - clippedLines[maxDistance_fallbackIndex] - [clippedLines[maxDistance_fallbackIndex].Count - 1]) - }; - result.resultPaths.Clear(); - result.resultPaths.Add(tempPath); - } - } - catch (Exception) - { - // Harmless - we'll reject the case and move on. - } - - result.distance = maxDistance; - return result; - } -} \ No newline at end of file diff --git a/Common/Variance/entropy/entropyLayerSettings.cs b/Common/Variance/entropy/entropyLayerSettings.cs index 656bdac..fbdeb88 100644 --- a/Common/Variance/entropy/entropyLayerSettings.cs +++ b/Common/Variance/entropy/entropyLayerSettings.cs @@ -2,71 +2,24 @@ using System.Collections.Generic; using System.Linq; using geoLib; +using shapeEngine; namespace Variance; [Serializable] -public class EntropyLayerSettings +public class EntropyLayerSettings : ShapeSettings { private static string default_comment = ""; private static int[] default_bgLayers = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - private static int default_enabled = 0; - private static int default_geoCoreShapeEngine = 0; private static int default_showDrawn = 0; - private static int default_alignGeom = 0; - private static string default_layerName = ""; - private static int default_shapeIndex = (int)CentralProperties.typeShapes.none; - - private static decimal default_subShapeHorLength = 0; - private static decimal default_subShapeHorOffset = 0; - private static decimal default_subShapeVerLength = 0; - private static decimal default_subShapeVerOffset = 0; - private static int default_subShapeTipLocIndex = 0; - private static decimal default_subShape2HorLength = 0; - private static decimal default_subShape2HorOffset = 0; - private static decimal default_subShape2VerLength = 0; - private static decimal default_subShape2VerOffset = 0; - private static int default_subShape2TipLocIndex = 0; - private static decimal default_subShape3HorLength = 0; - private static decimal default_subShape3HorOffset = 0; - private static decimal default_subShape3VerLength = 0; - private static decimal default_subShape3VerOffset = 0; - private static int default_subShape3TipLocIndex = 0; - private static int default_subShapeRefIndex = 0; - private static int default_posInSubShapeIndex = (int)CommonVars.subShapeLocations.BL; - - private static decimal default_globalHorOffset = 0; - private static decimal default_globalVerOffset = 0; - - private static decimal default_sideBias = 0; - private static decimal default_horTipBias = 0; + private static string default_rngmapping = CommonVars.boxMuller; - private static decimal default_horTipBiasNVar = 0; - private static decimal default_horTipBiasPVar = 0; - private static decimal default_verTipBias = 0; - private static decimal default_verTipBiasNVar = 0; - private static decimal default_verTipBiasPVar = 0; - private static decimal default_rotation = 0; - private static decimal default_proximityBias = 0; - private static decimal default_proximityIsoDistance = 0; - private static int default_proximitySideRays = 2; - private static int default_proximitySideRaysFallOff = 0; - private static decimal default_proximitySideRaysFallOffMultiplier = 1.0m; - - private static int default_edgeSlide = 0; - private static decimal default_edgeSlideTension = 0.35m; private static decimal default_wobble = 0; - private static decimal default_innerCRR = 0; private static decimal default_innerCV = 0; - private static decimal default_outerCRR = 0; private static decimal default_outerCV = 0; - private static decimal default_LWR = 0; - private static int default_LWRNoiseType = (int)CommonVars.noiseIndex.perlin; private static int default_correlatedLWR = 0; private static int default_correlatedLWRLayerIndex = -1; - private static int default_LWRNoisePreview = 0; - private static decimal default_LWRNoiseFreq = 0.2m; private static decimal default_sideCDU = 0; private static decimal default_tipsCDU = 0; private static decimal default_horOverlay = 0; @@ -87,16 +40,13 @@ public class EntropyLayerSettings private static int[] default_overlayXReferenceLayers = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; private static int[] default_overlayYReferenceLayers = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - private static int default_flipH = 0; - private static int default_flipV = 0; - private static int default_fileType = 0; // layout (now exposed by geoCore - could be redundant) private static List default_fileData = new() { new [] { new GeoLibPointF(0, 0) } }; private static string default_fileToLoad = ""; private static string default_ldNameFromFile = ""; private static string default_structureNameFromFile = ""; private static int default_ldFromFile = 0; - private static int default_polyFill = (int)CommonVars.PolyFill.pftNonZero; // non-zero + private static int default_polyFill = (int)PolyFill.pftNonZero; // non-zero private static int default_structureFromFile = 0; private static int default_perPoly = 0; private static int default_referenceLayout = 0; @@ -112,8 +62,8 @@ public class EntropyLayerSettings private static int default_omitLayer = 0; - private static decimal default_rayExtension = 1.03m; - + private static int default_LWRNoisePreview = 0; + [NonSerialized] private int[] bgLayers; private int[] overlayXReferenceLayers; @@ -131,7 +81,7 @@ public bool isLayerActive() private bool pIsLayerActive() { - return enabled == 1 && omitFromSim == 0; + return getInt(ShapeSettings.properties_i.enabled) == 1 && omitFromSim == 0; } public int[] getIntArray(properties_intarray p) @@ -245,22 +195,9 @@ private void pSetIntArrayValue(properties_intarray p, int index, int val) } } - private int enabled; private int omitFromSim; // prevent layer being included in simulation. - private int geoCoreShapeEngine; - + [NonSerialized] private int showDrawn; - - private int shapeIndex; - private int subShapeTipLocIndex; - private int subShape2TipLocIndex; - private int subShape3TipLocIndex; - private int subShapeRefIndex; - private int posInSubShapeIndex; - private int proximitySideRays; - private int edgeSlide; - private int LWRNoiseType; - private int LWR2NoiseType; private int correlatedLWR; private int correlatedLWRLayerIndex; private int correlatedLWR2; @@ -280,9 +217,6 @@ private void pSetIntArrayValue(properties_intarray p, int index, int val) private int overlayYReferenceLayer; private int averageOverlayX; private int averageOverlayY; - private int flipH; - private int flipV; - private int alignGeomX, alignGeomY; private int structureFromFile; private int ldFromFile; private int polyFill; @@ -294,10 +228,8 @@ private void pSetIntArrayValue(properties_intarray p, int index, int val) private int booleanLayerOpA; private int booleanLayerOpB; private int booleanLayerOpAB; - - private int proxSideRaysFallOff; - - public enum properties_i + + public new enum properties_i { enabled, omit, gCSEngine, showDrawn, shapeIndex, shape0Tip, shape1Tip, shape2Tip, subShapeIndex, posIndex, proxRays, proxSideRaysFallOff, edgeSlide, lwrType, lwr2Type, lwrPreview, lwr_corr, lwr_corr_ref, lwr2_corr, lwr2_corr_ref, @@ -318,46 +250,61 @@ private int pGetInt(properties_i p) switch (p) { case properties_i.enabled: - ret = enabled; + ret = getInt(ShapeSettings.properties_i.enabled); break; - case properties_i.omit: - ret = omitFromSim; + case properties_i.shapeIndex: + ret = getInt(ShapeSettings.properties_i.shapeIndex); break; case properties_i.gCSEngine: - ret = geoCoreShapeEngine; - break; - case properties_i.showDrawn: - ret = showDrawn; - break; - case properties_i.shapeIndex: - ret = shapeIndex; + ret = getInt(ShapeSettings.properties_i.gCSEngine); break; case properties_i.shape0Tip: - ret = subShapeTipLocIndex; + ret = getInt(ShapeSettings.properties_i.subShapeTipLocIndex); break; case properties_i.shape1Tip: - ret = subShape2TipLocIndex; + ret = getInt(ShapeSettings.properties_i.subShape2TipLocIndex); break; case properties_i.shape2Tip: - ret = subShape3TipLocIndex; + ret = getInt(ShapeSettings.properties_i.subShape3TipLocIndex); break; case properties_i.subShapeIndex: - ret = subShapeRefIndex; + ret = getInt(ShapeSettings.properties_i.subShapeRefIndex); break; case properties_i.posIndex: - ret = posInSubShapeIndex; + ret = getInt(ShapeSettings.properties_i.posInSubShapeIndex); + break; + case properties_i.edgeSlide: + ret = getInt(ShapeSettings.properties_i.edgeSlide); break; case properties_i.proxRays: - ret = proximitySideRays; + ret = getInt(ShapeSettings.properties_i.proxRays); break; - case properties_i.edgeSlide: - ret = edgeSlide; + case properties_i.proxSideRaysFallOff: + ret = getInt(ShapeSettings.properties_i.proxSideRaysFallOff); break; case properties_i.lwrType: - ret = LWRNoiseType; + ret = getInt(ShapeSettings.properties_i.lwrType); break; case properties_i.lwr2Type: - ret = LWR2NoiseType; + ret = getInt(ShapeSettings.properties_i.lwr2Type); + break; + case properties_i.flipH: + ret = getInt(ShapeSettings.properties_i.flipH); + break; + case properties_i.flipV: + ret = getInt(ShapeSettings.properties_i.flipV); + break; + case properties_i.alignX: + ret = getInt(ShapeSettings.properties_i.alignX); + break; + case properties_i.alignY: + ret = getInt(ShapeSettings.properties_i.alignY); + break; + case properties_i.omit: + ret = omitFromSim; + break; + case properties_i.showDrawn: + ret = showDrawn; break; case properties_i.lwr_corr: ret = correlatedLWR; @@ -410,18 +357,6 @@ private int pGetInt(properties_i p) case properties_i.tCDU_corr_ref: ret = correlatedTipCDULayerIndex; break; - case properties_i.alignX: - ret = alignGeomX; - break; - case properties_i.alignY: - ret = alignGeomY; - break; - case properties_i.flipH: - ret = flipH; - break; - case properties_i.flipV: - ret = flipV; - break; case properties_i.structure: ret = structureFromFile; break; @@ -455,9 +390,6 @@ private int pGetInt(properties_i p) case properties_i.bLayerOpAB: ret = booleanLayerOpAB; break; - case properties_i.proxSideRaysFallOff: - ret = proxSideRaysFallOff; - break; } return ret; @@ -473,46 +405,61 @@ private void pSetInt(properties_i p, int val) switch (p) { case properties_i.enabled: - enabled = val; + setInt(ShapeSettings.properties_i.enabled, val); break; - case properties_i.omit: - omitFromSim = val; + case properties_i.shapeIndex: + setInt(ShapeSettings.properties_i.shapeIndex, val); break; case properties_i.gCSEngine: - geoCoreShapeEngine = val; - break; - case properties_i.showDrawn: - showDrawn = val; - break; - case properties_i.shapeIndex: - shapeIndex = val; + setInt(ShapeSettings.properties_i.gCSEngine, val); break; case properties_i.shape0Tip: - subShapeTipLocIndex = val; + setInt(ShapeSettings.properties_i.subShapeTipLocIndex, val); break; case properties_i.shape1Tip: - subShape2TipLocIndex = val; + setInt(ShapeSettings.properties_i.subShape2TipLocIndex, val); break; case properties_i.shape2Tip: - subShape3TipLocIndex = val; + setInt(ShapeSettings.properties_i.subShape3TipLocIndex, val); break; case properties_i.subShapeIndex: - subShapeRefIndex = val; + setInt(ShapeSettings.properties_i.subShapeRefIndex, val); break; case properties_i.posIndex: - posInSubShapeIndex = val; + setInt(ShapeSettings.properties_i.posInSubShapeIndex, val); + break; + case properties_i.edgeSlide: + setInt(ShapeSettings.properties_i.edgeSlide, val); break; case properties_i.proxRays: - proximitySideRays = val; + setInt(ShapeSettings.properties_i.proxRays, val); break; - case properties_i.edgeSlide: - edgeSlide = val; + case properties_i.proxSideRaysFallOff: + setInt(ShapeSettings.properties_i.proxSideRaysFallOff, val); break; case properties_i.lwrType: - LWRNoiseType = val; + setInt(ShapeSettings.properties_i.lwrType, val); break; case properties_i.lwr2Type: - LWR2NoiseType = val; + setInt(ShapeSettings.properties_i.lwr2Type, val); + break; + case properties_i.flipH: + setInt(ShapeSettings.properties_i.flipH, val); + break; + case properties_i.flipV: + setInt(ShapeSettings.properties_i.flipV, val); + break; + case properties_i.alignX: + setInt(ShapeSettings.properties_i.alignX, val); + break; + case properties_i.alignY: + setInt(ShapeSettings.properties_i.alignY, val); + break; + case properties_i.showDrawn: + showDrawn = val; + break; + case properties_i.omit: + omitFromSim = val; break; case properties_i.lwrPreview: LWRNoisePreview = val; @@ -565,18 +512,6 @@ private void pSetInt(properties_i p, int val) case properties_i.tCDU_corr_ref: correlatedTipCDULayerIndex = val; break; - case properties_i.alignX: - alignGeomX = val; - break; - case properties_i.alignY: - alignGeomY = val; - break; - case properties_i.flipH: - flipH = val; - break; - case properties_i.flipV: - flipV = val; - break; case properties_i.structure: structureFromFile = val; break; @@ -610,9 +545,6 @@ private void pSetInt(properties_i p, int val) case properties_i.bLayerOpAB: booleanLayerOpAB = val; break; - case properties_i.proxSideRaysFallOff: - proxSideRaysFallOff = val; - break; } } @@ -625,9 +557,56 @@ private void pDefaultInt(properties_i p) { switch (p) { + case properties_i.enabled: + defaultInt(ShapeSettings.properties_i.enabled); + break; + case properties_i.shapeIndex: + defaultInt(ShapeSettings.properties_i.shapeIndex); + break; + case properties_i.gCSEngine: + defaultInt(ShapeSettings.properties_i.gCSEngine); + break; + case properties_i.shape0Tip: + defaultInt(ShapeSettings.properties_i.subShapeTipLocIndex); + break; + case properties_i.shape1Tip: + defaultInt(ShapeSettings.properties_i.subShape2TipLocIndex); + break; + case properties_i.shape2Tip: + defaultInt(ShapeSettings.properties_i.subShape3TipLocIndex); + break; + case properties_i.subShapeIndex: + defaultInt(ShapeSettings.properties_i.subShapeRefIndex); + break; + case properties_i.posIndex: + defaultInt(ShapeSettings.properties_i.posInSubShapeIndex); + break; + case properties_i.edgeSlide: + defaultInt(ShapeSettings.properties_i.edgeSlide); + break; + case properties_i.proxRays: + defaultInt(ShapeSettings.properties_i.proxRays); + break; + case properties_i.proxSideRaysFallOff: + defaultInt(ShapeSettings.properties_i.proxSideRaysFallOff); + break; + case properties_i.lwrType: + defaultInt(ShapeSettings.properties_i.lwrType); + break; + case properties_i.lwr2Type: + defaultInt(ShapeSettings.properties_i.lwr2Type); + break; + case properties_i.flipH: + defaultInt(ShapeSettings.properties_i.flipH); + break; + case properties_i.flipV: + defaultInt(ShapeSettings.properties_i.flipV); + break; case properties_i.alignX: + defaultInt(ShapeSettings.properties_i.alignX); + break; case properties_i.alignY: - alignGeomY = default_alignGeom; + defaultInt(ShapeSettings.properties_i.alignY); break; case properties_i.CDU_corr: correlatedCDU = default_correlatedCDU; @@ -635,12 +614,6 @@ private void pDefaultInt(properties_i p) case properties_i.CDU_corr_ref: correlatedCDULayerIndex = default_correlatedCDULayerIndex; break; - case properties_i.edgeSlide: - edgeSlide = default_edgeSlide; - break; - case properties_i.enabled: - enabled = default_enabled; - break; case properties_i.omit: omitFromSim = default_omitLayer; break; @@ -650,27 +623,12 @@ private void pDefaultInt(properties_i p) case properties_i.fill: polyFill = default_polyFill; break; - case properties_i.flipH: - flipH = default_flipH; - break; - case properties_i.flipV: - flipV = default_flipV; - break; - case properties_i.gCSEngine: - geoCoreShapeEngine = default_geoCoreShapeEngine; - break; case properties_i.lD: ldFromFile = default_ldFromFile; break; case properties_i.lwrPreview: LWRNoisePreview = default_LWRNoisePreview; break; - case properties_i.lwrType: - LWRNoiseType = default_LWRNoiseType; - break; - case properties_i.lwr2Type: - LWR2NoiseType = default_LWRNoiseType; - break; case properties_i.lwr_corr: correlatedLWR = default_correlatedLWR; break; @@ -686,36 +644,15 @@ private void pDefaultInt(properties_i p) case properties_i.perPoly: perPoly = default_perPoly; break; - case properties_i.posIndex: - posInSubShapeIndex = default_posInSubShapeIndex; - break; - case properties_i.proxRays: - proximitySideRays = default_proximitySideRays; - break; case properties_i.refLayout: referenceLayout = default_referenceLayout; break; - case properties_i.shape0Tip: - subShapeTipLocIndex = default_subShapeTipLocIndex; - break; - case properties_i.shape1Tip: - subShape2TipLocIndex = default_subShape2TipLocIndex; - break; - case properties_i.shape2Tip: - subShape3TipLocIndex = default_subShape3TipLocIndex; - break; - case properties_i.shapeIndex: - shapeIndex = default_shapeIndex; - break; case properties_i.showDrawn: showDrawn = default_showDrawn; break; case properties_i.structure: structureFromFile = default_structureFromFile; break; - case properties_i.subShapeIndex: - posInSubShapeIndex = default_posInSubShapeIndex; - break; case properties_i.tCDU_corr: correlatedTipCDU = default_correlatedTipCDU; break; @@ -761,9 +698,6 @@ private void pDefaultInt(properties_i p) case properties_i.bLayerOpAB: booleanLayerOpAB = default_booleanLayerA; break; - case properties_i.proxSideRaysFallOff: - proxSideRaysFallOff = default_proximitySideRaysFallOff; - break; } } @@ -778,44 +712,59 @@ private static int pGetDefaultInt(properties_i p) switch (p) { case properties_i.enabled: - ret = default_enabled; + ret = getDefaultInt(ShapeSettings.properties_i.enabled); break; - case properties_i.omit: - ret = default_omitLayer; + case properties_i.shapeIndex: + ret = getDefaultInt(ShapeSettings.properties_i.shapeIndex); break; case properties_i.gCSEngine: - ret = default_geoCoreShapeEngine; - break; - case properties_i.showDrawn: - ret = default_showDrawn; - break; - case properties_i.shapeIndex: - ret = default_shapeIndex; + ret = getDefaultInt(ShapeSettings.properties_i.gCSEngine); break; case properties_i.shape0Tip: - ret = default_subShapeTipLocIndex; + ret = getDefaultInt(ShapeSettings.properties_i.subShapeTipLocIndex); break; case properties_i.shape1Tip: - ret = default_subShape2TipLocIndex; + ret = getDefaultInt(ShapeSettings.properties_i.subShape2TipLocIndex); break; case properties_i.shape2Tip: - ret = default_subShape3TipLocIndex; + ret = getDefaultInt(ShapeSettings.properties_i.subShape3TipLocIndex); break; case properties_i.subShapeIndex: - ret = default_subShapeRefIndex; + ret = getDefaultInt(ShapeSettings.properties_i.subShapeRefIndex); break; case properties_i.posIndex: - ret = default_posInSubShapeIndex; + ret = getDefaultInt(ShapeSettings.properties_i.posInSubShapeIndex); + break; + case properties_i.edgeSlide: + ret = getDefaultInt(ShapeSettings.properties_i.edgeSlide); break; case properties_i.proxRays: - ret = default_proximitySideRays; + ret = getDefaultInt(ShapeSettings.properties_i.proxRays); break; - case properties_i.edgeSlide: - ret = default_edgeSlide; + case properties_i.proxSideRaysFallOff: + ret = getDefaultInt(ShapeSettings.properties_i.proxSideRaysFallOff); break; case properties_i.lwrType: case properties_i.lwr2Type: - ret = default_LWRNoiseType; + ret = getDefaultInt(ShapeSettings.properties_i.lwrType); + break; + case properties_i.flipH: + ret = getDefaultInt(ShapeSettings.properties_i.flipH); + break; + case properties_i.flipV: + ret = getDefaultInt(ShapeSettings.properties_i.flipV); + break; + case properties_i.alignX: + ret = getDefaultInt(ShapeSettings.properties_i.alignX); + break; + case properties_i.alignY: + ret = getDefaultInt(ShapeSettings.properties_i.alignY); + break; + case properties_i.omit: + ret = default_omitLayer; + break; + case properties_i.showDrawn: + ret = default_showDrawn; break; case properties_i.lwrPreview: ret = default_LWRNoisePreview; @@ -864,16 +813,6 @@ private static int pGetDefaultInt(properties_i p) case properties_i.tCDU_corr_ref: ret = default_correlatedTipCDULayerIndex; break; - case properties_i.alignX: - case properties_i.alignY: - ret = default_alignGeom; - break; - case properties_i.flipH: - ret = default_flipH; - break; - case properties_i.flipV: - ret = default_flipV; - break; case properties_i.structure: ret = default_structureFromFile; break; @@ -907,16 +846,12 @@ private static int pGetDefaultInt(properties_i p) case properties_i.bLayerOpAB: ret = default_booleanLayerOpAB; break; - case properties_i.proxSideRaysFallOff: - ret = default_proximitySideRaysFallOff; - break; } return ret; } private string comment; - private string layerName; private string horTipBiasPVar_RNGMapping; private string horTipBiasNVar_RNGMapping; private string verTipBiasPVar_RNGMapping; @@ -934,7 +869,7 @@ private static int pGetDefaultInt(properties_i p) private string structureNameFromFile; private string ldNameFromFile; - public enum properties_s + public new enum properties_s { comment, name, hTipPVar_RNG, hTipNVar_RNG, vTipPVar_RNG, vTipNVar_RNG, iCV_RNG, oCV_RNG, lwr_RNG, lwr2_RNG, sCDU_RNG, tCDU_RNG, xOL_RNG, yOL_RNG, wobble_RNG, @@ -956,7 +891,7 @@ private string pGetString(properties_s p) ret = comment; break; case properties_s.name: - ret = layerName; + ret = getString(ShapeSettings.properties_s.s_name); break; case properties_s.hTipNVar_RNG: ret = horTipBiasNVar_RNGMapping; @@ -1024,7 +959,7 @@ private void pSetString(properties_s p, string val) comment = val; break; case properties_s.name: - layerName = val; + setString(ShapeSettings.properties_s.s_name, val); break; case properties_s.hTipNVar_RNG: horTipBiasNVar_RNGMapping = val; @@ -1111,7 +1046,7 @@ private void pDefaultString(properties_s p) LWR_RNGMapping = default_rngmapping; break; case properties_s.name: - layerName = default_layerName; + defaultString(ShapeSettings.properties_s.s_name); break; case properties_s.oCV_RNG: outerCV_RNGMapping = default_rngmapping; @@ -1158,7 +1093,7 @@ private static string pGetDefaultString(properties_s p) ret = default_comment; break; case properties_s.name: - ret = default_layerName; + ret = getDefaultString(ShapeSettings.properties_s.s_name); break; case properties_s.hTipNVar_RNG: case properties_s.hTipPVar_RNG: @@ -1189,55 +1124,19 @@ private static string pGetDefaultString(properties_s p) return ret; } - private decimal subShapeHorLength; - private decimal subShapeHorOffset; - private decimal subShapeVerLength; - private decimal subShapeVerOffset; - private decimal subShape2HorLength; - private decimal subShape2HorOffset; - private decimal subShape2VerLength; - private decimal subShape2VerOffset; - private decimal subShape3HorLength; - private decimal subShape3HorOffset; - private decimal subShape3VerLength; - private decimal subShape3VerOffset; - private decimal globalHorOffset; - private decimal globalVerOffset; - private decimal rotation; private decimal wobble; - private decimal sideBias; - private decimal horTipBias; - private decimal horTipBiasPVar; - private decimal horTipBiasNVar; - private decimal verTipBias; - private decimal verTipBiasPVar; - private decimal verTipBiasNVar; - private decimal proximityBias; - private decimal proximityIsoDistance; private decimal lensDistortionCoeff1; private decimal lensDistortionCoeff2; - private decimal innerCRR; - private decimal outerCRR; private decimal innerCV; private decimal outerCV; - private decimal LWR; - private decimal LWR2; - private decimal edgeSlideTension; - private decimal LWRNoiseFreq; - private decimal LWR2NoiseFreq; private decimal sideCDU; private decimal tipsCDU; private decimal horOverlay; private decimal verOverlay; - private decimal proxSideRaysMultiplier; - private decimal rayExtension; - private decimal gcRayExtension; - public enum properties_decimal + public new enum properties_decimal { - s0HorLength, s0VerLength, s0HorOffset, s0VerOffset, - s1HorLength, s1VerLength, s1HorOffset, s1VerOffset, - s2HorLength, s2VerLength, s2HorOffset, s2VerOffset, + horLength, verLength, horOffset, verOffset, gHorOffset, gVerOffset, rot, wobble, sBias, hTBias, hTNVar, hTPVar, vTBias, vTNVar, vTPVar, @@ -1252,90 +1151,96 @@ public enum properties_decimal rayExtension, keyhole_factor } - public decimal getDecimal(properties_decimal p) + public decimal getDecimal(properties_decimal p, int _subShapeRef = -1) { - return pGetDecimal(p); + return pGetDecimal(p, _subShapeRef); } - private decimal pGetDecimal(properties_decimal p) + private decimal pGetDecimal(properties_decimal p, int _subShapeRef) { decimal ret = 0m; switch (p) { - case properties_decimal.s0HorLength: - ret = subShapeHorLength; - break; - case properties_decimal.s0VerLength: - ret = subShapeVerLength; - break; - case properties_decimal.s0HorOffset: - ret = subShapeHorOffset; - break; - case properties_decimal.s0VerOffset: - ret = subShapeVerOffset; - break; - case properties_decimal.s1HorLength: - ret = subShape2HorLength; - break; - case properties_decimal.s1VerLength: - ret = subShape2VerLength; - break; - case properties_decimal.s1HorOffset: - ret = subShape2HorOffset; + case properties_decimal.horLength: + ret = getDecimal(ShapeSettings.properties_decimal.horLength, _subShapeRef); break; - case properties_decimal.s1VerOffset: - ret = subShape2VerOffset; + case properties_decimal.verLength: + ret = getDecimal(ShapeSettings.properties_decimal.verLength, _subShapeRef); break; - case properties_decimal.s2HorLength: - ret = subShape3HorLength; + case properties_decimal.horOffset: + ret = getDecimal(ShapeSettings.properties_decimal.horOffset, _subShapeRef); break; - case properties_decimal.s2VerLength: - ret = subShape3VerLength; - break; - case properties_decimal.s2HorOffset: - ret = subShape3HorOffset; - break; - case properties_decimal.s2VerOffset: - ret = subShape3VerOffset; + case properties_decimal.verOffset: + ret = getDecimal(ShapeSettings.properties_decimal.verOffset, _subShapeRef); break; case properties_decimal.gHorOffset: - ret = globalHorOffset; + ret = getDecimal(ShapeSettings.properties_decimal.gHorOffset); break; case properties_decimal.gVerOffset: - ret = globalVerOffset; + ret = getDecimal(ShapeSettings.properties_decimal.gVerOffset); break; - case properties_decimal.rot: - ret = rotation; + case properties_decimal.iCR: + ret = getDecimal(ShapeSettings.properties_decimal.iCR); break; - case properties_decimal.wobble: - ret = wobble; + case properties_decimal.oCR: + ret = getDecimal(ShapeSettings.properties_decimal.oCR); break; case properties_decimal.sBias: - ret = sideBias; + ret = getDecimal(ShapeSettings.properties_decimal.sBias); break; case properties_decimal.hTBias: - ret = horTipBias; + ret = getDecimal(ShapeSettings.properties_decimal.hTBias); break; case properties_decimal.hTNVar: - ret = horTipBiasNVar; + ret = getDecimal(ShapeSettings.properties_decimal.hTNVar); break; case properties_decimal.hTPVar: - ret = horTipBiasPVar; + ret = getDecimal(ShapeSettings.properties_decimal.hTPVar); break; case properties_decimal.vTBias: - ret = verTipBias; + ret = getDecimal(ShapeSettings.properties_decimal.vTBias); break; case properties_decimal.vTNVar: - ret = verTipBiasNVar; + ret = getDecimal(ShapeSettings.properties_decimal.vTNVar); break; case properties_decimal.vTPVar: - ret = verTipBiasPVar; + ret = getDecimal(ShapeSettings.properties_decimal.vTPVar); + break; + case properties_decimal.lwr: + ret = getDecimal(ShapeSettings.properties_decimal.lwr); + break; + case properties_decimal.lwrFreq: + ret = getDecimal(ShapeSettings.properties_decimal.lwrFreq); + break; + case properties_decimal.lwr2: + ret = getDecimal(ShapeSettings.properties_decimal.lwr2); + break; + case properties_decimal.lwr2Freq: + ret = getDecimal(ShapeSettings.properties_decimal.lwr2Freq); + break; + case properties_decimal.eTension: + ret = getDecimal(ShapeSettings.properties_decimal.eTension); + break; + case properties_decimal.rot: + ret = getDecimal(ShapeSettings.properties_decimal.rot); break; case properties_decimal.pBias: - ret = proximityBias; + ret = getDecimal(ShapeSettings.properties_decimal.pBias); break; case properties_decimal.pBiasDist: - ret = proximityIsoDistance; + ret = getDecimal(ShapeSettings.properties_decimal.pBiasDist); + break; + case properties_decimal.proxSideRaysMultiplier: + ret = getDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier); + break; + case properties_decimal.rayExtension: + ret = getDecimal(ShapeSettings.properties_decimal.rayExtension); + break; + case properties_decimal.keyhole_factor: + ret = getDecimal(ShapeSettings.properties_decimal.keyhole_factor); + break; + case properties_decimal.wobble: + ret = wobble; break; case properties_decimal.lDC1: ret = lensDistortionCoeff1; @@ -1343,33 +1248,12 @@ private decimal pGetDecimal(properties_decimal p) case properties_decimal.lDC2: ret = lensDistortionCoeff2; break; - case properties_decimal.iCR: - ret = innerCRR; - break; case properties_decimal.iCV: ret = innerCV; break; - case properties_decimal.oCR: - ret = outerCRR; - break; case properties_decimal.oCV: ret = outerCV; break; - case properties_decimal.lwr: - ret = LWR; - break; - case properties_decimal.lwrFreq: - ret = LWRNoiseFreq; - break; - case properties_decimal.lwr2: - ret = LWR2; - break; - case properties_decimal.lwr2Freq: - ret = LWR2NoiseFreq; - break; - case properties_decimal.eTension: - ret = edgeSlideTension; - break; case properties_decimal.sCDU: ret = sideCDU; break; @@ -1382,104 +1266,97 @@ private decimal pGetDecimal(properties_decimal p) case properties_decimal.yOL: ret = verOverlay; break; - case properties_decimal.proxSideRaysMultiplier: - ret = proxSideRaysMultiplier; - break; - case properties_decimal.rayExtension: - ret = rayExtension; - break; - case properties_decimal.keyhole_factor: - ret = gcRayExtension; - break; } return ret; } - public static decimal getDefaultDecimal(properties_decimal p) + public static decimal getDefaultDecimal(properties_decimal p, int _subShapeRef = -1) { - return pGetDefaultDecimal(p); + return pGetDefaultDecimal(p, _subShapeRef); } - private static decimal pGetDefaultDecimal(properties_decimal p) + private static decimal pGetDefaultDecimal(properties_decimal p, int _subShapeRef) { decimal ret = 0m; switch (p) { - case properties_decimal.s0HorLength: - ret = default_subShapeHorLength; - break; - case properties_decimal.s0VerLength: - ret = default_subShapeVerLength; - break; - case properties_decimal.s0HorOffset: - ret = default_subShapeHorOffset; - break; - case properties_decimal.s0VerOffset: - ret = default_subShapeVerOffset; - break; - case properties_decimal.s1HorLength: - ret = default_subShape2HorLength; - break; - case properties_decimal.s1VerLength: - ret = default_subShape2VerLength; - break; - case properties_decimal.s1HorOffset: - ret = default_subShape2HorOffset; - break; - case properties_decimal.s1VerOffset: - ret = default_subShape2VerOffset; - break; - case properties_decimal.s2HorLength: - ret = default_subShape3HorLength; + case properties_decimal.horLength: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.horLength, _subShapeRef); break; - case properties_decimal.s2VerLength: - ret = default_subShape3VerLength; + case properties_decimal.verLength: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.verLength, _subShapeRef); break; - case properties_decimal.s2HorOffset: - ret = default_subShape3HorOffset; + case properties_decimal.horOffset: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.horOffset, _subShapeRef); break; - case properties_decimal.s2VerOffset: - ret = default_subShape3VerOffset; + case properties_decimal.verOffset: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.verOffset, _subShapeRef); break; case properties_decimal.gHorOffset: - ret = default_globalHorOffset; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.gHorOffset); break; case properties_decimal.gVerOffset: - ret = default_globalVerOffset; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.gVerOffset); break; - case properties_decimal.rot: - ret = default_rotation; + case properties_decimal.iCR: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.iCR); break; - case properties_decimal.wobble: - ret = default_wobble; + case properties_decimal.oCR: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.oCR); break; case properties_decimal.sBias: - ret = default_sideBias; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.sBias); break; case properties_decimal.hTBias: - ret = default_horTipBias; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.hTBias); break; case properties_decimal.hTNVar: - ret = default_horTipBiasNVar; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.hTNVar); break; case properties_decimal.hTPVar: - ret = default_horTipBiasPVar; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.hTPVar); break; case properties_decimal.vTBias: - ret = default_verTipBias; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.vTBias); break; case properties_decimal.vTNVar: - ret = default_verTipBiasNVar; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.vTNVar); break; case properties_decimal.vTPVar: - ret = default_verTipBiasPVar; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.vTPVar); + break; + case properties_decimal.lwr: + case properties_decimal.lwr2: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.lwr); + break; + case properties_decimal.lwrFreq: + case properties_decimal.lwr2Freq: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.lwrFreq); + break; + case properties_decimal.eTension: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.eTension); + break; + case properties_decimal.rot: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.rot); break; case properties_decimal.pBias: - ret = default_proximityBias; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.pBias); break; case properties_decimal.pBiasDist: - ret = default_proximityIsoDistance; + ret = getDefaultDecimal(ShapeSettings.properties_decimal.pBiasDist); + break; + case properties_decimal.proxSideRaysMultiplier: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier); + break; + case properties_decimal.rayExtension: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.rayExtension); + break; + case properties_decimal.keyhole_factor: + ret = getDefaultDecimal(ShapeSettings.properties_decimal.keyhole_factor); + break; + case properties_decimal.wobble: + ret = default_wobble; break; case properties_decimal.lDC1: ret = default_lensDistortionCoeff1; @@ -1487,29 +1364,12 @@ private static decimal pGetDefaultDecimal(properties_decimal p) case properties_decimal.lDC2: ret = default_lensDistortionCoeff2; break; - case properties_decimal.iCR: - ret = default_innerCRR; - break; case properties_decimal.iCV: ret = default_innerCV; break; - case properties_decimal.oCR: - ret = default_outerCRR; - break; case properties_decimal.oCV: ret = default_outerCV; break; - case properties_decimal.lwr: - case properties_decimal.lwr2: - ret = default_LWR; - break; - case properties_decimal.lwrFreq: - case properties_decimal.lwr2Freq: - ret = default_LWRNoiseFreq; - break; - case properties_decimal.eTension: - ret = default_edgeSlideTension; - break; case properties_decimal.sCDU: ret = default_sideCDU; break; @@ -1522,103 +1382,100 @@ private static decimal pGetDefaultDecimal(properties_decimal p) case properties_decimal.yOL: ret = default_verOverlay; break; - case properties_decimal.proxSideRaysMultiplier: - ret = default_proximitySideRaysFallOffMultiplier; - break; - case properties_decimal.rayExtension: - ret = default_rayExtension; - break; - case properties_decimal.keyhole_factor: - ret = default_rayExtension; - break; } return ret; } - public void setDecimal(properties_decimal p, decimal val) + public void setDecimal(properties_decimal p, decimal val, int _subShapeRef = -1) { - pSetDecimal(p, val); + pSetDecimal(p, val, _subShapeRef); } - private void pSetDecimal(properties_decimal p, decimal val) + private void pSetDecimal(properties_decimal p, decimal val, int _subShapeRef) { switch (p) { - case properties_decimal.s0HorLength: - subShapeHorLength = val; - break; - case properties_decimal.s0VerLength: - subShapeVerLength = val; - break; - case properties_decimal.s0HorOffset: - subShapeHorOffset = val; - break; - case properties_decimal.s0VerOffset: - subShapeVerOffset = val; - break; - case properties_decimal.s1HorLength: - subShape2HorLength = val; - break; - case properties_decimal.s1VerLength: - subShape2VerLength = val; - break; - case properties_decimal.s1HorOffset: - subShape2HorOffset = val; - break; - case properties_decimal.s1VerOffset: - subShape2VerOffset = val; - break; - case properties_decimal.s2HorLength: - subShape3HorLength = val; + case properties_decimal.horLength: + setDecimal(ShapeSettings.properties_decimal.horLength, val, _subShapeRef); break; - case properties_decimal.s2VerLength: - subShape3VerLength = val; + case properties_decimal.verLength: + setDecimal(ShapeSettings.properties_decimal.verLength, val, _subShapeRef); break; - case properties_decimal.s2HorOffset: - subShape3HorOffset = val; + case properties_decimal.horOffset: + setDecimal(ShapeSettings.properties_decimal.horOffset, val, _subShapeRef); break; - case properties_decimal.s2VerOffset: - subShape3VerOffset = val; + case properties_decimal.verOffset: + setDecimal(ShapeSettings.properties_decimal.verOffset, val, _subShapeRef); break; case properties_decimal.gHorOffset: - globalHorOffset = val; + setDecimal(ShapeSettings.properties_decimal.gHorOffset, val); break; case properties_decimal.gVerOffset: - globalVerOffset = val; + setDecimal(ShapeSettings.properties_decimal.gVerOffset, val); break; - case properties_decimal.rot: - rotation = val; + case properties_decimal.iCR: + setDecimal(ShapeSettings.properties_decimal.iCR, val); break; - case properties_decimal.wobble: - wobble = val; + case properties_decimal.oCR: + setDecimal(ShapeSettings.properties_decimal.oCR, val); break; case properties_decimal.sBias: - sideBias = val; + setDecimal(ShapeSettings.properties_decimal.sBias, val); break; case properties_decimal.hTBias: - horTipBias = val; + setDecimal(ShapeSettings.properties_decimal.hTBias, val); break; case properties_decimal.hTNVar: - horTipBiasNVar = val; + setDecimal(ShapeSettings.properties_decimal.hTNVar, val); break; case properties_decimal.hTPVar: - horTipBiasPVar = val; + setDecimal(ShapeSettings.properties_decimal.hTPVar, val); break; case properties_decimal.vTBias: - verTipBias = val; + setDecimal(ShapeSettings.properties_decimal.vTBias, val); break; case properties_decimal.vTNVar: - verTipBiasNVar = val; + setDecimal(ShapeSettings.properties_decimal.vTNVar, val); break; case properties_decimal.vTPVar: - verTipBiasPVar = val; + setDecimal(ShapeSettings.properties_decimal.vTPVar, val); + break; + case properties_decimal.lwr: + setDecimal(ShapeSettings.properties_decimal.lwr, val); + break; + case properties_decimal.lwrFreq: + setDecimal(ShapeSettings.properties_decimal.lwrFreq, val); + break; + case properties_decimal.lwr2: + setDecimal(ShapeSettings.properties_decimal.lwr2, val); + break; + case properties_decimal.lwr2Freq: + setDecimal(ShapeSettings.properties_decimal.lwr2Freq, val); + break; + case properties_decimal.eTension: + setDecimal(ShapeSettings.properties_decimal.eTension, val); + break; + case properties_decimal.rot: + setDecimal(ShapeSettings.properties_decimal.rot, val); break; case properties_decimal.pBias: - proximityBias = val; + setDecimal(ShapeSettings.properties_decimal.pBias, val); break; case properties_decimal.pBiasDist: - proximityIsoDistance = val; + setDecimal(ShapeSettings.properties_decimal.pBiasDist, val); + break; + case properties_decimal.proxSideRaysMultiplier: + setDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier, val); + break; + case properties_decimal.rayExtension: + setDecimal(ShapeSettings.properties_decimal.rayExtension, val); + break; + case properties_decimal.keyhole_factor: + setDecimal(ShapeSettings.properties_decimal.keyhole_factor, val); + break; + case properties_decimal.wobble: + wobble = val; break; case properties_decimal.lDC1: lensDistortionCoeff1 = val; @@ -1626,33 +1483,12 @@ private void pSetDecimal(properties_decimal p, decimal val) case properties_decimal.lDC2: lensDistortionCoeff2 = val; break; - case properties_decimal.iCR: - innerCRR = val; - break; case properties_decimal.iCV: innerCV = val; break; - case properties_decimal.oCR: - outerCRR = val; - break; case properties_decimal.oCV: outerCV = val; break; - case properties_decimal.lwr: - LWR = val; - break; - case properties_decimal.lwrFreq: - LWRNoiseFreq = val; - break; - case properties_decimal.lwr2: - LWR2 = val; - break; - case properties_decimal.lwr2Freq: - LWR2NoiseFreq = val; - break; - case properties_decimal.eTension: - edgeSlideTension = val; - break; case properties_decimal.sCDU: sideCDU = val; break; @@ -1665,122 +1501,107 @@ private void pSetDecimal(properties_decimal p, decimal val) case properties_decimal.yOL: verOverlay = val; break; - case properties_decimal.proxSideRaysMultiplier: - proxSideRaysMultiplier = val; - break; - case properties_decimal.rayExtension: - rayExtension = val; - break; - case properties_decimal.keyhole_factor: - gcRayExtension = val; - break; } } - public void defaultDecimal(properties_decimal p) + public void defaultDecimal(properties_decimal p, int _subShapeRef = -1) { - pDefaultDecimal(p); + pDefaultDecimal(p, _subShapeRef); } - private void pDefaultDecimal(properties_decimal p) + private void pDefaultDecimal(properties_decimal p, int _subShapeRef) { switch (p) { - case properties_decimal.eTension: - edgeSlideTension = default_edgeSlideTension; + case properties_decimal.horLength: + defaultDecimal(ShapeSettings.properties_decimal.horLength, _subShapeRef); + break; + case properties_decimal.verLength: + defaultDecimal(ShapeSettings.properties_decimal.verLength, _subShapeRef); + break; + case properties_decimal.horOffset: + defaultDecimal(ShapeSettings.properties_decimal.horOffset, _subShapeRef); + break; + case properties_decimal.verOffset: + defaultDecimal(ShapeSettings.properties_decimal.verOffset, _subShapeRef); break; case properties_decimal.gHorOffset: - globalHorOffset = default_globalHorOffset; + defaultDecimal(ShapeSettings.properties_decimal.gHorOffset); break; case properties_decimal.gVerOffset: - globalVerOffset = default_globalVerOffset; + defaultDecimal(ShapeSettings.properties_decimal.gVerOffset); + break; + case properties_decimal.iCR: + defaultDecimal(ShapeSettings.properties_decimal.iCR); + break; + case properties_decimal.oCR: + defaultDecimal(ShapeSettings.properties_decimal.oCR); + break; + case properties_decimal.sBias: + defaultDecimal(ShapeSettings.properties_decimal.sBias); break; case properties_decimal.hTBias: - horTipBias = default_horTipBias; + defaultDecimal(ShapeSettings.properties_decimal.hTBias); break; case properties_decimal.hTNVar: - horTipBiasNVar = default_horTipBiasNVar; + defaultDecimal(ShapeSettings.properties_decimal.hTNVar); break; case properties_decimal.hTPVar: - horTipBiasPVar = default_horTipBiasPVar; + defaultDecimal(ShapeSettings.properties_decimal.hTPVar); break; - case properties_decimal.iCR: - innerCRR = default_innerCRR; - break; - case properties_decimal.iCV: - innerCV = default_innerCV; + case properties_decimal.vTBias: + defaultDecimal(ShapeSettings.properties_decimal.vTBias); break; - case properties_decimal.lDC1: - lensDistortionCoeff1 = default_lensDistortionCoeff1; + case properties_decimal.vTNVar: + defaultDecimal(ShapeSettings.properties_decimal.vTNVar); break; - case properties_decimal.lDC2: - lensDistortionCoeff2 = default_lensDistortionCoeff2; + case properties_decimal.vTPVar: + defaultDecimal(ShapeSettings.properties_decimal.vTPVar); break; case properties_decimal.lwr: - LWR = default_LWR; + defaultDecimal(ShapeSettings.properties_decimal.lwr); break; case properties_decimal.lwr2: - LWR2 = default_LWR; + defaultDecimal(ShapeSettings.properties_decimal.lwr2); break; case properties_decimal.lwrFreq: - LWRNoiseFreq = default_LWRNoiseFreq; + defaultDecimal(ShapeSettings.properties_decimal.lwrFreq); break; case properties_decimal.lwr2Freq: - LWR2NoiseFreq = default_LWRNoiseFreq; + defaultDecimal(ShapeSettings.properties_decimal.lwr2Freq); break; - case properties_decimal.oCR: - outerCRR = default_outerCRR; + case properties_decimal.eTension: + defaultDecimal(ShapeSettings.properties_decimal.eTension); break; - case properties_decimal.oCV: - outerCV = default_outerCV; + case properties_decimal.rot: + defaultDecimal(ShapeSettings.properties_decimal.rot); break; case properties_decimal.pBias: - proximityBias = default_proximityBias; + defaultDecimal(ShapeSettings.properties_decimal.pBias); break; case properties_decimal.pBiasDist: - proximityIsoDistance = default_proximityIsoDistance; - break; - case properties_decimal.rot: - rotation = default_rotation; - break; - case properties_decimal.s0HorLength: - subShapeHorLength = default_subShapeHorLength; + defaultDecimal(ShapeSettings.properties_decimal.pBiasDist); break; - case properties_decimal.s0HorOffset: - subShapeHorOffset = default_subShapeHorOffset; - break; - case properties_decimal.s0VerLength: - subShapeVerLength = default_subShapeVerLength; - break; - case properties_decimal.s0VerOffset: - subShapeVerOffset = default_subShapeVerOffset; - break; - case properties_decimal.s1HorLength: - subShape2HorLength = default_subShape2HorLength; - break; - case properties_decimal.s1HorOffset: - subShape2HorOffset = default_subShape2HorOffset; - break; - case properties_decimal.s1VerLength: - subShape2VerLength = default_subShape2VerLength; + case properties_decimal.proxSideRaysMultiplier: + defaultDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier); break; - case properties_decimal.s1VerOffset: - subShape2VerOffset = default_subShape2VerOffset; + case properties_decimal.rayExtension: + defaultDecimal(ShapeSettings.properties_decimal.rayExtension); break; - case properties_decimal.s2HorLength: - subShape3HorLength = default_subShape3HorLength; + case properties_decimal.keyhole_factor: + defaultDecimal(ShapeSettings.properties_decimal.keyhole_factor); break; - case properties_decimal.s2HorOffset: - subShape3HorOffset = default_subShape3HorOffset; + case properties_decimal.iCV: + innerCV = default_innerCV; break; - case properties_decimal.s2VerLength: - subShape3VerLength = default_subShape3VerLength; + case properties_decimal.lDC1: + lensDistortionCoeff1 = default_lensDistortionCoeff1; break; - case properties_decimal.s2VerOffset: - subShape3VerOffset = default_subShape3VerOffset; + case properties_decimal.lDC2: + lensDistortionCoeff2 = default_lensDistortionCoeff2; break; - case properties_decimal.sBias: - sideBias = default_sideBias; + case properties_decimal.oCV: + outerCV = default_outerCV; break; case properties_decimal.sCDU: sideCDU = default_sideCDU; @@ -1788,15 +1609,6 @@ private void pDefaultDecimal(properties_decimal p) case properties_decimal.tCDU: tipsCDU = default_tipsCDU; break; - case properties_decimal.vTBias: - verTipBias = default_verTipBias; - break; - case properties_decimal.vTNVar: - verTipBiasNVar = default_verTipBiasNVar; - break; - case properties_decimal.vTPVar: - verTipBiasPVar = default_verTipBiasPVar; - break; case properties_decimal.wobble: wobble = default_wobble; break; @@ -1806,15 +1618,6 @@ private void pDefaultDecimal(properties_decimal p) case properties_decimal.yOL: verOverlay = default_verOverlay; break; - case properties_decimal.proxSideRaysMultiplier: - proxSideRaysMultiplier = default_proximitySideRaysFallOffMultiplier; - break; - case properties_decimal.rayExtension: - rayExtension = default_rayExtension; - break; - case properties_decimal.keyhole_factor: - gcRayExtension = default_rayExtension; - break; } } @@ -1880,65 +1683,22 @@ private void pEntropyLayerSettings() { comment = default_comment; bgLayers = default_bgLayers.ToArray(); - enabled = default_enabled; - geoCoreShapeEngine = default_geoCoreShapeEngine; - shapeIndex = default_shapeIndex; - layerName = default_layerName; - - subShapeHorLength = default_subShapeHorLength; - subShapeVerLength = default_subShapeVerLength; - subShapeHorOffset = default_subShapeHorOffset; - subShapeVerOffset = default_subShapeVerOffset; - subShapeTipLocIndex = default_subShapeTipLocIndex; - subShape2HorLength = default_subShape2HorLength; - subShape2VerLength = default_subShape2VerLength; - subShape2HorOffset = default_subShape2HorOffset; - subShape2VerOffset = default_subShape2VerOffset; - subShape2TipLocIndex = default_subShape2TipLocIndex; - subShape3HorLength = default_subShape3HorLength; - subShape3VerLength = default_subShape3VerLength; - subShape3HorOffset = default_subShape3HorOffset; - subShape3VerOffset = default_subShape3VerOffset; - subShape3TipLocIndex = default_subShape3TipLocIndex; - subShapeRefIndex = default_subShapeRefIndex; - posInSubShapeIndex = default_posInSubShapeIndex; - - rotation = default_rotation; + wobble = default_wobble; wobble_RNGMapping = default_rngmapping; - sideBias = default_sideBias; - horTipBias = default_horTipBias; - horTipBiasNVar = default_horTipBiasNVar; horTipBiasNVar_RNGMapping = default_rngmapping; - horTipBiasPVar = default_horTipBiasPVar; horTipBiasPVar_RNGMapping = default_rngmapping; - verTipBias = default_verTipBias; - verTipBiasNVar = default_verTipBiasNVar; verTipBiasNVar_RNGMapping = default_rngmapping; - verTipBiasPVar = default_verTipBiasPVar; verTipBiasPVar_RNGMapping = default_rngmapping; - proximityBias = default_proximityBias; - proximityIsoDistance = default_proximityIsoDistance; - proximitySideRays = default_proximitySideRays; - innerCRR = default_innerCRR; innerCV = default_innerCV; innerCV_RNGMapping = default_rngmapping; - outerCRR = default_outerCRR; outerCV = default_outerCV; outerCV_RNGMapping = default_rngmapping; - edgeSlide = default_edgeSlide; - edgeSlideTension = default_edgeSlideTension; - LWR = default_LWR; LWR_RNGMapping = default_rngmapping; - LWRNoiseType = default_LWRNoiseType; LWRNoisePreview = default_LWRNoisePreview; - LWRNoiseFreq = default_LWRNoiseFreq; - LWR2 = default_LWR; LWR2_RNGMapping = default_rngmapping; - LWR2NoiseType = default_LWRNoiseType; - LWR2NoiseFreq = default_LWRNoiseFreq; correlatedLWR = default_correlatedLWR; correlatedLWRLayerIndex = default_correlatedLWRLayerIndex; @@ -1981,10 +1741,6 @@ private void pEntropyLayerSettings() averageOverlayY = default_averageOverlayY; overlayXReferenceLayers = default_overlayXReferenceLayers.ToArray(); overlayYReferenceLayers = default_overlayYReferenceLayers.ToArray(); - flipH = default_flipH; - flipV = default_flipV; - alignGeomX = default_alignGeom; - alignGeomY = default_alignGeom; showDrawn = default_showDrawn; lensDistortionCoeff1 = default_lensDistortionCoeff1; @@ -1995,12 +1751,8 @@ private void pEntropyLayerSettings() booleanLayerOpA = default_booleanLayerOpA; booleanLayerOpB = default_booleanLayerOpB; booleanLayerOpAB = default_booleanLayerOpAB; - rayExtension = default_rayExtension; omitFromSim = default_omitLayer; - - proxSideRaysFallOff = default_proximitySideRaysFallOff; - proxSideRaysMultiplier = default_proximitySideRaysFallOffMultiplier; } public void adjustSettings(EntropyLayerSettings source, bool gdsOnly) @@ -2012,73 +1764,74 @@ private void pAdjustSettings(EntropyLayerSettings source, bool gdsOnly) { comment = source.comment; bgLayers = source.bgLayers.ToArray(); - enabled = source.enabled; - geoCoreShapeEngine = source.geoCoreShapeEngine; + setInt(ShapeSettings.properties_i.enabled, source.getInt(ShapeSettings.properties_i.enabled)); + setInt(ShapeSettings.properties_i.gCSEngine, source.getInt(ShapeSettings.properties_i.gCSEngine)); + setInt(ShapeSettings.properties_i.shapeIndex, source.getInt(ShapeSettings.properties_i.shapeIndex)); showDrawn = source.showDrawn; - layerName = source.layerName; - shapeIndex = source.shapeIndex; + + setString(ShapeSettings.properties_s.s_name, source.getString(ShapeSettings.properties_s.s_name)); if (!gdsOnly) { - subShapeHorLength = source.subShapeHorLength; - subShapeHorOffset = source.subShapeHorOffset; - subShapeVerLength = source.subShapeVerLength; - subShapeVerOffset = source.subShapeVerOffset; - subShapeTipLocIndex = source.subShapeTipLocIndex; - - subShape2HorLength = source.subShape2HorLength; - subShape2HorOffset = source.subShape2HorOffset; - subShape2VerLength = source.subShape2VerLength; - subShape2VerOffset = source.subShape2VerOffset; - subShape2TipLocIndex = source.subShape2TipLocIndex; - - subShape3HorLength = source.subShape3HorLength; - subShape3HorOffset = source.subShape3HorOffset; - subShape3VerLength = source.subShape3VerLength; - subShape3VerOffset = source.subShape3VerOffset; - subShape3TipLocIndex = source.subShape3TipLocIndex; - - subShapeRefIndex = source.subShapeRefIndex; - posInSubShapeIndex = source.posInSubShapeIndex; - - globalHorOffset = source.globalHorOffset; - globalVerOffset = source.globalVerOffset; - - rotation = source.rotation; + for (int i = 0; i < 3; i++) + { + setDecimal(ShapeSettings.properties_decimal.horLength, source.getDecimal(ShapeSettings.properties_decimal.horLength, i), i); + setDecimal(ShapeSettings.properties_decimal.verLength, source.getDecimal(ShapeSettings.properties_decimal.verLength, i), i); + setDecimal(ShapeSettings.properties_decimal.horOffset, source.getDecimal(ShapeSettings.properties_decimal.horOffset, i), i); + setDecimal(ShapeSettings.properties_decimal.verOffset, source.getDecimal(ShapeSettings.properties_decimal.verOffset, i), i); + } + setInt(ShapeSettings.properties_i.subShapeTipLocIndex, source.getInt(ShapeSettings.properties_i.subShapeTipLocIndex)); + setInt(ShapeSettings.properties_i.subShape2TipLocIndex, source.getInt(ShapeSettings.properties_i.subShape2TipLocIndex)); + setInt(ShapeSettings.properties_i.subShape3TipLocIndex, source.getInt(ShapeSettings.properties_i.subShape3TipLocIndex)); + + setInt(ShapeSettings.properties_i.subShapeRefIndex, source.getInt(ShapeSettings.properties_i.subShapeRefIndex)); + setInt(ShapeSettings.properties_i.posInSubShapeIndex, source.getInt(ShapeSettings.properties_i.posInSubShapeIndex)); + + setDecimal(ShapeSettings.properties_decimal.gHorOffset, source.getDecimal(ShapeSettings.properties_decimal.gHorOffset)); + setDecimal(ShapeSettings.properties_decimal.gVerOffset, source.getDecimal(ShapeSettings.properties_decimal.gVerOffset)); + + setDecimal(ShapeSettings.properties_decimal.rot, source.getDecimal(ShapeSettings.properties_decimal.rot)); wobble = source.wobble; wobble_RNGMapping = source.wobble_RNGMapping; - sideBias = source.sideBias; + setDecimal(ShapeSettings.properties_decimal.sBias, source.getDecimal(ShapeSettings.properties_decimal.sBias)); + + setDecimal(ShapeSettings.properties_decimal.hTBias, source.getDecimal(ShapeSettings.properties_decimal.hTBias)); + setDecimal(ShapeSettings.properties_decimal.hTNVar, source.getDecimal(ShapeSettings.properties_decimal.hTNVar)); + setDecimal(ShapeSettings.properties_decimal.hTPVar, source.getDecimal(ShapeSettings.properties_decimal.hTPVar)); - horTipBias = source.horTipBias; - horTipBiasNVar = source.horTipBiasNVar; horTipBiasNVar_RNGMapping = source.horTipBiasNVar_RNGMapping; - horTipBiasPVar = source.horTipBiasPVar; horTipBiasPVar_RNGMapping = source.horTipBiasPVar_RNGMapping; - verTipBias = source.verTipBias; - verTipBiasNVar = source.verTipBiasNVar; + + setDecimal(ShapeSettings.properties_decimal.vTBias, source.getDecimal(ShapeSettings.properties_decimal.vTBias)); + setDecimal(ShapeSettings.properties_decimal.vTNVar, source.getDecimal(ShapeSettings.properties_decimal.vTNVar)); + setDecimal(ShapeSettings.properties_decimal.vTPVar, source.getDecimal(ShapeSettings.properties_decimal.vTPVar)); verTipBiasNVar_RNGMapping = source.verTipBiasNVar_RNGMapping; - verTipBiasPVar = source.verTipBiasPVar; verTipBiasPVar_RNGMapping = source.verTipBiasPVar_RNGMapping; - proximityBias = source.proximityBias; - proximityIsoDistance = source.proximityIsoDistance; - proximitySideRays = source.proximitySideRays; - innerCRR = source.innerCRR; + setDecimal(ShapeSettings.properties_decimal.pBias, source.getDecimal(ShapeSettings.properties_decimal.pBias)); + setDecimal(ShapeSettings.properties_decimal.pBiasDist, source.getDecimal(ShapeSettings.properties_decimal.pBiasDist)); + setInt(ShapeSettings.properties_i.proxRays, source.getInt(ShapeSettings.properties_i.proxRays)); + setInt(ShapeSettings.properties_i.proxSideRaysFallOff, source.getInt(ShapeSettings.properties_i.proxSideRaysFallOff)); + setDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier, source.getDecimal(ShapeSettings.properties_decimal.proxSideRaysMultiplier)); + + setDecimal(ShapeSettings.properties_decimal.iCR, source.getDecimal(ShapeSettings.properties_decimal.iCR)); innerCV = source.innerCV; innerCV_RNGMapping = source.innerCV_RNGMapping; - outerCRR = source.outerCRR; + setDecimal(ShapeSettings.properties_decimal.oCR, source.getDecimal(ShapeSettings.properties_decimal.oCR)); outerCV = source.outerCV; outerCV_RNGMapping = source.outerCV_RNGMapping; - edgeSlide = source.edgeSlide; - edgeSlideTension = source.edgeSlideTension; - LWR = source.LWR; - LWRNoiseType = source.LWRNoiseType; + setInt(ShapeSettings.properties_i.edgeSlide, source.getInt(ShapeSettings.properties_i.edgeSlide)); + setDecimal(ShapeSettings.properties_decimal.eTension, source.getDecimal(ShapeSettings.properties_decimal.eTension)); + + setDecimal(ShapeSettings.properties_decimal.lwr, source.getDecimal(ShapeSettings.properties_decimal.lwr)); + setDecimal(ShapeSettings.properties_decimal.lwrFreq, source.getDecimal(ShapeSettings.properties_decimal.lwrFreq)); + setInt(ShapeSettings.properties_i.lwrType, source.getInt(ShapeSettings.properties_i.lwrType)); LWRNoisePreview = source.LWRNoisePreview; - LWRNoiseFreq = source.LWRNoiseFreq; - LWR2 = source.LWR2; - LWR2NoiseType = source.LWR2NoiseType; - LWR2NoiseFreq = source.LWR2NoiseFreq; + + setDecimal(ShapeSettings.properties_decimal.lwr2, source.getDecimal(ShapeSettings.properties_decimal.lwr2)); + setDecimal(ShapeSettings.properties_decimal.lwr2Freq, source.getDecimal(ShapeSettings.properties_decimal.lwr2Freq)); + setInt(ShapeSettings.properties_i.lwr2Type, source.getInt(ShapeSettings.properties_i.lwr2Type)); correlatedLWR = source.correlatedLWR; correlatedLWRLayerIndex = source.correlatedLWRLayerIndex; @@ -2115,10 +1868,10 @@ private void pAdjustSettings(EntropyLayerSettings source, bool gdsOnly) overlayXReferenceLayers = source.overlayXReferenceLayers.ToArray(); overlayYReferenceLayers = source.overlayYReferenceLayers.ToArray(); - flipH = source.flipH; - flipV = source.flipV; - alignGeomX = source.alignGeomX; - alignGeomY = source.alignGeomY; + setInt(ShapeSettings.properties_i.flipH, source.getInt(ShapeSettings.properties_i.flipH)); + setInt(ShapeSettings.properties_i.flipV, source.getInt(ShapeSettings.properties_i.flipV)); + setInt(ShapeSettings.properties_i.alignX, source.getInt(ShapeSettings.properties_i.alignX)); + setInt(ShapeSettings.properties_i.alignY, source.getInt(ShapeSettings.properties_i.alignY)); lensDistortionCoeff1 = source.lensDistortionCoeff1; lensDistortionCoeff2 = source.lensDistortionCoeff2; @@ -2128,12 +1881,9 @@ private void pAdjustSettings(EntropyLayerSettings source, bool gdsOnly) booleanLayerOpA = source.booleanLayerOpA; booleanLayerOpB = source.booleanLayerOpB; booleanLayerOpAB = source.booleanLayerOpAB; - rayExtension = source.rayExtension; + setDecimal(ShapeSettings.properties_decimal.rayExtension, source.getDecimal(properties_decimal.rayExtension)); omitFromSim = source.omitFromSim; - - proxSideRaysFallOff = source.proxSideRaysFallOff; - proxSideRaysMultiplier = source.proxSideRaysMultiplier; } // layout stuff @@ -2179,4 +1929,4 @@ private bool pNonGaussianValues() return !gaussianvalues; } -} \ No newline at end of file +} diff --git a/Common/Variance/entropy/entropySettings.cs b/Common/Variance/entropy/entropySettings.cs index f65eac5..efd21bd 100644 --- a/Common/Variance/entropy/entropySettings.cs +++ b/Common/Variance/entropy/entropySettings.cs @@ -310,7 +310,7 @@ private void pDefaultOperator(properties_o p, int index) } } - private static int default_outputType = (int)CommonVars.calcModes.area; + private static int default_outputType = (int)geoAnalysis.supported.calcModes.area; private static int default_numberOfCases = 25000; private static double default_resolution = 1.0; private static int default_cornerSegments = 90; diff --git a/Common/Variance/entropy/entropySettings_nonSim.cs b/Common/Variance/entropy/entropySettings_nonSim.cs index 59c7f90..d0b49ff 100644 --- a/Common/Variance/entropy/entropySettings_nonSim.cs +++ b/Common/Variance/entropy/entropySettings_nonSim.cs @@ -1,5 +1,3 @@ -using System; - namespace Variance; public class EntropySettings_nonSim diff --git a/Common/Variance/entropy/entropyShape.cs b/Common/Variance/entropy/entropyShape.cs index ed97d4f..b3f0137 100644 --- a/Common/Variance/entropy/entropyShape.cs +++ b/Common/Variance/entropy/entropyShape.cs @@ -4,14 +4,12 @@ using Error; using geoLib; using geoWrangler; -using utility; +using shapeEngine; namespace Variance; public class EntropyShape { - private Fragmenter fragment; - private GeoLibPointF[] points; public GeoLibPointF[] getPoints() @@ -25,51 +23,11 @@ private GeoLibPointF[] pGetPoints() } private GeoLibPointF pivot; - - private double globalBias_Sides, globalBias_Tips; - - private MyVertex[] Vertex; // container for our extended point properties information. - private MyRound[] round1; // container for the rounding data. - private bool[] tips; // large array to hold tip information. - - private class BoundingBox - { - private GeoLibPointF midPoint; - public GeoLibPointF getMidPoint() - { - return pGetMidPoint(); - } - - private GeoLibPointF pGetMidPoint() - { - return midPoint; - } - - public BoundingBox(List incomingPoints) - { - pBoundingBox(incomingPoints); - } - - private void pBoundingBox(List incomingPoints) - { - if (incomingPoints == null) - { - midPoint = new GeoLibPointF(0.0f, 0.0f); - } - else - { - var minX = incomingPoints.Min(p => p.X); - var minY = incomingPoints.Min(p => p.Y); - var maxX = incomingPoints.Max(p => p.X); - var maxY = incomingPoints.Max(p => p.Y); - midPoint = new GeoLibPointF(minX + (maxX - minX) / 2.0f, minY + (maxY - minY) / 2.0f); - } - } - } - - private List preFlight(List mcPoints, EntropyLayerSettings entropyLayerSettings) + + private List preFlight(List mcPoints, EntropyLayerSettings entropyLayerSettings, double resolution, int scaleFactorForOperation) { // Fragment by resolution + Fragmenter fragment = new Fragmenter(resolution, scaleFactorForOperation); List newMCPoints = fragment.fragmentPath(mcPoints); bool H = entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.flipH) == 1; @@ -110,839 +68,83 @@ public EntropyShape(EntropySettings entropySettings, List private List makeShape(bool returnEarly, bool cornerCheck, EntropySettings entropySettings, List entropyLayerSettingsList, int settingsIndex, bool doPASearch, bool previewMode, ChaosSettings chaosSettings, ShapeLibrary shape) { - List mcPoints = new(); // overall points container. We'll use this to populate and send back our Point array later. Int only... - - Vertex = shape.Vertex; - tips = shape.tips; - round1 = shape.round1; - // Wrangle the tips. - for (int cp = 0; cp < Vertex.Length - 1; cp++) // We don't drive the last point directly - we'll close our shape. - { - if (!tips[cp]) - { - continue; - } - - // Note that these are reversed due to top-left origin of drawing! - // A positive bias shrinks the shape in this code..... - // Values below are correlated in the MCControl system for simulations. In preview mode, these are all zero. - double vTipBiasNegVar = chaosSettings.getValue(ChaosSettings.properties.vTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTNVar)); - double vTipBiasPosVar = chaosSettings.getValue(ChaosSettings.properties.vTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTPVar)); - double hTipBiasNegVar = chaosSettings.getValue(ChaosSettings.properties.hTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTNVar)); - double hTipBiasPosVar = chaosSettings.getValue(ChaosSettings.properties.hTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTPVar)); - if (Vertex[cp].direction == typeDirection.down1 && Vertex[cp].yBiasApplied == false) - { - Vertex[cp].Y -= Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTBias)); - Vertex[cp].Y -= Convert.ToDouble(globalBias_Tips); - if (chaosSettings.getValue(ChaosSettings.properties.vTipBiasType, settingsIndex) < 0.5) // Need to use our negative variation value - { - Vertex[cp].Y -= vTipBiasNegVar; - } - else - { - Vertex[cp].Y -= vTipBiasPosVar; - } - Vertex[cp].yBiasApplied = true; - } - if (Vertex[cp].direction == typeDirection.up1 && Vertex[cp].yBiasApplied == false) - { - Vertex[cp].Y += Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTBias)); - Vertex[cp].Y += globalBias_Tips; - if (chaosSettings.getValue(ChaosSettings.properties.vTipBiasType, settingsIndex) < 0.5) // Need to use our negative variation value - { - Vertex[cp].Y += vTipBiasNegVar; - } - else - { - Vertex[cp].Y += vTipBiasPosVar; - } - Vertex[cp].yBiasApplied = true; - } - if (Vertex[cp].direction == typeDirection.left1 && Vertex[cp].xBiasApplied == false) - { - Vertex[cp].X -= Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTBias)); - Vertex[cp].X -= globalBias_Tips; - if (chaosSettings.getValue(ChaosSettings.properties.hTipBiasType, settingsIndex) < 0.5) // Need to use our negative variation value - { - Vertex[cp].X -= hTipBiasNegVar; - } - else - { - Vertex[cp].X -= hTipBiasPosVar; - } - Vertex[cp].xBiasApplied = true; - } - - if (Vertex[cp].direction != typeDirection.right1 || Vertex[cp].xBiasApplied != false) - { - continue; - } - - Vertex[cp].X += Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTBias)); - Vertex[cp].X += globalBias_Tips; - if (chaosSettings.getValue(ChaosSettings.properties.hTipBiasType, settingsIndex) < 0.5) // Need to use our negative variation value - { - Vertex[cp].X += hTipBiasNegVar; - } - else - { - Vertex[cp].X += hTipBiasPosVar; - } - Vertex[cp].xBiasApplied = true; - } - - // Global bias for anything that isn't a tip. - for (int cp = 0; cp < Vertex.Length - 1; cp++) // We don't drive the last point directly - we'll close our shape. - { - if (!Vertex[cp].xBiasApplied && !tips[cp]) - { - switch (Vertex[cp].direction) - { - case typeDirection.left1: - Vertex[cp].X -= globalBias_Sides; - break; - case typeDirection.right1: - Vertex[cp].X += globalBias_Sides; - break; - } - } - if (!Vertex[cp].yBiasApplied && !tips[cp]) - { - switch (Vertex[cp].direction) - { - case typeDirection.up1: - Vertex[cp].Y += globalBias_Sides; - break; - case typeDirection.down1: - Vertex[cp].Y -= globalBias_Sides; - break; - } - } - } - - // Iterate the corners to apply the bias from the edges. - foreach (MyRound t in round1) - { - Vertex[t.index].X = Vertex[t.verFace].X; - Vertex[t.index].Y = Vertex[t.horFace].Y; - } - - Vertex[^1] = Vertex[0]; // close the shape. - round1[^1] = round1[0]; - - // Set the midpoints of the edges to the average between the two corners - for (int corner = 0; corner < round1.Length; corner++) - { - double previousEdgeLength; - - if (corner == 0) - { - previousEdgeLength = Math.Abs( - GeoWrangler.distanceBetweenPoints(new GeoLibPointF(Vertex[round1[corner].index].X, Vertex[round1[corner].index].Y), - new GeoLibPointF(Vertex[round1[^1].index].X, Vertex[round1[^1].index].Y)) - ); - } - else - { - previousEdgeLength = Math.Abs( - GeoWrangler.distanceBetweenPoints(new GeoLibPointF(Vertex[round1[corner].index].X, Vertex[round1[corner].index].Y), - new GeoLibPointF(Vertex[round1[corner - 1].index].X, Vertex[round1[corner - 1].index].Y)) - ); - } - - // Wrap around if we exceed the length - double nextEdgeLength = Math.Abs( - GeoWrangler.distanceBetweenPoints(new GeoLibPointF(Vertex[round1[(corner + 1) % (round1.Length - 1)].index].X, Vertex[round1[(corner + 1) % (round1.Length - 1)].index].Y), - new GeoLibPointF(Vertex[round1[(corner + 2) % (round1.Length - 1)].index].X, Vertex[round1[(corner + 2) % (round1.Length - 1)].index].Y)) - ); - - double currentEdgeLength = Math.Abs( - GeoWrangler.distanceBetweenPoints(new GeoLibPointF(Vertex[round1[corner].index].X, Vertex[round1[corner].index].Y), - new GeoLibPointF(Vertex[round1[(corner + 1) % (round1.Length - 1)].index].X, Vertex[round1[(corner + 1) % (round1.Length - 1)].index].Y)) - ); + // Define our biases. We will use these later. + double globalBias_Sides = Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.sBias)); + globalBias_Sides += chaosSettings.getValue(ChaosSettings.properties.CDUSVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.sCDU)) / 2; + double globalBias_Tips = chaosSettings.getValue(ChaosSettings.properties.CDUTVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.tCDU)) / 2; - double offset = 0.5f * currentEdgeLength; - bool reverseSlide = true; // used in the linear mode to handle reversed case (where ratio is > 1), and the no-slide case.) + List mcPoints = new(); // overall points container. We'll use this to populate and send back our Point array later. Int only... - if (entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.edgeSlide) == 1 && previousEdgeLength > 0 && nextEdgeLength > 0) - { - // Now we need to figure out the weighting. - double ratio = Math.Abs(nextEdgeLength / previousEdgeLength); - bool doLinearSlide = false; + double vTipBias = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.vTBias)); + double vTipBiasType = chaosSettings.getValue(ChaosSettings.properties.vTipBiasType, settingsIndex); + double vTipBiasNegVar = chaosSettings.getValue(ChaosSettings.properties.vTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTNVar)); + double vTipBiasPosVar = chaosSettings.getValue(ChaosSettings.properties.vTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.vTPVar)); - if (ratio < 1) - { - reverseSlide = false; - if (ratio < 1E-2) - { - ratio = 1E-2; // clamp - } - ratio = 1 / ratio; // normalize into our expected range - } + double hTipBias = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.hTBias)); + double hTipBiasType = chaosSettings.getValue(ChaosSettings.properties.hTipBiasType, settingsIndex); + double hTipBiasNegVar = chaosSettings.getValue(ChaosSettings.properties.hTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTNVar)); + double hTipBiasPosVar = chaosSettings.getValue(ChaosSettings.properties.hTipBiasVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.hTPVar)); - if (doLinearSlide) - { - // Linear - offset = Math.Pow(currentEdgeLength / 2.0f, 1.0f / ratio); // ratio * currentEdgeLength / 2.0f; - } - else - { - // Sigmoid function to try and provide some upper and lower resistance to the slide. - // center is to force 0.5 value of the scaling factor for a ratio of 1 - // tension controls the shape of the curve, and thus the sensitivity of the response.. - double center = 1.0f; - double tension = Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.eTension)); - offset = currentEdgeLength * (1 / (1 + Math.Exp(-tension * (center - ratio)))); - } - } + shape.computeTips(globalBias_Tips, hTipBias,hTipBiasType, hTipBiasNegVar, hTipBiasPosVar, vTipBias, vTipBiasType, vTipBiasNegVar, vTipBiasPosVar); - if (corner % 2 == 0) - { - // Get our associated vertical edge Y position - double yPoint1; - double yPoint2 = Vertex[round1[(corner + 1) % (round1.Length - 1)].horFace].Y; - switch (corner) - { - case 0: - // Need to wrap around for bias look-up - yPoint1 = Vertex[round1[^1].horFace].Y; - break; - default: - yPoint1 = Vertex[round1[corner].horFace].Y; - break; - } + shape.computeBias(globalBias_Sides); - if (yPoint1 < yPoint2) - { - if (reverseSlide) - { - Vertex[round1[corner].verFace].Y = yPoint2 - offset; - } - else - { - Vertex[round1[corner].verFace].Y = yPoint1 + offset; - } - } - else - { - if (reverseSlide) - { - Vertex[round1[corner].verFace].Y = yPoint2 + offset; - } - else - { - Vertex[round1[corner].verFace].Y = yPoint1 - offset; - } - } - } - else - { - // Tweak horizontal edge - double xPoint1 = Vertex[round1[corner].verFace].X; - double xPoint2 = Vertex[round1[(corner + 1) % (round1.Length - 1)].verFace].X; + shape.biasCorners(); - if (xPoint1 < xPoint2) - { - if (reverseSlide) - { - Vertex[round1[corner].horFace].X = xPoint2 - offset; - } - else - { - Vertex[round1[corner].horFace].X = xPoint1 + offset; - } - } - else - { - if (reverseSlide) - { - Vertex[round1[corner].horFace].X = xPoint2 + offset; - } - else - { - Vertex[round1[corner].horFace].X = xPoint1 - offset; - } - } - } - } + int edgeSlide = (entropyLayerSettingsList[settingsIndex].getInt(ShapeSettings.properties_i.edgeSlide)); + double eTension = Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(ShapeSettings.properties_decimal.eTension)); + shape.edgeMidpoints(edgeSlide, eTension); if (returnEarly) { mcPoints.Clear(); - mcPoints.AddRange(Vertex.Select(t => new GeoLibPointF(t.X, t.Y))); + mcPoints.AddRange(shape.Vertex.Select(t => new GeoLibPointF(t.X, t.Y))); return mcPoints; } - List mcHorEdgePoints = new(); // corner coordinates list, used as a temporary container for each iteration - List> mcHorEdgePointsList = new(); // Hold our lists of doubles for each corner in the shape, in order. We cast these to Int in the mcPoints list. - List> mcVerEdgePointsList = new(); // Hold our lists of doubles for each edge in the shape, in order. We cast these to Int in the mcPoints list. - - for (int round = 0; round < round1.Length - 1; round++) - { - // Derive our basic coordinates for the three vertices on the edge. - double start_x = Vertex[round1[round].index].X; - double start_y = Vertex[round1[round].index].Y; - double currentHorEdge_mid_x = Vertex[round1[round].horFace].X; - double currentVerEdge_mid_y = Vertex[round1[round].verFace].Y; - double end_x = Vertex[round1[round + 1].index].X; - double end_y = Vertex[round1[round + 1].index].Y; - double nextVerEdge_mid_y = Vertex[round1[round + 1].verFace].Y; - - switch (Math.Abs(start_y - end_y)) - { - // Test whether we have a vertical edge or not. We only process horizontal edges to avoid doubling up - case < double.Epsilon: - { - double mcPX; - double mcPY = 0.0f; - // Establish corner rounding sign at start and end points of edge. Default is to move outwards (inner CRR) - bool startInnerRounding = true; - bool endInnerRounding = true; - if (round1[round].direction == typeRound.exter) - { - startInnerRounding = false; - } - if (round1[round + 1].direction == typeRound.exter) - { - endInnerRounding = false; - } - - // Now sort out the shift based on face orientation. - bool horFaceUp = true; - switch (Vertex[round1[round].horFace].direction) - { - case typeDirection.up1: - break; - case typeDirection.down1: - horFaceUp = false; - break; - } - bool verFaceLeft = true; - switch (Vertex[round1[round].verFace].direction) - { - case typeDirection.left1: - break; - case typeDirection.right1: - verFaceLeft = false; - break; - } - - // Segment 1 - - // Clamp radius in each direction, if needed, to available distance - double hRadius = round1[round].MaxRadius; - double x_Distance = Math.Sqrt(Utils.myPow(currentHorEdge_mid_x - start_x, 2)); - double vRadius = round1[round].MaxRadius; - double y_Distance = Math.Sqrt(Utils.myPow(currentVerEdge_mid_y - start_y, 2)); - - // Add our random variation based on rounding type : - - bool paSearchAffectsCornerRounding = false; - - if (doPASearch) - { - switch (startInnerRounding) - { - case true: - paSearchAffectsCornerRounding = chaosSettings.getBool(ChaosSettings.bools.icPA, settingsIndex); - break; - default: - paSearchAffectsCornerRounding = chaosSettings.getBool(ChaosSettings.bools.ocPA, settingsIndex); - break; - } - } - - if (paSearchAffectsCornerRounding) - { - if (startInnerRounding) - { - hRadius = chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - vRadius = chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - } - else - { - hRadius = chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - vRadius = chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - } - } - else - { - if (!previewMode) - { - if (startInnerRounding) - { - hRadius += chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCV)); - vRadius += chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCV)); - } - else - { - hRadius += chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCV)); - vRadius += chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCV)); - } - } - } - - if (hRadius > x_Distance) - { - hRadius = x_Distance; - } - if (vRadius > y_Distance) - { - vRadius = y_Distance; - } - - // Clamp for negative radius values that would make no sense - if (hRadius < 0) - { - hRadius = 0; - } - if (vRadius < 0) - { - vRadius = 0; - } - - double angleIncrement = 90.0f / entropySettings.getValue(EntropySettings.properties_i.cSeg); - - // Sweep our corner. - double angle = 0.0f; - while (angle <= 90.0f) - { - // Set start condition - mcPX = start_x; // X position for new point. - mcPY = start_y; // this will hold our Y position for the new point. - - // Remove full contribution from rounding. - if (verFaceLeft) - { - if (startInnerRounding) - { - mcPX -= hRadius; - } - else - { - mcPX += hRadius; - } - } - else - { - if (startInnerRounding) - { - mcPX += hRadius; - } - else - { - mcPX -= hRadius; - } - } - if (horFaceUp) - { - if (startInnerRounding) - { - mcPY += vRadius; - } - else - { - mcPY -= vRadius; - } - } - else - { - if (startInnerRounding) - { - mcPY -= vRadius; - } - else - { - mcPY += vRadius; - } - } - - // Now process corner, adding back contribution from rounding - if (verFaceLeft) - { - if (startInnerRounding) - { - mcPX += hRadius * Math.Cos(Utils.toRadians(angle)); - } - else - { - mcPX -= hRadius * Math.Cos(Utils.toRadians(angle)); - } - } - else - { - if (startInnerRounding) - { - mcPX -= hRadius * Math.Cos(Utils.toRadians(angle)); - } - else - { - mcPX += hRadius * Math.Cos(Utils.toRadians(angle)); - } - } - if (horFaceUp) - { - if (startInnerRounding) - { - mcPY -= vRadius * Math.Sin(Utils.toRadians(angle)); - } - else - { - mcPY += vRadius * Math.Sin(Utils.toRadians(angle)); - } - } - else - { - if (startInnerRounding) - { - mcPY += vRadius * Math.Sin(Utils.toRadians(angle)); - } - else - { - mcPY -= vRadius * Math.Sin(Utils.toRadians(angle)); - } - } - - GeoLibPointF cPt = new(mcPX, mcPY); - if (angle == 0 || Math.Abs(angle - 90) < double.Epsilon || entropySettings.getValue(EntropySettings.properties_i.optC) == 0 || - entropySettings.getValue(EntropySettings.properties_i.optC) == 1 && - Math.Abs( - GeoWrangler.distanceBetweenPoints(mcHorEdgePoints[^1], cPt) - ) - > entropySettings.getResolution() - ) - { - mcHorEdgePoints.Add(cPt); - } - angle += angleIncrement; - } - - // OK. We now need to add points along the edge based on the simulation settings resolution. - // We need to add points from here to just before the midpoint - - double bridgeX = mcHorEdgePoints[^1].X; - - // Fragmenter returns first and last points in the point array. - GeoLibPointF[] fragments = fragment.fragmentPath(new [] { new GeoLibPointF(bridgeX, mcPY), new GeoLibPointF(currentHorEdge_mid_x, mcPY) }); - - for (int i = 1; i < fragments.Length - 1; i++) - { - mcHorEdgePoints.Add(fragments[i]); - } - - // Add our midpoint. - mcHorEdgePoints.Add(new GeoLibPointF(currentHorEdge_mid_x, mcPY)); - - // Segment 2, plus bridging on first pass through. - - bool firstPass = true; // With this set, we bridge from midpoint to our first point in the first pass through - // segment 2 of the edge. - verFaceLeft = true; - switch (Vertex[round1[round + 1].verFace].direction) - { - case typeDirection.left1: - break; - case typeDirection.right1: - verFaceLeft = false; - break; - } - - // Clamp radius to available distance, if needed. - hRadius = round1[round + 1].MaxRadius; - x_Distance = Math.Sqrt(Utils.myPow(currentHorEdge_mid_x - end_x, 2)); - vRadius = round1[round + 1].MaxRadius; - y_Distance = Math.Sqrt(Utils.myPow(nextVerEdge_mid_y - end_y, 2)); - - // Add our random variation based on rounding type : - - paSearchAffectsCornerRounding = false; - if (doPASearch) - { - switch (startInnerRounding) - { - case true: - paSearchAffectsCornerRounding = chaosSettings.getBool(ChaosSettings.bools.icPA, settingsIndex); - break; - default: - paSearchAffectsCornerRounding = chaosSettings.getBool(ChaosSettings.bools.ocPA, settingsIndex); - break; - } - } - - if (paSearchAffectsCornerRounding) - { - if (startInnerRounding) - { - hRadius = chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - vRadius = chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - } - else - { - hRadius = chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - vRadius = chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - } - } - else - { - // Add our random variation based on rounding type : - if (!previewMode) - { - if (endInnerRounding) - { - hRadius += chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCV)); - vRadius += chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.iCV)); - } - else - { - hRadius += chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCV)); - vRadius += chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.oCV)); - } - } - } - - if (hRadius > x_Distance) - { - hRadius = x_Distance; - } - if (vRadius > y_Distance) - { - vRadius = y_Distance; - } - - // Clamp for negative radius values that would make no sense - if (hRadius < 0) - { - hRadius = 0; - } - if (vRadius < 0) - { - vRadius = 0; - } - - // Sweep our end corner. We need to run the sweep in the opposite direction. - angle = 90.0f; - while (angle >= 0.0f) - { - // Set start conditions - mcPX = end_x; - mcPY = end_y; - - // Remove full extent of rounding in each direction, based on face orientation - if (verFaceLeft) - { - if (endInnerRounding) - { - mcPX -= hRadius; - } - else - { - mcPX += hRadius; - } - } - else - { - if (endInnerRounding) - { - mcPX += hRadius; - } - else - { - mcPX -= hRadius; - } - } - if (horFaceUp) - { - if (endInnerRounding) - { - mcPY += vRadius; - } - else - { - mcPY -= vRadius; - } - } - else - { - if (endInnerRounding) - { - mcPY -= vRadius; - } - else - { - mcPY += vRadius; - } - } - - // Process corners, adding back the contribution from the rounding based on the angle - if (verFaceLeft) - { - if (endInnerRounding) - { - mcPX += hRadius * Math.Cos(Utils.toRadians(angle)); - } - else - { - mcPX -= hRadius * Math.Cos(Utils.toRadians(angle)); - } - } - else - { - if (endInnerRounding) - { - mcPX -= hRadius * Math.Cos(Utils.toRadians(angle)); - } - else - { - mcPX += hRadius * Math.Cos(Utils.toRadians(angle)); - } - } - if (horFaceUp) - { - if (endInnerRounding) - { - mcPY -= vRadius * Math.Sin(Utils.toRadians(angle)); - } - else - { - mcPY += vRadius * Math.Sin(Utils.toRadians(angle)); - } - } - else - { - if (endInnerRounding) - { - mcPY += vRadius * Math.Sin(Utils.toRadians(angle)); - } - else - { - mcPY -= vRadius * Math.Sin(Utils.toRadians(angle)); - } - } - - // If this is the first pass, we need to add points to the start of the rounding, from the midpoint. - if (firstPass) - { - bridgeX = currentHorEdge_mid_x; - - // Fragmenter returns first and last points in the point array. - fragments = fragment.fragmentPath(new [] { new GeoLibPointF(bridgeX, mcPY), new GeoLibPointF(mcPX, mcPY) }); - - for (int i = 1; i < fragments.Length - 1; i++) - { - mcHorEdgePoints.Add(fragments[i]); - } - - firstPass = false; - } - - GeoLibPointF cPt = new(mcPX, mcPY); - if (angle == 0 || Math.Abs(angle - 90) < double.Epsilon || entropySettings.getValue(EntropySettings.properties_i.optC) == 0 || - entropySettings.getValue(EntropySettings.properties_i.optC) == 1 && - Math.Abs( - GeoWrangler.distanceBetweenPoints(mcHorEdgePoints[^1], cPt) - ) - > entropySettings.getResolution() - ) - { - mcHorEdgePoints.Add(cPt); - } - angle -= angleIncrement; - } - - mcHorEdgePointsList.Add(mcHorEdgePoints.ToList()); // make a deep copy of the points. - mcHorEdgePoints.Clear(); // clear our list of points to use on the next pass. - break; - } - } - } - - if (cornerCheck) - { - mcPoints.Clear(); - foreach (List t in mcHorEdgePointsList) - { - foreach (GeoLibPointF t1 in t) - { - mcPoints.Add(new GeoLibPointF(t1.X, t1.Y)); - } - } - mcPoints.Add(new GeoLibPointF(mcPoints[0].X, mcPoints[0].Y)); - return mcPoints; - } - - // Now we have our corners, let's process the vertical edges. We need the corners in order to get our start/end on each vertical edge. - for (int edge = 0; edge < mcHorEdgePointsList.Count; edge++) - { - // Get our start and end Y positions for our vertical edge. - List startHorEdgePointList = mcHorEdgePointsList[edge]; - int endHorEdgePointListIndex; - if (edge == 0) - { - endHorEdgePointListIndex = mcHorEdgePointsList.Count - 1; // need to wrap around. - } - else - { - endHorEdgePointListIndex = edge - 1; - } - - List endHorEdgePointList = mcHorEdgePointsList[endHorEdgePointListIndex]; - double vert_x = endHorEdgePointList[^1].X; - double startPoint_y = endHorEdgePointList[^1].Y; - double endPoint_y = startHorEdgePointList[0].Y; - - // We get the start and end points here. - GeoLibPointF[] fragments = fragment.fragmentPath(new [] { new GeoLibPointF(vert_x, startPoint_y), new GeoLibPointF(vert_x, endPoint_y) }); - - mcVerEdgePointsList.Add(fragments.ToList()); // make a deep copy of the points. - } - - // OK. We have our corners and edges. We need to walk them now. We'll apply the subshape 1 offset at the same time. - for (int section = 0; section < mcVerEdgePointsList.Count; section++) - { - for (int point = 0; point < mcVerEdgePointsList[section].Count; point++) - { - double x = mcVerEdgePointsList[section][point].X + Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - double y = mcVerEdgePointsList[section][point].Y + Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); - mcPoints.Add(new GeoLibPointF(x, y)); - } - - // Corner next. - // Start and end points match those in the vertical edges, so we avoid them to eliminate duplicates. - for (int point = 1; point < mcHorEdgePointsList[section].Count - 1; point++) - { - double x = mcHorEdgePointsList[section][point].X + Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - double y = mcHorEdgePointsList[section][point].Y + Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); - mcPoints.Add(new GeoLibPointF(x, y)); - } - } + double iCR = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.iCR)); + double oCR = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.oCR)); + double iCV = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.iCV)); + double oCV = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.oCV)); + double iCVariation = chaosSettings.getValue(ChaosSettings.properties.icVar, settingsIndex); + double oCVariation = chaosSettings.getValue(ChaosSettings.properties.ocVar, settingsIndex); + int cornerSegments = entropySettings.getValue(EntropySettings.properties_i.cSeg); + int optimizeCorners = entropySettings.getValue(EntropySettings.properties_i.optC); + double resolution = entropySettings.getResolution(); + bool icPA = chaosSettings.getBool(ChaosSettings.bools.icPA, settingsIndex); + bool ocPA = chaosSettings.getBool(ChaosSettings.bools.ocPA, settingsIndex); + double s0HO = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0)); + double s0VO = Convert.ToDouble(entropyLayerSettingsList[settingsIndex] + .getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0)); + + mcPoints = shape.processCorners(previewMode, cornerCheck, doPASearch, s0HO, s0VO, iCR, iCV, iCVariation, icPA, oCR, oCV, + oCVariation, ocPA, cornerSegments, optimizeCorners, resolution, CentralProperties.scaleFactorForOperation); return mcPoints; - } + } + private void makeEntropyShape(EntropySettings entropySettings, List entropyLayerSettingsList, int settingsIndex, bool doPASearch, bool previewMode, ChaosSettings chaosSettings, ShapeLibrary shape = null, GeoLibPointF pivot_ = null) { bool geoCoreShapeDefined = shape != null; bool cornerCheck = false; bool returnEarly = false; - double xOverlayVal = 0.0f; - double yOverlayVal = 0.0f; - if (pivot_ != null) { pivot = new GeoLibPointF(pivot_.X, pivot_.Y); } - - fragment = new Fragmenter(entropySettings.getResolution(), CentralProperties.scaleFactorForOperation); - - // Define our biases. We will use these later. - globalBias_Sides = Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.sBias)); - globalBias_Sides += chaosSettings.getValue(ChaosSettings.properties.CDUSVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.sCDU)) / 2; - globalBias_Tips = chaosSettings.getValue(ChaosSettings.properties.CDUTVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.tCDU)) / 2; - + if (shape == null) { - shape = new ShapeLibrary(entropyLayerSettingsList[settingsIndex]); + shape = new ShapeLibrary(CentralProperties.shapeTable, entropyLayerSettingsList[settingsIndex]); shape.setShape(entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.shapeIndex)); } @@ -952,7 +154,6 @@ private void makeEntropyShape(EntropySettings entropySettings, List mcPoints = new(); // overall points container. We'll use this to populate and send back our Point array later. Ints only... // Handle non-orthogonal case. - if (!failSafe) { // ReSharper disable once ConditionIsAlwaysTrueOrFalse @@ -976,7 +177,7 @@ private void makeEntropyShape(EntropySettings entropySettings, List 1) { // Need to clean up any duplicate points at this point, to avoid causing /0 issues below. - List newPoints = new(); - for (int pt = 1; pt < mcPoints.Count; pt++) - { - if (Math.Abs(Math.Sqrt(Utils.myPow(mcPoints[pt].X - mcPoints[pt - 1].X, 2) + Utils.myPow(mcPoints[pt].Y - mcPoints[pt - 1].Y, 2))) > threshold) - { - newPoints.Add(new GeoLibPointF(mcPoints[pt - 1])); - } - } + List newPoints = GeoWrangler.removeDuplicates(mcPoints, threshold); if (newPoints.Count != 0) { // Close shape. - mcPoints = newPoints.ToList(); - mcPoints.Add(new GeoLibPointF(mcPoints[0])); + mcPoints = GeoWrangler.close(newPoints); } } - - double rotationAngle = Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.rot)); double rotationVar = chaosSettings.getValue(ChaosSettings.properties.wobbleVar, settingsIndex) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.wobble)); // Per-poly rotation for layout case (only scenario where we have polygon sheets at this level) // Note that we don't have CSV tracking for this case - there's no practical way to record the random values here. - if (entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.perPoly) == 1 && entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.perPoly) == 1 && entropyLayerSettingsList[settingsIndex].getInt(ShapeSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { rotationVar = UtilityFuncs.getGaussianRandomNumber3(entropySettings) * Convert.ToDouble(entropyLayerSettingsList[settingsIndex].getDecimal(EntropyLayerSettings.properties_decimal.wobble)); } double rotationDirection = UtilityFuncs.getGaussianRandomNumber3(entropySettings); - if (rotationDirection <= 0.5) - { - rotationAngle -= rotationVar; - } - else - { - rotationAngle += rotationVar; - } - if (rotationAngle != 0 || (entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.flipH) == 1 || entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.flipV) == 1) && (entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.alignX) == 1 || entropyLayerSettingsList[settingsIndex].getInt(EntropyLayerSettings.properties_i.alignY) == 1)) - { - // Get our bounding box. - BoundingBox bb = new(mcPoints); - - switch (pivot) - { - case null: - pivot = new GeoLibPointF(bb.getMidPoint()); - break; - } - - // OK. Let's try some rotation and wobble. - // Temporary separate container for our rotated points, just for now. - List rotatedPoints = GeoWrangler.Rotate(pivot, mcPoints, rotationAngle); - mcPoints.Clear(); - mcPoints = rotatedPoints.ToList(); - } + mcPoints = shape.rotateShape(mcPoints, entropyLayerSettingsList[settingsIndex], rotationVar, rotationDirection, pivot); // Error handling (failSafe) for no points or no subshape - safety measure. if (!mcPoints.Any()) @@ -1106,14 +268,8 @@ private void makeEntropyShape(EntropySettings entropySettings, List double.Epsilon || Math.Abs(points[0].Y - points[^1].Y) > double.Epsilon) { ErrorReporter.showMessage_OK("Start and end not the same - entropyShape", "Oops"); diff --git a/Common/Variance/entropy/entropy_geo.cs b/Common/Variance/entropy/entropy_geo.cs index f927197..cfc0200 100644 --- a/Common/Variance/entropy/entropy_geo.cs +++ b/Common/Variance/entropy/entropy_geo.cs @@ -5,7 +5,8 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; -using ClipperLib1; +using Clipper2Lib; +using EmailNS; using Error; using gds; using geoCoreLib; @@ -17,8 +18,8 @@ namespace Variance; -using Path = List; -using Paths = List>; +using Path = List; +using Paths = List>; public partial class Entropy { @@ -109,7 +110,7 @@ private void entropyRunCore_singleThread(bool previewMode, int numberOfCases, in int numberOfResultsFields; switch (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType)) { - case (int)CommonVars.calcModes.chord: // chord + case (int)geoAnalysis.supported.calcModes.chord: // chord numberOfResultsFields = 4; break; default: // area, angle, spacing @@ -296,7 +297,7 @@ private void entropyRunCore_multipleThread(bool previewMode, int numberOfCases, int numberOfResultsFields; switch (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType)) { - case (int)CommonVars.calcModes.chord: // chord + case (int)geoAnalysis.supported.calcModes.chord: // chord numberOfResultsFields = 4; break; default: // area, angle, spacing @@ -424,7 +425,7 @@ private void entropyRunCore_multipleThread(bool previewMode, int numberOfCases, break; } // Multi-result check. - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.chord) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.chord) { // Is second result being filtered? rf = 1; @@ -502,7 +503,7 @@ private void entropyRunCore_multipleThread(bool previewMode, int numberOfCases, // resultPackage has its own locking. resultPackage.Add(currentResult, 0); // disable retention of geometry given new write-during-run methodology. } - catch (Exception ex) + catch (Exception) { } @@ -566,11 +567,11 @@ private void doTileExtraction(int col, int row) long tileRightX = (long)(tileLeftX + tileXSize * CentralProperties.scaleFactorForOperation); long tileBottomY = (long)(tileYOffset + row * tileYSize) * CentralProperties.scaleFactorForOperation; long tileTopY = (long)(tileBottomY + tileYSize * CentralProperties.scaleFactorForOperation); - tileCutter.Add(new IntPoint(tileLeftX, tileBottomY)); - tileCutter.Add(new IntPoint(tileLeftX, tileTopY)); - tileCutter.Add(new IntPoint(tileRightX, tileTopY)); - tileCutter.Add(new IntPoint(tileRightX, tileBottomY)); - tileCutter.Add(new IntPoint(tileLeftX, tileBottomY)); + tileCutter.Add(new Point64(tileLeftX, tileBottomY)); + tileCutter.Add(new Point64(tileLeftX, tileTopY)); + tileCutter.Add(new Point64(tileRightX, tileTopY)); + tileCutter.Add(new Point64(tileRightX, tileBottomY)); + tileCutter.Add(new Point64(tileLeftX, tileBottomY)); for (int layer = 0; layer < CentralProperties.maxLayersForMC; layer++) { @@ -580,7 +581,6 @@ private void doTileExtraction(int col, int row) continue; } - Paths result = new(); // Get our layout for clipping. Paths layout = new(); // Use Paths since we have polygon islands to wrangle. // fileData contains all of our polygons @@ -601,23 +601,19 @@ private void doTileExtraction(int col, int row) } // We now use a Union() to merge any partially overlapping polys. - Clipper c = new() + Clipper64 c = new() { PreserveCollinear = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0 }; - c.AddPaths(layout, PolyType.ptSubject, true); - c.Execute(ClipType.ctUnion, result, PolyFillType.pftNonZero, PolyFillType.pftNonZero); - layout = result.ToList(); - result.Clear(); + c.AddSubject(layout); + c.Execute(ClipType.Union, FillRule.NonZero, layout); // Carve out our tile - c = new Clipper - { - PreserveCollinear = commonVars.getLayerSettings(layer).getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0 - }; - c.AddPath(tileCutter, PolyType.ptClip, true); - c.AddPaths(layout, PolyType.ptSubject, true); - c.Execute(ClipType.ctIntersection, result); + c.Clear(); + c.AddClip(tileCutter); + c.AddSubject(layout); + Paths result = new(); + c.Execute(ClipType.Intersection, FillRule.EvenOdd, result); // Need to map output and downscale to floating points again. // We might have more than one polygon in the result, so be careful. @@ -626,7 +622,7 @@ private void doTileExtraction(int col, int row) List extractedPolys = result.Select(t => GeoWrangler.pointFFromPath(t, CentralProperties.scaleFactorForOperation)).Select(tempPoly => GeoWrangler.move(tempPoly, -xCompensation, -yCompensation)).ToList(); - commonVars.getNonSimulationSettings().extractedTile[layer] = extractedPolys.ToList(); + commonVars.getNonSimulationSettings().extractedTile[layer] = extractedPolys; } } @@ -727,9 +723,9 @@ private bool saveResults(bool tileHandling, int col, int row) configProgress?.Invoke(0, doneCases); // Create header for CSV output, if applicable string headerString = "Run,"; - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.area) // area output + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.area) // area output { - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.areaCalcModes.all) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.AreaHandler.areaCalcModes.all) { headerString += "Total Area"; } @@ -738,25 +734,25 @@ private bool saveResults(bool tileHandling, int col, int row) headerString += "Minimum Area"; } } - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.enclosure_spacing_overlap) // spacing output + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap) // spacing output { switch (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.subMode)) { - case (int)CommonVars.spacingCalcModes.spacing: - case (int)CommonVars.spacingCalcModes.spacingOld: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacing: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacingOld: headerString += "Spacing"; break; - case (int)CommonVars.spacingCalcModes.enclosure: - case (int)CommonVars.spacingCalcModes.enclosureOld: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosure: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosureOld: headerString += "Enclosure"; break; } } - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.chord) // chord output + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.chord) // chord output { headerString += "AMinTopChord,AMinBottomChord,BMinLeftChord,BMinRightChord"; } - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.angle) // angle output + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.angle) // angle output { headerString += "MinIntersectionAngle"; } @@ -905,7 +901,7 @@ private void writeSVG(Results currentResult, int resultEntry, int numberOfCases, string paddingString = "D" + numberOfCases.ToString().Length; // count chars in the number of cases as a string, use that to define padding. svgFileName += "_run" + resultEntry.ToString(paddingString) + ".svg"; - SVGBuilder svg = new(); + SVGBuilder.SVGBuilder svg = new(); // Inputs for (int previewShapeIndex = 0; previewShapeIndex < currentResult.getPreviewShapes().Count; previewShapeIndex++) @@ -994,7 +990,7 @@ private void writeLayout(Results currentResult, int resultEntry, int numberOfCas foreach (GeoLibPoint[] ePoly in from t in polys let polyLength = t.Length where polyLength > 2 select GeoWrangler.resize_to_int(t, scale)) { - gcell_root.addPolygon(ePoly.ToArray(), layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. + gcell_root.addPolygon(ePoly, layerIndex + 1, 0); // layer is 1-index based for output, so need to offset value accordingly. } } @@ -1013,7 +1009,7 @@ private void writeLayout(Results currentResult, int resultEntry, int numberOfCas GeoLibPoint[] ePoly = GeoWrangler.resize_to_int(rpolys[poly], scale); - gcell_root.addPolygon(ePoly.ToArray(), layerNum, 0); // layer is 1-index based for output, so need to offset value accordingly. + gcell_root.addPolygon(ePoly, layerNum, 0); // layer is 1-index based for output, so need to offset value accordingly. } g.setDrawing(drawing_); @@ -1235,7 +1231,14 @@ private void pEntropyRun(int numberOfCases, string csvFile, bool useThreads, boo // Assume user error if perJob is set and not onCompletion. if ((commonVars.getNonSimulationSettings().emailOnCompletion || commonVars.getNonSimulationSettings().emailPerJob) && numberOfCases > 1) { - Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + try + { + Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + } + catch (Exception e) + { + ErrorReporter.showMessage_OK(e.Message, "Error sending mail"); + } } } else @@ -1281,7 +1284,14 @@ private void pEntropyRun(int numberOfCases, string csvFile, bool useThreads, boo } if (commonVars.getNonSimulationSettings().emailPerJob) { - Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + try + { + Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + } + catch (Exception e) + { + ErrorReporter.showMessage_OK(e.Message, "Error sending mail"); + } } } } @@ -1330,7 +1340,14 @@ private void pEntropyRun(int numberOfCases, string csvFile, bool useThreads, boo } if (commonVars.getNonSimulationSettings().emailPerJob) { - Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + try + { + Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + } + catch (Exception e) + { + ErrorReporter.showMessage_OK(e.Message, "Error sending mail"); + } } col++; } @@ -1410,7 +1427,7 @@ private Results EntropyEval(bool previewMode, bool doPASearch, int currentRow, i // Check whether we need to manually close our shape or not, also only for the area case. int length = currentJobEngine.getPaths()[listMember].Count; int arraySize = length; - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.area && currentJobEngine.getPaths()[listMember][currentJobEngine.getPaths()[listMember].Count - 1] != currentJobEngine.getPaths()[listMember][0]) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.area && currentJobEngine.getPaths()[listMember][currentJobEngine.getPaths()[listMember].Count - 1] != currentJobEngine.getPaths()[listMember][0]) { arraySize++; } @@ -1430,7 +1447,7 @@ private Results EntropyEval(bool previewMode, bool doPASearch, int currentRow, i ); #endif // Close the shape only if we have an area calculation; for other cases we expect lines. - if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)CommonVars.calcModes.area && points[^1] != points[0]) + if (commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.oType) == (int)geoAnalysis.supported.calcModes.area && points[^1] != points[0]) { points[^1] = points[0]; } diff --git a/Common/Variance/entropy/entropy_implant.cs b/Common/Variance/entropy/entropy_implant.cs index 7d3dfd2..5c69dff 100644 --- a/Common/Variance/entropy/entropy_implant.cs +++ b/Common/Variance/entropy/entropy_implant.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using EmailNS; using Error; using gds; using geoCoreLib; @@ -307,7 +308,16 @@ private void pEntropyRun_implant(int numberOfCases, string csvFile, bool useThre // We'll use simulationSettings here just because legacy put the settings there and it's the easiest option. if (commonVars.getNonSimulationSettings().emailOnCompletion && numberOfCases > 1) { - Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + try + { + Email.Send(commonVars.getNonSimulationSettings().host, commonVars.getNonSimulationSettings().port, + commonVars.getNonSimulationSettings().ssl, emailString, lastSimResultsOverview, + commonVars.getNonSimulationSettings().emailAddress, commonVars.getNonSimulationSettings().emailPwd); + } + catch (Exception e) + { + ErrorReporter.showMessage_OK(e.Message, "Error sending mail"); + } } if (numberOfCases > 1) @@ -500,7 +510,7 @@ private void writeSVG(Results_implant currentResult, int resultEntry, int number string paddingString = "D" + numberOfCases.ToString().Length; // count chars in the number of cases as a string, use that to define padding. svgFileName += "_run" + resultEntry.ToString(paddingString) + ".svg"; - SVGBuilder svg = new() + SVGBuilder.SVGBuilder svg = new() { style = { @@ -577,7 +587,7 @@ private void writeLayout_implant(Results_implant currentResult, int resultEntry, foreach (GeoLibPoint[] ePoly in resistPolys.Select(t => GeoWrangler.resize_to_int(t, scale))) { - gcell_root.addPolygon(ePoly.ToArray(), i + 1, 0); + gcell_root.addPolygon(ePoly, i + 1, 0); } } @@ -586,7 +596,7 @@ private void writeLayout_implant(Results_implant currentResult, int resultEntry, g.addLayerName("L2D0", "shadowLine"); foreach (GeoLibPoint[] ePoly in shadowLine.Select(t => GeoWrangler.resize_to_int(t, scale))) { - gcell_root.addPolygon(ePoly.ToArray(), 2, 0); + gcell_root.addPolygon(ePoly, 2, 0); } g.setDrawing(drawing_); diff --git a/Common/Variance/entropy/paSearchSettings.cs b/Common/Variance/entropy/paSearchSettings.cs index b2a3309..a08600d 100644 --- a/Common/Variance/entropy/paSearchSettings.cs +++ b/Common/Variance/entropy/paSearchSettings.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using shapeEngine; namespace Variance; @@ -182,7 +183,7 @@ private bool[] pGetEnabledState(EntropyLayerSettings layerSettings) bool enable = layerSettings.getInt(EntropyLayerSettings.properties_i.enabled) == 1; if (enable) { - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (layerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { // Disable for geoCore case, as appropriate. if (layerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0) diff --git a/Common/Variance/results/results.cs b/Common/Variance/results/results.cs index b94f922..b89f8f8 100644 --- a/Common/Variance/results/results.cs +++ b/Common/Variance/results/results.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using geoLib; diff --git a/Common/Variance/support/Email.cs b/Common/Variance/support/Email.cs deleted file mode 100644 index 945851a..0000000 --- a/Common/Variance/support/Email.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Error; -using MailKit.Net.Smtp; -using MimeKit; - -namespace Variance; - -public static class Email -{ - public static void Send(string host, string port, bool ssl, string subject, string messageContent, string address, string password) - { - if (host == "" || port == "" || address == "" || password == "") - { - return; - } - - try - { - SmtpClient client = new() {ServerCertificateValidationCallback = (s, c, h, e) => true}; - client.Connect(host, Convert.ToInt32(port), ssl); - MimeMessage message = new() - { - Subject = subject, Body = new TextPart("plain") {Text = messageContent} - }; - message.From.Add(new MailboxAddress(address, address)); - message.To.Add(new MailboxAddress(address, address)); - client.Authenticate(address, password); - client.Send(message); - client.Disconnect(true); - } - catch (Exception ex) - { - ErrorReporter.showMessage_OK(ex.Message, "Email problem"); - } - } -} \ No newline at end of file diff --git a/Common/Variance/support/SVGBuilder.cs b/Common/Variance/support/SVGBuilder.cs deleted file mode 100644 index 5bcdd3f..0000000 --- a/Common/Variance/support/SVGBuilder.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using color; -using geoLib; - -namespace Variance; - -using Polygon = List; -using Polygons = List>; -//a very simple class that builds an SVG file with any number of -//polygons of the specified formats ... -public class SVGBuilder -{ - public class StyleInfo - { - public int pft { get; set; } - public MyColor brushClr { get; set; } - public MyColor penClr { get; set; } - public double penWidth { get; set; } - public int[] dashArray { get; set; } - public bool showCoords { get; set; } - public StyleInfo Clone() - { - StyleInfo si = new() - { - pft = pft, - brushClr = brushClr, - dashArray = dashArray, - penClr = penClr, - penWidth = penWidth, - showCoords = showCoords - }; - return si; - } - public StyleInfo() - { - pft = 0; // PolyFillType.pftNonZero; - brushClr = MyColor.AntiqueWhite; - dashArray = null; - penClr = MyColor.Black; - penWidth = 0.8; - showCoords = false; - } - } - - public class PolyInfo - { - public Polygons polygons { get; set; } - public StyleInfo si { get; set; } - //public Color pi_color; - } - - public class BoundingRect - { - public double bottom { get; set; } - public double top { get; set; } - public double left { get; set; } - public double right { get; set; } - } - - public StyleInfo style; - private List PolyInfoList; - - private const string svg_header = "\n" + - "\n\n" + - "\n\n"; - - private const string svg_path_format = "\"\n style=\"fill:{0};" + - " fill-opacity:0; fill-rule:{2}; stroke:{3};" + - " stroke-opacity:{4:f2}; stroke-width:{5:f2};\"/>\n\n"; - - public SVGBuilder() - { - PolyInfoList = new List(); - style = new StyleInfo(); - } - - public void AddPolygons(List pointArrayList) - { - Polygons tempPolygonsList = pointArrayList.Select(t => t.ToList()).Select(tempPolygon => tempPolygon.ToList()).ToList(); - AddPolygons(tempPolygonsList.ToList()); - } - - public void AddPolygons(GeoLibPointF[] pointArray) - { - Polygons tempPolygonsList = new(); - Polygon tempPolygon = pointArray.ToList(); - tempPolygonsList.Add(tempPolygon.ToList()); - AddPolygons(tempPolygonsList.ToList()); - } - - public void AddPolygons(Polygons poly) - { - if (poly.Count == 0) - { - return; - } - - PolyInfo pi = new() {polygons = poly, si = style.Clone()}; - PolyInfoList.Add(pi); - } - - public bool SaveToFile(string filename, double scale = 10.0, int margin = 10) - { - // if (scale == 0) scale = 1.0; - // if (margin < 0) margin = 0; - - //calculate the bounding rect ... - int i = 0, j = 0; - while (i < PolyInfoList.Count) - { - j = 0; - while (j < PolyInfoList[i].polygons.Count && - PolyInfoList[i].polygons[j].Count == 0) - { - j++; - } - - if (j < PolyInfoList[i].polygons.Count) - { - break; - } - - i++; - } - if (i == PolyInfoList.Count) - { - return false; - } - - BoundingRect rec = new() {left = PolyInfoList[i].polygons[j][0].X}; - rec.right = rec.left; - rec.top = PolyInfoList[0].polygons[j][0].Y; - rec.bottom = rec.top; - - for (; i < PolyInfoList.Count; i++) - { - foreach (GeoLibPointF pt in PolyInfoList[i].polygons.SelectMany(pg => pg)) - { - if (pt.X < rec.left) - { - rec.left = pt.X; - } - else if (pt.X > rec.right) - { - rec.right = pt.X; - } - - if (pt.Y < rec.top) - { - rec.top = pt.Y; - } - else if (pt.Y > rec.bottom) - { - rec.bottom = pt.Y; - } - } - } - - rec.left *= scale; - rec.top *= scale; - rec.right *= scale; - rec.bottom *= scale; - double offsetX = -rec.left + margin; - double offsetY = -rec.top + margin; - - using StreamWriter writer = new(filename); - writer.Write(svg_header, - rec.right - rec.left + margin * 2, - rec.bottom - rec.top + margin * 2, - rec.right - rec.left + margin * 2, - rec.bottom - rec.top + margin * 2); - - foreach (PolyInfo pi in PolyInfoList) - { - writer.Write(" p.Count >= 3)) - { - writer.Write(string.Format(NumberFormatInfo.InvariantInfo, " M {0:f2} {1:f2}", - p[0].X * scale + offsetX, - p[0].Y * scale + offsetY)); - for (int k = 1; k < p.Count; k++) - { - writer.Write(string.Format(NumberFormatInfo.InvariantInfo, " L {0:f2} {1:f2}", - p[k].X * scale + offsetX, - p[k].Y * scale + offsetY)); - } - writer.Write(" z"); - } - - writer.Write(string.Format(NumberFormatInfo.InvariantInfo, svg_path_format, - pi.si.brushClr.ToHtml(), - (float)pi.si.brushClr.A / 255, - pi.si.pft == 0, - pi.si.penClr.ToHtml(), - (float)pi.si.penClr.A / 255, - pi.si.penWidth)); - - switch (pi.si.showCoords) - { - case true: - { - writer.Write("\n\n"); - foreach (Polygon p in pi.polygons) - { - foreach (GeoLibPointF pt in p) - { - double x = pt.X; - double y = pt.Y; - writer.Write($"{x},{y}\n"); - - } - writer.Write("\n"); - } - writer.Write("\n"); - break; - } - } - } - writer.Write("\n"); - return true; - } -} \ No newline at end of file diff --git a/Common/Variance/support/Storage.cs b/Common/Variance/support/Storage.cs index bd42f78..3640e42 100644 --- a/Common/Variance/support/Storage.cs +++ b/Common/Variance/support/Storage.cs @@ -1,9 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Xml; using System.Xml.Linq; using Error; using geoLib; +using shapeEngine; using utility; namespace Variance; @@ -59,6 +61,150 @@ private void pStorage() } // compatibility shim for old projects pre-3.0 + + private void modifyLayerRefs_forLayerChange_1xto21(ref EntropyLayerSettings readSettings, + int compatibilityLayerOffset) + { + if (readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.CDU_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.tCDU_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.xOL_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.yOL_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.xOL_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 2 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 3) + { + readSettings.setInt(EntropyLayerSettings.properties_i.yOL_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) + compatibilityLayerOffset); + } + + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3, 0); + + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3, 0); + } + + private void modifyLayerRefs_forLayerChange_220(ref EntropyLayerSettings readSettings, int compatibilityLayerOffset) + { + if (readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.CDU_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.tCDU_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.xOL_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.yOL_corr_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.xOL_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) + compatibilityLayerOffset); + } + + if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 4 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 5 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 6 || + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 7) + { + readSettings.setInt(EntropyLayerSettings.properties_i.yOL_ref, + readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) + compatibilityLayerOffset); + } + + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7, 0); + + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7 + compatibilityLayerOffset, + readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7)); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6, 0); + readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7, 0); + } + private void modifyLayerRefs_forLayerChange(ref EntropyLayerSettings readSettings, int compatibilityLayerOffset) { switch (compatibilityLayerOffset) @@ -66,92 +212,13 @@ private void modifyLayerRefs_forLayerChange(ref EntropyLayerSettings readSetting // v1.x-2.1 file case 6: { - if (readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.CDU_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.tCDU_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.xOL_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.yOL_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.xOL_ref, readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 2 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 3) - { - readSettings.setInt(EntropyLayerSettings.properties_i.yOL_ref, readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) + compatibilityLayerOffset); - } - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 2, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 3, 0); - - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 2, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 3, 0); + modifyLayerRefs_forLayerChange_1xto21(ref readSettings, compatibilityLayerOffset); break; } // v2.2 file case 4: { - if (readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.CDU_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.CDU_corr_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.tCDU_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.tCDU_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.xOL_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.xOL_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.yOL_corr_ref, readSettings.getInt(EntropyLayerSettings.properties_i.yOL_corr_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.xOL_ref, readSettings.getInt(EntropyLayerSettings.properties_i.xOL_ref) + compatibilityLayerOffset); - } - if (readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 4 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 5 || - readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 6 || readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) == 7) - { - readSettings.setInt(EntropyLayerSettings.properties_i.yOL_ref, readSettings.getInt(EntropyLayerSettings.properties_i.yOL_ref) + compatibilityLayerOffset); - } - - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 4, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 5, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 6, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.xOLRefs, 7, 0); - - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7 + compatibilityLayerOffset, readSettings.getIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7)); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 4, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 5, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 6, 0); - readSettings.setIntArrayValue(EntropyLayerSettings.properties_intarray.yOLRefs, 7, 0); + modifyLayerRefs_forLayerChange_220(ref readSettings, compatibilityLayerOffset); break; } } @@ -240,15 +307,11 @@ public bool storeSimulationSettings(string filename, EntropySettings simulationS return pStoreSimulationSettings(filename, simulationSettings, simulationSettings_nonSim, listOfSettings, implantSimSettings, implantSettings_nonSim, implantSettings_, nonSimulationSettings_); } - private bool pStoreSimulationSettings(string filename, EntropySettings simulationSettings, EntropySettings_nonSim simulationSettings_nonSim, List listOfSettings, EntropySettings implantSimSettings, EntropySettings_nonSim implantSettings_nonSim, EntropyImplantSettings implantSettings_, NonSimulationSettings nonSimulationSettings_) + private void pStoreSimulationSettings_layer(ref XDocument doc, List listOfSettings) { - double[] camParameters; - XDocument doc = new(new XElement("Variance")); - // ReSharper disable once PossibleNullReferenceException - doc.Root.Add(new XElement("version", nonSimulationSettings_.version)); for (int i = 0; i < CentralProperties.maxLayersForMC; i++) { - camParameters = viewportSave?.Invoke(i); + double[] camParameters = viewportSave?.Invoke(i); XElement xelement = new("layer" + (i + 1), new XElement("name", listOfSettings[i].getString(EntropyLayerSettings.properties_s.name)), new XElement("comment", listOfSettings[i].getString(EntropyLayerSettings.properties_s.comment)), @@ -277,20 +340,20 @@ private bool pStoreSimulationSettings(string filename, EntropySettings simulatio new XElement("alignGeomY", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.alignY)), new XElement("shapeIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.shapeIndex)), new XElement("geoCoreShapeEngine", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.gCSEngine)), - new XElement("subShapeHorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)), - new XElement("subShapeHorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)), - new XElement("subShapeVerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)), - new XElement("subShapeVerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)), + new XElement("subShapeHorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horLength, 0)), + new XElement("subShapeHorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0)), + new XElement("subShapeVerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0)), + new XElement("subShapeVerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0)), new XElement("subShapeTipLocIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.shape0Tip)), - new XElement("subShape2HorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)), - new XElement("subShape2HorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)), - new XElement("subShape2VerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)), - new XElement("subShape2VerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)), + new XElement("subShape2HorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horLength, 1)), + new XElement("subShape2HorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 1)), + new XElement("subShape2VerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verLength, 1)), + new XElement("subShape2VerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 1)), new XElement("subShape2TipLocIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.shape1Tip)), - new XElement("subShape3HorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength)), - new XElement("subShape3HorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset)), - new XElement("subShape3VerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength)), - new XElement("subShape3VerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)), + new XElement("subShape3HorLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horLength, 2)), + new XElement("subShape3HorOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 2)), + new XElement("subShape3VerLength", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verLength, 2)), + new XElement("subShape3VerOffset", listOfSettings[i].getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 2)), new XElement("subShape3TipLocIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.shape2Tip)), new XElement("subShapeRefIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.subShapeIndex)), new XElement("posInSubShapeIndex", listOfSettings[i].getInt(EntropyLayerSettings.properties_i.posIndex)), @@ -420,8 +483,11 @@ private bool pStoreSimulationSettings(string filename, EntropySettings simulatio ); doc.Root.Add(xelement); } + } - camParameters = viewportSave?.Invoke(CentralProperties.maxLayersForMC); + private void pStoreSimulationSettings_simulation(ref XDocument doc, EntropySettings simulationSettings, EntropySettings_nonSim simulationSettings_nonSim) + { + double[] camParameters = viewportSave?.Invoke(CentralProperties.maxLayersForMC); doc.Root.Add(new XElement("settings", new XElement("comment", simulationSettings_nonSim.getString(EntropySettings_nonSim.properties_s.comment)), new XElement("paSearchComment", simulationSettings_nonSim.getString(EntropySettings_nonSim.properties_s.paComment)), @@ -483,8 +549,11 @@ private bool pStoreSimulationSettings(string filename, EntropySettings simulatio new XElement("layer1234_5678Operator", simulationSettings.getOperatorValue(EntropySettings.properties_o.eightLayer, 0)), new XElement("layer9101112_13141516Operator", simulationSettings.getOperatorValue(EntropySettings.properties_o.eightLayer, 1)) )); + } - camParameters = viewportSave?.Invoke(CentralProperties.maxLayersForMC + 1); + private void pStoreSimulationSettings_DOE(ref XDocument doc, EntropySettings simulationSettings) + { + double[] camParameters = viewportSave?.Invoke(CentralProperties.maxLayersForMC + 1); doc.Root.Add(new XElement("DOESettings", new XElement("displayZoomFactor", camParameters != null ? camParameters[2] : 1), new XElement("viewportX", camParameters != null ? camParameters[0] : 0), @@ -511,16 +580,24 @@ private bool pStoreSimulationSettings(string filename, EntropySettings simulatio new XElement("rows", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.rows)), new XElement("cols", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.cols)), new XElement("specificTile", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.sTile)), - new XElement("specificTile_Row", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.sTileRow)), - new XElement("specificTile_Col", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.sTileCol)), - new XElement("colOffset", simulationSettings.getDOESettings().getDouble(DOESettings.properties_d.colOffset)), - new XElement("rowOffset", simulationSettings.getDOESettings().getDouble(DOESettings.properties_d.rowOffset)), + new XElement("specificTile_Row", + simulationSettings.getDOESettings().getInt(DOESettings.properties_i.sTileRow)), + new XElement("specificTile_Col", + simulationSettings.getDOESettings().getInt(DOESettings.properties_i.sTileCol)), + new XElement("colOffset", + simulationSettings.getDOESettings().getDouble(DOESettings.properties_d.colOffset)), + new XElement("rowOffset", + simulationSettings.getDOESettings().getDouble(DOESettings.properties_d.rowOffset)), new XElement("listOfTiles", simulationSettings.getDOESettings().getInt(DOESettings.properties_i.uTileList)), new XElement("tileList_ColRow", simulationSettings.tileListToString(true)), - new XElement("iDRMConfigured", simulationSettings.getDOESettings().getBool(DOESettings.properties_b.iDRM) ? 1 : 0) + new XElement("iDRMConfigured", + simulationSettings.getDOESettings().getBool(DOESettings.properties_b.iDRM) ? 1 : 0) )); + } - camParameters = implantViewportSave?.Invoke(); + private void pStoreSimulationSettings_implant(ref XDocument doc, EntropySettings implantSimSettings, EntropySettings_nonSim implantSettings_nonSim, EntropyImplantSettings implantSettings_, NonSimulationSettings nonSimulationSettings_) + { + double[] camParameters = implantViewportSave?.Invoke(); doc.Root.Add(new XElement("implant", new XElement("displayZoomFactor", camParameters != null ? camParameters[2] : 1), new XElement("viewportX", camParameters != null ? camParameters[0] : 0), @@ -543,6 +620,18 @@ private bool pStoreSimulationSettings(string filename, EntropySettings simulatio new XElement("generateExternal", implantSettings_nonSim.getInt(EntropySettings_nonSim.properties_i.external)), new XElement("externalType", implantSettings_nonSim.getInt(EntropySettings_nonSim.properties_i.externalType)) )); + } + + private bool pStoreSimulationSettings(string filename, EntropySettings simulationSettings, EntropySettings_nonSim simulationSettings_nonSim, List listOfSettings, EntropySettings implantSimSettings, EntropySettings_nonSim implantSettings_nonSim, EntropyImplantSettings implantSettings_, NonSimulationSettings nonSimulationSettings_) + { + XDocument doc = new(new XElement("Variance")); + // ReSharper disable once PossibleNullReferenceException + doc.Root.Add(new XElement("version", nonSimulationSettings_.version)); + + pStoreSimulationSettings_layer(ref doc, listOfSettings); + pStoreSimulationSettings_simulation(ref doc, simulationSettings, simulationSettings_nonSim); + pStoreSimulationSettings_DOE(ref doc, simulationSettings); + pStoreSimulationSettings_implant(ref doc, implantSimSettings, implantSettings_nonSim, implantSettings_, nonSimulationSettings_); bool savedOK = true; try @@ -561,41 +650,11 @@ public string loadSimulationSettings(string currentVersion, string filename, Ent return pLoadSimulationSettings(currentVersion, filename, simulationSettings, simulationSettings_nonSim, implantSimSettings, implantSettings_nonSim, implantSettings_); } - private string pLoadSimulationSettings(string currentVersion, string filename, EntropySettings simulationSettings, EntropySettings_nonSim simulationSettings_nonSim, EntropySettings implantSimSettings, EntropySettings_nonSim implantSettings_nonSim, EntropyImplantSettings implantSettings_) + private void pLoadSimulationSettings_layer(string[] tokenVersion, XElement simulationFromFile) { - loadedLayers = new bool[CentralProperties.maxLayersForMC]; - string returnString = ""; - bool error = false; - XElement simulationFromFile; - try - { - simulationFromFile = XElement.Load(filename); - } - catch (Exception ex) - { - return ex.Message; - } - - // root is required for legacy projects. - if (simulationFromFile.Name != "Variance" && simulationFromFile.Name != "root") - { - return "This is not a " + CentralProperties.productName + " project file."; - } - - EntropyLayerSettings readSettings = new(); - - string version = simulationFromFile.Descendants("version").First().Value; - string[] tokenVersion = version.Split(new[] { '.' }); - - if (version != currentVersion) - { - ErrorReporter.showMessage_OK("Settings file for version " + version, "Legacy import"); - } - - prepUI?.Invoke(); - for (int layer = 0; layer < CentralProperties.maxLayersForMC; layer++) { + EntropyLayerSettings readSettings = new(); // Tracking our loaded layers to avoid stomping over them. if (loadedLayers[layer]) { @@ -731,9 +790,9 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E if (Convert.ToInt32(tokenVersion[0]) == 1 && Convert.ToInt32(tokenVersion[1]) < 9) { - if (readSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Sshape) + if (readSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Sshape) { - readSettings.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CommonVars.shapeNames.GEOCORE); //increment to map to the GDS setting in the 1.9 version. + readSettings.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CentralProperties.shapeNames.GEOCORE); //increment to map to the GDS setting in the 1.9 version. } } } @@ -744,38 +803,38 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s0HorLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeHorLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeHorLength").First().Value), 0); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horLength, 0); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeHorOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeHorOffset").First().Value), 0); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s0VerLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeVerLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeVerLength").First().Value), 0); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s0VerLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verLength, 0); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeVerOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShapeVerOffset").First().Value), 0); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0); } try @@ -789,38 +848,38 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s1HorLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2HorLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2HorLength").First().Value), 1); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s1HorLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horLength, 1); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2HorOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2HorOffset").First().Value), 1); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horOffset, 1); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s1VerLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2VerLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2VerLength").First().Value), 1); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verLength, 1); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2VerOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape2VerOffset").First().Value), 1); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verOffset, 1); } try @@ -834,38 +893,38 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s2HorLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3HorLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3HorLength").First().Value), 2); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s2HorLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horLength, 2); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3HorOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.horOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3HorOffset").First().Value), 2); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.horOffset, 2); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s2VerLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3VerLength").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verLength, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3VerLength").First().Value), 2); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s2VerLength); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verLength, 2); } try { - readSettings.setDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3VerOffset").First().Value)); + readSettings.setDecimal(EntropyLayerSettings.properties_decimal.verOffset, Convert.ToDecimal(simulationFromFile.Descendants(layerref).Descendants("subShape3VerOffset").First().Value), 2); } catch (Exception) { - readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset); + readSettings.defaultDecimal(EntropyLayerSettings.properties_decimal.verOffset, 2); } try @@ -1838,7 +1897,11 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E setLayerSettings?.Invoke(readSettings, layer, false, updateGeoCoreGeometryFromFile); // avoid resuming the UI loadedLayers[layer] = true; } + } + private bool pLoadSimulationSettings_simulation(string[] tokenVersion, XElement simulationFromFile, ref EntropySettings simulationSettings, ref EntropySettings_nonSim simulationSettings_nonSim) + { + bool error = false; try { suspendSettingsUI?.Invoke(); @@ -2216,6 +2279,13 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E error = true; } + return error; + } + + private bool pLoadSimulationSettings_DOE(string[] tokenVersion, XElement simulationFromFile, ref EntropySettings simulationSettings) + { + bool error = false; + try { string doeLabel = "DOESettings"; @@ -2408,6 +2478,13 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E error = true; } + return error; + } + + private bool pLoadSimulationSettings_implant(XElement simulationFromFile, ref EntropySettings implantSimSettings, ref EntropySettings_nonSim implantSettings_nonSim, ref EntropyImplantSettings implantSettings_) + { + bool error = false; + try { const string implantLabel = "implant"; @@ -2591,6 +2668,53 @@ private string pLoadSimulationSettings(string currentVersion, string filename, E error = true; } + return error; + } + + private string pLoadSimulationSettings(string currentVersion, string filename, EntropySettings simulationSettings, EntropySettings_nonSim simulationSettings_nonSim, EntropySettings implantSimSettings, EntropySettings_nonSim implantSettings_nonSim, EntropyImplantSettings implantSettings_) + { + loadedLayers = new bool[CentralProperties.maxLayersForMC]; + string returnString = ""; + bool error = false; + XElement simulationFromFile; + try + { + simulationFromFile = XElement.Load(filename); + } + catch (Exception ex) + { + return ex.Message; + } + + // root is required for legacy projects. + if (simulationFromFile.Name != "Variance" && simulationFromFile.Name != "root") + { + return "This is not a " + CentralProperties.productName + " project file."; + } + + string version = simulationFromFile.Descendants("version").First().Value; + string[] tokenVersion = version.Split(new[] { '.' }); + + if (version != currentVersion) + { + ErrorReporter.showMessage_OK("Settings file for version " + version, "Legacy import"); + } + + prepUI?.Invoke(); + + pLoadSimulationSettings_layer(tokenVersion, simulationFromFile); + error = pLoadSimulationSettings_simulation(tokenVersion, simulationFromFile, ref simulationSettings, ref simulationSettings_nonSim); + if (!error) + { + error = pLoadSimulationSettings_DOE(tokenVersion, simulationFromFile, ref simulationSettings); + } + + if (!error) + { + error = pLoadSimulationSettings_implant(simulationFromFile, ref implantSimSettings, + ref implantSettings_nonSim, ref implantSettings_); + } + resumeUI?.Invoke(); if (error) diff --git a/Common/Variance/support/VarianceContext.cs b/Common/Variance/support/VarianceContext.cs index ff92f33..7e856f0 100644 --- a/Common/Variance/support/VarianceContext.cs +++ b/Common/Variance/support/VarianceContext.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using color; using keys; @@ -29,6 +28,9 @@ public class VarianceContext public bool AA { get; set; } public bool FilledPolygons { get; set; } public bool drawPoints { get; set; } + + public bool expandUI { get; set; } + public Colors colors { get; private set; } public bool layerPreviewDOETile { get; set; } public bool geoCoreCDVariation { get; set; } @@ -68,6 +70,7 @@ private void makeContext(bool implantMode_, string xmlFileArg_, int numberOfThre openGLZoomFactor = 1; FilledPolygons = false; drawPoints = false; + expandUI = true; AA = true; FGOpacity = 0.7; BGOpacity = 0.5; @@ -77,6 +80,7 @@ private void makeContext(bool implantMode_, string xmlFileArg_, int numberOfThre HTCount = HTCount_; rngMappingEquations = new List(); friendlyNumber = false; + expandUI = false; string _msg = string.Empty; diff --git a/Common/Variance/support/centralProperties.cs b/Common/Variance/support/centralProperties.cs index 264b592..0a0c344 100644 --- a/Common/Variance/support/centralProperties.cs +++ b/Common/Variance/support/centralProperties.cs @@ -1,12 +1,38 @@ -namespace Variance; +using shapeEngine; + +namespace Variance; public static class CentralProperties { public const string productName = "Variance"; - public const string version = "4.4.2"; + public const string version = "5.0"; public const int maxLayersForMC = 16; // maximum number of supported layers in MC system public const int scaleFactorForOperation = 10000; - public enum typeShapes { none, rectangle, L, T, X, U, S, GEOCORE, BOOLEAN } + + public enum shapeNames + { + none, + rect, + Lshape, + Tshape, + Xshape, + Ushape, + Sshape, + GEOCORE, + BOOLEAN, + } + + public static int[] shapeTable = new[] { + (int)ShapeLibrary.shapeNames_all.none, + (int)ShapeLibrary.shapeNames_all.rect, + (int)ShapeLibrary.shapeNames_all.Lshape, + (int)ShapeLibrary.shapeNames_all.Tshape, + (int)ShapeLibrary.shapeNames_all.Xshape, + (int)ShapeLibrary.shapeNames_all.Ushape, + (int)ShapeLibrary.shapeNames_all.Sshape, + (int)ShapeLibrary.shapeNames_all.GEOCORE, + (int)ShapeLibrary.shapeNames_all.BOOLEAN + }; public const int timer_interval = 1000; } \ No newline at end of file diff --git a/Common/Variance/support/commonVars.cs b/Common/Variance/support/commonVars.cs index ddfc2c0..369a575 100644 --- a/Common/Variance/support/commonVars.cs +++ b/Common/Variance/support/commonVars.cs @@ -7,6 +7,8 @@ using entropyRNG; using Error; using geoCoreLib; +using geoWrangler; +using shapeEngine; using utility; using Timer = System.Timers.Timer; @@ -113,6 +115,7 @@ public enum properties_gl { aa, fill, points } private bool drawPoints; private bool friendlyNumber; + private bool expandedUI; public void setFriendly(bool val) { @@ -134,6 +137,26 @@ private bool pGetFriendly() return friendlyNumber; } + public void setExpandedUI(bool val) + { + pSetExpandedUI(val); + } + + private void pSetExpandedUI(bool val) + { + expandedUI = val; + } + + public bool getExpandedUI() + { + return pGetExpandedUI(); + } + + private bool pGetExpandedUI() + { + return expandedUI; + } + public void setOpenGLProp(properties_gl p, bool val) { pSetOpenGLProp(p, val); @@ -369,14 +392,10 @@ private void pSetSimRunning(bool val) public string projectFileName = ""; private bool geoCoreCDUWarningShown; - public enum calcModes { area, enclosure_spacing_overlap, chord, angle } - public enum areaCalcModes { all, perpoly } - public enum spacingCalcModes { spacing, enclosure, spacingOld, enclosureOld } // exp triggers projection from shortest edge for overlap evaluation. - public enum chordCalcElements { none, a, b } public enum upperTabNames { twoD, Implant, oneD, Utilities } public enum twoDTabNames { layer, settings, DOE, paSearch } - public static string[] csvHeader = { "CDUSVar", "CDUTVar", "LWRVar", "LWRSeed", "LWR2Var", "LWR2Seed", "horTipBiasVar", "verTipBiasVar", "iCVar", "oCVar", "overlayX", "overlayY", "wobbleVar" }; + public static readonly string[] csvHeader = { "CDUSVar", "CDUTVar", "LWRVar", "LWRSeed", "LWR2Var", "LWR2Seed", "horTipBiasVar", "verTipBiasVar", "iCVar", "oCVar", "overlayX", "overlayY", "wobbleVar" }; public enum external_Type { svg, gds, oas } @@ -561,7 +580,7 @@ private void pSetLayerSettings(EntropyLayerSettings entropyLayerSettings, int in { } - if (entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.sCDU) != 0.0m && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)shapeNames.GEOCORE && + if (entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.sCDU) != 0.0m && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && geoCoreCDVariation == false) { if (!geoCoreCDUWarningShown) @@ -580,7 +599,7 @@ private void pSetLayerSettings(EntropyLayerSettings entropyLayerSettings, int in else { getGeoCoreHandler(index).setValid(false); - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)shapeNames.GEOCORE && entropyLayerSettings.isReloaded()) + if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && entropyLayerSettings.isReloaded()) { getGeoCoreHandler(index).setFilename(entropyLayerSettings.getString(EntropyLayerSettings.properties_s.file)); getGeoCoreHandler(index).setValid(true); @@ -767,73 +786,7 @@ private bool pInterLayerRelationship_4(int i) } public ObservableCollection calcMode_names { get; private set; } - - private List availableShapes; - public List getAvailableShapes() - { - return pGetAvailableShapes(); - } - - private List pGetAvailableShapes() - { - return availableShapes; - } - - public enum shapeNames { none, rect, Lshape, Tshape, Xshape, Ushape, Sshape, GEOCORE, BOOLEAN } - - private List availableTipsLocations; - public List getAvailableTipsLocations() - { - return pGetAvailableTipsLocations(); - } - - private List pGetAvailableTipsLocations() - { - return availableTipsLocations; - } - - public enum tipLocations { none, L, R, LR, T, B, TB, TL, TR, TLR, BL, BR, BLR, TBL, TBR, all } - - private List availableSubShapePositions; - - public List getAvailableSubShapePositions() - { - return pGetAvailableSubShapePositions(); - } - - private List pGetAvailableSubShapePositions() - { - return availableSubShapePositions; - } - - public enum subShapeLocations { TL, TR, BL, BR, TS, RS, BS, LS, C } - - private List noiseTypes; - public List getNoiseTypes() - { - return pGetNoiseTypes(); - } - - private List pGetNoiseTypes() - { - return noiseTypes; - } - - public enum noiseIndex { perlin, simplex, opensimplex } - - private List polyFillTypes; - public List getPolyFillTypes() - { - return pGetPolyFillTypes(); - } - - private List pGetPolyFillTypes() - { - return polyFillTypes; - } - - public enum PolyFill { pftEvenOdd, pftNonZero, pftPositive, pftNegative } - + private List openGLModeList; public List getOpenGLModeList() @@ -968,6 +921,7 @@ private void pReset(VarianceContext varianceContext) layerPreviewDOETile = varianceContext.layerPreviewDOETile; friendlyNumber = varianceContext.friendlyNumber; + expandedUI = varianceContext.expandUI; HTCount = varianceContext.HTCount; @@ -1024,30 +978,13 @@ private void pCommonVars(VarianceContext varianceContext) { rngCustomMapping.Add(t); } - - noiseTypes = new List { "Perlin", "Simplex", "OpenSimplex" }; - - availableSubShapePositions = new List - { "Corner: Top Left", "Corner: Top Right", "Corner: Bottom Left", "Corner: Bottom Right", - "Middle: Top Side", "Middle: Right Side", "Middle: Bottom Side", "Middle: Left Side", - "Center"}; - - availableTipsLocations = new List - { "None", "Left", "Right", "Left & Right", - "Top", "Bottom", "Top & Bottom", - "Top & Left", "Top & Right", "Top & Left & Right", - "Bottom & Left", "Bottom & Right", "Bottom & Left & Right", - "Top & Bottom & Left", "Top & Bottom & Right", - "All"}; - - availableShapes = new List { "(None)", "Rectangle/Square", "L-shape", "T-shape", "X-shape", "U-shape", "S-shape", "GDS/Oasis", "Boolean" }; + calcMode_names = new ObservableCollection { "Compute Area Distribution", "Compute Spacing/Overlap Distribution", "Compute Chord Distribution", "Compute Angle Distribution" }; - polyFillTypes = new List { "Even/Odd", "Non-zero", "Positive", "Negative" }; openGLModeList = new List { "VBO", "Immediate" }; @@ -1422,16 +1359,16 @@ private void pGetBooleanEquation(List linesToWrite) switch (simulationSettings.getValue(EntropySettings.properties_i.oType)) { - case (int)calcModes.area: // area + case (int)geoAnalysis.supported.calcModes.area: // area boolString += "AND"; break; - case (int)calcModes.enclosure_spacing_overlap: // spacing + case (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap: // spacing boolString += "MIN SPACE/OVERLAP/ENCL TO/WITH"; break; - case (int)calcModes.chord: // chords + case (int)geoAnalysis.supported.calcModes.chord: // chords boolString += "MIN CHORDS WITH"; break; - case (int)calcModes.angle: // angle + case (int)geoAnalysis.supported.calcModes.angle: // angle boolString += "MIN INTERSECTION ANGLE WITH"; break; } @@ -1793,25 +1730,25 @@ private void pGetLayerSettings(int layer, ref List linesToWrite, bool on string shapeType = layerRefString + " Shape: "; int shapeParts = 1; bool externalShape = false; - linesToWrite.Add(shapeType + availableShapes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shapeIndex)]); + linesToWrite.Add(shapeType + ShapeLibrary.getAvailableShapes(CentralProperties.shapeTable)[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shapeIndex)]); switch (listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shapeIndex)) { - case (int)CentralProperties.typeShapes.L: + case (int)ShapeSettings.typeShapes_mode0.L: shapeParts = 2; break; - case (int)CentralProperties.typeShapes.T: + case (int)ShapeSettings.typeShapes_mode0.T: shapeParts = 2; break; - case (int)CentralProperties.typeShapes.U: + case (int)ShapeSettings.typeShapes_mode0.U: shapeParts = 2; break; - case (int)CentralProperties.typeShapes.X: + case (int)ShapeSettings.typeShapes_mode0.X: shapeParts = 2; break; - case (int)CentralProperties.typeShapes.S: + case (int)ShapeSettings.typeShapes_mode0.S: shapeParts = 3; break; - case (int)CentralProperties.typeShapes.GEOCORE: + case (int)ShapeSettings.typeShapes_mode0.GEOCORE: externalShape = true; break; } @@ -1823,7 +1760,7 @@ private void pGetLayerSettings(int layer, ref List linesToWrite, bool on linesToWrite.Add("Layout Layer/Datatype: " + listOfSettings[layer].getString(EntropyLayerSettings.properties_s.lD)); linesToWrite.Add("Contouring: " + listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.gCSEngine)); linesToWrite.Add("Per-Poly: " + listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.perPoly)); - linesToWrite.Add("Poly Fill Type: " + polyFillTypes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.fill)]); + linesToWrite.Add("Poly Fill Type: " + ShapeSettings.getPolyFillTypes()[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.fill)]); linesToWrite.Add("Horizontal Offset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset)); linesToWrite.Add("Vertical Offset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset)); linesToWrite.Add("Horizontal Overlay: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.xOL)); @@ -1842,28 +1779,20 @@ private void pGetLayerSettings(int layer, ref List linesToWrite, bool on for (int part = 0; part < shapeParts; part++) { linesToWrite.Add("Subshape " + part + ": "); + linesToWrite.Add(" HLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.horLength, part)); + linesToWrite.Add(" VLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.verLength, part)); + linesToWrite.Add(" HOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.horOffset, part)); + linesToWrite.Add(" VOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.verOffset, part)); switch (part) { case 0: - linesToWrite.Add(" HLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - linesToWrite.Add(" VLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - linesToWrite.Add(" HOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - linesToWrite.Add(" VOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); - linesToWrite.Add(" TipLocations: " + availableTipsLocations[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape0Tip)]); + linesToWrite.Add(" TipLocations: " + ShapeSettings.getAvailableTipsLocations()[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape0Tip)]); break; case 1: - linesToWrite.Add(" HLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - linesToWrite.Add(" VLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - linesToWrite.Add(" HOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - linesToWrite.Add(" VOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - linesToWrite.Add(" TipLocations: " + availableTipsLocations[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape1Tip)]); + linesToWrite.Add(" TipLocations: " + ShapeSettings.getAvailableTipsLocations()[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape1Tip)]); break; case 2: - linesToWrite.Add(" HLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength)); - linesToWrite.Add(" VLength: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength)); - linesToWrite.Add(" HOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset)); - linesToWrite.Add(" VOffset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)); - linesToWrite.Add(" TipLocations: " + availableTipsLocations[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape2Tip)]); + linesToWrite.Add(" TipLocations: " + ShapeSettings.getAvailableTipsLocations()[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.shape2Tip)]); break; } } @@ -1871,7 +1800,7 @@ private void pGetLayerSettings(int layer, ref List linesToWrite, bool on // Subshape reference linesToWrite.Add("SubshapeReference: " + listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.subShapeIndex)); // Subshape positioning - linesToWrite.Add("PositionInSubshape: " + availableSubShapePositions[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.posIndex)]); + linesToWrite.Add("PositionInSubshape: " + ShapeSettings.getAvailableSubShapePositions()[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.posIndex)]); // Global offsets. linesToWrite.Add("Horizontal Offset: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset)); @@ -1911,11 +1840,11 @@ private void pGetLayerSettings(int layer, ref List linesToWrite, bool on linesToWrite.Add("LWR: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.lwr)); linesToWrite.Add("LWR RNG Mapping: " + listOfSettings[layer].getString(EntropyLayerSettings.properties_s.lwr_RNG)); linesToWrite.Add("LWR Frequency: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.lwrFreq)); - linesToWrite.Add("LWR Noise: " + noiseTypes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.lwrType)]); + linesToWrite.Add("LWR Noise: " + NoiseC.noiseTypes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.lwrType)]); linesToWrite.Add("LWR2: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.lwr2)); linesToWrite.Add("LWR2 RNG Mapping: " + listOfSettings[layer].getString(EntropyLayerSettings.properties_s.lwr2_RNG)); linesToWrite.Add("LWR2 Frequency: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.lwr2Freq)); - linesToWrite.Add("LWR2 Noise: " + noiseTypes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.lwr2Type)]); + linesToWrite.Add("LWR2 Noise: " + NoiseC.noiseTypes[listOfSettings[layer].getInt(EntropyLayerSettings.properties_i.lwr2Type)]); linesToWrite.Add("Side CDU: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.sCDU)); linesToWrite.Add("Side CDU RNG Mapping: " + listOfSettings[layer].getString(EntropyLayerSettings.properties_s.sCDU_RNG)); linesToWrite.Add("Tips CDU: " + listOfSettings[layer].getDecimal(EntropyLayerSettings.properties_decimal.tCDU)); diff --git a/Common/Variance/support/previewShape.cs b/Common/Variance/support/previewShape.cs index 37cc5be..9dc7da3 100644 --- a/Common/Variance/support/previewShape.cs +++ b/Common/Variance/support/previewShape.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using ClipperLib1; +using Clipper2Lib; using color; using Error; using geoLib; @@ -9,17 +9,17 @@ using Noise; using utility; // tiled layout handling, Layout biasing/CDU. using System.Threading.Tasks; +using shapeEngine; namespace Variance; -using Path = List; -using Paths = List>; +using Path = List; +using Paths = List>; public class PreviewShape { private bool DOEDependency; // due to the DOE grid, we need this to sort out offsets. This includes buried references in Booleans. The min X/Y values for this case need to be at least the col/row offset. - private Fragmenter fragment; // Class for our preview shapes. private List previewPoints; // list of polygons defining the shape(s) that will be drawn. In the complex case, we populate this from complexPoints. public List getPoints() @@ -49,7 +49,7 @@ public void addPoints(GeoLibPointF[] poly) private void pAddPoints(GeoLibPointF[] poly) { - previewPoints.Add(poly.ToArray()); + previewPoints.Add(poly); } public void setPoints(List newPoints) @@ -59,7 +59,7 @@ public void setPoints(List newPoints) private void pSetPoints(List newPoints) { - previewPoints = newPoints.ToList(); + previewPoints = newPoints; } public void clearPoints() @@ -121,463 +121,7 @@ private int pGetIndex() { return _settingsIndex; } - - private void rectangle_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - // Vertical offset needed to put reference corner at world center - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - yOffset -= tmp_yOffset; - - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - } - xOffset += tmp_xOffset; - } - - private void lShape_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - // Vertical offset needed to put reference corner at world center - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - } - else - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - } - - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - yOffset -= tmp_yOffset; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1 && posInSubShapeString is "LS" or "BL" or "TL") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); // essentially the same in X as the RS for subshape 1. - } - else - { - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - } - else - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - } - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - else - { - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - } - } - } - } - - xOffset += tmp_xOffset; - } - - private void tShape_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1 && posInSubShapeString is "BR" or "BL" or "BS") - { - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - } - else - { - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - else - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - } - - } - } - yOffset -= tmp_yOffset; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1 && posInSubShapeString is "LS" or "BL" or "TL") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); // essentially the same in X as the RS for subshape 1. - } - else - { - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - } - else - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - } - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - else - { - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - } - } - } - } - - xOffset += tmp_xOffset; - } - - private void xShape_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1 && posInSubShapeString is "BR" or "BL" or "BS") - { - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - } - else - { - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - // Vertical offset needed to put reference corner at world center - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - else - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - } - - } - } - yOffset -= tmp_yOffset; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1 && posInSubShapeString is "LS" or "BL" or "TL") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - } - else - { - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - } - else - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - } - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - else - { - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - } - } - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1) - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - } - } - } - - xOffset += tmp_xOffset; - } - - private void uShape_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - yOffset -= tmp_yOffset; - - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - } - } - else - { - // Subshape 2 is always docked against top edge of subshape 1 in U. - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "BL" or "BR" or "BS" or "C") - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - - switch (posInSubShapeString) - { - // Half the value for a vertical centering requirement - case "RS" or "LS" or "C": - tmp_yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength) / 2); - break; - // Subtract the value for a subshape 2 bottom edge requirement - case "BL" or "BR" or "BS": - tmp_yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - break; - } - } - yOffset -= tmp_yOffset; - - // Subshape 2 is always H-centered in U. Makes it easy. - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) / 2); - - switch (posInSubShapeString) - { - case "TR" or "BR" or "RS": - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - break; - case "TL" or "BL" or "LS": - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - break; - } - } - xOffset += tmp_xOffset; - } - - private void sShape_offset(EntropyLayerSettings entropyLayerSettings) - { - string posInSubShapeString = ((CommonVars.subShapeLocations)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex)).ToString(); - double tmp_xOffset = 0; - double tmp_yOffset = 0; - - switch (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex)) - { - case 0: - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "C") - { - tmp_yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - - // Half the value for a vertical centering requirement - if (posInSubShapeString is "RS" or "LS" or "C") - { - tmp_yOffset = Convert.ToDouble(tmp_yOffset / 2); - } - } - - if (posInSubShapeString is "TR" or "BR" or "TS" or "RS" or "BS" or "C") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - - // Half the value for horizontal centering conditions - if (posInSubShapeString is "TS" or "BS" or "C") - { - tmp_xOffset = Convert.ToDouble(tmp_xOffset / 2); - } - } - break; - - case 1: - // Subshape 2 is always vertically offset relative to bottom edge of subshape 1 in S. - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "BL" or "BR" or "BS" or "C") - { - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - - switch (posInSubShapeString) - { - // Half the value for a vertical centering requirement - case "RS" or "LS" or "C": - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength) / 2); - break; - // Subtract the value for a subshape 2 bottom edge requirement - case "TL" or "TR" or "TS": - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - break; - } - } - - // Subshape 2 is always pinned to left edge in S. Makes it easy. - - if (posInSubShapeString is "TR" or "BR" or "RS" or "TS" or "BS" or "C") - { - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - if (posInSubShapeString is "TS" or "C" or "BS") - { - tmp_xOffset /= 2; - } - } - - break; - - case 2: - tmp_yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - // Subshape 3 is always offset relative to top edge of subshape 1 in S. - if (posInSubShapeString is "TL" or "TR" or "TS" or "RS" or "LS" or "BL" or "BR" or "BS" or "C") - { - tmp_yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)); - - switch (posInSubShapeString) - { - // Half the value for a vertical centering requirement - case "RS" or "LS" or "C": - tmp_yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength) / 2); - break; - // Subtract the value for a subshape 2 bottom edge requirement - case "BL" or "BR" or "BS": - tmp_yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength)); - break; - } - } - - // Subshape 3 is always pinned to right edge in S. Makes it easy. - tmp_xOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - - switch (posInSubShapeString) - { - case "TL" or "BL" or "LS": - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength)); - break; - case "TS" or "BS" or "C": - tmp_xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength) / 2); - break; - } - - break; - } - - yOffset -= tmp_yOffset; - xOffset += tmp_xOffset; - } - - private void doOffsets(EntropyLayerSettings entropyLayerSettings) - { - // Use our shape-specific offset calculation methods : - xOffset = 0; - yOffset = 0; - - switch (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex)) - { - case (int)CentralProperties.typeShapes.rectangle: - rectangle_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.L: - lShape_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.T: - tShape_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.X: - xShape_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.U: - uShape_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.S: - sShape_offset(entropyLayerSettings); - break; - case (int)CentralProperties.typeShapes.BOOLEAN: - case (int)CentralProperties.typeShapes.GEOCORE: - // customShape_offset(entropyLayerSettings); - break; - } - - // Now for global offset. - xOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset)); - yOffset -= Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset)); - } - + public PreviewShape() { init(); @@ -599,418 +143,69 @@ public PreviewShape(PreviewShape source) private void init(PreviewShape source) { - _settingsIndex = source._settingsIndex; - previewPoints = source.previewPoints.ToList(); - drawnPoly = source.drawnPoly.ToList(); - geoCoreOrthogonalPoly = source.geoCoreOrthogonalPoly.ToList(); - color = new MyColor(source.color); - } - - public PreviewShape(CommonVars commonVars, int settingsIndex, int subShapeIndex, int mode, bool doPASearch, bool previewMode, int currentRow, int currentCol) - { - xOffset = 0; - yOffset = 0; - init(commonVars, settingsIndex, subShapeIndex, mode, doPASearch, previewMode, currentRow, currentCol); - } - - public PreviewShape(CommonVars commonVars, ChaosSettings jobSettings_, int settingsIndex, int subShapeIndex, int mode, bool doPASearch, bool previewMode, int currentRow, int currentCol) - { - xOffset = 0; - yOffset = 0; - init(commonVars, jobSettings_, settingsIndex, subShapeIndex, mode, doPASearch, previewMode, currentRow, currentCol); - } - - private bool exitEarly; - - private void distortion(CommonVars commonVars, int settingsIndex) - { - for (int poly = 0; poly < previewPoints.Count; poly++) - { - switch (drawnPoly[poly]) - { - // Now let's get some barrel distortion sorted out. Only for non-drawn polygons, and skip if both coefficients are zero to avoid overhead. - case false when commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC1) != 0 || commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC2) != 0: - { - int pCount = previewPoints[poly].Length; -#if !VARIANCESINGLETHREADED - Parallel.For(0, pCount, point => -#else - for (Int32 point = 0; point < pCount; point++) -#endif - { - double px = previewPoints[poly][point].X; - double py = previewPoints[poly][point].Y; - - // Need to calculate a new 'radius' from the origin for each point in the polygon, then scale the X/Y values accordingly in the polygon. - // Use scale factor to try and guarantee a -1 to +1 value range - px /= CentralProperties.scaleFactorForOperation; - py /= CentralProperties.scaleFactorForOperation; - - double oRadius = Math.Sqrt(Utils.myPow(px, 2) + Utils.myPow(py, 2)); - // Polynomial radial distortion. - // rd = r(1 + (k1 * r^2) + (k2 * r^4)) from Zhang, 1999 (https://www.microsoft.com/en-us/research/wp-content/uploads/2016/11/zhan99.pdf) - // we only want a scaling factor for our X, Y coordinates. - // '1 -' or '1 +' drive the pincushion/barrel tone. Coefficients being negative will have the same effect, so just pick a direction and stick with it. - int amplifier = 1000; // scales up end-user values to work within this approach. - double t1 = Convert.ToDouble(commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC1)) * amplifier * Utils.myPow(Math.Abs(oRadius), 2); - double t2 = Convert.ToDouble(commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC2)) * Utils.myPow(amplifier, 2) * Utils.myPow(Math.Abs(oRadius), 4); - double sFactor = 1 - (t1 + t2); - - px *= sFactor * CentralProperties.scaleFactorForOperation; - py *= sFactor * CentralProperties.scaleFactorForOperation; - - previewPoints[poly][point] = new GeoLibPointF(px, py); - - } -#if !VARIANCESINGLETHREADED - ); -#endif - - // Re-fragment - previewPoints[poly] = fragment.fragmentPath(previewPoints[poly]); - break; - } - } - } - } - - private void doNoise(int noiseType, int seed, double freq, double jitterScale) - { - // Gets a -1 to +1 noise field. We get a seed from our RNG of choice unless the layer preview mode is set, where a fixed seed is used. - // Random constants to mitigate continuity effects in noise that cause nodes in the noise across multiple layers, due to periodicity. - const double x_const = 123489.1928734; - const double y_const = 891243.0982134; - - object noiseSource; - - switch (noiseType) - { - case (int)CommonVars.noiseIndex.opensimplex: - noiseSource = new OpenSimplexNoise(seed); - break; - case (int)CommonVars.noiseIndex.simplex: - noiseSource = new SimplexNoise(seed); - break; - default: - noiseSource = new PerlinNoise(seed); - break; - } - - // Need to iterate our preview points. - for (int poly = 0; poly < previewPoints.Count; poly++) - { - if (previewPoints[poly].Length <= 1 || drawnPoly[poly]) - { - continue; - } - GeoLibPointF[] mcPoints = previewPoints[poly].ToArray(); - int ptCount = mcPoints.Length; - - // Create our jittered polygon in a new list to avoid breaking normal computation, etc. by modifying the source. - GeoLibPointF[] jitteredPoints = new GeoLibPointF[ptCount]; - - // We could probably simply cast rays in the raycaster and use those, but for now reinvent the wheel here... - GeoLibPointF[] normals = new GeoLibPointF[ptCount]; - GeoLibPointF[] previousNormals = new GeoLibPointF[ptCount]; - // Pre-calculate these for the threading to be an option. - // This is a serial evaluation as we need both the previous and the current normal for each point. -#if !VARIANCESINGLETHREADED - Parallel.For(0, ptCount - 1, pt => -#else - for (Int32 pt = 0; pt < ptCount - 1; pt++) -#endif - { - double dx; - double dy; - if (pt == 0) - { - // First vertex needs special care. - dx = mcPoints[0].X - mcPoints[ptCount - 2].X; - dy = mcPoints[0].Y - mcPoints[ptCount - 2].Y; - } - else - { - dx = mcPoints[pt + 1].X - mcPoints[pt].X; - dy = mcPoints[pt + 1].Y - mcPoints[pt].Y; - } - normals[pt] = new GeoLibPointF(-dy, dx); - } -#if !VARIANCESINGLETHREADED - ); -#endif - normals[^1] = new GeoLibPointF(normals[0]); - - int nLength = normals.Length; -#if !VARIANCESINGLETHREADED - Parallel.For(1, nLength, pt => -#else - for (int pt = 1; pt < nLength; pt++) -#endif - { - previousNormals[pt] = new GeoLibPointF(normals[pt - 1]); - } -#if !VARIANCESINGLETHREADED - ); -#endif - - previousNormals[0] = new GeoLibPointF(normals[^2]); - -#if !VARIANCESINGLETHREADED - Parallel.For(0, ptCount - 1, pt => -#else - for (int pt = 0; pt < ptCount - 1; pt++) -#endif - { - // We need to average the normals of two edge segments to get the vector we need to displace our point along. - // This ensures that we handle corners and fluctuations in a reasonable manner. - GeoLibPointF averagedEdgeNormal = new((previousNormals[pt].X + normals[pt].X) / 2.0f, (previousNormals[pt].Y + normals[pt].Y) / 2.0f); - // Normalize our vector length. - double length = Math.Sqrt(Utils.myPow(averagedEdgeNormal.X, 2) + Utils.myPow(averagedEdgeNormal.Y, 2)); - const double normalTolerance = 1E-3; - if (length < normalTolerance) - { - length = normalTolerance; - } - averagedEdgeNormal.X /= length; - averagedEdgeNormal.Y /= length; - - // Use a tolerance as we're handling floats; we don't expect a normalized absolute value generally above 1.0, ignoring the float error. - /* - if ((Math.Abs(averagedEdgeNormal.X) - 1 > normalTolerance) || (Math.Abs(averagedEdgeNormal.Y) - 1 > normalTolerance)) - { - ErrorReporter.showMessage_OK("averageNormal exceeded limits: X:" + averagedEdgeNormal.X.ToString() + ",Y:" + averagedEdgeNormal.Y.ToString(), "oops"); - } - */ - - // We can now modify the position of our point and stuff it into our jittered list. - double jitterAmount; - - switch (noiseType) - { - case (int)CommonVars.noiseIndex.opensimplex: - jitterAmount = ((OpenSimplexNoise)noiseSource).Evaluate(freq * (mcPoints[pt].X + x_const), freq * (mcPoints[pt].Y + y_const)); - break; - case (int)CommonVars.noiseIndex.simplex: - jitterAmount = ((SimplexNoise)noiseSource).GetNoise(freq * (mcPoints[pt].X + x_const), freq * (mcPoints[pt].Y + y_const)); - break; - default: - jitterAmount = ((PerlinNoise)noiseSource).Noise(freq * (mcPoints[pt].X + x_const), freq * (mcPoints[pt].Y + y_const), 0); - break; - } - - jitterAmount *= jitterScale; - - double jitteredX = mcPoints[pt].X; - jitteredX += jitterAmount * averagedEdgeNormal.X; - - double jitteredY = mcPoints[pt].Y; - jitteredY += jitterAmount * averagedEdgeNormal.Y; - - jitteredPoints[pt] = new GeoLibPointF(jitteredX, jitteredY); - } -#if !VARIANCESINGLETHREADED - ); -#endif - jitteredPoints[ptCount - 1] = new GeoLibPointF(jitteredPoints[0]); - - // Push back to mcPoints for further processing. - previewPoints[poly] = jitteredPoints.ToArray(); - } - } - - private void applyNoise(bool previewMode, CommonVars commonVars, ChaosSettings jobSettings, int settingsIndex) - { - - EntropyLayerSettings entropyLayerSettings = commonVars.getLayerSettings(settingsIndex); - - double lwrConversionFactor; - lwrConversionFactor = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.ler) == 1 ? Math.Sqrt(2) : 0.5f; - - // LWR, skip if not requested to avoid runtime pain - if ((!previewMode || entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1) && entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr) != 0) - { - double jitterScale = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr)) / lwrConversionFactor; // LWR jitter of edge; use RSS for stricter assessment - if (!previewMode && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1 && !jobSettings.getPreviewMode()) - { - // This used to be easier, but now we have the case of a non-preview mode, but the layer setting calls for a preview. - jitterScale *= jobSettings.getValue(ChaosSettings.properties.LWRVar, settingsIndex); - } - - doNoise( - noiseType: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrType), - seed: jobSettings.getInt(ChaosSettings.ints.lwrSeed, settingsIndex), - freq: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwrFreq)), - jitterScale: jitterScale - ); - } - - switch (previewMode) - { - // LWR2, skip if not requested to avoid runtime pain - case false or true when entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2) != 0: - { - double jitterScale = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2)) / lwrConversionFactor; // LWR jitter of edge; use RSS for stricter assessment - if (!previewMode && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1 && !jobSettings.getPreviewMode()) - { - // This used to be easier, but now we have the case of a non-preview mode, but the layer setting calls for a preview. - jitterScale *= jobSettings.getValue(ChaosSettings.properties.LWR2Var, settingsIndex); - } - - doNoise( - noiseType: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwr2Type), - seed: jobSettings.getInt(ChaosSettings.ints.lwr2Seed, settingsIndex), - freq: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2Freq)), - jitterScale: jitterScale - ); - break; - } - } - } - - private void proximityBias(CommonVars commonVars, int settingsIndex) - { - // Proximity biasing - where isolated edges get bias based on distance to nearest supporting edge. - - EntropyLayerSettings entropyLayerSettings = commonVars.getLayerSettings(settingsIndex); - - bool proxBiasNeeded = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBias) != 0 && entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBiasDist) != 0; - - if (!proxBiasNeeded) - { - return; - } - - bool debug = false; - bool linear = false; - - List preOverlapMergePolys = new(); - - Paths dRays = new(); - - // Scale up our geometry for processing. Force a clockwise point order here due to potential upstream point order changes (e.g. polygon merging) - Paths sourceGeometry = GeoWrangler.pathsFromPointFs(previewPoints, CentralProperties.scaleFactorForOperation); - - int sCount = sourceGeometry.Count; - for (int poly = 0; poly < sCount; poly++) - { - if (sourceGeometry[poly].Count <= 1 || drawnPoly[poly]) - { - // Nothing to do with drawn or zero count entries. - continue; - } - - Path sourcePoly = sourceGeometry[poly].ToList(); - Paths collisionGeometry = sourceGeometry.ToList(); - // collisionGeometry.RemoveAt(poly); // Don't actually want to remove the emission as self-aware proximity matters. - Path deformedPoly = new(); - - // Threading operation here gets more tricky than the distance handler. We have a less clear trade off of threading based on the emission edge (the polygon being biased) vs the multisampling emission. - // In batch calculation mode, this tradeoff gets more awkward. - // Threading both options also causes major performance degradation as far too many threads are spawned for the host system. - bool multiSampleThread = false; - bool emitThread = false; - - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.proxRays) > 1) - { - multiSampleThread = true; - // for multipolygon scenarios, avoid threading the multisampling and instead favor threading emitting edge. - if (sourceGeometry.Count > 1) - { - emitThread = true; - multiSampleThread = false; - } - } - else - { - emitThread = true; - } - - Fragmenter f = new(commonVars.getSimulationSettings().getResolution() * CentralProperties.scaleFactorForOperation); - - sourcePoly = f.fragmentPath(sourcePoly); - - collisionGeometry = f.fragmentPaths(collisionGeometry); - - RayCast rc = new(sourcePoly, collisionGeometry, Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBiasDist) * CentralProperties.scaleFactorForOperation), false, invert:false, entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.proxRays), emitThread, multiSampleThread, sideRayFallOff: (RayCast.falloff)entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.proxSideRaysFallOff), sideRayFallOffMultiplier: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.proxSideRaysMultiplier))); - - Paths clippedLines = rc.getClippedRays().ToList(); - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (debug) - { - dRays.AddRange(clippedLines); - } - - // We hope to get the same number of clipped lines back as the number of points that went in.... - int cLCount = clippedLines.Count; - for (int line = 0; line < cLCount; line++) - { - long displacedX = sourcePoly[line].X; - long displacedY = sourcePoly[line].Y; - - double lineLength = rc.getRayLength(line); - - switch (lineLength) - { - // No biasing - ray never made it beyond the surface. Short-cut the - case 0: - deformedPoly.Add(new IntPoint(clippedLines[line][0])); - continue; - case < 0: - lineLength *= -1; - break; - } - - // Calculate our bias based on this distance and apply it. - double biasScaling = lineLength / CentralProperties.scaleFactorForOperation / Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBiasDist)); - - if (biasScaling > 1) - { - biasScaling = 1; - } + _settingsIndex = source._settingsIndex; + previewPoints = source.previewPoints.ToList(); + drawnPoly = source.drawnPoly.ToList(); + geoCoreOrthogonalPoly = source.geoCoreOrthogonalPoly.ToList(); + color = new MyColor(source.color); + } - // Probably should be a sigmoid, but using this for now. - double displacedAmount; + public PreviewShape(CommonVars commonVars, int settingsIndex, int subShapeIndex, int mode, bool doPASearch, bool previewMode, int currentRow, int currentCol) + { + xOffset = 0; + yOffset = 0; + init(commonVars, settingsIndex, subShapeIndex, mode, doPASearch, previewMode, currentRow, currentCol); + } - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (linear) - { - displacedAmount = biasScaling * Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBias)) * CentralProperties.scaleFactorForOperation; - } - else - { - // Using sine to make a ease-in/ease-out effect. - displacedAmount = Math.Sin(Utils.toRadians(biasScaling * 90.0f)) * Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.pBias)) * CentralProperties.scaleFactorForOperation; - } + public PreviewShape(CommonVars commonVars, ChaosSettings jobSettings_, int settingsIndex, int subShapeIndex, int mode, bool doPASearch, bool previewMode, int currentRow, int currentCol) + { + xOffset = 0; + yOffset = 0; + init(commonVars, jobSettings_, settingsIndex, subShapeIndex, mode, doPASearch, previewMode, currentRow, currentCol); + } - // Use our cast ray from rc to get a normalized average - IntPoint averagedEdgeNormal = GeoWrangler.intPoint_distanceBetweenPoints(clippedLines[line][clippedLines[line].Count - 1], clippedLines[line][0]); + private bool exitEarly; - // Normalize our vector length. - double aX = averagedEdgeNormal.X / lineLength; - double aY = averagedEdgeNormal.Y / lineLength; + private void applyNoise(bool previewMode, CommonVars commonVars, ChaosSettings jobSettings, int settingsIndex) + { + EntropyLayerSettings entropyLayerSettings = commonVars.getLayerSettings(settingsIndex); - displacedY += (long)(displacedAmount * aY); - displacedX += (long)(displacedAmount * aX); + double lwrConversionFactor = commonVars.getSimulationSettings().getValue(EntropySettings.properties_i.ler) == 1 ? Math.Sqrt(2) : 0.5f; - deformedPoly.Add(new IntPoint(displacedX, displacedY)); + // LWR, skip if not requested to avoid runtime pain + if ((!previewMode || entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1) && entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr) != 0) + { + double jitterScale = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr)) / lwrConversionFactor; // LWR jitter of edge; use RSS for stricter assessment + if (!previewMode && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1 && !jobSettings.getPreviewMode()) + { + // This used to be easier, but now we have the case of a non-preview mode, but the layer setting calls for a preview. + jitterScale *= jobSettings.getValue(ChaosSettings.properties.LWRVar, settingsIndex); } - preOverlapMergePolys.Add(GeoWrangler.pointFFromPath(deformedPoly, CentralProperties.scaleFactorForOperation)); - deformedPoly.Add(new IntPoint(deformedPoly[0])); - } - // Check for overlaps and process as needed post-biasing. - processOverlaps(commonVars, settingsIndex, preOverlapMergePolys, forceOverride: false); - - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (!debug) - { - return; + previewPoints = NoiseC.doNoise(previewPoints,drawnPoly, + noiseType: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrType), + seed: jobSettings.getInt(ChaosSettings.ints.lwrSeed, settingsIndex), + freq: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwrFreq)), + jitterScale: jitterScale + ); } - foreach (Path t in dRays) + if ((!previewMode || entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1) && entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2) != 0) { - previewPoints.Add(GeoWrangler.pointFFromPath(t, CentralProperties.scaleFactorForOperation)); - drawnPoly.Add(true); + // LWR2, skip if not requested to avoid runtime pain + double jitterScale = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2)) / lwrConversionFactor; // LWR jitter of edge; use RSS for stricter assessment + if (!previewMode && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwrPreview) == 1 && !jobSettings.getPreviewMode()) + { + // This used to be easier, but now we have the case of a non-preview mode, but the layer setting calls for a preview. + jitterScale *= jobSettings.getValue(ChaosSettings.properties.LWR2Var, settingsIndex); + } + + previewPoints = NoiseC.doNoise(previewPoints,drawnPoly, + noiseType: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.lwr2Type), + seed: jobSettings.getInt(ChaosSettings.ints.lwr2Seed, settingsIndex), + freq: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.lwr2Freq)), + jitterScale: jitterScale + ); } } @@ -1026,7 +221,6 @@ private void init(CommonVars commonVars, ChaosSettings chaosSettings, int settin try { DOEDependency = false; - fragment = new Fragmenter(commonVars.getSimulationSettings().getResolution(), CentralProperties.scaleFactorForOperation); previewPoints = new List(); drawnPoly = new List(); geoCoreOrthogonalPoly = new List(); @@ -1038,7 +232,7 @@ private void init(CommonVars commonVars, ChaosSettings chaosSettings, int settin entropyLayerSettings = commonVars.getLayerSettings(settingsIndex); break; } - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE) + if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE) { init_geoCore(commonVars, chaosSettings, settingsIndex, entropyLayerSettings, mode, doPASearch, previewMode, process_overlaps, doClockwiseGeoFix); // Get our offsets configured. We need to check for DOE settings here, to prevent relocation of extracted polygons within the tile during offset evaluation. @@ -1048,11 +242,13 @@ private void init(CommonVars commonVars, ChaosSettings chaosSettings, int settin commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.colOffset); commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowOffset); } - doOffsets(entropyLayerSettings); + GeoLibPointF offset = shapeOffsets.doOffsets(0, entropyLayerSettings); + xOffset = offset.X; + yOffset = offset.Y; } else // not geoCore related. { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.BOOLEAN) + if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.BOOLEAN) { try { @@ -1088,7 +284,9 @@ private void init(CommonVars commonVars, ChaosSettings chaosSettings, int settin commonVars.getSimulationSettings().getDOESettings().getDouble(DOESettings.properties_d.rowOffset); } - doOffsets(entropyLayerSettings); + GeoLibPointF offset = shapeOffsets.doOffsets(0, entropyLayerSettings); + xOffset = offset.X; + yOffset = offset.Y; } catch (Exception) { @@ -1097,155 +295,198 @@ private void init(CommonVars commonVars, ChaosSettings chaosSettings, int settin } else { - if (mode == 0) + init_general(commonVars, chaosSettings, settingsIndex, entropyLayerSettings, mode, doPASearch, previewMode, subShapeIndex); + } + } + + if (exitEarly || mode != 1) + { + return; + } + + // Fragment by resolution + Fragmenter fragment = new Fragmenter(commonVars.getSimulationSettings().getResolution(), CentralProperties.scaleFactorForOperation); + + Parallel.For(0, previewPoints.Count, i => + { + if (!drawnPoly[i]) + { + previewPoints[i] = fragment.fragmentPath(GeoWrangler.stripColinear(previewPoints[i])); + } + }); + + // Apply lens distortion. + previewPoints = distortShape.distortion(previewPoints, drawnPoly.ToArray(), + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC1), + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.lDC2), + commonVars.getSimulationSettings().getResolution(), CentralProperties.scaleFactorForOperation); + + Parallel.For(0, previewPoints.Count, i => + { + if (!drawnPoly[i]) + { + previewPoints[i] = fragment.fragmentPath(GeoWrangler.stripColinear(previewPoints[i])); + } + }); + + // Noise and proximity biasing. + applyNoise(previewMode, commonVars, chaosSettings, settingsIndex); + GeometryResult ret = Proximity.proximityBias(previewPoints, drawnPoly, + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.pBias), + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.pBiasDist), + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.proxRays), + commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.proxSideRaysFallOff), + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.proxSideRaysMultiplier), + commonVars.getLayerSettings(settingsIndex).getDecimal(EntropyLayerSettings.properties_decimal.rayExtension), + commonVars.getSimulationSettings().getResolution(), + CentralProperties.scaleFactorForOperation + ); + + previewPoints = ret.geometry.ToList(); + drawnPoly = ret.drawn.ToList(); + Parallel.For(0, previewPoints.Count, i => + { + if (!drawnPoly[i]) + { + previewPoints[i] = fragment.fragmentPath(GeoWrangler.stripColinear(previewPoints[i])); + } + }); + } + catch (Exception) + { + } + } + + private void init_general(CommonVars commonVars, ChaosSettings chaosSettings, int settingsIndex, EntropyLayerSettings entropyLayerSettings, int mode, bool doPASearch, bool previewMode, int subShapeIndex) + { + if (mode == 0) + { + // Basic shape - 5 points to make a closed preview. 5th is identical to 1st. + GeoLibPointF[] tempArray = new GeoLibPointF[5]; + + // Need exception handling here for overflow cases? + decimal bottom_leftX = 0, bottom_leftY = 0; + decimal top_leftX = 0, top_leftY = 0; + decimal top_rightX = 0, top_rightY = 0; + decimal bottom_rightX = 0, bottom_rightY = 0; + top_leftY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verLength, subShapeIndex); + top_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horLength, subShapeIndex); + top_rightY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verLength, subShapeIndex); + bottom_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horLength, subShapeIndex); + switch (subShapeIndex) + { + case 0: + bottom_leftX = 0; + bottom_leftY = 0; + top_leftX = 0; + bottom_rightY = 0; + xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, subShapeIndex)); + yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, subShapeIndex)); + break; + case 1: + bottom_leftX = 0; + bottom_leftY = 0; + top_leftX = 0; + bottom_rightY = 0; + xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, subShapeIndex)); + yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, subShapeIndex)); + break; + case 2: + { + bottom_leftX = 0; + bottom_leftY = 0; + top_leftX = 0; + bottom_rightY = 0; + xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 2) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0)); + yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 2) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verLength, 2) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0)); + if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.Sshape) { - // Basic shape - 5 points to make a closed preview. 5th is identical to 1st. - GeoLibPointF[] tempArray = new GeoLibPointF[5]; - - // Need exception handling here for overflow cases? - decimal bottom_leftX = 0, bottom_leftY = 0; - decimal top_leftX = 0, top_leftY = 0; - decimal top_rightX = 0, top_rightY = 0; - decimal bottom_rightX = 0, bottom_rightY = 0; - switch (subShapeIndex) - { - case 0: - bottom_leftX = 0; - bottom_leftY = 0; - top_leftX = 0; - top_leftY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength); - top_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); - top_rightY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength); - bottom_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength); - bottom_rightY = 0; - xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); - break; - case 1: - bottom_leftX = 0; - bottom_leftY = 0; - top_leftX = 0; - top_leftY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); - top_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength); - top_rightY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength); - bottom_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength); - bottom_rightY = 0; - xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - break; - case 2: - { - bottom_leftX = 0; - bottom_leftY = 0; - top_leftX = 0; - top_leftY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength); - top_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength); - top_rightY = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength); - bottom_rightX = entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength); - bottom_rightY = 0; - xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - yOffset = -Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.Sshape) - { - yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); // offset our subshape to put it in the correct place in the UI. - } + yOffset += Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verLength, 0)); // offset our subshape to put it in the correct place in the UI. + } - break; - } - } + break; + } + } - // Populate array. - tempArray[0] = new GeoLibPointF((double)bottom_leftX, (double)bottom_leftY); - tempArray[1] = new GeoLibPointF((double)top_leftX, (double)top_leftY); - tempArray[2] = new GeoLibPointF((double)top_rightX, (double)top_rightY); - tempArray[3] = new GeoLibPointF((double)bottom_rightX, (double)bottom_rightY); - tempArray[4] = new GeoLibPointF(tempArray[0]); + // Populate array. + tempArray[0] = new GeoLibPointF((double)bottom_leftX, (double)bottom_leftY); + tempArray[1] = new GeoLibPointF((double)top_leftX, (double)top_leftY); + tempArray[2] = new GeoLibPointF((double)top_rightX, (double)top_rightY); + tempArray[3] = new GeoLibPointF((double)bottom_rightX, (double)bottom_rightY); + tempArray[4] = new GeoLibPointF(tempArray[0]); - // Apply our deltas - int tLength = tempArray.Length; + // Apply our deltas + int tLength = tempArray.Length; #if !VARIANCESINGLETHREADED - Parallel.For(0, tLength, i => + Parallel.For(0, tLength, i => #else - for (Int32 i = 0; i < tLength; i++) + for (Int32 i = 0; i < tLength; i++) #endif - { - tempArray[i].X += xOffset; - tempArray[i].Y += yOffset; - } + { + tempArray[i].X += xOffset; + tempArray[i].Y += yOffset; + } #if !VARIANCESINGLETHREADED - ); + ); #endif - previewPoints.Add(tempArray); - drawnPoly.Add(true); - } - else - { - // Complex shape - try - { - EntropyShape complexPoints = new(commonVars.getSimulationSettings(), commonVars.getListOfSettings(), settingsIndex, doPASearch, previewMode, chaosSettings); - previewPoints.Add(complexPoints.getPoints()); - drawnPoly.Add(false); - } - catch (Exception) - { + previewPoints.Add(tempArray); + drawnPoly.Add(true); + } + else + { + // Complex shape + try + { + EntropyShape complexPoints = new(commonVars.getSimulationSettings(), commonVars.getListOfSettings(), settingsIndex, doPASearch, previewMode, chaosSettings); + previewPoints.Add(complexPoints.getPoints()); + drawnPoly.Add(false); + } + catch (Exception) + { - } - } - // Get our offsets configured. - doOffsets(entropyLayerSettings); + } + } + // Get our offsets configured. + GeoLibPointF offset = shapeOffsets.doOffsets(0, entropyLayerSettings); + xOffset = offset.X; + yOffset = offset.Y; - int pCount = previewPoints.Count; - for (int poly = 0; poly < pCount; poly++) - { - int ptCount = previewPoints[poly].Length; + int pCount = previewPoints.Count; + for (int poly = 0; poly < pCount; poly++) + { + int ptCount = previewPoints[poly].Length; + int poly1 = poly; #if !VARIANCESINGLETHREADED - Parallel.For(0, ptCount, point => + Parallel.For(0, ptCount, point => #else - for (Int32 point = 0; point < ptCount; point++) + for (Int32 point = 0; point < ptCount; point++) #endif - { - double px = previewPoints[poly][point].X + xOffset; - double py = previewPoints[poly][point].Y - yOffset; + { + double px = previewPoints[poly1][point].X + xOffset; + double py = previewPoints[poly1][point].Y - yOffset; - previewPoints[poly][point] = new GeoLibPointF(px, py); - } + previewPoints[poly1][point] = new GeoLibPointF(px, py); + } #if !VARIANCESINGLETHREADED - ); + ); #endif - if (Math.Abs(previewPoints[poly][0].X - previewPoints[poly][previewPoints[poly].Length - 1].X) > double.Epsilon || - Math.Abs(previewPoints[poly][0].Y - previewPoints[poly][previewPoints[poly].Length - 1].Y) > double.Epsilon) - { - ErrorReporter.showMessage_OK("Start and end not the same - previewShape", "Oops"); - } - } - } - } - - if (exitEarly || mode != 1) + if (Math.Abs(previewPoints[poly][0].X - previewPoints[poly][previewPoints[poly].Length - 1].X) > double.Epsilon || + Math.Abs(previewPoints[poly][0].Y - previewPoints[poly][previewPoints[poly].Length - 1].Y) > double.Epsilon) { - return; + ErrorReporter.showMessage_OK("Start and end not the same - previewShape", "Oops"); } - - // Apply lens distortion. - distortion(commonVars, settingsIndex); - // Noise and proximity biasing. - applyNoise(previewMode, commonVars, chaosSettings, settingsIndex); - proximityBias(commonVars, settingsIndex); - } - catch (Exception) - { } } - private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, int settingsIndex, EntropyLayerSettings entropyLayerSettings, int mode, bool doPASearch, bool previewMode, bool process_overlaps, bool forceClockwise) { + Fragmenter fragment = new Fragmenter(commonVars.getSimulationSettings().getResolution(), CentralProperties.scaleFactorForOperation); + // We'll use these to shift the points around. double xOverlayVal = 0.0f; double yOverlayVal = 0.0f; - xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset)); - yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset)); + xOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0)); + yOffset = Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset) + entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0)); // OK. We need to crop our layout based on the active tile if there is a DOE flag set. bool tileHandlingNeeded = commonVars.getSimulationSettings().getDOESettings().getLayerAffected(settingsIndex) == 1; @@ -1376,8 +617,8 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in } GeoLibPointF bb_mid = new(minx + (maxx - minx) / 2.0f, miny + (maxy - miny) / 2.0f); - bb_mid.X += xOverlayVal + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset) + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorOffset); - bb_mid.Y += yOverlayVal + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset) + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset); + bb_mid.X += xOverlayVal + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset) + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.horOffset, 0); + bb_mid.Y += yOverlayVal + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset) + (double)entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.verOffset, 0); if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.perPoly) == 1) { @@ -1402,6 +643,8 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in } tempPoly = new GeoLibPointF[arraySize]; + GeoLibPointF[] poly1 = tempPoly; + int poly2 = poly; #if !VARIANCESINGLETHREADED Parallel.For(0, arraySize, pt => @@ -1409,7 +652,7 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in for (int pt = 0; pt < arraySize; pt++) #endif { - tempPoly[pt] = new GeoLibPointF(tempPolyList[poly][pt].X + xOffset, tempPolyList[poly][pt].Y + yOffset); + poly1[pt] = new GeoLibPointF(tempPolyList[poly2][pt].X + xOffset, tempPolyList[poly2][pt].Y + yOffset); } #if !VARIANCESINGLETHREADED ); @@ -1421,13 +664,15 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in tempPoly = new GeoLibPointF[polySize]; + GeoLibPointF[] poly1 = tempPoly; + int poly2 = poly; #if !VARIANCESINGLETHREADED Parallel.For(0, polySize, pt => #else for (Int32 pt = 0; pt < polySize; pt++) #endif { - tempPoly[pt] = new GeoLibPointF(entropyLayerSettings.getFileData()[poly][pt].X + xOffset, entropyLayerSettings.getFileData()[poly][pt].Y + yOffset); + poly1[pt] = new GeoLibPointF(entropyLayerSettings.getFileData()[poly2][pt].X + xOffset, entropyLayerSettings.getFileData()[poly2][pt].Y + yOffset); } #if !VARIANCESINGLETHREADED ); @@ -1440,23 +685,23 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in // However, external geometry may need this spin fixing. Although the upper levels should also re-spin geometry properly - we don't assume this. if (forceClockwise) { - tempPoly = GeoWrangler.clockwiseAndReorder(tempPoly); // force clockwise order and lower-left at 0 index. + tempPoly = GeoWrangler.clockwiseAndReorderXY(tempPoly); // force clockwise order and lower-left at 0 index. } // Strip termination points. Set shape will take care of additional clean-up if needed. - tempPoly = GeoWrangler.stripTerminators(tempPoly, false); + // tempPoly = GeoWrangler.stripTerminators(tempPoly, false); if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0) { - previewPoints.Add(fragment.fragmentPath(tempPoly.ToArray())); + previewPoints.Add(fragment.fragmentPath(tempPoly)); geoCoreOrthogonalPoly.Add(false); // We need to populate the list, but in this non-contoured case, the value doesn't matter. } else { // Feed tempPoly to shape engine. - ShapeLibrary shape = new(entropyLayerSettings); + ShapeLibrary shape = new(CentralProperties.shapeTable, entropyLayerSettings); - shape.setShape(entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex), tempPoly.ToArray()); // feed the shape engine with the geometry using our optional parameter. + shape.setShape(entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex), tempPoly); // feed the shape engine with the geometry using our optional parameter. EntropyShape complexPoints = new(commonVars.getSimulationSettings(), commonVars.getListOfSettings(), settingsIndex, doPASearch, previewMode, chaosSettings, shape, bb_mid); // Add resulting shape to the previewPoints. previewPoints.Add(complexPoints.getPoints()); @@ -1484,13 +729,14 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in int ptCount = previewPoints[poly].Length; #if !VARIANCESINGLETHREADED + var poly1 = poly; Parallel.For(0, ptCount, pt => #else for (int pt = 0; pt < ptCount; pt++) #endif { - previewPoints[poly][pt].X += xOverlayVal; - previewPoints[poly][pt].Y += yOverlayVal; + previewPoints[poly1][pt].X += xOverlayVal; + previewPoints[poly1][pt].Y += yOverlayVal; } #if !VARIANCESINGLETHREADED ); @@ -1520,11 +766,13 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 0 || !geoCoreOrthogonalPoly[poly] && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 1) { - Paths resizedPolyData = new(); + Paths resizedPolyData; Path gdsPointData = GeoWrangler.pathFromPointF(previewPoints[poly], CentralProperties.scaleFactorForOperation); - ClipperOffset co = new(); - co.AddPath(gdsPointData, JoinType.jtMiter, EndType.etClosedPolygon); - co.Execute(ref resizedPolyData, Convert.ToDouble(globalBias_Sides * CentralProperties.scaleFactorForOperation)); + ClipperOffset co = new() {PreserveCollinear = true, ReverseSolution = true}; + co.AddPath(gdsPointData, JoinType.Miter, EndType.Polygon); + resizedPolyData = co.Execute(Convert.ToDouble(globalBias_Sides * CentralProperties.scaleFactorForOperation)); + resizedPolyData = GeoWrangler.reOrderXY(resizedPolyData); + resizedPolyData = GeoWrangler.close(resizedPolyData); // Store our polygon data (note that we could have ended up with two or more polygons due to reduction) try @@ -1550,12 +798,12 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in if (geoCoreOrthogonalPoly[poly] && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 1) { // Decouple out of paranoia. - resizedLayoutData.Add(previewPoints[poly].ToArray()); + resizedLayoutData.Add(previewPoints[poly]); } } - previewPoints = resizedLayoutData.ToList(); - drawnPoly = new_Drawn.ToList(); + previewPoints = resizedLayoutData; + drawnPoly = new_Drawn; } } catch (Exception) @@ -1565,7 +813,23 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in if (process_overlaps) { - processOverlaps(commonVars, settingsIndex, previewPoints, forceOverride: false, (PolyFillType)commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.fill)); + double customSizing = 0; + + if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == + (int) CentralProperties.shapeNames.GEOCORE) + { + customSizing = GeoWrangler.keyhole_sizing * Convert.ToDouble(commonVars.getLayerSettings(settingsIndex) + .getDecimal(EntropyLayerSettings.properties_decimal.keyhole_factor)); + } + + double resolution = commonVars.getSimulationSettings().getResolution(); + double extension = Convert.ToDouble(commonVars.getLayerSettings(settingsIndex) + .getDecimal(EntropyLayerSettings.properties_decimal.rayExtension)); + + GeometryResult ret = ProcessOverlaps.processOverlaps(previewPoints, drawnPoly, extension:extension , resolution:resolution, scaleFactorForOperation:CentralProperties.scaleFactorForOperation, customSizing:customSizing, forceOverride: false, (FillRule)commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.fill)); + + previewPoints = ret.geometry.ToList(); + drawnPoly = ret.drawn.ToList(); } } else @@ -1591,13 +855,14 @@ private void init_geoCore(CommonVars commonVars, ChaosSettings chaosSettings, in int arraySize = entropyLayerSettings.getFileData()[poly].Length; GeoLibPointF[] tmp = new GeoLibPointF[arraySize]; #if !VARIANCESINGLETHREADED + var poly1 = poly; Parallel.For(0, arraySize, pt => #else for (Int32 pt = 0; pt < arraySize; pt++) #endif { - tmp[pt] = new GeoLibPointF(entropyLayerSettings.getFileData()[poly][pt].X + xOffset, - entropyLayerSettings.getFileData()[poly][pt].Y + yOffset); + tmp[pt] = new GeoLibPointF(entropyLayerSettings.getFileData()[poly1][pt].X + xOffset, + entropyLayerSettings.getFileData()[poly1][pt].Y + yOffset); } #if !VARIANCESINGLETHREADED ); @@ -1634,16 +899,18 @@ private void init_boolean(CommonVars commonVars, ChaosSettings chaosSettings, in Paths layerAPaths = GeoWrangler.pathsFromPointFs(a_pShape.getPoints(), CentralProperties.scaleFactorForOperation); Paths layerBPaths = GeoWrangler.pathsFromPointFs(b_pShape.getPoints(), CentralProperties.scaleFactorForOperation); - // Now this gets interesting. We leverage the Boolean engine in ChaosEngine to get the result we want. + + // Now this gets interesting. We leverage the Boolean engine in GeoWrangler to get the result we want. // This should probably be relocated at some point, but for now, it's an odd interaction. - Paths booleanPaths = ChaosEngine.customBoolean( + Paths booleanPaths = GeoWrangler.customBoolean( firstLayerOperator: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.bLayerOpA), firstLayer: layerAPaths, secondLayerOperator: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.bLayerOpB), secondLayer: layerBPaths, booleanFlag: entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.bLayerOpAB), resolution: commonVars.getSimulationSettings().getResolution(), - extension: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.rayExtension)) + extension: Convert.ToDouble(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.rayExtension)), CentralProperties.scaleFactorForOperation + // fragmenter:new Fragmenter(fragment, CentralProperties.scaleFactorForOperation) ); // This is set later, if needed, to force an early return from the overlap processing path. @@ -1674,205 +941,28 @@ private void init_boolean(CommonVars commonVars, ChaosSettings chaosSettings, in // Feels a little hacky, but it ought to work. EntropyLayerSettings tempSettings = new(); tempSettings.adjustSettings(entropyLayerSettings, gdsOnly: false); - tempSettings.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CommonVars.shapeNames.GEOCORE); + tempSettings.setInt(EntropyLayerSettings.properties_i.shapeIndex, (int)CentralProperties.shapeNames.GEOCORE); tempSettings.setInt(EntropyLayerSettings.properties_i.gCSEngine, 1); tempSettings.setFileData(booleanGeo.ToList()); drawnPoly.Clear(); previewPoints.Clear(); init(commonVars, chaosSettings, settingsIndex, subShapeIndex, mode, doPASearch, previewMode, currentRow, currentCol, tempSettings, doClockwiseGeoFix: true, process_overlaps: false); // Avoid the baked-in point order reprocessing which breaks our representation. - processOverlaps(commonVars, settingsIndex, previewPoints, forceOverride:false, (PolyFillType)commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.fill)); - } - - private void processOverlaps(CommonVars commonVars, int settingsIndex, List sourceData, bool forceOverride = false, PolyFillType pft = PolyFillType.pftNonZero) - { - // Filter drawn, process those, then do not-drawn. This allows for element counts to change. - List drawnStuff = new(); - List notDrawnStuff = new(); - int sCount = sourceData.Count; - for (int i = 0; i < sCount; i++) - { - if (drawnPoly[i]) - { - drawnStuff.Add(sourceData[i]); - } - else - { - notDrawnStuff.Add(sourceData[i]); - } - } - - double extension = Convert.ToDouble(commonVars.getLayerSettings(settingsIndex) - .getDecimal(EntropyLayerSettings.properties_decimal.rayExtension)); - double customSizing = 0; if (commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.shapeIndex) == - (int) CommonVars.shapeNames.GEOCORE) + (int) CentralProperties.shapeNames.GEOCORE) { customSizing = GeoWrangler.keyhole_sizing * Convert.ToDouble(commonVars.getLayerSettings(settingsIndex) .getDecimal(EntropyLayerSettings.properties_decimal.keyhole_factor)); } - - List processed_Drawn = processOverlaps_core(commonVars, drawnStuff, customSizing:customSizing, extension:extension, forceOverride, pft); - - List processed_NotDrawn = processOverlaps_core(commonVars, notDrawnStuff, customSizing:customSizing, extension: extension, forceOverride, pft); - - previewPoints.Clear(); - drawnPoly.Clear(); - - int pdCount = processed_Drawn.Count; - int pndCount = processed_NotDrawn.Count; - - for (int i = 0; i < pdCount; i++) - { - previewPoints.Add(processed_Drawn[i]); - drawnPoly.Add(true); - } - - for (int i = 0; i < pndCount; i++) - { - previewPoints.Add(processed_NotDrawn[i]); - drawnPoly.Add(false); - } - - } - - private List processOverlaps_core(CommonVars commonVars, List sourceData, double customSizing, double extension, bool forceOverride = false, PolyFillType pft = PolyFillType.pftNonZero) - { - try - { - Clipper c = new() {PreserveCollinear = true}; - Paths sourcePolyData = GeoWrangler.pathsFromPointFs(sourceData, CentralProperties.scaleFactorForOperation); - Paths resizedPolyData = new(); - - // Union isn't always robust, so get a bounding box and run an intersection boolean to rationalize the geometry. - IntRect bounds = ClipperBase.GetBounds(sourcePolyData); - Path bounding = new() - { - new IntPoint(bounds.left, bounds.bottom), - new IntPoint(bounds.left, bounds.top), - new IntPoint(bounds.right, bounds.top), - new IntPoint(bounds.right, bounds.bottom) - }; - - c.AddPaths(sourcePolyData, PolyType.ptClip, true); - c.AddPaths(sourcePolyData, PolyType.ptSubject, true); - - c.Execute(ClipType.ctIntersection, resizedPolyData, pft, pft); - - // Avoid the overlap handling if we don't actually need to do it. - - bool returnEarly = false; - - int rpdCount = resizedPolyData.Count; - int sCount = sourceData.Count; - - if (rpdCount == sCount) - { - returnEarly = true; - for (int i = 0; i < rpdCount; i++) - { - // Clipper drops the closing vertex. - if (resizedPolyData[i].Count == sourceData[i].Length - 1) - { - continue; - } - - returnEarly = false; - break; - } - } - - if (returnEarly) - { - // Secondary check - c.Clear(); - - c.AddPath(bounding, PolyType.ptClip, true); - c.AddPaths(sourcePolyData, PolyType.ptSubject, true); - - c.Execute(ClipType.ctIntersection, resizedPolyData, pft, pft); - - // Decompose to outers and cutters - Paths[] decomp = GeoWrangler.getDecomposed(resizedPolyData); - - Paths outers = decomp[(int)GeoWrangler.type.outer]; - Paths cutters = decomp[(int)GeoWrangler.type.cutter]; - - int oCount = outers.Count; - int cCount = cutters.Count; - - // Is any cutter fully enclosed within an outer? - for (int outer = 0; outer < oCount; outer++) - { - double origArea = Math.Abs(Clipper.Area(outers[outer])); - for (int cutter = 0; cutter < cCount; cutter++) - { - c.Clear(); - c.AddPath(outers[outer], PolyType.ptSubject, true); - c.AddPath(cutters[cutter], PolyType.ptClip, true); - Paths test = new(); - c.Execute(ClipType.ctUnion, test, PolyFillType.pftPositive, PolyFillType.pftPositive); - - double uArea = test.Sum(t => Math.Abs(Clipper.Area(t))); - - if (!(Math.Abs(uArea - origArea) < double.Epsilon)) - { - continue; - } - - returnEarly = false; - break; - } - if (!returnEarly) - { - break; - } - } - - if (returnEarly) - { - return sourceData.ToList(); - } - } - - resizedPolyData = GeoWrangler.close(resizedPolyData); - - // Here, we can run into trouble....we might have a set of polygons which need to get keyholed. For example, where we have fully enclosed 'cutters' within an outer boundary. - // Can geoWrangler help us out here? - - // We need to run the fragmenter here because the keyholer / raycaster pipeline needs points for emission. - Fragmenter f = new(commonVars.getSimulationSettings().getResolution() * CentralProperties.scaleFactorForOperation); - resizedPolyData = GeoWrangler.makeKeyHole(f.fragmentPaths(resizedPolyData), customSizing:customSizing, extension:extension).ToList(); - - if (!resizedPolyData.Any()) - { - return sourceData; - } - - // We got some resulting geometry from our Boolean so let's process it to send back to the caller. - List refinedData = new(); - - resizedPolyData = GeoWrangler.close(resizedPolyData); - - rpdCount = resizedPolyData.Count; - - // Switch our fragmenter to use a new configuration for the downsized geometry. - f = new Fragmenter(commonVars.getSimulationSettings().getResolution(), CentralProperties.scaleFactorForOperation); - - // Convert back our geometry. - for (int rPoly = 0; rPoly < rpdCount; rPoly++) - { - // We have to re-fragment as the overlap processing changed the geometry heavily. - refinedData.Add(f.fragmentPath(GeoWrangler.pointFFromPath(resizedPolyData[rPoly], CentralProperties.scaleFactorForOperation))); - } + double resolution = commonVars.getSimulationSettings().getResolution(); + double extension = Convert.ToDouble(commonVars.getLayerSettings(settingsIndex) + .getDecimal(EntropyLayerSettings.properties_decimal.rayExtension)); + + GeometryResult ret = ProcessOverlaps.processOverlaps(previewPoints, drawnPoly, extension:extension , resolution:resolution, scaleFactorForOperation:CentralProperties.scaleFactorForOperation, customSizing:customSizing, forceOverride:false, (FillRule)commonVars.getLayerSettings(settingsIndex).getInt(EntropyLayerSettings.properties_i.fill)); - return refinedData.ToList(); - } - catch (Exception) - { - return sourceData.ToList(); - } + previewPoints = ret.geometry.ToList(); + drawnPoly = ret.drawn.ToList(); } } \ No newline at end of file diff --git a/Common/Variance/support/replay.cs b/Common/Variance/support/replay.cs index 25b060a..3892326 100644 --- a/Common/Variance/support/replay.cs +++ b/Common/Variance/support/replay.cs @@ -324,8 +324,8 @@ private void pGetState(int index) // Result parsing. switch (commonVars_.getSimulationSettings().getValue(EntropySettings.properties_i.oType)) { - case (int)CommonVars.calcModes.area: - searchString = commonVars_.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)CommonVars.areaCalcModes.all ? "Total Area" : "Minimum Area"; + case (int)geoAnalysis.supported.calcModes.area: + searchString = commonVars_.getSimulationSettings().getValue(EntropySettings.properties_i.subMode) == (int)geoAnalysis.AreaHandler.areaCalcModes.all ? "Total Area" : "Minimum Area"; colIndex = Array.IndexOf(parsed[0], searchString); result = parsed[index][colIndex]; @@ -339,15 +339,15 @@ private void pGetState(int index) } break; - case (int)CommonVars.calcModes.enclosure_spacing_overlap: + case (int)geoAnalysis.supported.calcModes.enclosure_spacing_overlap: switch (commonVars_.getSimulationSettings().getValue(EntropySettings.properties_i.subMode)) { - case (int)CommonVars.spacingCalcModes.spacing: - case (int)CommonVars.spacingCalcModes.spacingOld: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacing: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.spacingOld: searchString = "Spacing"; break; - case (int)CommonVars.spacingCalcModes.enclosure: - case (int)CommonVars.spacingCalcModes.enclosureOld: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosure: + case (int)geoAnalysis.DistanceHandler.spacingCalcModes.enclosureOld: searchString = "Enclosure"; break; } @@ -364,7 +364,7 @@ private void pGetState(int index) } break; - case (int)CommonVars.calcModes.chord: // chord output + case (int)geoAnalysis.supported.calcModes.chord: // chord output string[] searchStrings = { "AMinTopChord", "AMinBottomChord", "BMinLeftChord", "BMinRightChord" }; string[] resultValues = new string[searchStrings.Length]; for (int i = 0; i < searchStrings.Length; i++) @@ -388,7 +388,7 @@ private void pGetState(int index) } break; - case (int)CommonVars.calcModes.angle: // angle output + case (int)geoAnalysis.supported.calcModes.angle: // angle output searchString = "MinIntersectionAngle"; colIndex = Array.IndexOf(parsed[0], searchString); result = parsed[index][colIndex]; diff --git a/Common/Variance/support/shapeLibrary.cs b/Common/Variance/support/shapeLibrary.cs deleted file mode 100644 index f32ef0f..0000000 --- a/Common/Variance/support/shapeLibrary.cs +++ /dev/null @@ -1,1717 +0,0 @@ -using System; -using System.Threading.Tasks; -using geoLib; -using geoWrangler; - -namespace Variance; - -public class ShapeLibrary -{ - private int shapeIndex; - public bool shapeValid { get; private set; } - public bool geoCoreShapeOrthogonal { get; private set; } - public MyVertex[] Vertex { get; private set; } - public MyRound[] round1 { get; private set; } - public bool[] tips { get; private set; } - private EntropyLayerSettings layerSettings; - - public ShapeLibrary(EntropyLayerSettings mcLayerSettings) - { - pShapeLibrary(mcLayerSettings); - } - - private void pShapeLibrary(EntropyLayerSettings mcLayerSettings) - { - shapeValid = false; - layerSettings = mcLayerSettings; - } - - public ShapeLibrary(int shapeIndex_, EntropyLayerSettings mcLayerSettings) - { - pShapeLibrary(shapeIndex_, mcLayerSettings); - } - - private void pShapeLibrary(int shapeIndex_, EntropyLayerSettings mcLayerSettings) - { - shapeIndex = shapeIndex_; - shapeValid = false; - layerSettings = mcLayerSettings; - pSetShape(shapeIndex); - } - - public void setShape(int shapeIndex_, GeoLibPointF[] sourcePoly = null) - { - pSetShape(shapeIndex_, sourcePoly); - } - - private void pSetShape(int shapeIndex_, GeoLibPointF[] sourcePoly = null) - { - try - { - shapeIndex = shapeIndex_; - switch (shapeIndex) - { - case (int)CommonVars.shapeNames.rect: - rectangle(); - break; - case (int)CommonVars.shapeNames.Lshape: - Lshape(); - break; - case (int)CommonVars.shapeNames.Tshape: - Tshape(); - break; - case (int)CommonVars.shapeNames.Xshape: - crossShape(); - break; - case (int)CommonVars.shapeNames.Ushape: - Ushape(); - break; - case (int)CommonVars.shapeNames.Sshape: - Sshape(); - break; - case (int)CommonVars.shapeNames.GEOCORE: - if (layerSettings.getInt(EntropyLayerSettings.properties_i.gCSEngine) == 1) - { - customShape(sourcePoly); - } - break; - } - } - catch (Exception) - { - - } - } - - private void configureArrays() - { - double vertexCount = 0; - switch (shapeIndex) - { - case (int)CommonVars.shapeNames.rect: // rectangle - vertexCount = 9; - break; - case (int)CommonVars.shapeNames.Lshape: // L - vertexCount = 13; - break; - case (int)CommonVars.shapeNames.Tshape: // T - vertexCount = 17; - break; - case (int)CommonVars.shapeNames.Xshape: // Cross - vertexCount = 25; - break; - case (int)CommonVars.shapeNames.Ushape: // U - vertexCount = 17; - break; - case (int)CommonVars.shapeNames.Sshape: // S - vertexCount = 25; - break; - } - int arrayLength = (int)vertexCount; - Vertex = new MyVertex[arrayLength]; - tips = new bool[arrayLength]; -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, arrayLength, i => -#else - for (Int32 i = 0; i < arrayLength; i++) -#endif - { - tips[i] = false; - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - arrayLength = (int)Math.Floor(vertexCount / 2) + 1; - round1 = new MyRound[arrayLength]; -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, arrayLength, i => -#else - for (Int32 i = 0; i < arrayLength; i++) -#endif - { - round1[i] = new MyRound(); - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - } - - private void rectangle() - { - configureArrays(); - - // Sort out the tips by setting 'true' to center vertex that defines tip in each case. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[5] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[8] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[3] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[3] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[1] = true; - tips[3] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[3] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[3] = true; - tips[5] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[1] = true; - tips[7] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[5] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[5] = true; - tips[7] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[3] = true; - tips[7] = true; - tips[1] = true; - tips[8] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[3] = true; - tips[7] = true; - tips[5] = true; - break; - default: // All - tips[3] = true; - tips[7] = true; - tips[1] = true; - tips[8] = true; - tips[5] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - // Repositioning with respect to subshape reference is also applied in callsite. - - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = 0.0; - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - tmpY = 0.0; - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void Tshape() - { - configureArrays(); - // Sort out the tips by setting 'true' to center vertex that defines tip in each case. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[3] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[3] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[3] = true; - tips[1] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[3] = true; - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[3] = true; - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[15] = true; - tips[1] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[15] = true; - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[15] = true; - tips[5] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[1] = true; - tips[3] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[3] = true; - tips[5] = true; - tips[13] = true; - tips[15] = true; - break; - default: // All - tips[1] = true; - tips[3] = true; - tips[5] = true; - tips[13] = true; - tips[15] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape1Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - break; - case (int)CommonVars.tipLocations.R: // Right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[7] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[7] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[11] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[11] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[11] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[7] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[7] = true; - tips[9] = true; - tips[11] = true; - break; - default: // All - tips[7] = true; - tips[9] = true; - tips[11] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) + - (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerOffset))))) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - Vertex[8] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength) / 2); - Vertex[9] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength) / 2); - Vertex[10] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - Vertex[11] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength) / 2); - Vertex[12] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) / 2; - Vertex[13] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = 0; - Vertex[14] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength) / 2); - Vertex[15] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void Lshape() - { - configureArrays(); - // Sort out the tips by setting 'true' to center vertex that defines tip in each case. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[5] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[3] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[11] = true; - tips[3] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[1] = true; - tips[3] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[3] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[3] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[11] = true; - tips[1] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[11] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[5] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[1] = true; - tips[11] = true; - tips[3] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[11] = true; - tips[3] = true; - tips[5] = true; - break; - default: // All - tips[1] = true; - tips[5] = true; - tips[11] = true; - tips[3] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape1Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - break; - case (int)CommonVars.tipLocations.R: // Right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[7] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[7] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[11] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[11] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[11] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[7] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[7] = true; - tips[11] = true; - tips[9] = true; - break; - default: // All - tips[9] = true; - tips[7] = true; - tips[11] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - // Repositioning with respect to subshape reference is also applied in callsite. - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength))) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY -= (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength))) / 2; - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[8] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[9] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[10] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX -= (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength))) / 2; - Vertex[11] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void Ushape() - { - configureArrays(); - // Sort out the tips by setting 'true' to center vertex that defines tip in each case. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[13] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[3] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[3] = true; - tips[11] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[1] = true; - tips[3] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[3] = true; - tips[11] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[3] = true; - tips[11] = true; - tips[13] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[1] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[13] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[13] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[1] = true; - tips[3] = true; - tips[11] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[3] = true; - tips[11] = true; - tips[13] = true; - tips[15] = true; - break; - default: // All - tips[1] = true; - tips[3] = true; - tips[11] = true; - tips[13] = true; - tips[15] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape1Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[5] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[5] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[5] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[5] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[5] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[5] = true; - tips[7] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[7] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[7] = true; - tips[9] = true; - break; - default: // All - tips[5] = true; - tips[7] = true; - tips[9] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - // Repositioning with respect to subshape reference is also applied in callsite. - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)) / 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)) / 2; - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[8] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[9] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[10] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) - (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)))) / 2; - Vertex[11] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[12] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY /= 2; - Vertex[13] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = 0; - Vertex[14] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX /= 2; - Vertex[15] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void crossShape() - { - configureArrays(); - // Sort out the tips. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[9] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[11] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[11] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[1] = true; - tips[9] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[11] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[9] = true; - tips[11] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[1] = true; - tips[9] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[9] = true; - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[11] = true; - tips[1] = true; - tips[9] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[13] = true; - tips[11] = true; - tips[23] = true; - tips[21] = true; - break; - default: // All - tips[1] = true; - tips[9] = true; - tips[13] = true; - tips[21] = true; - tips[11] = true; - tips[23] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape1Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[5] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[17] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[5] = true; - tips[17] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[7] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[3] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[3] = true; - tips[7] = true; - tips[15] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[5] = true; - tips[7] = true; - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[7] = true; - tips[15] = true; - tips[17] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[5] = true; - tips[7] = true; - tips[15] = true; - tips[17] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[3] = true; - tips[5] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[3] = true; - tips[17] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[3] = true; - tips[5] = true; - tips[17] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[5] = true; - tips[3] = true; - tips[7] = true; - tips[15] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[3] = true; - tips[7] = true; - tips[15] = true; - tips[17] = true; - tips[19] = true; - break; - default: // All - tips[5] = true; - tips[17] = true; - tips[3] = true; - tips[7] = true; - tips[15] = true; - tips[19] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - tmpX /= 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - tmpX *= 2; - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX /= 2; - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = 0.0; - Vertex[8] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset))) / 2; - Vertex[9] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[10] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[11] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[12] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset))) / 2; - Vertex[13] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - Vertex[14] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - // Need midpoint of edge - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - tmpX += (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength))) / 2 / 2; // midpoint - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - Vertex[15] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - Vertex[16] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[17] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[18] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - // Need midpoint of edge - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - tmpX += (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength))) / 2 / 2; // midpoint - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorOffset)); - Vertex[19] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[20] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) / 2; - Vertex[21] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - - tmpY = 0.0; - Vertex[22] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[23] = new MyVertex(tmpX, tmpY, typeDirection.down1, true, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void Sshape() - { - configureArrays(); - // Sort out the tips by setting 'true' to center vertex that defines tip in each case. - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip)) - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[1] = true; - tips[9] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[1] = true; - tips[9] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[11] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[11] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[1] = true; - tips[9] = true; - tips[11] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[11] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[1] = true; - tips[9] = true; - tips[11] = true; - tips[13] = true; - tips[21] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[1] = true; - tips[9] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[1] = true; - tips[9] = true; - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[1] = true; - tips[9] = true; - tips[11] = true; - tips[23] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[11] = true; - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - default: // All - tips[1] = true; - tips[9] = true; - tips[11] = true; - tips[13] = true; - tips[21] = true; - tips[23] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape1Tip)) // Bottom notch - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - tips[5] = true; - break; - case (int)CommonVars.tipLocations.R: // Right - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[5] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[3] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[3] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[3] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[3] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[3] = true; - tips[5] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[7] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[5] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[5] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[3] = true; - tips[7] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[3] = true; - tips[5] = true; - tips[7] = true; - break; - default: // All - tips[3] = true; - tips[5] = true; - tips[7] = true; - break; - } - switch (layerSettings.getInt(EntropyLayerSettings.properties_i.shape2Tip)) // Top notch - { - case (int)CommonVars.tipLocations.none: // None - break; - case (int)CommonVars.tipLocations.L: // Left - break; - case (int)CommonVars.tipLocations.R: // Right - tips[17] = true; - break; - case (int)CommonVars.tipLocations.LR: // Left and right - tips[17] = true; - break; - case (int)CommonVars.tipLocations.T: // Top - tips[19] = true; - break; - case (int)CommonVars.tipLocations.B: // Bottom - tips[15] = true; - break; - case (int)CommonVars.tipLocations.TB: // Top and Bottom - tips[15] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TL: // Top and Left - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TR: // Top and Right - tips[17] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TLR: // Top and Left and Right - tips[17] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.BL: // Bottom and Left - tips[15] = true; - break; - case (int)CommonVars.tipLocations.BR: // Bottom and Right - tips[15] = true; - tips[17] = true; - break; - case (int)CommonVars.tipLocations.BLR: // Bottom and Left and Right - tips[15] = true; - tips[17] = true; - break; - case (int)CommonVars.tipLocations.TBL: // Top and Bottom and Left - tips[17] = true; - tips[19] = true; - break; - case (int)CommonVars.tipLocations.TBR: // Top and Bottom and Right - tips[15] = true; - tips[17] = true; - tips[19] = true; - break; - default: // All - tips[15] = true; - tips[17] = true; - tips[19] = true; - break; - } - - // NOTE: - // Subshape offsets are applied later to simplify ellipse generation - // Horizontal and vertical global offsets are applied in callsite. - // Repositioning with respect to subshape reference is also applied in callsite. - double tmpX = 0.0; - double tmpY = 0.0; - Vertex[0] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) / 2; - Vertex[1] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)); - Vertex[2] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[3] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - Vertex[4] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)) / 2; - Vertex[5] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerOffset)) + Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - Vertex[6] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)) / 2; - Vertex[7] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - tmpX = 0; - Vertex[8] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY = (Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - tmpY) / 2; - Vertex[9] = new MyVertex(tmpX, tmpY, typeDirection.left1, true, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)); - Vertex[10] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[11] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - // Center so no rounding definition - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[12] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)) / 2; - Vertex[13] = new MyVertex(tmpX, tmpY, typeDirection.right1, true, false, typeVertex.center); - // Center so no rounding definition - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)); - Vertex[14] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength) / 2); - Vertex[15] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorOffset)); - Vertex[16] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY -= Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength) / 2); - Vertex[17] = new MyVertex(tmpX, tmpY, typeDirection.right1, false, false, typeVertex.center); - - tmpY = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerLength)) - Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2VerOffset)); - Vertex[18] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX += Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s2HorLength) / 2); - Vertex[19] = new MyVertex(tmpX, tmpY, typeDirection.up1, false, false, typeVertex.center); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - Vertex[20] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpY /= 2; - Vertex[21] = new MyVertex(tmpX, tmpY, typeDirection.right1, false, false, typeVertex.center); - - tmpY = 0; - Vertex[22] = new MyVertex(tmpX, tmpY, typeDirection.tilt1, true, false, typeVertex.corner); - - tmpX = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)) / 2; - Vertex[23] = new MyVertex(tmpX, tmpY, typeDirection.down1, false, false, typeVertex.center); - - processEdgesForRounding(); - - shapeValid = true; - } - - private void processEdgesForRounding() - { - int horEdge = Vertex.Length - 2; // deal with padding. - int verEdge = 1; - for (int r = 0; r < round1.Length - 1; r++) - { - try - { - round1[r].index = r * 2; - round1[r].horFace = horEdge; - round1[r].verFace = verEdge; - - // Figure out our corner type. First is a special case. - if (r == 0) - { - round1[r].direction = typeRound.exter; - round1[r].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - } - else - { - if ( - Vertex[round1[r].verFace].direction == typeDirection.right1 && Vertex[round1[r].horFace].direction == typeDirection.up1 && horEdge < verEdge || - Vertex[round1[r].verFace].direction == typeDirection.left1 && Vertex[round1[r].horFace].direction == typeDirection.up1 && horEdge > verEdge || - Vertex[round1[r].verFace].direction == typeDirection.right1 && Vertex[round1[r].horFace].direction == typeDirection.down1 && horEdge > verEdge || - Vertex[round1[r].verFace].direction == typeDirection.left1 && Vertex[round1[r].horFace].direction == typeDirection.down1 && horEdge < verEdge - ) - { - round1[r].direction = typeRound.exter; - round1[r].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - } - else - { - round1[r].direction = typeRound.inner; - round1[r].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - } - } - - // Small fudge for the 0 case - if (r == 0) - { - horEdge = -1; - } - - // Change our edge configuration for the next loop. We need to handle overflow references as well - if (r % 2 == 0) - { - horEdge += 4; - horEdge %= Vertex.Length; - } - else - { - verEdge += 4; - verEdge %= Vertex.Length; - } - } - catch (Exception) - { - } - } - - // First and last are the same. - round1[^1] = round1[0]; - } - - // Intended to take geometry from an external source and map it into our shape engine. - private void customShape(GeoLibPointF[] sourcePoly) - { - if (sourcePoly == null) - { - shapeValid = false; - return; - } - - // Note that we assume the point order matches our general primitives; might need upstream review to ensure this is being - // fed correctly. - // Upstream should trim array to ensure end point is different from start point, but we'll force the issue here for robustness. - sourcePoly = GeoWrangler.stripTerminators(sourcePoly, true); - sourcePoly = GeoWrangler.stripColinear(sourcePoly); - // Strip the terminator again to meet the requirements below. - sourcePoly = GeoWrangler.stripTerminators(sourcePoly, false); - sourcePoly = GeoWrangler.clockwise(sourcePoly); - - // We need to look at our incoming shape to see whether it's orthogonal and suitable for contouring. - geoCoreShapeOrthogonal = GeoWrangler.orthogonal(sourcePoly, angularTolerance:0); - - if (!geoCoreShapeOrthogonal) - { - customShape_nonOrthogonal(sourcePoly); - } - else - { - customShape_orthogonal(sourcePoly); - } - - shapeValid = true; - } - - private void customShape_nonOrthogonal(GeoLibPointF[] sourcePoly) - { - int sCount = sourcePoly.Length; - Vertex = new MyVertex[sCount + 1]; // add one to close. - // Assign shape vertices to Vertex and move on. EntropyShape will know what to do. -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, sCount, pt => -#else - for (int pt = 0; pt < sCount; pt++) -#endif - { - Vertex[pt] = new MyVertex(sourcePoly[pt].X, sourcePoly[pt].Y, typeDirection.tilt1, false, false, typeVertex.corner); - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - // Close the shape. - Vertex[^1] = new MyVertex(Vertex[0]); - } - - private void customShape_orthogonal(GeoLibPointF[] sourcePoly) - { - int sCount = sourcePoly.Length; - int vertexCount = sCount * 2 + 1; // assumes no point in midpoint of edges, and 1 to close. - Vertex = new MyVertex[vertexCount]; - tips = new bool[vertexCount]; - int vertexCounter = 0; // set up our vertex counter. - -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, vertexCount, i => -#else - for (Int32 i = 0; i < vertexCount; i++) -#endif - { - tips[i] = false; - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - - int roundCount = sourcePoly.Length + 1; - round1 = new MyRound[roundCount]; -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, roundCount, i => -#else - for (Int32 i = 0; i < roundCount; i++) -#endif - { - round1[i] = new MyRound(); - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - // Set up first rounding entry - round1[0].direction = typeRound.exter; - round1[0].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - round1[0].verFace = 1; - round1[0].horFace = vertexCount - 2; - round1[^1] = round1[0]; // close the loop - - // Set up first vertex. - Vertex[0] = new MyVertex(sourcePoly[0].X, sourcePoly[0].Y, typeDirection.tilt1, false, false, typeVertex.corner); - vertexCounter++; - // Set up first midpoint. - Vertex[1] = new MyVertex((sourcePoly[0].X + sourcePoly[1].X) / 2.0f, (sourcePoly[0].Y + sourcePoly[1].Y) / 2.0f, typeDirection.left1, true, false, typeVertex.center); - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.L || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.LR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.all) - { - tips[vertexCounter] = true; - } - vertexCounter++; - - // Also set our end points - Vertex[vertexCount - 2] = new MyVertex((sourcePoly[0].X + sourcePoly[^1].X) / 2.0f, - (sourcePoly[0].Y + sourcePoly[^1].Y) / 2.0f, typeDirection.down1, false, false, typeVertex.center); - - // Figure out our rounding characteristics. - - // First edge is always vertical, left facing. - bool left = true; - bool up = false; - - for (int pt = 1; pt < roundCount - 1; pt++) - { - // Link to our vertical/horizontal edges - round1[pt].index = vertexCounter; - if (pt % 2 == 1) - { - round1[pt].verFace = vertexCounter - 1; - round1[pt].horFace = vertexCounter + 1; - } - else - { - round1[pt].verFace = vertexCounter + 1; - round1[pt].horFace = vertexCounter - 1; - } - - // Register our corner point into the vertex array. - Vertex[vertexCounter] = new MyVertex(sourcePoly[pt].X, sourcePoly[pt].Y, typeDirection.tilt1, false, false, typeVertex.corner); - vertexCounter++; - - // Now we have to wrangle the midpoint. - - int next = (pt + 1) % sourcePoly.Length; // wrap to polygon length - - // Find the normal for the edge to the next point. - - double dx = sourcePoly[next].X - sourcePoly[pt].X; - double dy = sourcePoly[next].Y - sourcePoly[pt].Y; - - // Set up our midpoint for convenience. - GeoLibPointF midPt = new(sourcePoly[pt].X + dx / 2.0f, sourcePoly[pt].Y + dy / 2.0f); - - // The normal, to match convention in the distance calculation is assessed from this point to the next point. - - // Get average angle for this vertex based on angles from line segments. - // http://stackoverflow.com/questions/1243614/how-do-i-calculate-the-normal-vector-of-a-line-segmen - GeoLibPointF normalPt = new(-dy, dx); - - // Vertical edge has a normal with an X value non-zero and Y value ~0. - // treating a 0.01 difference as being ~0 - bool vertical = Math.Abs(normalPt.X) > 0.01; - - // Assess the normal to establish direction - if (vertical) - { - // left facing vertical edge has normal with negative X value. - left = normalPt.X < 0; - } - else - { - // down facing horizontal edge has normal with negative Y value. - up = !(normalPt.Y < 0); - } - - if (!vertical) - { - if (up) - { - Vertex[vertexCounter] = new MyVertex(midPt.X, midPt.Y, typeDirection.up1, vertical, false, typeVertex.center); - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.T || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TB || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.all) - { - tips[vertexCounter] = true; - } - } - else - { - Vertex[vertexCounter] = new MyVertex(midPt.X, midPt.Y, typeDirection.down1, vertical, false, typeVertex.center); - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.B || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TB || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.all) - { - tips[vertexCounter] = true; - } - } - } - else - { - if (left) - { - Vertex[vertexCounter] = new MyVertex(midPt.X, midPt.Y, typeDirection.left1, vertical, false, typeVertex.center); - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.L || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.LR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBL || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.all) - { - tips[vertexCounter] = true; - } - } - else - { - Vertex[vertexCounter] = new MyVertex(midPt.X, midPt.Y, typeDirection.right1, vertical, false, typeVertex.center); - if (layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.R || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.LR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TBR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.BLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.TLR || - layerSettings.getInt(EntropyLayerSettings.properties_i.shape0Tip) == (int)CommonVars.tipLocations.all) - { - tips[vertexCounter] = true; - } - } - } - vertexCounter++; - } - - // Reprocess our corners for inner/outer rounding based on horFace/verFace directions -#if !SHAPELIBSINGLETHREADED - Parallel.For(0, roundCount, pt => -#else - for (int pt = 0; pt < roundCount; pt++) -#endif - { - // Only certain changes in direction correspond to an outer vertex, for a clockwise ordered series of points. - bool outerVertex = pt == 0 || pt == round1.Length - 1 || - round1[pt].verFace < round1[pt].horFace && Vertex[round1[pt].verFace].direction == typeDirection.left1 && Vertex[round1[pt].horFace].direction == typeDirection.up1 || - round1[pt].verFace > round1[pt].horFace && Vertex[round1[pt].horFace].direction == typeDirection.up1 && Vertex[round1[pt].verFace].direction == typeDirection.right1 || - round1[pt].verFace < round1[pt].horFace && Vertex[round1[pt].verFace].direction == typeDirection.right1 && Vertex[round1[pt].horFace].direction == typeDirection.down1 || - round1[pt].verFace > round1[pt].horFace && Vertex[round1[pt].horFace].direction == typeDirection.down1 && Vertex[round1[pt].verFace].direction == typeDirection.left1; - - if (outerVertex) - { - round1[pt].direction = typeRound.exter; - round1[pt].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.oCR)); - } - else - { - round1[pt].direction = typeRound.inner; - round1[pt].MaxRadius = Convert.ToDouble(layerSettings.getDecimal(EntropyLayerSettings.properties_decimal.iCR)); - } - - Vertex[round1[pt].index].inner = !outerVertex; - } -#if !SHAPELIBSINGLETHREADED - ); -#endif - } -} \ No newline at end of file diff --git a/Common/Variance/support/simulationPreview.cs b/Common/Variance/support/simulationPreview.cs index c606e06..fb55d99 100644 --- a/Common/Variance/support/simulationPreview.cs +++ b/Common/Variance/support/simulationPreview.cs @@ -87,78 +87,6 @@ private string pGetResult() return resultText; } - // ReSharper disable once UnusedMember.Local - private void doOffsets(EntropyLayerSettings entropyLayerSettings) - { - // OK. Now we need to pay attention to the subshape reference settings. - /* - * 0: Top left - * 1: Top right - * 2: Bottom left - * 3: Bottom right - * 4: Top middle - * 5: Right middle - * 6: Bottom middle - * 7: Left middle - * 8: Center center - */ - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TL || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TR || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.RS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.LS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.C) - { - // Vertical offset needed to put reference corner at world center - // Our coordinates have placed bottom left at 0,0 so negative offsets needed (note origin comment above) - // Find our subshape reference. - int tmp_yOffset = Convert.ToInt32(entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0 ? entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0VerLength) : entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1VerLength)); - - // Half the value for a vertical centering requirement - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.RS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.LS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.C) - { - tmp_yOffset = Convert.ToInt32(tmp_yOffset / 2); - } - } - - // Coordinates placed bottom left at 0,0. - int tmp_xOffset = 0; - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 1) - { - tmp_xOffset = -1 * Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - } - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TR || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.BR || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.RS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.BS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.C) - { - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.subShapeIndex) == 0) - { - tmp_xOffset -= Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s0HorLength)); - } - else - { - tmp_xOffset -= Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.s1HorLength)); - } - - // Half the value for horizontal centering conditions - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.TS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.BS || - entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.posIndex) == (int)CommonVars.subShapeLocations.C) - { - tmp_xOffset = Convert.ToInt32(tmp_xOffset / 2); - } - } - - // Now for global offset. - Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gHorOffset)); - Convert.ToInt32(entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.gVerOffset)); - } - public SimulationPreview(ref VarianceContext varianceContext) { pSimulationPreview(ref varianceContext); diff --git a/Common/Variance/support/utilityFuncs.cs b/Common/Variance/support/utilityFuncs.cs index 62dfc52..f481615 100644 --- a/Common/Variance/support/utilityFuncs.cs +++ b/Common/Variance/support/utilityFuncs.cs @@ -280,7 +280,7 @@ private static bool pReadiDRMCSVFile(ref CommonVars commonVars, string fileName) { // Assuming Pass/Fail,Column,Row,Co-ord X,Co-ord Y,,,,,,,,,,,,, tempString = sr.ReadLine(); - parsedString = tempString.Split(csvSeparators); + parsedString = tempString!.Split(csvSeparators); if (parsedString[0] == "" || parsedString[0] == "Occupy matrix") { break; @@ -337,7 +337,7 @@ private static bool pReadQuiltCSVFile(ref CommonVars commonVars, string fileName } // Now we have the meat of the data we need. string tempString = sr.ReadLine(); - string[] parsedString = tempString.Split(csvSeparators); + string[] parsedString = tempString!.Split(csvSeparators); if (parsedString.Length >= 6) { // We have 6 values to extract from this line. diff --git a/Common/Variance_hl/Variance_hl.csproj b/Common/Variance_hl/Variance_hl.csproj index 026cb95..540f8cd 100644 --- a/Common/Variance_hl/Variance_hl.csproj +++ b/Common/Variance_hl/Variance_hl.csproj @@ -34,18 +34,6 @@ DOE\DOESettings.cs - - engines\angleHandler.cs - - - engines\areaHandler.cs - - - engines\chordHandler.cs - - - engines\distanceHandler.cs - entropy\entropy.cs @@ -94,9 +82,6 @@ support\commonVars.cs - - support\Email.cs - support\nonSimulationSettings.cs @@ -106,9 +91,6 @@ support\replay.cs - - support\shapeLibrary.cs - support\simpleAES.cs @@ -118,9 +100,6 @@ support\Storage.cs - - support\SVGBuilder.cs - support\utilityFuncs.cs @@ -134,10 +113,12 @@ {576cba59-f35e-4f45-905c-26927e2e441a} color + {663a7d25-5255-4b85-b94d-53c431426339} entropyRNG + {87c2783d-ac80-4684-875c-f06237e9cc3f} @@ -150,16 +131,17 @@ + + {c3255560-6437-4eff-8948-971a76c6e9ab} utility - - + diff --git a/Directory.Build.props b/Directory.Build.props index 95a6117..4144991 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,7 +21,7 @@ files avoids problems with generated AssemblyInfo, among other benefits. --> $(ArtifactsDir)bin\$(MSBuildProjectName)\ - 1.0.14 + 1.0.15 @@ -35,7 +35,7 @@ - osx-x64 + osx-arm64 libveldrid-spirv.dylib diff --git a/Documentation/ilb_testcase_images/003_001.png b/Documentation/ilb_testcase_images/003_001.png index f99a804..173829e 100644 Binary files a/Documentation/ilb_testcase_images/003_001.png and b/Documentation/ilb_testcase_images/003_001.png differ diff --git a/Documentation/ilb_testcase_images/003_002.png b/Documentation/ilb_testcase_images/003_002.png index 4d61060..bcbb963 100644 Binary files a/Documentation/ilb_testcase_images/003_002.png and b/Documentation/ilb_testcase_images/003_002.png differ diff --git a/Documentation/ilb_testcase_images/004_001.png b/Documentation/ilb_testcase_images/004_001.png index 4ffc50e..2d60768 100644 Binary files a/Documentation/ilb_testcase_images/004_001.png and b/Documentation/ilb_testcase_images/004_001.png differ diff --git a/Documentation/ilb_testcase_images/004_002.png b/Documentation/ilb_testcase_images/004_002.png index 62e8409..cac3392 100644 Binary files a/Documentation/ilb_testcase_images/004_002.png and b/Documentation/ilb_testcase_images/004_002.png differ diff --git a/Documentation/ilb_testcase_images/005_001.png b/Documentation/ilb_testcase_images/005_001.png index 1441d83..3f65012 100644 Binary files a/Documentation/ilb_testcase_images/005_001.png and b/Documentation/ilb_testcase_images/005_001.png differ diff --git a/Documentation/ilb_testcase_images/005_002.png b/Documentation/ilb_testcase_images/005_002.png index 0810d58..5830cb5 100644 Binary files a/Documentation/ilb_testcase_images/005_002.png and b/Documentation/ilb_testcase_images/005_002.png differ diff --git a/Documentation/ilb_testcase_images/006_001.png b/Documentation/ilb_testcase_images/006_001.png index 705d5a6..300d659 100644 Binary files a/Documentation/ilb_testcase_images/006_001.png and b/Documentation/ilb_testcase_images/006_001.png differ diff --git a/Documentation/ilb_testcase_images/006_002.png b/Documentation/ilb_testcase_images/006_002.png index 801a9c7..1982d51 100644 Binary files a/Documentation/ilb_testcase_images/006_002.png and b/Documentation/ilb_testcase_images/006_002.png differ diff --git a/Documentation/ilb_testcase_images/006_003.png b/Documentation/ilb_testcase_images/006_003.png index 7b49419..c571e3f 100644 Binary files a/Documentation/ilb_testcase_images/006_003.png and b/Documentation/ilb_testcase_images/006_003.png differ diff --git a/Documentation/ilb_testcase_images/007_001.png b/Documentation/ilb_testcase_images/007_001.png index c937b42..f7690da 100644 Binary files a/Documentation/ilb_testcase_images/007_001.png and b/Documentation/ilb_testcase_images/007_001.png differ diff --git a/Documentation/ilb_testcase_images/007_002.png b/Documentation/ilb_testcase_images/007_002.png index 72faabd..346a43b 100644 Binary files a/Documentation/ilb_testcase_images/007_002.png and b/Documentation/ilb_testcase_images/007_002.png differ diff --git a/Documentation/ilb_testcase_images/007_003.png b/Documentation/ilb_testcase_images/007_003.png index 759687e..2e6e83d 100644 Binary files a/Documentation/ilb_testcase_images/007_003.png and b/Documentation/ilb_testcase_images/007_003.png differ diff --git a/Documentation/ilb_testcase_images/008_001.png b/Documentation/ilb_testcase_images/008_001.png index 454297f..2f22391 100644 Binary files a/Documentation/ilb_testcase_images/008_001.png and b/Documentation/ilb_testcase_images/008_001.png differ diff --git a/Documentation/ilb_testcase_images/009_001.png b/Documentation/ilb_testcase_images/009_001.png index 44f2300..9e6596c 100644 Binary files a/Documentation/ilb_testcase_images/009_001.png and b/Documentation/ilb_testcase_images/009_001.png differ diff --git a/Documentation/ilb_testcase_images/009_002.png b/Documentation/ilb_testcase_images/009_002.png index 3f8cbd0..0321335 100644 Binary files a/Documentation/ilb_testcase_images/009_002.png and b/Documentation/ilb_testcase_images/009_002.png differ diff --git a/Documentation/ilb_testcase_images/010_001.png b/Documentation/ilb_testcase_images/010_001.png index b5a5d12..d28143a 100644 Binary files a/Documentation/ilb_testcase_images/010_001.png and b/Documentation/ilb_testcase_images/010_001.png differ diff --git a/Documentation/ilb_testcase_images/010b_001.png b/Documentation/ilb_testcase_images/010b_001.png index 0d587ea..d121d67 100644 Binary files a/Documentation/ilb_testcase_images/010b_001.png and b/Documentation/ilb_testcase_images/010b_001.png differ diff --git a/Documentation/ilb_testcase_images/011_001.png b/Documentation/ilb_testcase_images/011_001.png index 6ba0fd3..286b5e1 100644 Binary files a/Documentation/ilb_testcase_images/011_001.png and b/Documentation/ilb_testcase_images/011_001.png differ diff --git a/Documentation/ilb_testcase_images/011_002.png b/Documentation/ilb_testcase_images/011_002.png index 4b7bba3..ec8522d 100644 Binary files a/Documentation/ilb_testcase_images/011_002.png and b/Documentation/ilb_testcase_images/011_002.png differ diff --git a/Documentation/ilb_testcase_images/012_001.png b/Documentation/ilb_testcase_images/012_001.png index 736d45c..fc4f2e8 100644 Binary files a/Documentation/ilb_testcase_images/012_001.png and b/Documentation/ilb_testcase_images/012_001.png differ diff --git a/Documentation/ilb_testcase_images/012_002.png b/Documentation/ilb_testcase_images/012_002.png index 7044d7c..6fd215c 100644 Binary files a/Documentation/ilb_testcase_images/012_002.png and b/Documentation/ilb_testcase_images/012_002.png differ diff --git a/Documentation/ilb_testcase_images/012_003.png b/Documentation/ilb_testcase_images/012_003.png index 9e7ed2d..8413435 100644 Binary files a/Documentation/ilb_testcase_images/012_003.png and b/Documentation/ilb_testcase_images/012_003.png differ diff --git a/Documentation/ilb_testcase_images/012_004.png b/Documentation/ilb_testcase_images/012_004.png index 4ac21e4..7127849 100644 Binary files a/Documentation/ilb_testcase_images/012_004.png and b/Documentation/ilb_testcase_images/012_004.png differ diff --git a/Documentation/ilb_testcase_images/013_001.png b/Documentation/ilb_testcase_images/013_001.png index 29084e2..d5fd12f 100644 Binary files a/Documentation/ilb_testcase_images/013_001.png and b/Documentation/ilb_testcase_images/013_001.png differ diff --git a/Documentation/ilb_testcase_images/013_002.png b/Documentation/ilb_testcase_images/013_002.png index 5c3890f..da64539 100644 Binary files a/Documentation/ilb_testcase_images/013_002.png and b/Documentation/ilb_testcase_images/013_002.png differ diff --git a/Documentation/ilb_testcase_images/014_001.png b/Documentation/ilb_testcase_images/014_001.png index 1485bc4..37472d4 100644 Binary files a/Documentation/ilb_testcase_images/014_001.png and b/Documentation/ilb_testcase_images/014_001.png differ diff --git a/Documentation/ilb_testcase_images/014_002.png b/Documentation/ilb_testcase_images/014_002.png index a079413..c71609c 100644 Binary files a/Documentation/ilb_testcase_images/014_002.png and b/Documentation/ilb_testcase_images/014_002.png differ diff --git a/Documentation/ilb_testcase_images/015_001.png b/Documentation/ilb_testcase_images/015_001.png index 622067a..3cb7def 100644 Binary files a/Documentation/ilb_testcase_images/015_001.png and b/Documentation/ilb_testcase_images/015_001.png differ diff --git a/Documentation/ilb_testcase_images/015_002.png b/Documentation/ilb_testcase_images/015_002.png index 7a689ee..b78e7b4 100644 Binary files a/Documentation/ilb_testcase_images/015_002.png and b/Documentation/ilb_testcase_images/015_002.png differ diff --git a/Documentation/ilb_testcase_images/015_003.png b/Documentation/ilb_testcase_images/015_003.png index b8b238a..56a5aaa 100644 Binary files a/Documentation/ilb_testcase_images/015_003.png and b/Documentation/ilb_testcase_images/015_003.png differ diff --git a/Documentation/ilb_testcase_images/016_001.png b/Documentation/ilb_testcase_images/016_001.png index c15c007..564a65c 100644 Binary files a/Documentation/ilb_testcase_images/016_001.png and b/Documentation/ilb_testcase_images/016_001.png differ diff --git a/Documentation/ilb_testcase_images/016_002.png b/Documentation/ilb_testcase_images/016_002.png index 141ddb3..f7c8b61 100644 Binary files a/Documentation/ilb_testcase_images/016_002.png and b/Documentation/ilb_testcase_images/016_002.png differ diff --git a/Documentation/ilb_testcase_images/016_003.png b/Documentation/ilb_testcase_images/016_003.png index fb6d612..52f0370 100644 Binary files a/Documentation/ilb_testcase_images/016_003.png and b/Documentation/ilb_testcase_images/016_003.png differ diff --git a/Documentation/ilb_testcase_images/017_001.png b/Documentation/ilb_testcase_images/017_001.png index 2ba723d..ee91b9c 100644 Binary files a/Documentation/ilb_testcase_images/017_001.png and b/Documentation/ilb_testcase_images/017_001.png differ diff --git a/Documentation/ilb_testcase_images/017_002.png b/Documentation/ilb_testcase_images/017_002.png index d8b4daf..063acc6 100644 Binary files a/Documentation/ilb_testcase_images/017_002.png and b/Documentation/ilb_testcase_images/017_002.png differ diff --git a/Documentation/ilb_testcase_images/017_003.png b/Documentation/ilb_testcase_images/017_003.png index 597cc98..33be3e9 100644 Binary files a/Documentation/ilb_testcase_images/017_003.png and b/Documentation/ilb_testcase_images/017_003.png differ diff --git a/Documentation/ilb_testcase_images/018_001.png b/Documentation/ilb_testcase_images/018_001.png index 1aadb7c..533ab47 100644 Binary files a/Documentation/ilb_testcase_images/018_001.png and b/Documentation/ilb_testcase_images/018_001.png differ diff --git a/Documentation/ilb_testcase_images/018_002.png b/Documentation/ilb_testcase_images/018_002.png index 7e7fb10..885ccf5 100644 Binary files a/Documentation/ilb_testcase_images/018_002.png and b/Documentation/ilb_testcase_images/018_002.png differ diff --git a/Documentation/ilb_testcase_images/018_003.png b/Documentation/ilb_testcase_images/018_003.png index 14be568..ce7c059 100644 Binary files a/Documentation/ilb_testcase_images/018_003.png and b/Documentation/ilb_testcase_images/018_003.png differ diff --git a/Documentation/ilb_testcase_images/018_004.png b/Documentation/ilb_testcase_images/018_004.png index 481196b..6cecfb7 100644 Binary files a/Documentation/ilb_testcase_images/018_004.png and b/Documentation/ilb_testcase_images/018_004.png differ diff --git a/Documentation/ilb_testcase_images/sim001_001.png b/Documentation/ilb_testcase_images/sim001_001.png index 8abcb16..c3a5698 100644 Binary files a/Documentation/ilb_testcase_images/sim001_001.png and b/Documentation/ilb_testcase_images/sim001_001.png differ diff --git a/Documentation/ilb_testcase_images/sim001_002.png b/Documentation/ilb_testcase_images/sim001_002.png index 98dbd93..3526b1b 100644 Binary files a/Documentation/ilb_testcase_images/sim001_002.png and b/Documentation/ilb_testcase_images/sim001_002.png differ diff --git a/Documentation/ilb_testcase_images/sim002_001.png b/Documentation/ilb_testcase_images/sim002_001.png index 4a849df..be8d241 100644 Binary files a/Documentation/ilb_testcase_images/sim002_001.png and b/Documentation/ilb_testcase_images/sim002_001.png differ diff --git a/Documentation/ilb_testcase_images/sim002_002.png b/Documentation/ilb_testcase_images/sim002_002.png index 6c89c4b..74f327c 100644 Binary files a/Documentation/ilb_testcase_images/sim002_002.png and b/Documentation/ilb_testcase_images/sim002_002.png differ diff --git a/Documentation/images/1d.png b/Documentation/images/1d.png index 136d39b..b8b7272 100644 Binary files a/Documentation/images/1d.png and b/Documentation/images/1d.png differ diff --git a/Documentation/images/Eto_450_WPF.png b/Documentation/images/Eto_450_WPF.png new file mode 100644 index 0000000..b613dc9 Binary files /dev/null and b/Documentation/images/Eto_450_WPF.png differ diff --git a/Documentation/images/Eto_450_WPF_2.png b/Documentation/images/Eto_450_WPF_2.png new file mode 100644 index 0000000..874376d Binary files /dev/null and b/Documentation/images/Eto_450_WPF_2.png differ diff --git a/Documentation/images/Eto_500_Gtk.png b/Documentation/images/Eto_500_Gtk.png new file mode 100644 index 0000000..9983632 Binary files /dev/null and b/Documentation/images/Eto_500_Gtk.png differ diff --git a/Documentation/images/Eto_500_Gtk_2.png b/Documentation/images/Eto_500_Gtk_2.png new file mode 100644 index 0000000..abd3557 Binary files /dev/null and b/Documentation/images/Eto_500_Gtk_2.png differ diff --git a/Documentation/images/Eto_500_WPF.png b/Documentation/images/Eto_500_WPF.png new file mode 100644 index 0000000..1b22169 Binary files /dev/null and b/Documentation/images/Eto_500_WPF.png differ diff --git a/Documentation/images/Eto_500_WPF_2.png b/Documentation/images/Eto_500_WPF_2.png new file mode 100644 index 0000000..2aef393 Binary files /dev/null and b/Documentation/images/Eto_500_WPF_2.png differ diff --git a/Documentation/images/Lshape.png b/Documentation/images/Lshape.png index bc46497..2d9e7f6 100644 Binary files a/Documentation/images/Lshape.png and b/Documentation/images/Lshape.png differ diff --git a/Documentation/images/Sshape.png b/Documentation/images/Sshape.png index 52a6708..96b3cfb 100644 Binary files a/Documentation/images/Sshape.png and b/Documentation/images/Sshape.png differ diff --git a/Documentation/images/T_EdgeSlide_015.png b/Documentation/images/T_EdgeSlide_015.png index ee5f288..d172d3a 100644 Binary files a/Documentation/images/T_EdgeSlide_015.png and b/Documentation/images/T_EdgeSlide_015.png differ diff --git a/Documentation/images/T_EdgeSlide_035.png b/Documentation/images/T_EdgeSlide_035.png index 8e0c4f9..6c88e03 100644 Binary files a/Documentation/images/T_EdgeSlide_035.png and b/Documentation/images/T_EdgeSlide_035.png differ diff --git a/Documentation/images/T_noEdgeSlide.png b/Documentation/images/T_noEdgeSlide.png index 05e4559..e937fea 100644 Binary files a/Documentation/images/T_noEdgeSlide.png and b/Documentation/images/T_noEdgeSlide.png differ diff --git a/Documentation/images/Tshape.png b/Documentation/images/Tshape.png index 8fa45be..1e0bc1a 100644 Binary files a/Documentation/images/Tshape.png and b/Documentation/images/Tshape.png differ diff --git a/Documentation/images/Ushape.png b/Documentation/images/Ushape.png index 2610e96..39e0da6 100644 Binary files a/Documentation/images/Ushape.png and b/Documentation/images/Ushape.png differ diff --git a/Documentation/images/Xshape.png b/Documentation/images/Xshape.png index 6c365f6..c4eeee5 100644 Binary files a/Documentation/images/Xshape.png and b/Documentation/images/Xshape.png differ diff --git a/Documentation/images/angleCalc_1.png b/Documentation/images/angleCalc_1.png index 9467023..58974d3 100644 Binary files a/Documentation/images/angleCalc_1.png and b/Documentation/images/angleCalc_1.png differ diff --git a/Documentation/images/angleCalc_2.png b/Documentation/images/angleCalc_2.png index ef08ef3..14c26fa 100644 Binary files a/Documentation/images/angleCalc_2.png and b/Documentation/images/angleCalc_2.png differ diff --git a/Documentation/images/areaCalc_1.png b/Documentation/images/areaCalc_1.png index 7552e54..ae5b983 100644 Binary files a/Documentation/images/areaCalc_1.png and b/Documentation/images/areaCalc_1.png differ diff --git a/Documentation/images/areaCalc_2.png b/Documentation/images/areaCalc_2.png index ed414c9..7bea022 100644 Binary files a/Documentation/images/areaCalc_2.png and b/Documentation/images/areaCalc_2.png differ diff --git a/Documentation/images/backgroundLayers.png b/Documentation/images/backgroundLayers.png index f56863d..cbefa27 100644 Binary files a/Documentation/images/backgroundLayers.png and b/Documentation/images/backgroundLayers.png differ diff --git a/Documentation/images/biasGDS.png b/Documentation/images/biasGDS.png index 95e6233..0ca05a1 100644 Binary files a/Documentation/images/biasGDS.png and b/Documentation/images/biasGDS.png differ diff --git a/Documentation/images/biasGDS_area.png b/Documentation/images/biasGDS_area.png index a3f3d89..105df04 100644 Binary files a/Documentation/images/biasGDS_area.png and b/Documentation/images/biasGDS_area.png differ diff --git a/Documentation/images/chordCalc_1.png b/Documentation/images/chordCalc_1.png index e0f27ad..7884913 100644 Binary files a/Documentation/images/chordCalc_1.png and b/Documentation/images/chordCalc_1.png differ diff --git a/Documentation/images/chordCalc_2.png b/Documentation/images/chordCalc_2.png index f4bc654..04940f0 100644 Binary files a/Documentation/images/chordCalc_2.png and b/Documentation/images/chordCalc_2.png differ diff --git a/Documentation/images/chordCalc_3.png b/Documentation/images/chordCalc_3.png index 0421e82..03ebe8b 100644 Binary files a/Documentation/images/chordCalc_3.png and b/Documentation/images/chordCalc_3.png differ diff --git a/Documentation/images/chordCalc_4.png b/Documentation/images/chordCalc_4.png index 68bf33e..a3fe65c 100644 Binary files a/Documentation/images/chordCalc_4.png and b/Documentation/images/chordCalc_4.png differ diff --git a/Documentation/images/contextmenu.png b/Documentation/images/contextmenu.png index bf60ef6..de92092 100644 Binary files a/Documentation/images/contextmenu.png and b/Documentation/images/contextmenu.png differ diff --git a/Documentation/images/custom_RNG.png b/Documentation/images/custom_RNG.png index 51a2aa8..a37de45 100644 Binary files a/Documentation/images/custom_RNG.png and b/Documentation/images/custom_RNG.png differ diff --git a/Documentation/images/custom_RNG_applied.png b/Documentation/images/custom_RNG_applied.png index 85aeb69..74677e0 100644 Binary files a/Documentation/images/custom_RNG_applied.png and b/Documentation/images/custom_RNG_applied.png differ diff --git a/Documentation/images/custom_RNG_menu.png b/Documentation/images/custom_RNG_menu.png index 657787e..755962b 100644 Binary files a/Documentation/images/custom_RNG_menu.png and b/Documentation/images/custom_RNG_menu.png differ diff --git a/Documentation/images/distanceCalc_1.png b/Documentation/images/distanceCalc_1.png index b6e1009..3d35880 100644 Binary files a/Documentation/images/distanceCalc_1.png and b/Documentation/images/distanceCalc_1.png differ diff --git a/Documentation/images/distanceCalc_2.png b/Documentation/images/distanceCalc_2.png index 6535819..627c3a0 100644 Binary files a/Documentation/images/distanceCalc_2.png and b/Documentation/images/distanceCalc_2.png differ diff --git a/Documentation/images/distanceCalc_Filtering.png b/Documentation/images/distanceCalc_Filtering.png index 2e820b2..afab3f8 100644 Binary files a/Documentation/images/distanceCalc_Filtering.png and b/Documentation/images/distanceCalc_Filtering.png differ diff --git a/Documentation/images/distanceCalc_enclosure.png b/Documentation/images/distanceCalc_enclosure.png index 5f80c05..64802bb 100644 Binary files a/Documentation/images/distanceCalc_enclosure.png and b/Documentation/images/distanceCalc_enclosure.png differ diff --git a/Documentation/images/distanceCalc_enclosure_overlap.png b/Documentation/images/distanceCalc_enclosure_overlap.png index 9c3fda7..ec7728e 100644 Binary files a/Documentation/images/distanceCalc_enclosure_overlap.png and b/Documentation/images/distanceCalc_enclosure_overlap.png differ diff --git a/Documentation/images/distanceCalc_wrongOrder.png b/Documentation/images/distanceCalc_wrongOrder.png index da213d7..eac35b1 100644 Binary files a/Documentation/images/distanceCalc_wrongOrder.png and b/Documentation/images/distanceCalc_wrongOrder.png differ diff --git a/Documentation/images/distanceCalc_wrongOrder_shortestEdge.png b/Documentation/images/distanceCalc_wrongOrder_shortestEdge.png index 0e0334d..0d10fef 100644 Binary files a/Documentation/images/distanceCalc_wrongOrder_shortestEdge.png and b/Documentation/images/distanceCalc_wrongOrder_shortestEdge.png differ diff --git a/Documentation/images/filled_geometry.png b/Documentation/images/filled_geometry.png index 7552e54..69275d1 100644 Binary files a/Documentation/images/filled_geometry.png and b/Documentation/images/filled_geometry.png differ diff --git a/Documentation/images/flippedH_center.png b/Documentation/images/flippedH_center.png index 55ad1bd..6b34e57 100644 Binary files a/Documentation/images/flippedH_center.png and b/Documentation/images/flippedH_center.png differ diff --git a/Documentation/images/flipped_nocenter.png b/Documentation/images/flipped_nocenter.png index 3ea8a46..6e5062f 100644 Binary files a/Documentation/images/flipped_nocenter.png and b/Documentation/images/flipped_nocenter.png differ diff --git a/Documentation/images/gds.png b/Documentation/images/gds.png index 7593ad3..9540f4e 100644 Binary files a/Documentation/images/gds.png and b/Documentation/images/gds.png differ diff --git a/Documentation/images/gdsDOE_1.png b/Documentation/images/gdsDOE_1.png index 2dd2af0..1ca035f 100644 Binary files a/Documentation/images/gdsDOE_1.png and b/Documentation/images/gdsDOE_1.png differ diff --git a/Documentation/images/gdsDOE_2.png b/Documentation/images/gdsDOE_2.png index e46d3f0..e05496b 100644 Binary files a/Documentation/images/gdsDOE_2.png and b/Documentation/images/gdsDOE_2.png differ diff --git a/Documentation/images/gdsDOE_3.png b/Documentation/images/gdsDOE_3.png index 366bb63..98caad0 100644 Binary files a/Documentation/images/gdsDOE_3.png and b/Documentation/images/gdsDOE_3.png differ diff --git a/Documentation/images/gds_contour.png b/Documentation/images/gds_contour.png index 2c0f198..962c305 100644 Binary files a/Documentation/images/gds_contour.png and b/Documentation/images/gds_contour.png differ diff --git a/Documentation/images/gds_contour_merging.png b/Documentation/images/gds_contour_merging.png index 4b2d226..fb432e3 100644 Binary files a/Documentation/images/gds_contour_merging.png and b/Documentation/images/gds_contour_merging.png differ diff --git a/Documentation/images/gds_contour_path.png b/Documentation/images/gds_contour_path.png index 3039f35..b40e070 100644 Binary files a/Documentation/images/gds_contour_path.png and b/Documentation/images/gds_contour_path.png differ diff --git a/Documentation/images/geometric_equation.png b/Documentation/images/geometric_equation.png index 69cb41c..8754db7 100644 Binary files a/Documentation/images/geometric_equation.png and b/Documentation/images/geometric_equation.png differ diff --git a/Documentation/images/ilb_12bg.png b/Documentation/images/ilb_12bg.png index 3e4e90c..ab6c9ad 100644 Binary files a/Documentation/images/ilb_12bg.png and b/Documentation/images/ilb_12bg.png differ diff --git a/Documentation/images/ilb_3.png b/Documentation/images/ilb_3.png index 3c3a951..6f85446 100644 Binary files a/Documentation/images/ilb_3.png and b/Documentation/images/ilb_3.png differ diff --git a/Documentation/images/ilb_ler.png b/Documentation/images/ilb_ler.png index 3202ffa..7ec9f64 100644 Binary files a/Documentation/images/ilb_ler.png and b/Documentation/images/ilb_ler.png differ diff --git a/Documentation/images/ilb_noOmit12.PNG b/Documentation/images/ilb_noOmit12.PNG index 8acf015..6f56526 100644 Binary files a/Documentation/images/ilb_noOmit12.PNG and b/Documentation/images/ilb_noOmit12.PNG differ diff --git a/Documentation/images/ilb_omit12.png b/Documentation/images/ilb_omit12.png index 20e39f3..d89e186 100644 Binary files a/Documentation/images/ilb_omit12.png and b/Documentation/images/ilb_omit12.png differ diff --git a/Documentation/images/ilb_tip_proxBias.PNG b/Documentation/images/ilb_tip_proxBias.PNG index 1dbdd41..5f0f01f 100644 Binary files a/Documentation/images/ilb_tip_proxBias.PNG and b/Documentation/images/ilb_tip_proxBias.PNG differ diff --git a/Documentation/images/implant.png b/Documentation/images/implant.png index 239fb62..8ae1a94 100644 Binary files a/Documentation/images/implant.png and b/Documentation/images/implant.png differ diff --git a/Documentation/images/keyhole_fail.PNG b/Documentation/images/keyhole_fail.PNG deleted file mode 100644 index 93b08e4..0000000 Binary files a/Documentation/images/keyhole_fail.PNG and /dev/null differ diff --git a/Documentation/images/keyhole_fix.PNG b/Documentation/images/keyhole_fix.PNG index a39f89f..f044a4d 100644 Binary files a/Documentation/images/keyhole_fix.PNG and b/Documentation/images/keyhole_fix.PNG differ diff --git a/Documentation/images/layerSettings_1.png b/Documentation/images/layerSettings_1.png index 1b50a9b..1b22169 100644 Binary files a/Documentation/images/layerSettings_1.png and b/Documentation/images/layerSettings_1.png differ diff --git a/Documentation/images/layerSettings_2.png b/Documentation/images/layerSettings_2.png index 01d7bd5..63601f7 100644 Binary files a/Documentation/images/layerSettings_2.png and b/Documentation/images/layerSettings_2.png differ diff --git a/Documentation/images/layerSettings_3.png b/Documentation/images/layerSettings_3.png index d69daff..6e1910a 100644 Binary files a/Documentation/images/layerSettings_3.png and b/Documentation/images/layerSettings_3.png differ diff --git a/Documentation/images/layerSettings_4.png b/Documentation/images/layerSettings_4.png index 62c016a..87a0be3 100644 Binary files a/Documentation/images/layerSettings_4.png and b/Documentation/images/layerSettings_4.png differ diff --git a/Documentation/images/layerSettings_biasEtch.png b/Documentation/images/layerSettings_biasEtch.png index 2ac2459..e8428cc 100644 Binary files a/Documentation/images/layerSettings_biasEtch.png and b/Documentation/images/layerSettings_biasEtch.png differ diff --git a/Documentation/images/layerSettings_layoutOrigin.png b/Documentation/images/layerSettings_layoutOrigin.png index 59bdbc8..c3b3562 100644 Binary files a/Documentation/images/layerSettings_layoutOrigin.png and b/Documentation/images/layerSettings_layoutOrigin.png differ diff --git a/Documentation/images/layerSettings_rotation.png b/Documentation/images/layerSettings_rotation.png index 49c03e5..4276899 100644 Binary files a/Documentation/images/layerSettings_rotation.png and b/Documentation/images/layerSettings_rotation.png differ diff --git a/Documentation/images/layerSettings_subShapes.png b/Documentation/images/layerSettings_subShapes.png index bc46497..2d9e7f6 100644 Binary files a/Documentation/images/layerSettings_subShapes.png and b/Documentation/images/layerSettings_subShapes.png differ diff --git a/Documentation/images/layerSettings_tips.png b/Documentation/images/layerSettings_tips.png index aab5ede..93f2551 100644 Binary files a/Documentation/images/layerSettings_tips.png and b/Documentation/images/layerSettings_tips.png differ diff --git a/Documentation/images/layerSettings_tips_2.png b/Documentation/images/layerSettings_tips_2.png index 3c810c3..54f472e 100644 Binary files a/Documentation/images/layerSettings_tips_2.png and b/Documentation/images/layerSettings_tips_2.png differ diff --git a/Documentation/images/layout_export_1.png b/Documentation/images/layout_export_1.png index 656a75e..638858a 100644 Binary files a/Documentation/images/layout_export_1.png and b/Documentation/images/layout_export_1.png differ diff --git a/Documentation/images/lens_k1_0_k2_3.png b/Documentation/images/lens_k1_0_k2_3.png index a674bcc..c71dc78 100644 Binary files a/Documentation/images/lens_k1_0_k2_3.png and b/Documentation/images/lens_k1_0_k2_3.png differ diff --git a/Documentation/images/lens_k1_1.3_k2_0.png b/Documentation/images/lens_k1_1.3_k2_0.png index bc11f5f..a54f4d8 100644 Binary files a/Documentation/images/lens_k1_1.3_k2_0.png and b/Documentation/images/lens_k1_1.3_k2_0.png differ diff --git a/Documentation/images/lens_k1_1.3_k2_3.png b/Documentation/images/lens_k1_1.3_k2_3.png index a0f4313..1d4069f 100644 Binary files a/Documentation/images/lens_k1_1.3_k2_3.png and b/Documentation/images/lens_k1_1.3_k2_3.png differ diff --git a/Documentation/images/ler_preview_opensimplex.png b/Documentation/images/ler_preview_opensimplex.png index 3684882..72f10a0 100644 Binary files a/Documentation/images/ler_preview_opensimplex.png and b/Documentation/images/ler_preview_opensimplex.png differ diff --git a/Documentation/images/ler_preview_perlin.png b/Documentation/images/ler_preview_perlin.png index edeaf87..a16f141 100644 Binary files a/Documentation/images/ler_preview_perlin.png and b/Documentation/images/ler_preview_perlin.png differ diff --git a/Documentation/images/ler_preview_perlin_lowFreqLayer1.png b/Documentation/images/ler_preview_perlin_lowFreqLayer1.png index 22e4007..7a4260d 100644 Binary files a/Documentation/images/ler_preview_perlin_lowFreqLayer1.png and b/Documentation/images/ler_preview_perlin_lowFreqLayer1.png differ diff --git a/Documentation/images/ler_preview_perlin_lowFreqLayer1_highFreqLayer2.png b/Documentation/images/ler_preview_perlin_lowFreqLayer1_highFreqLayer2.png index 43f2b0d..2c8f275 100644 Binary files a/Documentation/images/ler_preview_perlin_lowFreqLayer1_highFreqLayer2.png and b/Documentation/images/ler_preview_perlin_lowFreqLayer1_highFreqLayer2.png differ diff --git a/Documentation/images/multipoly_flip.png b/Documentation/images/multipoly_flip.png index 0e63688..e55e314 100644 Binary files a/Documentation/images/multipoly_flip.png and b/Documentation/images/multipoly_flip.png differ diff --git a/Documentation/images/multipoly_flipValign.png b/Documentation/images/multipoly_flipValign.png index 62b6ab3..b5dcc57 100644 Binary files a/Documentation/images/multipoly_flipValign.png and b/Documentation/images/multipoly_flipValign.png differ diff --git a/Documentation/images/multipoly_rotation.png b/Documentation/images/multipoly_rotation.png index 29d8a54..a4a7d11 100644 Binary files a/Documentation/images/multipoly_rotation.png and b/Documentation/images/multipoly_rotation.png differ diff --git a/Documentation/images/multipoly_rotation_perpoly.png b/Documentation/images/multipoly_rotation_perpoly.png index e39d8de..435250f 100644 Binary files a/Documentation/images/multipoly_rotation_perpoly.png and b/Documentation/images/multipoly_rotation_perpoly.png differ diff --git a/Documentation/images/overlap_ler.png b/Documentation/images/overlap_ler.png index f105b5e..98d4910 100644 Binary files a/Documentation/images/overlap_ler.png and b/Documentation/images/overlap_ler.png differ diff --git a/Documentation/images/overlap_raytrace.png b/Documentation/images/overlap_raytrace.png index b1a681b..d2fcaa0 100644 Binary files a/Documentation/images/overlap_raytrace.png and b/Documentation/images/overlap_raytrace.png differ diff --git a/Documentation/images/overlap_raytrace_shortestEdge.png b/Documentation/images/overlap_raytrace_shortestEdge.png index a825bec..0025141 100644 Binary files a/Documentation/images/overlap_raytrace_shortestEdge.png and b/Documentation/images/overlap_raytrace_shortestEdge.png differ diff --git a/Documentation/images/pa_search.png b/Documentation/images/pa_search.png index 6ca8bc6..1301ad5 100644 Binary files a/Documentation/images/pa_search.png and b/Documentation/images/pa_search.png differ diff --git a/Documentation/images/proxbias_cosineFalloff.png b/Documentation/images/proxbias_cosineFalloff.png index 4d71468..fdebfae 100644 Binary files a/Documentation/images/proxbias_cosineFalloff.png and b/Documentation/images/proxbias_cosineFalloff.png differ diff --git a/Documentation/images/proxbias_gaussianFalloff.png b/Documentation/images/proxbias_gaussianFalloff.png index e21cd23..8697afe 100644 Binary files a/Documentation/images/proxbias_gaussianFalloff.png and b/Documentation/images/proxbias_gaussianFalloff.png differ diff --git a/Documentation/images/proxbias_linearFalloff.png b/Documentation/images/proxbias_linearFalloff.png index e42a3d9..1f3106a 100644 Binary files a/Documentation/images/proxbias_linearFalloff.png and b/Documentation/images/proxbias_linearFalloff.png differ diff --git a/Documentation/images/proxbias_noFalloff.png b/Documentation/images/proxbias_noFalloff.png index 6009b69..2620edb 100644 Binary files a/Documentation/images/proxbias_noFalloff.png and b/Documentation/images/proxbias_noFalloff.png differ diff --git a/Documentation/images/rays_0.PNG b/Documentation/images/rays_0.PNG index 376dd45..1d460c9 100644 Binary files a/Documentation/images/rays_0.PNG and b/Documentation/images/rays_0.PNG differ diff --git a/Documentation/images/rays_1.PNG b/Documentation/images/rays_1.PNG index 91f5b1c..63d44a2 100644 Binary files a/Documentation/images/rays_1.PNG and b/Documentation/images/rays_1.PNG differ diff --git a/Documentation/images/rays_2.PNG b/Documentation/images/rays_2.PNG index 5dc0b4a..7c169a4 100644 Binary files a/Documentation/images/rays_2.PNG and b/Documentation/images/rays_2.PNG differ diff --git a/Documentation/images/rays_4.PNG b/Documentation/images/rays_4.PNG index 464c399..d586dde 100644 Binary files a/Documentation/images/rays_4.PNG and b/Documentation/images/rays_4.PNG differ diff --git a/Documentation/images/settings.png b/Documentation/images/settings.png index 05cbd74..2aef393 100644 Binary files a/Documentation/images/settings.png and b/Documentation/images/settings.png differ diff --git a/Documentation/images/u_rays_0.PNG b/Documentation/images/u_rays_0.PNG index 1bf0f94..119d1fc 100644 Binary files a/Documentation/images/u_rays_0.PNG and b/Documentation/images/u_rays_0.PNG differ diff --git a/Documentation/images/u_rays_1.PNG b/Documentation/images/u_rays_1.PNG index 1384338..270877f 100644 Binary files a/Documentation/images/u_rays_1.PNG and b/Documentation/images/u_rays_1.PNG differ diff --git a/Documentation/images/u_rays_2.PNG b/Documentation/images/u_rays_2.PNG index d0b9549..d28b686 100644 Binary files a/Documentation/images/u_rays_2.PNG and b/Documentation/images/u_rays_2.PNG differ diff --git a/Documentation/images/u_rays_4.PNG b/Documentation/images/u_rays_4.PNG index 0da5814..3eaf9ec 100644 Binary files a/Documentation/images/u_rays_4.PNG and b/Documentation/images/u_rays_4.PNG differ diff --git a/Documentation/images/utilities.png b/Documentation/images/utilities.png index 58c47d6..cc817f5 100644 Binary files a/Documentation/images/utilities.png and b/Documentation/images/utilities.png differ diff --git a/Documentation/implementations.html b/Documentation/implementations.html index 4433b4b..26d8f9c 100644 --- a/Documentation/implementations.html +++ b/Documentation/implementations.html @@ -8,160 +8,159 @@ background-color: black } p.western { - font-family: "Calibri", serif; - font-size: 10pt; + font-family: "Calibri", serif; + font-size: 10pt; color: #aaaaaa; - so-language: en-US + so-language: en-US } p.cjk { - font-family: "Calibri"; - font-size: 10pt; - so-language: en-US + font-family: "Calibri"; + font-size: 10pt; + so-language: en-US } p.ctl { font-family:; - font-size: 10pt; - so-language: ar-SA + font-size: 10pt; + so-language: ar-SA } h1 { - direction: ltr; - color: #365f91; - line-height: 100%; - text-align: justify; - page-break-inside: avoid; - orphans: 2; - widows: 2 + direction: ltr; + color: #365f91; + line-height: 100%; + text-align: justify; + page-break-inside: avoid; + orphans: 2; + widows: 2 } h1.western { - font-family: "Cambria", serif; - font-size: 13pt; - so-language: en-US + font-family: "Cambria", serif; + font-size: 13pt; + so-language: en-US } h1.cjk { - font-family: "宋体"; - font-size: 13pt; - so-language: en-US + font-family: "宋体"; + font-size: 13pt; + so-language: en-US } h1.ctl { font-family:; - font-size: 13pt; - so-language: ar-SA + font-size: 13pt; + so-language: ar-SA } h2 { - direction: ltr; - color: #4f81bd; - line-height: 100%; - text-align: justify; - page-break-inside: avoid; - orphans: 2; - widows: 2 + direction: ltr; + color: #4f81bd; + line-height: 100%; + text-align: justify; + page-break-inside: avoid; + orphans: 2; + widows: 2 } h2.western { - font-family: "Cambria", serif; - font-size: 12pt; - so-language: en-US + font-family: "Cambria", serif; + font-size: 12pt; + so-language: en-US } h2.cjk { - font-family: "宋体"; - font-size: 12pt; - so-language: en-US + font-family: "宋体"; + font-size: 12pt; + so-language: en-US } h2.ctl { font-family:; - font-size: 12pt; - so-language: ar-SA + font-size: 12pt; + so-language: ar-SA } h3 { - direction: ltr; - color: #4f81bd; - line-height: 100%; - text-align: justify; - page-break-inside: avoid; - orphans: 2; - widows: 2 + direction: ltr; + color: #4f81bd; + line-height: 100%; + text-align: justify; + page-break-inside: avoid; + orphans: 2; + widows: 2 } h3.western { - font-family: "Cambria", serif; - font-size: 10pt; - so-language: en-US + font-family: "Cambria", serif; + font-size: 10pt; + so-language: en-US } h3.cjk { - font-family: "宋体"; - font-size: 10pt; - so-language: en-US + font-family: "宋体"; + font-size: 10pt; + so-language: en-US } h3.ctl { font-family:; - font-size: 10pt; - so-language: ar-SA + font-size: 10pt; + so-language: ar-SA } h4 { - direction: ltr; - color: #4f81bd; - line-height: 100%; - text-align: justify; - page-break-inside: avoid; - orphans: 2; - widows: 2 + direction: ltr; + color: #4f81bd; + line-height: 100%; + text-align: justify; + page-break-inside: avoid; + orphans: 2; + widows: 2 } h4.western { - font-family: "Cambria", serif; - font-size: 10pt; - so-language: en-US; - font-style: italic + font-family: "Cambria", serif; + font-size: 10pt; + so-language: en-US; + font-style: italic } h4.cjk { - font-family: "宋体"; - font-size: 10pt; - so-language: en-US; - font-style: italic + font-family: "宋体"; + font-size: 10pt; + so-language: en-US; + font-style: italic } h4.ctl { font-family:; - font-size: 10pt; - so-language: ar-SA; - font-style: italic + font-size: 10pt; + so-language: ar-SA; + font-style: italic } a:link { - color: #00aacc + color: #00aacc } ul { font-family: "Calibri", serif; - font-size: 11pt; + font-size: 10pt; color: #aaaaaa; so-language: en-US } ol { font-family: "Calibri", serif; - font-size: 11pt; + font-size: 10pt; color: #aaaaaa; so-language: en-US } -h1.western1 { font-family: "Cambria", serif; - font-size: 13pt; - so-language: en-US +h1.western1 { font-family: "Cambria", serif; + font-size: 13pt; + so-language: en-US } -p.western1 { font-family: "Calibri", serif; - font-size: 10pt; - so-language: en-US +p.western1 { font-family: "Calibri", serif; + font-size: 10pt; + so-language: en-US } -h2.western1 { font-family: "Cambria", serif; - font-size: 12pt; - so-language: en-US +h2.western1 { font-family: "Cambria", serif; + font-size: 12pt; + so-language: en-US } -p.western2 { font-family: "Calibri", serif; - font-size: 10pt; - color: #aaaaaa; - so-language: en-US +p.western2 { font-family: "Calibri", serif; + font-size: 10pt; + so-language: en-US } a { - font-family: "Calibri", serif; - font-size: 10pt; - so-language: en-US; - color: #33aacc + font-family: "Calibri", serif; + font-size: 10pt; + so-language: en-US; + color: #33aacc } img { - max-width: 100% ; + max-width: 100%; height: auto; width: auto\9; /* ie8 */ } @@ -184,10 +183,10 @@

WPF

@@ -199,8 +198,9 @@

WPF

- + - +

Mac

-

Known issues:

+

Known issues:

    +
  • The Mac build is currently Intel-only. M1 porting is pending hardware.
  • This has comparable performance to Windows (within 10%) following the move to use .NET Core 3.1.
@@ -226,21 +226,15 @@

GTK

  • The user interface under GTK has some large buttons and occasional layout refresh bugs that do not impair use of the tool.
  • This has comparable performance to Windows (within 10%) following the move to use .NET Core 3.1.
  • +
  • nVidia driver bugs cause the tool to crash on launch for OpenGL. Vulkan is fine. AMD and Intel hardware is not affected.
- - - -
- - - -
- + +
diff --git a/Documentation/licenses_acknowledgements.html b/Documentation/licenses_acknowledgements.html index 9a8e7f5..197d368 100644 --- a/Documentation/licenses_acknowledgements.html +++ b/Documentation/licenses_acknowledgements.html @@ -167,7 +167,7 @@

Licenses

ClipperLib

-

Copyright © 2010-2019 Angus Johnson.

+

Copyright © 2010-2022 Angus Johnson.

Boost Software License 1.0 (BSL-1.0)

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:

The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.

diff --git a/Documentation/main.html b/Documentation/main.html index 9cb6238..cdbbf8c 100644 --- a/Documentation/main.html +++ b/Documentation/main.html @@ -183,7 +183,7 @@ -

Variance (4.4.2)

+

Variance (5.0)

Phil Stopford

@@ -223,7 +223,7 @@

Fast, efficient workflow

  • Copy/paste layer settings, and background layer display make set-up very simple.
  • External layout support is extensive:
    • -
    • GDS and Oasis, including GZIP-compressed.
    • +
    • IMPROVED: GDS and OASIS, including GZIP-compressed. 5.0 brings improved support for OASIS, including strict files.
    • Layout geometry can be used to drive contour generation.
    • Layout geometry can be updated from the file on-disk when the project is loaded.
    • Hierarchical layout is better supported in terms of nested cell references, and arrays of reference cells.
    • @@ -231,7 +231,8 @@

      Fast, efficient workflow

  • Layer shape can be defined using a Boolean of two other layers, including the results of another Boolean.
    • -
    • IMPROVED: Further enhanced support for keyholing (one or more cutters fully enclosed within another polygon), including handling of pre-existing keyholes.
    • +
    • IMPROVED: Use of next-generation polygon clipping library brings performance improvements and better results.
    • +
    • Further enhanced support for keyholing (one or more cutters fully enclosed within another polygon), including handling of pre-existing keyholes.
    • Auto-removal of interior walls (keyholes) at input to simulation engine pipeline.
    @@ -248,6 +249,7 @@

    Fast, efficient workflow

  • Edge tension model to reproduce line narrowing.
  • Pitch effect biasing, including on keyholed geometry.
    • +
    • IMPROVED: Use of next-generation polygon clipping library brings performance improvements and better results.
    • Previously, side rays had a disproportionate effect on the computed visibility, leading to muted response. Now, customizable falloffs are available.
    @@ -266,19 +268,22 @@

    Fast, efficient workflow

  • Lens distortion : short and long range, pincushion/barrel distortion.
  • Wobble (rotational variation)
  • -
  • Export of the layer contours to GDSII or Oasis is available, now also from within any viewport.
  • +
  • IMPROVED: Export of the layer contours to GDSII or OASIS is available, now also from within any viewport.
  • Simulation Configuration:

    If you know the variations and want to evaluate them:

    • Choose your calculation mode : area, chords, overlap/spacing, intersection angle.
    • +
        +
      • IMPROVED: Chord now handles rotated 'B' shape correctly.
      • +
    • Set up the number of cases to evaluate.
    • Summary file is always showing inputs and outputs for a given simulation.
    • Choose whether to output the full set of run data to CSV (important for replaying simulations).
      • Export to CSV is fully multithreaded, so runs much faster than before.
      -
    • Support for outputting simulation geometry to GDSII, Oasis, or SVG (SVG was only option prior to this release).
    • +
    • Support for outputting simulation geometry to GDSII, OASIS, or SVG (SVG was only option prior to this release).
      • Export of the geometry happens during the run, eliminating the memory overhead (at the cost of runtime increase).
      • Criteria can be set by result field to limit exports to cases of interest in the run.
      • @@ -290,6 +295,7 @@

        Fast, efficient workflow

      • Run the simulation.
        • Runtime is reduced (where possible) through adaptive geometry decimation.
        • +
        • IMPROVED: Use of next-generation polygon clipping library brings performance improvements and better results.

      If you want to review certain results in depth, use the replay system to look at specific cases.

      @@ -303,12 +309,17 @@

      Fast, efficient workflow

      • Consistent, multi-platform GUI (Windows, Mac, Linux).
        • +
        • IMPROVED: Expanders to reduce scrolling, with options to expand/collapse all via menu and hotkey.
        • +
        • IMPROVED: Refined layout.
        • User interface is resizable.
        • Native platform look-and-feel is preserved, rather than modified, on macOS and Linux (GTK).
      • Large modern viewport used throughout:
        • The optimal framework is automatically used on the platform being used (Vulkan, OpenGL, Direct3D, Metal). If desired, this can be overridden.
        • +
            +
          • NOTE : nVidia driver problems prevent OpenGL under Linux. Vulkan is fine.
          • +
        • Drag and cursor key navigation
        • Wheel and key zoom
        • Customizable preferences (colors, zoom, antialiasing, opacity, fill).
        • diff --git a/Documentation/montecarlo_layerSettings_boolean.html b/Documentation/montecarlo_layerSettings_boolean.html index 5a4d936..caae96f 100644 --- a/Documentation/montecarlo_layerSettings_boolean.html +++ b/Documentation/montecarlo_layerSettings_boolean.html @@ -199,9 +199,8 @@

          Boolean

          -

          To be consistent with the contouring pipeline, keyholes are inserted to connect holes to the outer edges. Keyholes are found using a raycast, biased towards the shortest, and ideally orthogonal, edge. This edge is used to cut a path, connecting the hole to the outer geometry. To minimize potential error, a minimal quadrangle is constructed from this edge. It can be that numeric error prevents this fully cutting a path, leading to a failed keyhole. In these situations, increase the ray extension value. This makes the cutter for the path longer (not wider). If you make it too long, artifacts can be created.

          +

          To be consistent with the contouring pipeline, keyholes are inserted to connect holes to the outer edges. Keyholes are found using a raycast, biased towards the shortest, and ideally orthogonal, edge. This edge is used to cut a path, connecting the hole to the outer geometry. To minimize potential error, a minimal quadrangle is constructed from this edge. Very rarely, numeric error prevents this fully cutting a path, leading to a failed keyhole. In these situations, increase the ray extension value. This makes the cutter for the path longer (not wider). If you make it too long, artifacts can be created.

          -

          diff --git a/Documentation/navbar.html b/Documentation/navbar.html index 23734d8..ccb791b 100644 --- a/Documentation/navbar.html +++ b/Documentation/navbar.html @@ -185,6 +185,11 @@

          Changelog

          + + +

          ->4.4

          + +

          ->4.3

          @@ -232,7 +237,7 @@ -

          -->GTK2

          +

          -->GTK

          diff --git a/Documentation/releases.html b/Documentation/releases.html index fbd8ec2..a3e2819 100644 --- a/Documentation/releases.html +++ b/Documentation/releases.html @@ -198,57 +198,42 @@

          Variance Release History

          - -

          New to 4.4.2 (Jan 7 2022)

          + +

          New to 5.0 (Aug 27 2022)

            -
          • Addressing keyholer limitation from nested donuts.
          • +
          • Shape engine updates.
          • +
          • Proximity biasing artifacts should now be eliminated due to geometry processing enhancements.
          • +
          • Major refinement to boolean and keyhole pipelines, moved also to the GeoWrangler library for re-use.
            • -
            • Fairly tricky problem to solve, with ongoing R&D here.
            • -
            • Added keyhole width property to geoCore layer, to scale the keyhole width and avoid loss in sliver/gap.
            • +
            • Keyholer no longer preferentially uses an orthogonal insertion candidate if the polygons are not orthogonal.
            • +
            • Keyholer now performs a reverse walk to check for any missed candidates in the original pass.
            -
          • GeoCore copy/paste fix.
          • -
          • NET 6.0 migration.
          • -
          • Fixed missing progress bar.
          • -
          • DOE tile preview in layer now also crops 'drawn' to show just tile contents.
          • -
          • GTK fix for UI scrollable from Eto.Forms project.
          • -
          • Multithreading work.
          • +
          • Fixed an issue in the chord handler where rotations of the 'B' shape could break the edge extraction and fail the evaluation.
          • +
          • User interface enhancements : using expanders to allow sections to be collapsed or expanded as required, decluttering the view and reducing scrolling.
          • +
          • Layout handling enhancements.
            • -
            • 5% performance gain with this and the .NET 6.0 migration.
            • +
            • Internal lists are updated with layout load, removing the need for the client to do this.
            • +
            • Registering layer names against layer:datatype would throw an error if the name was already registered.
            • +
            • Duplicated points are now removed during load, to allow for correct contouring behavior of otherwise-orthogonal geometry.
            • +
            • Resolved compatibility with certain flavors of OASIS (e.g. strict).
            • +
            • Revised layout to tool handling, to make scaling behavior less opaque.
            • +
            • Fixed a defect in the OASIS file writer that yielded missing or broken geometry in some cases.
            -
          -
          -
          - -
          - -

          New to 4.4.1 (Apr 30 2021)

          -
          -
            -
          • Rare ChordHandler issues addressed
          • +
          • ClipperLib 2.
            • -
            • Resolved issue that caused truncated chord evaluation.
            • -
            • Reduced cut-off value for sub-resolution chords.
            • +
            • Next-generation polygon clipping library, bringing major performance and behavioral improvements.
            • +
            • Performance gains across the board compared to 4.4.2:
            • +
                +
              • Up to 15-20% improvement in simulation performance.
              • +
              • ILB performance even more improved.
              • +
              • Proximity biasing runs in around half the time.
              • +
            -
          • Cleaned-up internal code to improve readability.
          • -
          -
          -
          - -
          - -

          New to 4.4 (Feb 8 2021)

          -
          -
            -
          • Export of case geometry to external files can now be controlled using critera on the results field(s).
          • -
          • UI refinements.
          • -
          • Bug fix to keyholer extension read from project file.
          diff --git a/Documentation/releases_440.html b/Documentation/releases_440.html new file mode 100644 index 0000000..fbd8ec2 --- /dev/null +++ b/Documentation/releases_440.html @@ -0,0 +1,259 @@ + + + + +Variance - Reference + + + + + +
          + +

          Variance Release History

          + + +
          + +

          New to 4.4.2 (Jan 7 2022)

          +
          +
            +
          • Addressing keyholer limitation from nested donuts.
          • +
              +
            • Fairly tricky problem to solve, with ongoing R&D here.
            • +
            • Added keyhole width property to geoCore layer, to scale the keyhole width and avoid loss in sliver/gap.
            • +
            +
          • GeoCore copy/paste fix.
          • +
          • NET 6.0 migration.
          • +
          • Fixed missing progress bar.
          • +
          • DOE tile preview in layer now also crops 'drawn' to show just tile contents.
          • +
          • GTK fix for UI scrollable from Eto.Forms project.
          • +
          • Multithreading work.
          • +
              +
            • 5% performance gain with this and the .NET 6.0 migration.
            • +
            +
          +
          +
          + +
          + +

          New to 4.4.1 (Apr 30 2021)

          +
          +
            +
          • Rare ChordHandler issues addressed
          • +
              +
            • Resolved issue that caused truncated chord evaluation.
            • +
            • Reduced cut-off value for sub-resolution chords.
            • +
            +
          • Cleaned-up internal code to improve readability.
          • +
          +
          +
          + +
          + +

          New to 4.4 (Feb 8 2021)

          +
          +
            +
          • Export of case geometry to external files can now be controlled using critera on the results field(s).
          • +
          • UI refinements.
          • +
          • Bug fix to keyholer extension read from project file.
          • +
          +
          +
          + +
          + + + diff --git a/Eto/Common/headless.cs b/Eto/Common/headless.cs index 237ad59..83d0c48 100644 --- a/Eto/Common/headless.cs +++ b/Eto/Common/headless.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Threading; +using shapeEngine; namespace Variance; @@ -99,7 +100,7 @@ private void pUpdateReadout() { try { - List t = new(); + List t; if (varianceContext.implantMode) { Console.WriteLine("Converging on: " + entropyControl.getImplantResultPackage().getMeanAndStdDev()); @@ -137,7 +138,7 @@ private void pUpdateReadout() private void summary() { - List t = new(); + List t; if (varianceContext.implantMode) { Console.WriteLine("Converged on: " + entropyControl.getImplantResultPackage().getMeanAndStdDev()); @@ -298,7 +299,7 @@ private void clearAbortFlag() private void updateSimUIMT() { - commonVars.m_timer.Elapsed += new System.Timers.ElapsedEventHandler(updateReadout); + commonVars.m_timer.Elapsed += updateReadout; } private void updateProgress(double val) @@ -384,7 +385,7 @@ private void pSetLayerSettings(EntropyLayerSettings entropyLayerSettings, int se { } - if (entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.sCDU) != 0.0m && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE && + if (entropyLayerSettings.getDecimal(EntropyLayerSettings.properties_decimal.sCDU) != 0.0m && entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && varianceContext.geoCoreCDVariation == false) { ErrorReporter.showMessage_OK("Project uses Oasis/GDS CD variation.", "Overriding preference."); @@ -399,7 +400,7 @@ private void pSetLayerSettings(EntropyLayerSettings entropyLayerSettings, int se else { commonVars.getGeoCoreHandler(settingsIndex).setValid(false); - if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CommonVars.shapeNames.GEOCORE && entropyLayerSettings.isReloaded()) + if (entropyLayerSettings.getInt(EntropyLayerSettings.properties_i.shapeIndex) == (int)CentralProperties.shapeNames.GEOCORE && entropyLayerSettings.isReloaded()) { commonVars.getGeoCoreHandler(settingsIndex).setFilename(entropyLayerSettings.getString(EntropyLayerSettings.properties_s.file)); commonVars.getGeoCoreHandler(settingsIndex).setValid(true); diff --git a/Eto/Resources/resources.csproj b/Eto/Resources/resources.csproj index d29284b..dfb07b1 100644 --- a/Eto/Resources/resources.csproj +++ b/Eto/Resources/resources.csproj @@ -22,7 +22,7 @@ - + diff --git a/Eto/Variance.Gtk/Variance.Gtk.csproj b/Eto/Variance.Gtk/Variance.Gtk.csproj index 2903c43..692af48 100644 --- a/Eto/Variance.Gtk/Variance.Gtk.csproj +++ b/Eto/Variance.Gtk/Variance.Gtk.csproj @@ -20,7 +20,7 @@ - + diff --git a/Eto/Variance.Mac/Variance.Mac.csproj b/Eto/Variance.Mac/Variance.Mac.csproj index cebe1d3..dbd53df 100644 --- a/Eto/Variance.Mac/Variance.Mac.csproj +++ b/Eto/Variance.Mac/Variance.Mac.csproj @@ -25,7 +25,7 @@ - + diff --git a/Eto/Variance.WPF/Variance.WPF.csproj b/Eto/Variance.WPF/Variance.WPF.csproj index 8bd740b..169b0b8 100644 --- a/Eto/Variance.WPF/Variance.WPF.csproj +++ b/Eto/Variance.WPF/Variance.WPF.csproj @@ -16,7 +16,7 @@ - TRACE + TRACE;CHAOSSINGLETHREADED @@ -29,7 +29,7 @@ - + diff --git a/Series 5.txt b/Series 5.txt new file mode 100644 index 0000000..36757d3 --- /dev/null +++ b/Series 5.txt @@ -0,0 +1,57 @@ +Changelog for Variance + +5.0 + + - Shake-down + +5.0a3 + + - Adding more fragmentation passes at various stages in the shape generation, to improve contouring. + - GeoCore fixes. + - Library removes duplicate points for the layout when loading, to avoid potential contour issue in otherwise-orthogonal geometry. + - Library avoids trying to add a layer name to the mapping dictionary when the key already exists. + - Internal lists are updated when loading layout now, avoiding mismatches on the client side. + - Major refactoring of various systems to allow code re-use. No user impact expected. + - SVGBuilder now a separate library. + - GeoWrangler now owns: + - Proximity biasing. + - Added code to address issues when input geometry is not sequenced properly. This resulted in sawtooth edges. + - Noise (LWR) application. + - GeoAnalysis takes care of the analysis engines (area, chord, angle, spacing/enclosure). + - ShapeEngine provides a common, extensible, base geometry reference. + - ShapeSettings is extended by Variance with additional properties. + - Various components then work together to output and modify shapes. + - Clipper2 updates and related code changed to avoid the need to reverse solutions. + +5.0a2 + + - Refactorings of code (no user impact expected). + - Reducing copies, etc. based on code review. + - Keyholer enhancements. + - No longer preferentially seek an orthogonal insertion for cases where there is a contributing non-orthogonal polygon. + - Orthogonality preference is about retaining contouring abilities, but non-orthogonal contributors preclude that. + - Reverse-walk second evaluation to catch more suitable insertion candidates not found from the initial pass. + - Resolved identified issues in overlap handling due to Clipper 2 changes. + - Adjusted some of the internal methodology also to use Z tagging to find original source of overlap edges. This avoids KDTree usage which could sometimes produce false associations due to proximity effects. + - Certain OASIS files were causing trouble before. Now fixed. + - Refactoring to move boolean handlers from Variance core to GeoWrangler. + - Enhancement for boolean sequencing to squelch keyholes in inputs and outputs. + - Revisions to internal handling of GeoCore data. + - Chord handler bug fix. + - Previous implementation had an issue if rotation was applied such that the min-X,min-Y location in the 'B' path was located above the min-Y,min-X location. This caused the edge extraction to find the wrong edge. For the 'B' path, now re-order in min-Y,min-X sequence, which appears to work properly in all cases reviewed up to now. + - Updated to latest Clipper2 upstream. + - Fixed an issue with geometry exchange where premature terminator removal was breaking things. + - UI overhaul to introduce expanders for the various layer sections, and expand/collapse all menu and key combinations. + +5.0a1 + + - Bug fix to layout file saving that yielded broken or missing geometry in some cases. + - ClipperLib 2! + - Many library changes to work with new systems. + - Keyholer adjustments based on new behavior of ClipperLib 2. + - Single polygon negation hack from ClipperLib1 is no longer needed, and actually brought new issues. + - Sequential booleans work fine. + - Minor tweaks to orthogonality checks to permit contouring from boolean sequence, due to not-quite-90 degree angles being observed. + - Added a re-ordering call in the strip colinear code; avoids problems when the initial point is an edge midpoint. + - Open path offsetting is much simpler; old approach retired to take advantage. + - Various changes to raytracer to address some test fails; allow for inversion direction to be adjusted and work to better handle edge cases. diff --git a/Variance.sln b/Variance.sln index 0822b11..c299d10 100644 --- a/Variance.sln +++ b/Variance.sln @@ -60,308 +60,250 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Eto", "Eto", "{B440F290-1E0 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{59912BF0-0AF4-41FA-B82B-B9FAD59296CD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamicAero2", "..\DesignLibs_GPL\Eto\DynamicAero2\DynamicAero2.csproj", "{AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LHC", "..\DesignLibs_GPL\Common\LHC\LHC.csproj", "{B69AEC0E-2F90-42F2-B735-50B33EDB8141}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicAero2", "..\DesignLibs_GPL\Eto\DynamicAero2\DynamicAero2.csproj", "{BFF3FC44-0610-4C45-80D8-20EA6613CE6D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SVGBuilder", "..\DesignLibs_GPL\Common\SVGBuilder\SVGBuilder.csproj", "{684AAFAA-AE22-4920-945D-49B8F97B21FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "geoAnalysis", "..\DesignLibs_GPL\Common\geoAnalysis\geoAnalysis.csproj", "{3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Email", "..\DesignLibs_GPL\Common\Email\Email.csproj", "{334E7695-D21C-4D32-ACE3-4D9D0A9A981B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "shapeEngine", "..\DesignLibs_GPL\Common\shapeEngine\shapeEngine.csproj", "{411DD039-48D4-422E-94FE-ECFA06ACC9A5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 - Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|x64.ActiveCfg = Debug|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|x64.Build.0 = Debug|Any CPU - {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|x86.ActiveCfg = Debug|Any CPU - {87C2783D-AC80-4684-875C-F06237E9CC3F}.Debug|x86.Build.0 = Debug|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|Any CPU.Build.0 = Release|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|x64.ActiveCfg = Release|Any CPU {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|x64.Build.0 = Release|Any CPU - {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|x86.ActiveCfg = Release|Any CPU - {87C2783D-AC80-4684-875C-F06237E9CC3F}.Release|x86.Build.0 = Release|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|x64.ActiveCfg = Debug|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|x64.Build.0 = Debug|Any CPU - {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|x86.ActiveCfg = Debug|Any CPU - {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Debug|x86.Build.0 = Debug|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|Any CPU.Build.0 = Release|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|x64.ActiveCfg = Release|Any CPU {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|x64.Build.0 = Release|Any CPU - {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|x86.ActiveCfg = Release|Any CPU - {9B35CB06-05BD-468C-9D9B-41876B793EF5}.Release|x86.Build.0 = Release|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|x64.ActiveCfg = Debug|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|x64.Build.0 = Debug|Any CPU - {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|x86.ActiveCfg = Debug|Any CPU - {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Debug|x86.Build.0 = Debug|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|Any CPU.Build.0 = Release|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|x64.ActiveCfg = Release|Any CPU {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|x64.Build.0 = Release|Any CPU - {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|x86.ActiveCfg = Release|Any CPU - {FF8EDE08-8236-49A0-A82E-3B6208B81431}.Release|x86.Build.0 = Release|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|Any CPU.Build.0 = Debug|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|x64.ActiveCfg = Debug|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|x64.Build.0 = Debug|Any CPU - {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|x86.ActiveCfg = Debug|Any CPU - {6270531D-FCD0-44B8-95BA-4C4CED998179}.Debug|x86.Build.0 = Debug|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|Any CPU.ActiveCfg = Release|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|Any CPU.Build.0 = Release|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|x64.ActiveCfg = Release|Any CPU {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|x64.Build.0 = Release|Any CPU - {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|x86.ActiveCfg = Release|Any CPU - {6270531D-FCD0-44B8-95BA-4C4CED998179}.Release|x86.Build.0 = Release|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|Any CPU.Build.0 = Debug|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|x64.ActiveCfg = Debug|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|x64.Build.0 = Debug|Any CPU - {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|x86.ActiveCfg = Debug|Any CPU - {5EE39029-873A-45A0-9259-2198BF8729F4}.Debug|x86.Build.0 = Debug|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|Any CPU.ActiveCfg = Release|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|Any CPU.Build.0 = Release|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|x64.ActiveCfg = Release|Any CPU {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|x64.Build.0 = Release|Any CPU - {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|x86.ActiveCfg = Release|Any CPU - {5EE39029-873A-45A0-9259-2198BF8729F4}.Release|x86.Build.0 = Release|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|Any CPU.Build.0 = Debug|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|x64.ActiveCfg = Debug|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|x64.Build.0 = Debug|Any CPU - {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|x86.ActiveCfg = Debug|Any CPU - {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Debug|x86.Build.0 = Debug|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|Any CPU.ActiveCfg = Release|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|Any CPU.Build.0 = Release|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|x64.ActiveCfg = Release|Any CPU {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|x64.Build.0 = Release|Any CPU - {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|x86.ActiveCfg = Release|Any CPU - {1D7842B4-12C0-4E11-A6A9-77CEB55F156C}.Release|x86.Build.0 = Release|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|x64.ActiveCfg = Debug|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|x64.Build.0 = Debug|Any CPU - {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|x86.ActiveCfg = Debug|Any CPU - {C3255560-6437-4EFF-8948-971A76C6E9AB}.Debug|x86.Build.0 = Debug|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|Any CPU.Build.0 = Release|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|x64.ActiveCfg = Release|Any CPU {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|x64.Build.0 = Release|Any CPU - {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|x86.ActiveCfg = Release|Any CPU - {C3255560-6437-4EFF-8948-971A76C6E9AB}.Release|x86.Build.0 = Release|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|Any CPU.Build.0 = Debug|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|x64.ActiveCfg = Debug|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|x64.Build.0 = Debug|Any CPU - {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|x86.ActiveCfg = Debug|Any CPU - {576CBA59-F35E-4F45-905C-26927E2E441A}.Debug|x86.Build.0 = Debug|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|Any CPU.ActiveCfg = Release|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|Any CPU.Build.0 = Release|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|x64.ActiveCfg = Release|Any CPU {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|x64.Build.0 = Release|Any CPU - {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|x86.ActiveCfg = Release|Any CPU - {576CBA59-F35E-4F45-905C-26927E2E441A}.Release|x86.Build.0 = Release|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Debug|Any CPU.Build.0 = Debug|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Debug|x64.ActiveCfg = Debug|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Debug|x64.Build.0 = Debug|Any CPU - {663A7D25-5255-4B85-B94D-53C431426339}.Debug|x86.ActiveCfg = Debug|Any CPU - {663A7D25-5255-4B85-B94D-53C431426339}.Debug|x86.Build.0 = Debug|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Release|Any CPU.ActiveCfg = Release|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Release|Any CPU.Build.0 = Release|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Release|x64.ActiveCfg = Release|Any CPU {663A7D25-5255-4B85-B94D-53C431426339}.Release|x64.Build.0 = Release|Any CPU - {663A7D25-5255-4B85-B94D-53C431426339}.Release|x86.ActiveCfg = Release|Any CPU - {663A7D25-5255-4B85-B94D-53C431426339}.Release|x86.Build.0 = Release|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|Any CPU.Build.0 = Debug|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|x64.ActiveCfg = Debug|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|x64.Build.0 = Debug|Any CPU - {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|x86.ActiveCfg = Debug|Any CPU - {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Debug|x86.Build.0 = Debug|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|Any CPU.ActiveCfg = Release|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|Any CPU.Build.0 = Release|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|x64.ActiveCfg = Release|Any CPU {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|x64.Build.0 = Release|Any CPU - {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|x86.ActiveCfg = Release|Any CPU - {DE11C249-FEF2-41C4-AE0C-BAA039788DA8}.Release|x86.Build.0 = Release|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|Any CPU.Build.0 = Debug|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|x64.ActiveCfg = Debug|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|x64.Build.0 = Debug|Any CPU - {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|x86.ActiveCfg = Debug|Any CPU - {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Debug|x86.Build.0 = Debug|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|Any CPU.ActiveCfg = Release|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|Any CPU.Build.0 = Release|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|x64.ActiveCfg = Release|Any CPU {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|x64.Build.0 = Release|Any CPU - {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|x86.ActiveCfg = Release|Any CPU - {FFC02E18-22CD-4F8D-9DF1-E87FE58C4821}.Release|x86.Build.0 = Release|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|x64.ActiveCfg = Debug|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|x64.Build.0 = Debug|Any CPU - {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|x86.ActiveCfg = Debug|Any CPU - {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Debug|x86.Build.0 = Debug|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|Any CPU.Build.0 = Release|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|x64.ActiveCfg = Release|Any CPU {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|x64.Build.0 = Release|Any CPU - {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|x86.ActiveCfg = Release|Any CPU - {7B4E57E2-739D-40B7-894A-2EA467C6DE18}.Release|x86.Build.0 = Release|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|Any CPU.Build.0 = Debug|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|x64.ActiveCfg = Debug|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|x64.Build.0 = Debug|Any CPU - {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|x86.ActiveCfg = Debug|Any CPU - {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Debug|x86.Build.0 = Debug|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|Any CPU.ActiveCfg = Release|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|Any CPU.Build.0 = Release|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|x64.ActiveCfg = Release|Any CPU {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|x64.Build.0 = Release|Any CPU - {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|x86.ActiveCfg = Release|Any CPU - {13D15F17-7EC0-48E8-A13E-A0760DB70999}.Release|x86.Build.0 = Release|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|x64.ActiveCfg = Debug|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|x64.Build.0 = Debug|Any CPU - {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|x86.ActiveCfg = Debug|Any CPU - {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Debug|x86.Build.0 = Debug|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|Any CPU.ActiveCfg = Release|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|Any CPU.Build.0 = Release|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|x64.ActiveCfg = Release|Any CPU {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|x64.Build.0 = Release|Any CPU - {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|x86.ActiveCfg = Release|Any CPU - {B72FF9C0-FE72-47B2-B4ED-D11575B2D1DF}.Release|x86.Build.0 = Release|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|x64.ActiveCfg = Debug|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|x64.Build.0 = Debug|Any CPU - {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|x86.ActiveCfg = Debug|Any CPU - {150BF729-EDBE-4557-927C-0EB3844794F6}.Debug|x86.Build.0 = Debug|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|Any CPU.Build.0 = Release|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|x64.ActiveCfg = Release|Any CPU {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|x64.Build.0 = Release|Any CPU - {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|x86.ActiveCfg = Release|Any CPU - {150BF729-EDBE-4557-927C-0EB3844794F6}.Release|x86.Build.0 = Release|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|x64.ActiveCfg = Debug|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|x64.Build.0 = Debug|Any CPU - {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|x86.ActiveCfg = Debug|Any CPU - {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Debug|x86.Build.0 = Debug|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|Any CPU.ActiveCfg = Release|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|Any CPU.Build.0 = Release|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|x64.ActiveCfg = Release|Any CPU {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|x64.Build.0 = Release|Any CPU - {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|x86.ActiveCfg = Release|Any CPU - {ADB1092A-6BD2-4FAB-BC39-91BB49F0AD2D}.Release|x86.Build.0 = Release|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|Any CPU.Build.0 = Debug|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|x64.ActiveCfg = Debug|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|x64.Build.0 = Debug|Any CPU - {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|x86.ActiveCfg = Debug|Any CPU - {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Debug|x86.Build.0 = Debug|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|Any CPU.ActiveCfg = Release|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|Any CPU.Build.0 = Release|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|x64.ActiveCfg = Release|Any CPU {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|x64.Build.0 = Release|Any CPU - {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|x86.ActiveCfg = Release|Any CPU - {DAFA7EA7-4087-4943-8FBC-ED5156721409}.Release|x86.Build.0 = Release|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|x64.ActiveCfg = Debug|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|x64.Build.0 = Debug|Any CPU - {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|x86.ActiveCfg = Debug|Any CPU - {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Debug|x86.Build.0 = Debug|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|Any CPU.Build.0 = Release|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|x64.ActiveCfg = Release|Any CPU {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|x64.Build.0 = Release|Any CPU - {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|x86.ActiveCfg = Release|Any CPU - {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F}.Release|x86.Build.0 = Release|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|Any CPU.Build.0 = Debug|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|x64.ActiveCfg = Debug|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|x64.Build.0 = Debug|Any CPU - {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|x86.ActiveCfg = Debug|Any CPU - {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Debug|x86.Build.0 = Debug|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|Any CPU.ActiveCfg = Release|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|Any CPU.Build.0 = Release|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|x64.ActiveCfg = Release|Any CPU {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|x64.Build.0 = Release|Any CPU - {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|x86.ActiveCfg = Release|Any CPU - {F3EEFD6A-23CD-410A-8BEC-CA2B7E29553D}.Release|x86.Build.0 = Release|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|Any CPU.Build.0 = Debug|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|x64.ActiveCfg = Debug|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|x64.Build.0 = Debug|Any CPU - {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|x86.ActiveCfg = Debug|Any CPU - {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Debug|x86.Build.0 = Debug|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|Any CPU.ActiveCfg = Release|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|Any CPU.Build.0 = Release|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|x64.ActiveCfg = Release|Any CPU {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|x64.Build.0 = Release|Any CPU - {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|x86.ActiveCfg = Release|Any CPU - {D89C0EB9-8758-4352-85EC-151C0FFB69A7}.Release|x86.Build.0 = Release|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|x64.ActiveCfg = Debug|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|x64.Build.0 = Debug|Any CPU - {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|x86.ActiveCfg = Debug|Any CPU - {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Debug|x86.Build.0 = Debug|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|Any CPU.Build.0 = Release|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|x64.ActiveCfg = Release|Any CPU {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|x64.Build.0 = Release|Any CPU - {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|x86.ActiveCfg = Release|Any CPU - {19A4A36B-C946-4BB6-81AE-285E19272E2A}.Release|x86.Build.0 = Release|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|x64.ActiveCfg = Debug|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|x64.Build.0 = Debug|Any CPU - {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|x86.ActiveCfg = Debug|Any CPU - {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Debug|x86.Build.0 = Debug|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|Any CPU.ActiveCfg = Release|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|Any CPU.Build.0 = Release|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|x64.ActiveCfg = Release|Any CPU {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|x64.Build.0 = Release|Any CPU - {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|x86.ActiveCfg = Release|Any CPU - {A50E044D-3E14-40C0-95F7-54FCBD6BD0D3}.Release|x86.Build.0 = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|x64.ActiveCfg = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|x64.Build.0 = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|x86.ActiveCfg = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Debug|x86.Build.0 = Debug|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|Any CPU.Build.0 = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|x64.ActiveCfg = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|x64.Build.0 = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|x86.ActiveCfg = Release|Any CPU - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79}.Release|x86.Build.0 = Release|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|Any CPU.Build.0 = Debug|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|x64.ActiveCfg = Debug|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|x64.Build.0 = Debug|Any CPU - {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|x86.ActiveCfg = Debug|Any CPU - {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Debug|x86.Build.0 = Debug|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|Any CPU.ActiveCfg = Release|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|Any CPU.Build.0 = Release|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|x64.ActiveCfg = Release|Any CPU {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|x64.Build.0 = Release|Any CPU - {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|x86.ActiveCfg = Release|Any CPU - {B69AEC0E-2F90-42F2-B735-50B33EDB8141}.Release|x86.Build.0 = Release|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Debug|x64.ActiveCfg = Debug|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Debug|x64.Build.0 = Debug|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Release|Any CPU.Build.0 = Release|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Release|x64.ActiveCfg = Release|Any CPU + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D}.Release|x64.Build.0 = Release|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Debug|x64.ActiveCfg = Debug|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Debug|x64.Build.0 = Debug|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Release|Any CPU.Build.0 = Release|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Release|x64.ActiveCfg = Release|Any CPU + {684AAFAA-AE22-4920-945D-49B8F97B21FB}.Release|x64.Build.0 = Release|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Debug|x64.Build.0 = Debug|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Release|Any CPU.Build.0 = Release|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Release|x64.ActiveCfg = Release|Any CPU + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691}.Release|x64.Build.0 = Release|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Debug|x64.ActiveCfg = Debug|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Debug|x64.Build.0 = Debug|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Release|Any CPU.Build.0 = Release|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Release|x64.ActiveCfg = Release|Any CPU + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B}.Release|x64.Build.0 = Release|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Debug|x64.Build.0 = Debug|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Release|Any CPU.Build.0 = Release|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Release|x64.ActiveCfg = Release|Any CPU + {411DD039-48D4-422E-94FE-ECFA06ACC9A5}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -384,8 +326,12 @@ Global {9B4D03BB-9C3F-4D1C-B6AF-F3647EB6106F} = {B440F290-1E0F-45F1-ADB7-415AEA8B04CA} {B440F290-1E0F-45F1-ADB7-415AEA8B04CA} = {737F4D86-2E7A-48E5-89B9-7DEB6EFC2443} {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} = {737F4D86-2E7A-48E5-89B9-7DEB6EFC2443} - {AD7A5CFB-DE65-45DD-9A45-ADE4E2C4AC79} = {B440F290-1E0F-45F1-ADB7-415AEA8B04CA} {B69AEC0E-2F90-42F2-B735-50B33EDB8141} = {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} + {BFF3FC44-0610-4C45-80D8-20EA6613CE6D} = {B440F290-1E0F-45F1-ADB7-415AEA8B04CA} + {684AAFAA-AE22-4920-945D-49B8F97B21FB} = {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} + {3B4710E7-F9D9-4B19-9CE1-D0E2684BD691} = {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} + {334E7695-D21C-4D32-ACE3-4D9D0A9A981B} = {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} + {411DD039-48D4-422E-94FE-ECFA06ACC9A5} = {59912BF0-0AF4-41FA-B82B-B9FAD59296CD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B6266959-173B-4E69-92E6-CEF36DE419C8}