This document is archived and information here might be outdated. Recommended version. |
A collection of 3D triangles, where each consecutive triplet of vertices defines a new triangle
Use the ISupportErrorInfo method InterfaceSupportsErrorInfo to determine if the object supports extended error information. If the object supports extended error info, VC++ developers should use the OLE/COM IErrorInfo interface to access the ErrorInfo object. Visual Basic developers should use the global error object Err to retrieve this extended error information.
Interfaces | Description |
---|---|
IClone (esriSystem) | Provides access to members that control cloning of objects. |
IGeometry | Provides access to members that describe properties and behavior of all geometric objects. |
IGeometry2 | Provides access to members that extend the IGeometry interface with a more sophisticated projection method. |
IGeometryCollection | Provides access to members that can be used for accessing, adding and removing individual geometries of a multi-part geometry (Multipoint, Polyline, Polygon, MultiPatch, and GeometryBag). |
IMAware | Indicator interface that identifies geometric objects that can have persistent M values attached to their vertices. |
IPointCollection | Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch. |
IPointCollection4 | Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch. |
IPointIDAware | Indicator interface that identifies geometries that can have persistent point ID values attached to coordinates. |
ISupportErrorInfo (esriSystem) | |
ITransform2D | Provides access to methods for transforming geometries using either specific parameters or arbitrary transformation objects (affine transformations, geographic transformations, etc.). |
ITransform3D | Provides access to methods for transforming 3D geometries using either specific parameters or arbitrary transformation objects. |
ITriangles | Indicator interface that identifies a Triangles patch. |
IXMLSerialize (esriSystem) | Provides access to members that XML serialize and deserialize an object to/from XML. |
IZAware | Indicator interface that identifies geometries that can have persistent Z values attached to their vertices. |
private static object _missing = Type.Missing;
public static IGeometry GetTrianglesGeometry()
{
//Triangles: Six Triangles Lying In Different Planes
IPointCollection trianglesPointCollection =
new TrianglesClass();
//Triangle 1
trianglesPointCollection.AddPoint(
ConstructPoint3D(7.5, 7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(10, 7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(7.5, 5, 0),
ref _missing, ref _missing
);
//Triangle 2
trianglesPointCollection.AddPoint(
ConstructPoint3D(-7.5, 7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(-5, 7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(-7.5, 5, 0),
ref _missing, ref _missing
);
//Triangle 3
trianglesPointCollection.AddPoint(
ConstructPoint3D(0, -5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(2.5, -5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(0, -7.5, 0),
ref _missing, ref _missing
);
//Triangle 4
trianglesPointCollection.AddPoint(
ConstructPoint3D(0, 7.5, 2.5),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(2.5, 7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(0, 7.5, 0),
ref _missing, ref _missing
);
//Triangle 5
trianglesPointCollection.AddPoint(
ConstructPoint3D(-7.5, -7.5, 2.5),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(-5, -7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(-7.5, -7.5, 0),
ref _missing, ref _missing
);
//Triangle 6
trianglesPointCollection.AddPoint(
ConstructPoint3D(7.5, -7.5, 2.5),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(10, -7.5, 0),
ref _missing, ref _missing
);
trianglesPointCollection.AddPoint(
ConstructPoint3D(7.5, -7.5, 0),
ref _missing, ref _missing
);
return trianglesPointCollection as IGeometry;
}
private static IPoint ConstructPoint3D(double x, double y, double z)
{
IPoint point = ConstructPoint2D(x, y);
point.Z = z;
return point;
}
private static IPoint ConstructPoint2D(double x, double y)
{
IPoint point = new PointClass();
point.PutCoords(x, y);
return point;
}