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 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 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); }