This document is archived and information here might be outdated.  Recommended version.


IGeometryBridge.Densify Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Geometry)  

IGeometryBridge.Densify Method

Densify segment into the specified number of smaller segments.

[Visual Basic .NET]
Public Sub Densify ( _
    ByVal pSegment As ISegment, _
    ByVal maxDeviation As Double, _
    ByRef pcOutSegments As Integer, _
    ByRef segments As ILine[] _
)
[C#]
public void Densify (
    ISegment pSegment,
    double maxDeviation,
    ref int pcOutSegments,
    ref ILine[] segments
);
[C++]
HRESULT Densify(
  ISegment* pSegment,
  double maxDeviation,
  long* pcOutSegments,
  Array* segments
);
[C++]

Parameters pSegment [in]
pSegment is a parameter of type ISegment maxDeviation maxDeviation is a parameter of type double pcOutSegments [in, out] pcOutSegments is a parameter of type long segments [in, out] segments is a parameter of type Array

Product Availability

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

Description

All development languages compatible version of ISegment::Densify .

[C#]

    //This method demonstrates how to use the ISegment.Densify method
    private void Densify()
    {
        //Create a new closed Circular Arc segment
        IPoint center=new PointClass();
        center.PutCoords(0, 0);
        IPoint fromToPoint=new PointClass();
        fromToPoint.PutCoords(10, 10);
        ICircularArc circularArc=new CircularArcClass();
        circularArc.PutCoords(center, fromToPoint, fromToPoint, esriArcOrientation.esriArcClockwise);
        ISegment segment=circularArc as ISegment;

        //Call densify
        //maxDeviation: 0.1, tells the method that the segment must not further
        //                    a part from that distance from the curve
        //outSegments: output parameter returning the the number of segments created
        //outSegmentsArray: array will contain the output segments.
        //The array size is the max number of parts

        ILine[] outSegmentsArray=new ILine[7];
        double maxDeviation=0.1;
        int outSegments=0;
        IGeometryBridge geometryBridge=new GeometryEnvironmentClass();
        geometryBridge.Densify(segment, maxDeviation, ref outSegments, ref outSegmentsArray);
        System.Windows.Forms.MessageBox.Show("The segment array contains : " + outSegments + " segments");
    }

See Also

IGeometryBridge Interface