This document is archived and information here might be outdated. Recommended version. |
Changes this arc into its complement; 'from' and 'to' points are unchanged.
[Visual Basic .NET]
Public Sub Complement ( _
)
[C#]
public void Complement (
);
[C++]
HRESULT Complement(
void
);
The Complement of a CircularArc is the CircularArc between the ToPoint and the FromPoint of the original CircularArc that creates a full circle when combined with the original CircularArc. The Complement maintains the same FromPoint and ToPoint as the original CircularArc, but has the different IsMinor and IsCounterClockwise values.
//This example shows how to create a Complement of Circular arc.
static void ComplementArcs()
{
//Create three points to draw an arc through.
IPoint point1 = new ESRI.ArcGIS.Geometry.Point();
IPoint point2 = new ESRI.ArcGIS.Geometry.Point();
IPoint point3 = new ESRI.ArcGIS.Geometry.Point();
point1.PutCoords(200, 200);
point2.PutCoords(200, 300);
point3.PutCoords(300, 300);
//Construct a Three Point Arc and draw as solid line.
IConstructCircularArc constructionArc = new CircularArc() as IConstructCircularArc;
constructionArc.ConstructThreePoints(point1, point2, point3, true);
//Draw the compliment of the previous arc as dashed line.
ICircularArc evilCircularArc = constructionArc as ICircularArc;
evilCircularArc.Complement();
}
Public Sub ComplementArcs()
'Create three points to draw an arc through.
Dim pPoint1 As ESRI.ArcGIS.Geometry.IPoint, pPoint2 As ESRI.ArcGIS.Geometry.IPoint, pPoint3 As ESRI.ArcGIS.Geometry.IPoint
pPoint1 = eCreatePoint(200, 200)
pPoint2 = eCreatePoint(200, 300)
pPoint3 = eCreatePoint(300, 300)
'Construct a Three Point Arc and draw as solid line.
Dim pCArc As ESRI.ArcGIS.Geometry.IConstructCircularArc
pCArc = New ESRI.ArcGIS.Geometry.CircularArc
pCArc.ConstructThreePoints(pPoint1, pPoint2, pPoint3, True)
'Create the compliment of the previous arc as dashed line.
Dim pCArcCmp As ESRI.ArcGIS.Geometry.ICircularArc
pCArcCmp = pCArc
pCArcCmp.Complement()
End Sub
Public Function eCreatePoint(ByVal X As Double, ByVal Y As Double) As ESRI.ArcGIS.Geometry.IPoint
eCreatePoint = New ESRI.ArcGIS.Geometry.PointClass()
eCreatePoint.PutCoords(X, Y)
End Function