//helper method to read an output slice private unsafe void readOutputSlice(void *result, bool mode2D, double z, int sliceIdx, MultiSlicerInterface.MultiCfg.PathType pathtype, Color[] colorList, Transaction tr, BlockTableRecord btr) { Color col; SI.OutputSliceInfo info = dll.getOutputSliceInfo(result, sliceIdx, (int)pathtype); int numpaths = info.numpaths; if (numpaths == 0) { return; } int * numpointss = info.numpointsArray; long **paths = info.pathsArray; double scalingFactor = dll.factor_internal_to_input; if (!mode2D) { z = info.z * dll.factor_internal_to_input; col = colorList[info.ntool]; } else { col = colorList[sliceIdx]; } for (int i = 0; i < numpaths; i++) { int numpoints = *(numpointss++); long * path = *(paths++); Polyline p = new Polyline(); if (numpoints > 0) { for (int j = 0; j < numpoints; j++) { p.AddVertexAt(j, new Point2d((*(path++)) * scalingFactor, (*(path++)) * scalingFactor), 0, 0, 0); } p.Color = col; p.Elevation = z; addPolyline(tr, btr, p); } } }
public unsafe OutputSliceInfo readOutputSlice(void *obj, int idx, MultiCfg.PathType pathtype) { return(dll.getOutputSliceInfo(obj, idx, (int)pathtype)); }