本文整理汇总了C#中Rhino.Geometry.Curve.ChangeToConstObject方法的典型用法代码示例。如果您正苦于以下问题:C# Curve.ChangeToConstObject方法的具体用法?C# Curve.ChangeToConstObject怎么用?C# Curve.ChangeToConstObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rhino.Geometry.Curve
的用法示例。
在下文中一共展示了Curve.ChangeToConstObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}