ArcObjects Library Reference (Geometry)  

Ring CoClass

An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Extended Error Information

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

Interfaces Description
IArea Provides access to members that return properties common to rings and polygons.
IClone (esriSystem) Provides access to members that control cloning of objects.
IConstructPath Provides access to members that construct a path using other geometries and measures.
ICurve Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.).
ICurve3D Provides access to members that define operations common to curves with Zs.
IGeometry Provides access to members that describe properties and behavior of all geometric objects.
IPath Provides access to members that identify a path and define its behavior.
IPointCollection Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch.
IPointCollection3 Provides access to members that manipulate the points of a Multipoint.
IPointCollection4 Provides access to members that manipulate the points of a Multipoint, Path, Ring, Polyline, Polygon, TriangleFan, TriangleStrip, or MultiPatch.
IRing Provides access to members that identify a ring and define its behavior.
IRing2 Provides extended access to members that identify a ring and define its behavior.
ISegmentCollection Provides access to members that manipulate the segments of a path, ring, polyline, or polygon.
ISupportErrorInfo Indicates whether a specific interface can return Automation error objects.
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.
IXMLSerialize (esriSystem) Provides access to members that XML serialize and deserialize an object to/from XML.
[C#]

 

        private static object _missing = Type.Missing;

 

        public static IGeometry GetRingGeometry()

        {
            const double RingVertexCount = 9;

            const double RingDegrees = 360.0;

            const double VectorComponentOffset = 0.0000001;

            const double RingRadius = 5;

 

            IPoint centerPoint = ConstructPoint3D(-7.5, -7.5, 7.5);

 

            IPointCollection pointCollection = new RingClass();

 

            IVector3D upperAxisVector3D = ConstructVector3D(0, 0, 10);

 

            IVector3D lowerAxisVector3D = ConstructVector3D(0, 0, -10);

 

            lowerAxisVector3D.XComponent += VectorComponentOffset;

 

            IVector3D normalVector3D =
                   upperAxisVector3D.CrossProduct(lowerAxisVector3D) as IVector3D;

 

            normalVector3D.Magnitude = RingRadius;

 

            double rotationAngleInRadians =
                   GetRadians(RingDegrees / RingVertexCount);

 

            for (int i = 0; i < RingVertexCount; i++)

            {

                   normalVector3D.Rotate(
                          -1 * rotationAngleInRadians, upperAxisVector3D
                   );

 

                   pointCollection.AddPoint(

                          ConstructPoint3D(

                                 centerPoint.X + normalVector3D.XComponent,

                                 centerPoint.Y + normalVector3D.YComponent,

                                 centerPoint.Z

                          ),
                          ref _missing, ref _missing
                   );

            }

 

            pointCollection.AddPoint(
                   pointCollection.get_Point(0),
                   ref _missing, ref _missing
            );

 

            return pointCollection 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;

        }