This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IC > IConstructCurve Interface > IConstructCurve.ConstructExtended Method (ArcObjects .NET 10.4 SDK) |
Constructs an extended version of the 'from' curve that goes to the 'to' curve. The flags are bit-wise combined esriCurveExtension values.
[Visual Basic .NET] Public Sub ConstructExtended ( _ ByVal fromCurve As ICurve, _ ByVal toCurve As ICurve, _ ByVal extensionFlags As Integer, _ ByRef extensionsPerformed As Boolean _ )
[C#] public void ConstructExtended ( ICurve fromCurve, ICurve toCurve, int extensionFlags, ref bool extensionsPerformed );
[C++]
HRESULT ConstructExtended(
ICurve* fromCurve,
ICurve* toCurve,
long extensionFlags,
VARIANT_BOOL* extensionsPerformed
);
[C++]
Parameters fromCurve
fromCurve is a parameter of type ICurve toCurve
toCurve is a parameter of type ICurve extensionFlags extensionFlags is a parameter of type long extensionsPerformed [in, out] extensionsPerformed is a parameter of type VARIANT_BOOL
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.
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); }
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