public static IGeometry GetExample3() { //Triangles: Three Upright Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 7.5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample3() { //Triangles: Three Upright Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, 2.5, 7.5), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-2.5, -2.5, 7.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -2.5, 7.5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; }
public static IGeometry GetExample1() { //Triangles: One Triangle Lying On XY Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; }
public static IGeometry GetExample1() { //Triangles: One Triangle Lying On XY Plane IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 2.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 2.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public MultiPatchConstruction StartTris(IPoint p) { EndPatch(); object missing = Type.Missing; IPointCollection newTris = new TrianglesClass(); newTris.AddPoint(p, ref missing, ref missing); _currentPatch = (IGeometry)newTris; return(this); }
public static IGeometry GetExample3() { //Composite: House Composed Of 7 Ring, 1 TriangleStrip, And 1 Triangles Parts IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Base (Exterior Ring) IPointCollection basePointCollection = new RingClass(); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(basePointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(basePointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(basePointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Front With Cutaway For Door (Exterior Ring) IPointCollection frontPointCollection = new RingClass(); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 1, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 1, 4), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -1, 4), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -1, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); frontPointCollection.AddPoint(frontPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(frontPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(frontPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Back (Exterior Ring) IPointCollection backPointCollection = new RingClass(); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); backPointCollection.AddPoint(backPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(backPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(backPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Right Side (Ring Group) //Exterior Ring IPointCollection rightSideExteriorPointCollection = new RingClass(); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(rightSideExteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(rightSideExteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(rightSideExteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring IPointCollection rightSideInteriorPointCollection = new RingClass(); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 4), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 2), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 2), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 4), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(rightSideInteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(rightSideInteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(rightSideInteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchInnerRing); //Left Side (Ring Group) //Exterior Ring IPointCollection leftSideExteriorPointCollection = new RingClass(); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(leftSideExteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(leftSideExteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(leftSideExteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring IPointCollection leftSideInteriorPointCollection = new RingClass(); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 4), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 4), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 2), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 2), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(leftSideInteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(leftSideInteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(leftSideInteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchInnerRing); //Roof IPointCollection roofPointCollection = new TriangleStripClass(); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 9), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 9), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(roofPointCollection as IGeometry, ref _missing, ref _missing); //Triangular Area Between Roof And Front/Back IPointCollection triangularAreaPointCollection = new TrianglesClass(); //Area Between Roof And Front triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 9), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); //Area Between Roof And Back triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 9), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangularAreaPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; }
public static IGeometry GetExample3() { //Composite: House Composed Of 7 Ring, 1 TriangleStrip, And 1 Triangles Parts IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IMultiPatch multiPatch = multiPatchGeometryCollection as IMultiPatch; //Base (Exterior Ring) IPointCollection basePointCollection = new RingClass(); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); basePointCollection.AddPoint(basePointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(basePointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(basePointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Front With Cutaway For Door (Exterior Ring) IPointCollection frontPointCollection = new RingClass(); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 1, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 1, 4), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -1, 4), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -1, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); frontPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); frontPointCollection.AddPoint(frontPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(frontPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(frontPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Back (Exterior Ring) IPointCollection backPointCollection = new RingClass(); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); backPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); backPointCollection.AddPoint(backPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(backPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(backPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Right Side (Ring Group) //Exterior Ring IPointCollection rightSideExteriorPointCollection = new RingClass(); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 0), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 0), ref _missing, ref _missing); rightSideExteriorPointCollection.AddPoint(rightSideExteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(rightSideExteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(rightSideExteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring IPointCollection rightSideInteriorPointCollection = new RingClass(); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 4), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, 4, 2), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 2), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, 4, 4), ref _missing, ref _missing); rightSideInteriorPointCollection.AddPoint(rightSideInteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(rightSideInteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(rightSideInteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchInnerRing); //Left Side (Ring Group) //Exterior Ring IPointCollection leftSideExteriorPointCollection = new RingClass(); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 0), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 0), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); leftSideExteriorPointCollection.AddPoint(leftSideExteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(leftSideExteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(leftSideExteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchOuterRing); //Interior Ring IPointCollection leftSideInteriorPointCollection = new RingClass(); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 4), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 4), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-1, -4, 2), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(1, -4, 2), ref _missing, ref _missing); leftSideInteriorPointCollection.AddPoint(leftSideInteriorPointCollection.get_Point(0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(leftSideInteriorPointCollection as IGeometry, ref _missing, ref _missing); multiPatch.PutRingType(leftSideInteriorPointCollection as IRing, esriMultiPatchRingType.esriMultiPatchInnerRing); //Roof IPointCollection roofPointCollection = new TriangleStripClass(); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 9), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 9), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); roofPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(roofPointCollection as IGeometry, ref _missing, ref _missing); //Triangular Area Between Roof And Front/Back IPointCollection triangularAreaPointCollection = new TrianglesClass(); //Area Between Roof And Front triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 9), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 4, 6), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, -4, 6), ref _missing, ref _missing); //Area Between Roof And Back triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 0, 9), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -4, 6), ref _missing, ref _missing); triangularAreaPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 4, 6), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(triangularAreaPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public void CreatEnclose() { //边界索引 //UP ArrayList[] UpIndexList = new ArrayList[4]; //DOWN ArrayList[] DownIndexList = new ArrayList[4]; for (int i = 0; i < 4; i++) { UpIndexList[i] = new ArrayList(); DownIndexList[i] = new ArrayList(); } //四壁 for (int i = 0; i < NodeCount - 4; i++) { if (orderNodeU[i].Y < YMin + RasterSize / 2) { UpIndexList[0].Add(i); } if (orderNodeU[i].X > XMax - RasterSize / 2) { UpIndexList[1].Add(i); } if (orderNodeU[i].Y > YMax - RasterSize / 2) { UpIndexList[2].Add(i); } if (orderNodeU[i].X < XMin + RasterSize / 2) { UpIndexList[3].Add(i); } } for (int i = 0; i < 4; i++) { DownIndexList[i].AddRange(UpIndexList[i]); DownIndexList[i].Reverse(); } multiPatchGeometryCollection[TINID] = new MultiPatchClass(); IPointCollection[] ringPointCollection = new IPointCollection[4]; int[] BoundryCount = new int[4]; for (int i = 0; i < 4; i++) { BoundryCount[i] = UpIndexList[i].Count; ringPointCollection[i] = new RingClass(); } for (int i = 0; i < 4; i++) { //up for (int j = 0; j < BoundryCount[i]; j++) { IPoint Upoint = new PointClass(); Material.MakeZAware(Upoint); orderNodeU[(int)(UpIndexList[i])[j]].QueryAsPoint(Upoint); ringPointCollection[i].AddPoint(Upoint, ref _missing, ref _missing); } //down for (int j = 0; j < BoundryCount[i]; j++) { IPoint Dpoint = new PointClass(); Material.MakeZAware(Dpoint); orderNodeD[(int)(DownIndexList[i])[j]].QueryAsPoint(Dpoint); ringPointCollection[i].AddPoint(Dpoint, ref _missing, ref _missing); } //最后一点 IPoint LastPoint = new PointClass(); Material.MakeZAware(LastPoint); orderNodeU[(int)(UpIndexList[i])[0]].QueryAsPoint(LastPoint); ringPointCollection[i].AddPoint(LastPoint, ref _missing, ref _missing); } for (int j = 0; j < 4; j++) { multiPatchGeometryCollection[TINID].AddGeometry(ringPointCollection[j] as IGeometry, ref _missing, ref _missing); } ////添加上下曲面 //up int triangleCountU = tinU.TriangleCount; for (int i = 0; i < triangleCountU; i++) { bool add = true; ITinTriangle triangleU = tinU.GetTriangle(i + 1); if (triangleU.IsEmpty) { continue; } IPointCollection trianglePointCollection = new TrianglesClass();; for (int j = 0; j < 3; j++) { IPoint tp = new PointClass(); Material.MakeZAware(tp); (triangleU.get_Node(j)).QueryAsPoint(tp); if (tp.Z.Equals(Double.NaN)) { add = false; break; } trianglePointCollection.AddPoint(tp, ref _missing, ref _missing); } if (add == true) { multiPatchGeometryCollection[TINID].AddGeometry(trianglePointCollection as IGeometry, ref _missing, ref _missing); } } //down int triangleCountD = tinD.TriangleCount; for (int i = 0; i < triangleCountD; i++) { bool add = true; ITinTriangle triangleD = tinD.GetTriangle(i + 1); if (triangleD.IsEmpty) { continue; } IPointCollection trianglePointCollection = new TrianglesClass();; for (int j = 0; j < 3; j++) { IPoint tp = new PointClass(); Material.MakeZAware(tp); (triangleD.get_Node(j)).QueryAsPoint(tp); if (tp.Z.Equals(Double.NaN)) { add = false; break; } trianglePointCollection.AddPoint(tp, ref _missing, ref _missing); } if (add == true) { multiPatchGeometryCollection[TINID].AddGeometry(trianglePointCollection as IGeometry, ref _missing, ref _missing); } } }
public static IGeometry GetExample4() { //Triangles: Six Triangles Lying In Different Planes IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 0), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 0), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 0), ref _missing, ref _missing); //Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 0), ref _missing, ref _missing); //Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 0), ref _missing, ref _missing); //Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; }
public static IGeometry GetExample6() { //Triangles: Closed Box Constructed From Single Triangles Part Composed Of 12 Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass() as IGeometryCollection; IPointCollection trianglesPointCollection = new TrianglesClass() as IPointCollection; //Bottom trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); //Side 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); //Side 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); //Side 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); //Side 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); //Top trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return multiPatchGeometryCollection as IGeometry; }
public static IGeometry GetExample4() { //Triangles: Six Triangles Lying In Different Planes IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass(); IPointCollection trianglesPointCollection = new TrianglesClass(); //Triangle 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, 5, 0), ref _missing, ref _missing); //Triangle 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, 5, 0), ref _missing, ref _missing); //Triangle 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, -5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, -7.5, 0), ref _missing, ref _missing); //Triangle 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(2.5, 7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 7.5, 0), ref _missing, ref _missing); //Triangle 5 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-5, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(-7.5, -7.5, 0), ref _missing, ref _missing); //Triangle 6 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 2.5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(10, -7.5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(7.5, -7.5, 0), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }
public static IGeometry GetExample6() { //Triangles: Closed Box Constructed From Single Triangles Part Composed Of 12 Triangles IGeometryCollection multiPatchGeometryCollection = new MultiPatchClass() as IGeometryCollection; IPointCollection trianglesPointCollection = new TrianglesClass() as IPointCollection; //Bottom trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); //Side 1 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); //Side 2 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); //Side 3 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); //Side 4 trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 0), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); //Top trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(0, 0, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 5, 5), ref _missing, ref _missing); trianglesPointCollection.AddPoint(GeometryUtilities.ConstructPoint3D(5, 0, 5), ref _missing, ref _missing); multiPatchGeometryCollection.AddGeometry(trianglesPointCollection as IGeometry, ref _missing, ref _missing); return(multiPatchGeometryCollection as IGeometry); }