This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IC > IConstructMultipoint Interface > IConstructMultipoint.ConstructIntersection Method (ArcObjects .NET 10.4 SDK) |
Constructs the point(s) of intersection/tangency between two segments. Different ways of extending the segments in order to locate additional points can be specified.
[Visual Basic .NET] Public Sub ConstructIntersection ( _ ByVal segment1 As ISegment, _ ByVal extension1 As esriSegmentExtension, _ ByVal segment2 As ISegment, _ ByVal extension2 As esriSegmentExtension, _ [ByRef params1 As Object], _ [ByRef params2 As Object], _ [ByRef isTangentPoint As Object] _ )
[C#] public void ConstructIntersection ( ISegment segment1, esriSegmentExtension extension1, ISegment segment2, esriSegmentExtension extension2, ref object params1, ref object params2, ref object isTangentPoint );
Optional Values
[C++]
HRESULT ConstructIntersection(
ISegment* segment1,
esriSegmentExtension extension1,
ISegment* segment2,
esriSegmentExtension extension2,
VARIANT* params1,
VARIANT* params2,
VARIANT* isTangentPoint
);
[C++]
Parameters segment1
segment1 is a parameter of type ISegment extension1
extension1 is a parameter of type esriSegmentExtension segment2
segment2 is a parameter of type ISegment extension2
extension2 is a parameter of type esriSegmentExtension params1 [out, optional] params1 is a parameter of type VARIANT
To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND. params2 [out, optional] params2 is a parameter of type VARIANT
To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND. isTangentPoint [out, optional] isTangentPoint is a parameter of type VARIANT
To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.
Constructs a Multipoint containing the points of intersection and tangency between two input geometries. The input geometries can be extended by any of the esriSegmentExtension methods. Optionally, the construction method also returns the relative position and tangency of the intersection point along each curve.
private void ConstructIntersection() { IPoint[] points=new IPoint[4]; for(int i=0; i < 4; i++) { points[i]=new PointClass(); } points[0].PutCoords(150, 100); points[1].PutCoords(200, 600); points[2].PutCoords(400, 600); points[3].PutCoords(450, 100); IBezierCurveGEN bezierCurve=new BezierCurveClass(); bezierCurve.PutCoords(ref points); IPoint centerPoint=new PointClass(); centerPoint.PutCoords(300, 300); IPoint fromPoint=new PointClass(); fromPoint.PutCoords(100, 100); IPoint toPoint=new PointClass(); toPoint.PutCoords(500, 100); IConstructCircularArc circularArcConstruction=new CircularArcClass(); circularArcConstruction.ConstructThreePoints(fromPoint, centerPoint, toPoint, false); //params optional object param0; object param1; object isTangentPoint; IConstructMultipoint constructMultipoint=new MultipointClass(); constructMultipoint.ConstructIntersection(circularArcConstruction as ISegment, esriSegmentExtension.esriNoExtension, bezierCurve as ISegment, esriSegmentExtension.esriNoExtension, out param0, out param1, out isTangentPoint); IMultipoint multipoint=constructMultipoint as IMultipoint; IPointCollection pointCollection=multipoint as IPointCollection; for (int i=0; i < pointCollection.PointCount; i++) { System.Windows.Forms.MessageBox.Show("Point : " + i + " X=" + pointCollection.get_Point(i).X + " Y=" + pointCollection.get_Point(i).Y); } }
Private Sub ConstructIntersection()
Dim pConstructCircularArc As ESRI.ArcGIS.Geometry.IConstructCircularArc
Dim pCArc As ESRI.ArcGIS.Geometry.ICircularArc
Dim pPoint1 As ESRI.ArcGIS.Geometry.IPoint
Dim pPoint2 As ESRI.ArcGIS.Geometry.IPoint
Dim pPoint3 As ESRI.ArcGIS.Geometry.IPoint
Dim pTcoll As ESRI.ArcGIS.Geometry.IPointCollection
Dim pConstructMultipoint As ESRI.ArcGIS.Geometry.IConstructMultipoint
Dim pMultipoint As ESRI.ArcGIS.Geometry.IMultipoint
Dim i As Long
Dim pBezier As ESRI.ArcGIS.Geometry.IBezierCurve
Dim pPtCon(0 To 3) As ESRI.ArcGIS.Geometry.IPoint
For i=0 To 3
pPtCon(i)=New ESRI.ArcGIS.Geometry.Point
Next
pPtCon(0).PutCoords(150, 100)
pPtCon(1).PutCoords(200, 600)
pPtCon(2).PutCoords(400, 600)
pPtCon(3).PutCoords(450, 100)
pBezier=New ESRI.ArcGIS.Geometry.BezierCurve
pBezier.PutCoords(4, pPtCon(0))
pConstructMultipoint=New ESRI.ArcGIS.Geometry.Multipoint
pConstructCircularArc=New ESRI.ArcGIS.Geometry.CircularArc
pCArc=pConstructCircularArc
pPoint1=New ESRI.ArcGIS.Geometry.Point
pPoint2=New ESRI.ArcGIS.Geometry.Point
pPoint3=New ESRI.ArcGIS.Geometry.Point
pPoint1.PutCoords(100, 100)
pPoint2.PutCoords(300, 300)
pPoint3.PutCoords(500, 100)
pConstructCircularArc.ConstructThreePoints(pPoint1, pPoint2, pPoint3, False)
pConstructMultipoint.ConstructIntersection(pCArc, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, pBezier, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension)
pMultipoint=pConstructMultipoint
pTcoll=pMultipoint
Debug.Print("*********************************************")
Debug.Print(" Report the intersection points")
Debug.Print("*********************************************")
For i=0 To pTcoll.PointCount - 1
Debug.Print("Point : " & pTcoll.Point(i).X & " , " & pTcoll.Point(i).Y)
Next
End Sub
IConstructMultipoint Interface | ITopologicalOperator.Intersect Method | IConstructMultipoint.ConstructIntersectionEx Method | IConstructMultipoint.ConstructIntersection Method