private static void test_cell_export() { // Note that the cell computation is for all layers/dataypes. The list of GCPolygons would need to be filtered separately for the LD of interest. string arrayDir = baseDir + "cellrefarray\\"; GeoCoreHandler gH_GDS = new(); gH_GDS.updateGeoCoreHandler(arrayDir + "L_array_nested.gds", GeoCore.fileType.gds); GeoCore gcGDS = gH_GDS.getGeo(); // Simple cell. gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("r"); // Only a single layer datatype. gcGDS.activeLD = gcGDS.getActiveStructureLDList().IndexOf("L1D0"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t1 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); // Array gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("a"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t2 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); // Nested array gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("b"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t3 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); }
private static void loadSaveTest(string baseName, string gdsDir, string oasDir, string outDir) { GeoCoreHandler gH_GDS = new(); gH_GDS.updateGeoCoreHandler(gdsDir + baseName + ".gds", GeoCore.fileType.gds); GeoCore gcGDS = gH_GDS.getGeo(); // Can we write consistent with what was read. gds.gdsWriter gw = new(gcGDS, outDir + baseName + "_out.gds"); gw.save(); // Check that we can write out the GDS-sourced drawing to Oasis, proving the internal drawing is handled consistently. oasis.oasWriter gow = new(gcGDS, outDir + baseName + "_GDSout.oas"); gow.save(); GeoCoreHandler gH_OAS = new(); gH_OAS.updateGeoCoreHandler(oasDir + baseName + ".oas", GeoCore.fileType.oasis); GeoCore gcOAS = gH_OAS.getGeo(); // Can we write consistent with what was read. oasis.oasWriter ow = new(gcOAS, outDir + baseName + "_out.oas"); ow.save(); // Check that we can write out the OAS-sourced drawing to GDS, proving the internal drawing is handled consistently. gds.gdsWriter ogw = new(gcOAS, outDir + baseName + "_OASout.gds"); ogw.save(); }
private void init() { // stubs changed = false; filename = ""; geo = new GeoCore(); valid = geo.isValid(); error_msgs = geo.error_msgs; }
private static void test_cell_export_complex() { // Note that the cell computation is for all layers/dataypes. The list of GCPolygons would need to be filtered separately for the LD of interest. string arrayDir = baseDir + "cellrefarray\\"; GeoCoreHandler gH_GDS = new(); gH_GDS.updateGeoCoreHandler(arrayDir + "L_array_nested_2.gds", GeoCore.fileType.gds); GeoCore gcGDS = gH_GDS.getGeo(); // Simple cell. gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("r"); // Only a single layer datatype. gcGDS.activeLD = gcGDS.getActiveStructureLDList().IndexOf("L1D0"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t1 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); // Array gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("a"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t2 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); // Nested array gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("b"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GCPolygon> t3 = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(); List <GCPolygon> t3a = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(layer: 1, datatype: 0); List <GCPolygon> t3b = gcGDS.getDrawing().cellList[gcGDS.activeStructure].convertToPolygons(layer: 2, datatype: 0); List <GCPolygon> t4 = gcGDS.convertToPolygons(); List <GCPolygon> t4a = gcGDS.convertToPolygons(activeLDOnly: true); List <GCPolygon> t4b = gcGDS.convertToPolygons(layer: 2, datatype: 0); if (t3.Count != t4.Count) { throw new Exception("test_cell_export_complex failed : t3,t4"); } if (t3a.Count != t4a.Count) { throw new Exception("test_cell_export_complex failed : t3a, t4a"); } if (t3b.Count != t4b.Count) { throw new Exception("test_cell_export_complex failed : t3b, t4b"); } }
private void pReadValues(GeoCoreHandler sourceGeoCoreHandler) { valid = sourceGeoCoreHandler.valid; error_msgs = sourceGeoCoreHandler.error_msgs; filename = sourceGeoCoreHandler.filename; geo = geo switch { null => new GeoCore(), _ => geo }; geo.readValues(sourceGeoCoreHandler.geo); }
private static void test_cellrefarray_nested() { string arrayDir = baseDir + "cellrefarray\\"; GeoCoreHandler gH_GDS = new(); gH_GDS.updateGeoCoreHandler(arrayDir + "L_array_nested_2.gds", GeoCore.fileType.gds); GeoCore gcGDS = gH_GDS.getGeo(); // The array is in cell 'a' gcGDS.activeStructure = gcGDS.getStructureList().IndexOf("b"); // Only a single layer datatype. gcGDS.activeLD = gcGDS.getActiveStructureLDList().IndexOf("L1D0"); gcGDS.updateGeometry(gcGDS.activeStructure, gcGDS.activeLD); List <GeoLibPointF[]> geo2 = gcGDS.points(flatten: true); }
private void pOASWriter(GeoCore gc, string filename) { drawing_ = gc.getDrawing(); filename_ = filename; namedLayers = gc.getLayerNames(); }
public oasWriter(GeoCore gc, string filename) { pOASWriter(gc, filename); }
public override void Execute() { var core = new GeoCore(); core.StoreLocations(); }
private void pGDSWriter(GeoCore gc, string filename) { drawing_ = gc.getDrawing(); filename_ = filename; }
private const bool noTerminate = false; // debug to allow file comparison during write. public gdsWriter(GeoCore gc, string filename) { pGDSWriter(gc, filename); }