// Public Methods (4) /// <summary> /// Clone the object /// </summary> /// <returns></returns> public override object Clone() { var vg = new PixelGrid2D(_BBox, _PixelSize); for (var i = 0; i < Count; i++) { vg[i] = this[i]; } return(vg); }
/// <summary> /// VoxelGrid constructor: Copies (clone) a VoxelGrid from another voxelGrid /// Complexity O(n) for voxelsize /// </summary> /// <param name="vg"></param> public PixelGrid2D(PixelGrid2D vg) { // struct: should be copy _BBox = vg._BBox; // struct: should be copy _PixelSize = vg.PixelSize; // struct: should be copy SizeUV = vg.SizeUV; // class: needs deep copy Grid = new BitArray(vg.Grid.Count); for (var i = 0; i < vg.Grid.Count; i++) { Grid[i] = vg.Grid[i]; } }