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


IConstructMultipoint.ConstructIntersection Method (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Geometry)  

IConstructMultipoint.ConstructIntersection Method

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
);
[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* params2 [out, optional]
params2 is a parameter of type VARIANT* isTangentPoint [out, optional]
isTangentPoint is a parameter of type VARIANT*

Product Availability

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

Description

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.

Remarks

 

IConstructMultipoint ConstructIntersection Example

[C#]
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);
  }
}
[Visual Basic .NET]

    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

See Also

IConstructMultipoint Interface | ITopologicalOperator.Intersect Method | IConstructMultipoint.ConstructIntersectionEx Method | IConstructMultipoint.ConstructIntersection Method