Provides access to members that construct a line segment using other geometries and measures.
Description
Methods for constructing a Line segment based either on the bisection of an angle defined by three input points or the extension of an existing Line to the boundary of the Spatial Reference.
Members
Name | Description | |
---|---|---|
ConstructAngleBisector | Constructs a line segment being the bisector through the angle defined by the three input points. | |
ConstructExtended | Extends a line segment until one or both of its endpoints reaches the boundary of the domain of the line's associated spatial reference. |
IConstructLine.ConstructAngleBisector Method
Constructs a line segment being the bisector through the angle defined by the three input points.
Public Sub ConstructAngleBisector ( _
ByVal from As IPoint, _
ByVal through As IPoint, _
ByVal to As IPoint, _
ByVal Length As Double, _
ByVal useAcuteAngle As Boolean _
)
public void ConstructAngleBisector (
IPoint from,
IPoint through,
IPoint to,
double Length,
bool useAcuteAngle
);
Description
Constructs a Line segment of given input Length which bisects the Angle formed by the right side of the three input points. The From Point of the new Line is the Through input point. If the right side angle is smaller, the constructed Line will always bisect this angle, regardless of the value of bUseSmallerAngle. However, if the right side angle is larger, and bUseSmallerAngle is TRUE, then the constructed line will bisect the smaller angle (left side) instead of the right side reflex angle.
Remarks
// This example constructs a new line using the ConstructAngleBisector method.
// Note the usage of the acute angle.
public void ConstructLineFromAngleBisector()
{
IPoint fromPoint = new PointClass();
fromPoint.PutCoords(1, 0);
IPoint throughPoint = new PointClass();
throughPoint.PutCoords(1, 1);
IPoint toPoint = new PointClass();
toPoint.PutCoords(0, 1);
IConstructLine constructLine = new LineClass();
double distance = 1.4142135623731;
constructLine.ConstructAngleBisector(fromPoint, throughPoint, toPoint, distance, false);
ILine line = constructLine as ILine;
printProperties(line);
// Now use the the acute angle with the same data.
//Gives same results as setting dDist to -1.4142135623731 and not using
// the acute angle.
constructLine.ConstructAngleBisector(fromPoint, throughPoint, toPoint, distance, true);
ILine line2 = constructLine as ILine;
printProperties(line2);
}
private void printProperties(ILine line)
{
IPoint outFromPoint = new PointClass();
IPoint outToPoint = new PointClass();
line.QueryCoords(outFromPoint, outToPoint);
System.Windows.Forms.MessageBox.Show(outFromPoint.X + " , " +
outFromPoint.Y + " , " +
outToPoint.X + " , " +
outToPoint.Y + "\n" +
"angle = " + line.Angle);
}
'+++ This example constructs a new line using the ConstructAngleBisector method.
'+++ Note the usage of the acute angle.
Public Sub t_Line_ConstructAngleBisector()
On Error GoTo Errorhandler
Dim pPointFrom As IPoint
Dim pPointTo As IPoint
Dim pPointThrough As IPoint
Dim pLine As ILine
Dim pCLine As IConstructLine
Dim dDist As Double
Dim pP1 As IPoint
Dim pP2 As IPoint
pPointFrom = New Point
pPointTo = New Point
pPointThrough = New Point
pLine = New Line
pCLine = New Line
pP1 = New Point
pP2 = New Point
pPointFrom.PutCoords(1, 0)
pPointTo.PutCoords(0, 1)
pPointThrough.PutCoords(1, 1)
dDist = 1.4142135623731
pCLine.ConstructAngleBisector(pPointFrom, pPointThrough, pPointTo, dDist, False)
pLine = pCLine
pLine.QueryCoords(pP1, pP2)
MsgBox(pP1.X & "," & pP1.Y & " to " & pP2.X & "," & pP2.Y _
& vbCrLf & "angle = " & pLine.Angle)
'+++ Now use the the acute angle with the same data.
'+++ Gives same results as setting dDist to -1.4142135623731 and not using
'+++ the acute angle.
pCLine.ConstructAngleBisector(pPointFrom, pPointThrough, pPointTo, dDist, True)
pLine = pCLine
pLine.QueryCoords(pP1, pP2)
MsgBox(pP1.X & "," & pP1.Y & " to " & pP2.X & "," & pP2.Y _
& vbCrLf & "angle = " & pLine.Angle)
Exit Sub
Errorhandler:
MsgBox(Err.Number & "..." & Err.Description)
Exit Sub
End Sub
IConstructLine.ConstructExtended Method
Extends a line segment until one or both of its endpoints reaches the boundary of the domain of the line's associated spatial reference.
Public Sub ConstructExtended ( _
ByVal inLine As ILine, _
ByVal extendHow As esriSegmentExtension _
)
public void ConstructExtended (
ILine inLine,
esriSegmentExtension extendHow
);
Description
Extends a line to the maximum extent of the Spatial Reference given a desired extension method.
Remarks
To extend a Line to another Curve, wrap the Line in a Polyline and use IConstructCurve::ConstructExtended.
Classes that implement IConstructLine
Classes | Description |
---|---|
Line | A 2D straight line between a pair of 2D endpoints; can optionally have height, measure and ID attributes at each endpoint. |