Provides access to members that identify third degree bezier curve segments and defines their properties.
Description
A Bezier Curve is a non-linear Segment defined by four control points. The bezier curve starts at control point 0 and ends at control point 3. Control points 0 and 1 define the tangent at the from point and control points 2 and 3 define the tangent at the to point. The length of these tangent lines and position of the control points determines the shape of the created bezier curve.
When To Use
The IBezierCurve interface is used to define the properties/behavior of a Bezier Curve. For example, use the methods in this interface to put control points to define a Bezier Curve object or query an existing Bezier Curve object to get its four control points.
Members
Name | Description | |
---|---|---|
Degree | The degree of the Bezier curve. For third degree Beziers, this is always 3. | |
Dimension | The topological dimension of this geometry. | |
Envelope | Creates a copy of this geometry's envelope and returns it. | |
FromPoint | The 'from' point of the curve. | |
GeometryType | The type of this geometry. | |
GeoNormalize | Shifts longitudes, if need be, into a continuous range of 360 degrees. | |
GeoNormalizeFromLongitude | Normalizes longitudes into a continuous range containing the longitude. This method is obsolete. | |
GetSubcurve | Extracts a portion of this curve into a new curve. | |
IsClosed | Indicates if 'from' and 'to' points (of each part) are identical. | |
IsEmpty | Indicates whether this geometry contains any points. | |
Length | The length of the curve. | |
Project | Projects this geometry into a new spatial reference. | |
PutCoord | Sets the specified (0 <= index < 4) control point of this Bezier curve. | |
PutCoords | Sets this Bezier curve's control points from an array of between 1 to 4 input points. | |
PutWKSCoords | Sets this Bezier curve's control points from the array of 4 input point structures. | |
QueryChordLengthTangentAtFrom | Returns tangent vector at 'from' point, based on chord length parametrization; and whether it has been set by user or by smoothing process. | |
QueryChordLengthTangentAtTo | Returns tangent vector at 'to' point, based on chord length parametrization; and whether it has been set by user or by smoothing process. | |
QueryCoord | Copies the specified control point of this Bezier curve into the input point. | |
QueryCoords | Copies this Bezier curve's control points into the array of 4 existing points. | |
QueryEnvelope | Copies this geometry's envelope properties into the specified envelope. | |
QueryFromPoint | Copies this curve's 'from' point to the input point. | |
QueryInflectionPoint | Finds inflection point; sets it empty if none exists. | |
QueryNormal | Constructs a line normal to a curve from a point at a specified distance along the curve. | |
QueryPoint | Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve. | |
QueryPointAndDistance | Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items. | |
QueryTangent | Constructs a line tangent to a curve from a point at a specified distance along the curve. | |
QueryToPoint | Copies the curve's 'to' point into the input point. | |
QueryWKSCoords | Copies this Bezier curve's control points into the array of 4 existing point structures. | |
ReverseOrientation | Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc). | |
SetChordLengthTangentAtFrom | Establishes tangent vector at 'from' point, based on chord length parametrization; and sets flag whether it has been set by user or by smoothing process. | |
SetChordLengthTangentAtTo | Establishes tangent vector at 'to' point, based on chord length parametrization; and sets flag whether it has been set by user or by smoothing process. | |
SetEmpty | Removes all points from this geometry. | |
SnapToSpatialReference | Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system. | |
SpatialReference | The spatial reference associated with this geometry. | |
ToPoint | The 'to' point of the curve. |
IBezierCurve.Degree Property
The degree of the Bezier curve. For third degree Beziers, this is always 3.
Public ReadOnly Property Degree As Integer
public int Degree {get;}
Description
Returns the degree of the Bezier Curve. Currently, all Bezier Curves have a degree of 3 by definition.
IBezierCurve.PutCoord Method
Sets the specified (0 <= index < 4) control point of this Bezier curve.
Public Sub PutCoord ( _
ByVal Index As Integer, _
ByVal controlPoint As IPoint _
)
public void PutCoord (
int Index,
IPoint controlPoint
);
Description
Places a specific control Point into a bezier curve. Control point 0 is the FromPoint of the Bezier curve (also the From tangent's FromPoint), control point 1 is the From tangent's ToPoint, control point 2 is the To tangent's FromPoint, and control point 3 is the ToPoint of the Bezier curve (also the To tangent's ToPoint).
Remarks
Use PutCoords to set all control points simultaneously. PutCoord should not be use to create a new BezierCurve, use PutCoords instead. PutCoord should only be use to modify an existing and well define BezierCurve.
IBezierCurve.PutCoords Method
Sets this Bezier curve's control points from an array of between 1 to 4 input points.
Public Sub PutCoords ( _
ByVal numPoints As Integer, _
ByRef controlPoints As IPoint _
)
public void PutCoords (
int numPoints,
ref IPoint controlPoints
);
Description
It is recommended that the IBezierCurveGEN::PutCoords OLE Automation compliant version of this method be used instead of this version.
Remarks
Use PutCoord to set a single control point.
IBezierCurve.PutWKSCoords Method
Sets this Bezier curve's control points from the array of 4 input point structures.
Public Sub PutWKSCoords ( _
ByRef controlPoints As WKSPoint _
)
public void PutWKSCoords (
ref WKSPoint controlPoints
);
IBezierCurve.QueryChordLengthTangentAtFrom Method
Returns tangent vector at 'from' point, based on chord length parametrization; and whether it has been set by user or by smoothing process.
Public Sub QueryChordLengthTangentAtFrom ( _
ByVal tangent As IPoint, _
ByRef setByUser As Boolean _
)
public void QueryChordLengthTangentAtFrom (
IPoint tangent,
ref bool setByUser
);
Description
Returns the ChordLength Tangent at the From Point of the BezierCurve along with a flag indicating whether this ChordLength Tangent was set by the user or defined from Control Points. The ChordLength Tangent is not the same as the internal Control Points or the Tangent at the From Point although both lie on the same line. The coordinates of the returned point are in reality a Dx and Dy which can be added to the From point in order to get the tangent.
private void QueryChordLengthTangentAtFrom()
{
//Control points
IPoint[] controlPoints = new IPoint[4];
//Bezier FromPoint / From Tangent FromPoint
controlPoints[0] = new ESRI.ArcGIS.Geometry.Point();
//From Tangent ToPoint
controlPoints[1] = new ESRI.ArcGIS.Geometry.Point();
//To Tangent FromPoint
controlPoints[2] = new ESRI.ArcGIS.Geometry.Point();
//Bezier To Point / To Tangent ToPoint
controlPoints[3] = new ESRI.ArcGIS.Geometry.Point();
//Define the Bezier Control Points. This is a simple S-Curve.
controlPoints[0].PutCoords(100, 100);
controlPoints[1].PutCoords(150, 200);
controlPoints[2].PutCoords(250, 0);
controlPoints[3].PutCoords(400, 100);
IBezierCurveGEN bezierCurve = new BezierCurve();
bezierCurve.PutCoords(ref controlPoints);
//QueryChordLengthTangentAtFrom
IPoint tangentPoint = new ESRI.ArcGIS.Geometry.Point();
bool isUserSet = false;
bezierCurve.QueryChordLengthTangentAtFrom(tangentPoint, ref isUserSet);
//Report
String report = "QueryChordLengthTangentAtFrom \n" +
"Point At From : " + tangentPoint.X + " , " + tangentPoint.Y + "\n" +
"Set by the user : " + isUserSet;
System.Windows.Forms.MessageBox.Show(report);
}
IBezierCurve.QueryChordLengthTangentAtTo Method
Returns tangent vector at 'to' point, based on chord length parametrization; and whether it has been set by user or by smoothing process.
Public Sub QueryChordLengthTangentAtTo ( _
ByVal tangent As IPoint, _
ByRef setByUser As Boolean _
)
public void QueryChordLengthTangentAtTo (
IPoint tangent,
ref bool setByUser
);
Description
Returns the ChordLength Tangent at the To Point of the BezierCurve along with a flag indicating whether this ChordLength Tangent was set by the user or defined from Control Points. The ChordLength Tangent is not the same as the internal Control Points or the Tangent at the To Point although both lie on the same line. The coordinates of the returned point are in reality a Dx and Dy which can be added to the To point in order to get the tangent.
private void QueryChordLengthTangentAtTo()
{
//Control points
IPoint[] controlPoints = new IPoint[4];
//Bezier FromPoint / From Tangent FromPoint
controlPoints[0] = new ESRI.ArcGIS.Geometry.Point();
//From Tangent ToPoint
controlPoints[1] = new ESRI.ArcGIS.Geometry.Point();
//To Tangent FromPoint
controlPoints[2] = new ESRI.ArcGIS.Geometry.Point();
//Bezier To Point / To Tangent ToPoint
controlPoints[3] = new ESRI.ArcGIS.Geometry.Point();
//Define the Bezier Control Points. This is a simple S-Curve.
controlPoints[0].PutCoords(100, 100);
controlPoints[1].PutCoords(150, 200);
controlPoints[2].PutCoords(250, 0);
controlPoints[3].PutCoords(400, 100);
IBezierCurveGEN bezierCurve = new BezierCurve();
bezierCurve.PutCoords(ref controlPoints);
//QueryChordLengthTangentAtTo
IPoint tangentPoint = new ESRI.ArcGIS.Geometry.Point();
bool isUserSet = false;
bezierCurve.QueryChordLengthTangentAtTo(tangentPoint, ref isUserSet);
//Report
String report = "QueryChordLengthTangentAtTo \n" +
"Point At From : " + tangentPoint.X + " , " + tangentPoint.Y + "\n" +
"Set by the user : " + isUserSet;
System.Windows.Forms.MessageBox.Show(report);
}
IBezierCurve.QueryCoord Method
Copies the specified control point of this Bezier curve into the input point.
Public Sub QueryCoord ( _
ByVal Index As Integer, _
ByVal controlPoint As IPoint _
)
public void QueryCoord (
int Index,
IPoint controlPoint
);
Description
Use QueryCoord to obtain a specific bezier control Point. Any of the four bezier control points (0 to 3) can be queried.
Remarks
Use QueryCoords to get all of the control points.
IBezierCurve.QueryCoords Method
Copies this Bezier curve's control points into the array of 4 existing points.
Public Sub QueryCoords ( _
ByRef controlPoints As IPoint _
)
public void QueryCoords (
ref IPoint controlPoints
);
Description
QueryCoords returns all four of the BezierCurve control points into an array of 4 Points.
Remarks
Use QueryCoord to get a specific control point.
IBezierCurve.QueryInflectionPoint Method
Finds inflection point; sets it empty if none exists.
Public Sub QueryInflectionPoint ( _
ByVal inflectionPoint As IPoint _
)
public void QueryInflectionPoint (
IPoint inflectionPoint
);
Description
Returns the first Inflection Point of the Bezier Curve, or returns an Empty Point if no Inflection Point Exists. An Inflection Point occurs where the sign of the Curvature changes.
Remarks
Most Bezier Curves have 0 or 1 Inflection Points, but a few constructions result in Bezier Curves with 2 Inflection Points. For these Bezier Curve, the only way to find both Inflection Points is to Reverse the Orientation of the Bezier Curve and call QueryInflectionPoint a second time. If the Inflection Points are not equal, the Bezier Curve has two Inflection Points, otherwise, it only has a single Inflection Point.
private void QueryInflectionPoint()
{
//Control points
IPoint[] controlPoints = new IPoint[4];
//Bezier FromPoint / From Tangent FromPoint
controlPoints[0] = new ESRI.ArcGIS.Geometry.Point();
//From Tangent ToPoint
controlPoints[1] = new ESRI.ArcGIS.Geometry.Point();
//To Tangent FromPoint
controlPoints[2] = new ESRI.ArcGIS.Geometry.Point();
//Bezier To Point / To Tangent ToPoint
controlPoints[3] = new ESRI.ArcGIS.Geometry.Point();
//Define the Bezier Control Points. This is a simple S-Curve.
controlPoints[0].PutCoords(100, 100);
controlPoints[1].PutCoords(150, 200);
controlPoints[2].PutCoords(250, 0);
controlPoints[3].PutCoords(400, 100);
IBezierCurveGEN bezierCurve = new BezierCurve();
bezierCurve.PutCoords(ref controlPoints);
//Report control Point
IPoint[] outControlPoints = new IPoint[4];
for (int i = 0; i < controlPoints.Length; i++)
{
outControlPoints[i] = new ESRI.ArcGIS.Geometry.Point();
}
bezierCurve.QueryCoords(ref outControlPoints);
String report = "Control Points \n";
for (int i = 0; i < outControlPoints.Length; i++)
{
report = report + outControlPoints[i].X + " , " + outControlPoints[i].Y + " \n";
}
IPoint infelctionPoint = new ESRI.ArcGIS.Geometry.Point(); ;
bezierCurve.QueryInflectionPoint(infelctionPoint);
report = report + "Inflection Point : " + infelctionPoint.X + " , " + infelctionPoint.Y;
System.Windows.Forms.MessageBox.Show(report);
}
IBezierCurve.QueryWKSCoords Method
Copies this Bezier curve's control points into the array of 4 existing point structures.
Public Sub QueryWKSCoords ( _
ByRef controlPoints As WKSPoint _
)
public void QueryWKSCoords (
ref WKSPoint controlPoints
);
IBezierCurve.SetChordLengthTangentAtFrom Method
Establishes tangent vector at 'from' point, based on chord length parametrization; and sets flag whether it has been set by user or by smoothing process.
Public Sub SetChordLengthTangentAtFrom ( _
ByVal tangent As IPoint, _
ByVal setByUser As Boolean _
)
public void SetChordLengthTangentAtFrom (
IPoint tangent,
bool setByUser
);
Description
Sets the ChordLength Tangent at the From Point of the BezierCurve. The ChordLength Tangent is not the same as the internal Control Points or the Tangent at the From Point although both lie on the same line.
IBezierCurve.SetChordLengthTangentAtTo Method
Establishes tangent vector at 'to' point, based on chord length parametrization; and sets flag whether it has been set by user or by smoothing process.
Public Sub SetChordLengthTangentAtTo ( _
ByVal tangent As IPoint, _
ByVal setByUser As Boolean _
)
public void SetChordLengthTangentAtTo (
IPoint tangent,
bool setByUser
);
Description
Sets the ChordLength Tangent at the To Point of the BezierCurve. The ChordLength Tangent is not the same as the internal Control Points or the Tangent at the To Point although both lie on the same line.
Inherited Interfaces
Interfaces | Description |
---|---|
ICurve | Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.). |
IGeometry | Provides access to members that describe properties and behavior of all geometric objects. |
Classes that implement IBezierCurve
Classes | Description |
---|---|
BezierCurve | A cubic Bezier curve defined between two points; optionally has measure, height and ID attributes at each endpoint. |