本文整理汇总了C#中Rhino.Geometry.Curve.NonConstPointer方法的典型用法代码示例。如果您正苦于以下问题:C# Curve.NonConstPointer方法的具体用法?C# Curve.NonConstPointer怎么用?C# Curve.NonConstPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino.Geometry.Curve
的用法示例。
在下文中一共展示了Curve.NonConstPointer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeEndsMeet
/// <summary>
/// Makes adjustments to the ends of one or both input curves so that they meet at a point.
/// </summary>
/// <param name="curveA">1st curve to adjust.</param>
/// <param name="adjustStartCurveA">
/// Which end of the 1st curve to adjust: true is start, false is end.
/// </param>
/// <param name="curveB">2nd curve to adjust.</param>
/// <param name="adjustStartCurveB">
/// which end of the 2nd curve to adjust true==start, false==end.
/// </param>
/// <returns>true on success.</returns>
public static bool MakeEndsMeet(Curve curveA, bool adjustStartCurveA, Curve curveB, bool adjustStartCurveB)
{
IntPtr pCurveA = curveA.NonConstPointer();
IntPtr pCurveB = curveB.NonConstPointer();
return UnsafeNativeMethods.RHC_RhinoMakeCurveEndsMeet(pCurveA, adjustStartCurveA, pCurveB, adjustStartCurveB);
}
示例2: SetCurve
/// <summary>
/// Only for developers who are defining custom subclasses of CurveObject.
/// Directly sets the internal curve geometry for this object. Note that
/// this function does not work with Rhino's "undo".
/// </summary>
/// <param name="curve"></param>
/// <returns>
/// The old curve geometry that was set for this object
/// </returns>
/// <remarks>
/// Note that this function does not work with Rhino's "undo". The typical
/// approach for adjusting the curve geometry is to modify the object that you
/// get when you call the CurveGeometry property and then call CommitChanges.
/// </remarks>
protected Curve SetCurve(Curve curve)
{
var parent = curve.ParentRhinoObject();
if (parent != null && parent.RuntimeSerialNumber == this.RuntimeSerialNumber)
return curve;
IntPtr pThis = this.NonConstPointer_I_KnowWhatImDoing();
IntPtr pCurve = curve.NonConstPointer();
IntPtr pOldCurve = UnsafeNativeMethods.CRhinoCurveObject_SetCurve(pThis, pCurve);
curve.ChangeToConstObject(this);
if (pOldCurve != pCurve && pOldCurve != IntPtr.Zero)
return new Curve(pOldCurve, null);
return curve;
}