Interface IConstructCurve

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Provides access to members that construct a curve using other geometries and measures.

[Guid("650CFDC0-D947-11D0-830D-0000F8034032")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IConstructCurve

Methods

ConstructExtended(ICurve, ICurve, int, ref bool)

Constructs an extended version of the 'from' curve that goes to the 'to' curve. The flags are bit-wise combined esriCurveExtension values.

void ConstructExtended(ICurve fromCurve, ICurve toCurve, int extensionFlags, ref bool extensionsPerformed)

Parameters

fromCurve ICurve
toCurve ICurve
extensionFlags int
extensionsPerformed bool

Remarks

This method will return an empty geometry if you attempt to create a polygon from two linear

geometries as input. This is not a way to create a polygon from two polylines.

If the input curve is a polygon the result will be a copy of the polygon.

The flags are bit-wise combined esriCurveExtension values.

ConstructCurve ConstructExtended Example

[C#]
private void ConstructExtended()
{
   //Segment 0
   IPoint point0 = new PointClass();
   point0.PutCoords(0, 0);
   IPoint point1 = new PointClass();
   point1.PutCoords(10, 10);

ILine segment0 = new LineClass(); segment0.PutCoords(point0, point1);

//Segment 1 IPoint point2 = new PointClass(); point2.PutCoords(10, 10); IPoint point3 = new PointClass(); point3.PutCoords(10, 0);

ILine segment1 = new LineClass(); segment1.PutCoords(point2, point3);

//Segment 2 IPoint point4 = new PointClass(); point4.PutCoords(10, 0); IPoint point5 = new PointClass(); point5.PutCoords(0, 0); ILine segment2 = new LineClass(); segment2.PutCoords(point4, point5);

//Polygon object Missing = Type.Missing; ISegmentCollection segmentCollection = new PolygonClass(); segmentCollection.AddSegment(segment0 as ISegment, ref Missing, ref Missing); segmentCollection.AddSegment(segment1 as ISegment, ref Missing, ref Missing); segmentCollection.AddSegment(segment2 as ISegment, ref Missing, ref Missing); ICurve curve = segmentCollection as ICurve;

//Line IPoint point6 = new PointClass(); point6.PutCoords(-10, 20); IPoint point7= new PointClass(); point7.PutCoords(0, 5); ILine line = new Line(); line.PutCoords(point6, point7);

//Polyline ISegmentCollection polyLineSegmentCollection = new PolylineClass(); polyLineSegmentCollection.AddSegment(line as ISegment, ref Missing, ref Missing); ICurve curve1 = polyLineSegmentCollection as ICurve;

//Construct the extend IConstructCurve constructCurve = new PolylineClass(); bool isExtensionPerfomed = false; constructCurve.ConstructExtended(curve, curve1, (int) esriCurveExtension.esriDefaultCurveExtension, ref isExtensionPerfomed); }

[Visual Basic .NET]

    Private Sub ConstructExtended()
        Dim pConstructCurve As ESRI.ArcGIS.Geometry.IConstructCurve
        Dim pCurve1 As ESRI.ArcGIS.Geometry.ICurve
        Dim pCurve2 As ESRI.ArcGIS.Geometry.ICurve
        Dim pPolyLineGeoColl As ESRI.ArcGIS.Geometry.ISegmentCollection
        Dim pPolygonGeoColl As ESRI.ArcGIS.Geometry.ISegmentCollection
        Dim pSeg0 As ESRI.ArcGIS.Geometry.ILine
        Dim pSeg1 As ESRI.ArcGIS.Geometry.ILine
        Dim pSeg2 As ESRI.ArcGIS.Geometry.ILine
        Dim pLine As ESRI.ArcGIS.Geometry.ILine
        Dim pPt0 As ESRI.ArcGIS.Geometry.IPoint
        Dim pPt1 As ESRI.ArcGIS.Geometry.IPoint
        Dim bExtensionPerformed As Boolean
        'Points
        pPt0 = New ESRI.ArcGIS.Geometry.Point
        pPt1 = New ESRI.ArcGIS.Geometry.Point
        'Segment 0
        pSeg0 = New ESRI.ArcGIS.Geometry.Line
        pPt0.PutCoords(0, 0)
        pPt1.PutCoords(10, 10)
        pSeg0.PutCoords(pPt0, pPt1)
        'Segment 1
        pSeg1 = New ESRI.ArcGIS.Geometry.Line
        pPt0.PutCoords(10, 10)
        pPt1.PutCoords(10, 0)
        pSeg1.PutCoords(pPt0, pPt1)
        'Segment 2
        pSeg2 = New ESRI.ArcGIS.Geometry.Line
        pPt0.PutCoords(10, 0)
        pPt1.PutCoords(0, 0)
        pSeg2.PutCoords(pPt0, pPt1)
        'Polygon
        pPolygonGeoColl = New ESRI.ArcGIS.Geometry.Polygon
        pPolygonGeoColl.AddSegment(pSeg0)
        pPolygonGeoColl.AddSegment(pSeg1)
        pPolygonGeoColl.AddSegment(pSeg2)
        pCurve2 = pPolygonGeoColl
        'Line
        pLine = New ESRI.ArcGIS.Geometry.Line
        pPt0.PutCoords(-10, 20)
        pPt1.PutCoords(0, 5)
        pLine.PutCoords(pPt0, pPt1)
        'Polyline
        pPolyLineGeoColl = New ESRI.ArcGIS.Geometry.Polyline
        pPolyLineGeoColl.AddSegment(pLine)
        pCurve1 = pPolyLineGeoColl
        'Construct the extend
        pConstructCurve = New ESRI.ArcGIS.Geometry.Polyline
        pConstructCurve.ConstructExtended(pCurve1, pCurve2, ESRI.ArcGIS.Geometry.esriCurveExtension.esriDefaultCurveExtension, bExtensionPerformed)
    End Sub
















































ConstructKoch(IPolycurve, double, int)

Constructs a Koch snowflake fractal using the input polycurve as the generator. 'r' is not used. Do not use a value for recursionLevel > 10.

void ConstructKoch(IPolycurve p, double r, int recursionLevel)

Parameters

p IPolycurve
r double
recursionLevel int

Remarks

 

ConstructCurve ConstructKoch Example

ConstructOffset(IPolycurve, double, ref object, ref object)

Constructs a curve being the locus of points offset a given distance from another curve. See the enumeration esriConstructOffsetEnum to information on different ways that offset curve can be generated.

void ConstructOffset(IPolycurve inCurve, double Offset, ref object offsetHow, ref object bevelRatio)

Parameters

inCurve IPolycurve
Offset double
offsetHow object
bevelRatio object

Remarks

This results produced by this method are sensitive to large offset distances, particularly when the offset distance is larger than the length of the segments in the reference geometry.  The remove self intersecting arcs feature is particularly problematic when extremely large offsets are involved. 

The sides of the curve are determined from the order of the vertices of the curve.  Tracing the curve from the first vertex to the last will give you a direction along the curve it is to the right and left of this direction that the positive and negative parameters will dictate where the offset is constructed.  In these terms it is simple to infer where the offset will be constructed.

One alternative is to use buffer to generate the offsets. 

[C#]

//This example demonstrate how to use IConstructCurve::ConstructOffset
private IPolyline ConstructOffset(IPolyline inPolyline, double offset)
{
    if (inPolyline == null || inPolyline.IsEmpty)
    {
        return null;
    }
    object Missing = Type.Missing;
    IConstructCurve constructCurve = new PolylineClass();
    constructCurve.ConstructOffset(inPolyline, offset, ref Missing, ref Missing);
    return constructCurve as IPolyline;
}










[Visual Basic .NET]

    'This example demonstrate how to use IConstructCurve::ConstructOffset
    Private Function ConstructOffset(ByVal pInPolyline As IPolyline, ByVal dOffset As Double) As IPolyline
        Dim pConstructCurve As IConstructCurve
        On Error GoTo ErrorHandler


        If pInPolyline Is Nothing Or pInPolyline.IsEmpty Then

ConstructOffset = Nothing

Exit Function
End If


        pConstructCurve = New Polyline

pConstructCurve.ConstructOffset(pInPolyline, dOffset, esriConstructOffsetEnum.esriConstructOffsetRounded + esriConstructOffsetEnum.esriConstructOffsetSimple)
ConstructOffset = pConstructCurve
Exit Function


ErrorHandler:
        ConstructOffset = Nothing
    End Function