ArrayList parcel3DAddedList = new ArrayList(); //long private void addParcels3D() { while (parcels3DToBeAdded.Count != 0) { Parcel3D parcel3D = (Parcel3D)parcels3DToBeAdded[0]; //UnityEngine.Debug.Log(parcel3D.parCis+" se načítá"); if (!parcel3DAddedList.Contains(parcel3D.suid)) { UnityEngine.Debug.Log(parcel3D.parCis + " se načte"); //foreach (Parcel3DBoundaryFace bf in parcel3D.boundaryFaces) createBoundaryFace(bf); } parcels3DToBeAdded.Remove(parcel3D); } }
/*private void addParcel3DBoundaryFaces(Parcel3D parcel3D) * { * foreach (Parcel3DBoundaryFace boundaryFace in parcel3D.boundaryFaces) * { * * } * * ArrayList surfacePoints3D = new ArrayList(); * long bfid = -1; * foreach (ParcelPoint3D parcelPoint3D in parcelPoints3D) * { * if(parcelPoint3D.bfid != bfid && bfid != -1) * { * SurfacesToBeAdded.Add(vector3(surfacePoints3D)); * surfacePoints3D = new ArrayList(); * } * surfacePoints3D.Add(parcelPoint3D); * bfid = parcelPoint3D.bfid; * } * SurfacesToBeAdded.Add(vector3(surfacePoints3D)); * } * * private void addParcel3DLines(Parcel3D parcel3D) * { * ParcelPoint3D point1 = (ParcelPoint3D)parcelPoints3D[0]; * foreach (ParcelPoint3D point2 in parcelPoints3D) * { * if(point2.seq != 1) //predpokladam, ze jdou za sebou * { * add3DLine(point1, point2); * } * point1 = point2; * } * }*/ private Parcel3D parseParcel3DData(ArrayList parcel3DData) { //UnityEngine.Debug.Log("parseParcel3DData"); Parcel3D parcel = new Parcel3D(); parcel.boundaryFaces = new ArrayList(); Parcel3DBoundaryFace bf = new Parcel3DBoundaryFace(); bf.parrentParcel = parcel; bf.points = new ArrayList(); bf.bfid = -1; //UnityEngine.Debug.Log("parse2DParcelData... Length: " + parcel3DData.Count); //UnityEngine.Debug.Log(((String[])parcel3DData[0]).Length); foreach (string[] pointData in parcel3DData) { try { if (bf.bfid == -1) { bf.bfid = long.Parse(pointData[2]); } if (bf.bfid != long.Parse(pointData[2])) { parcel.boundaryFaces.Add(bf); bf = new Parcel3DBoundaryFace(); bf.parrentParcel = parcel; bf.points = new ArrayList(); bf.bfid = long.Parse(pointData[2]); } parcel.suid = long.Parse(pointData[0]); parcel.parCis = pointData[1]; bf.orientation = char.Parse(pointData[3]); Parcel3DPoint point = new Parcel3DPoint(); point.y = float.Parse(pointData[6]); point.x = float.Parse(pointData[5]); point.h = float.Parse(pointData[7]); bf.points.Add(point); } catch (Exception e) { UnityEngine.Debug.Log(e.Message); } } parcel.boundaryFaces.Add(bf); //UnityEngine.Debug.Log("parcela 3D... " + parcel.parCis); //UnityEngine.Debug.Log(" čílslo parcely: " + parcel.parCis); //UnityEngine.Debug.Log(" počet bf: " + parcel.boundaryFaces.Count); return(parcel); }