当前位置: 首页>>代码示例>>C#>>正文


C# Runtime.ConstPointer方法代码示例

本文整理汇总了C#中Runtime.ConstPointer方法的典型用法代码示例。如果您正苦于以下问题:C# Runtime.ConstPointer方法的具体用法?C# Runtime.ConstPointer怎么用?C# Runtime.ConstPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Runtime的用法示例。


在下文中一共展示了Runtime.ConstPointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PolyLineFromNativeArray

 //David: I just copied this function from Point3dList...
 internal static Polyline PolyLineFromNativeArray(Runtime.InteropWrappers.SimpleArrayPoint3d pts)
 {
   if (null == pts)
     return null;
   int count = pts.Count;
   Polyline list = new Polyline(count);
   if (count > 0)
   {
     IntPtr pNativeArray = pts.ConstPointer();
     UnsafeNativeMethods.ON_3dPointArray_CopyValues(pNativeArray, list.m_items);
     list.m_size = count;
   }
   return list;
 }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:15,代码来源:opennurbs_polyline.cs

示例2: MoveUserDataTo

 /// <summary>
 /// Moves the user data.
 /// <para>See <see cref="MoveUserDataFrom"/> for more information.</para>
 /// </summary>
 /// <param name="objectToGetUserData">Object data source.</param>
 /// <param name="id">Target.</param>
 /// <param name="append">If the data should be appended or replaced.</param>
 public static void MoveUserDataTo(Runtime.CommonObject objectToGetUserData, Guid id, bool append)
 {
   if (id != Guid.Empty)
   {
     IntPtr const_ptr_onobject = objectToGetUserData.ConstPointer();
     UnsafeNativeMethods.ON_UserDataHolder_MoveUserDataTo(id, const_ptr_onobject, append);
   }
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:15,代码来源:opennurbs_userdata.cs

示例3: MoveUserDataFrom

 /// <summary>
 /// Moves the user data from objectWithUserData to a temporary data storage
 /// identifierd by the return Guid.  When MoveUserDataFrom returns, the
 /// objectWithUserData will not have any user data.
 /// </summary>
 /// <param name="objectWithUserData">Object with user data attached.</param>
 /// <returns>
 /// Guid identifier for storage of UserData that is held in a temporary list
 /// by this class. This function should be used in conjunction with MoveUserDataTo
 /// to transfer the user data to a different object.
 /// Returns Guid.Empty if there was no user data to transfer.
 /// </returns>
 public static Guid MoveUserDataFrom(Runtime.CommonObject objectWithUserData)
 {
   Guid id = Guid.NewGuid();
   IntPtr const_ptr_onobject = objectWithUserData.ConstPointer();
   if (UnsafeNativeMethods.ON_UserDataHolder_MoveUserDataFrom(id, const_ptr_onobject))
     return id;
   return Guid.Empty;
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:20,代码来源:opennurbs_userdata.cs

示例4: Copy

 /// <summary>
 /// Expert user tool that copies user data that has a positive 
 /// CopyCount from the source object to a destination object.
 /// Generally speaking you don't need to use Copy().
 /// Simply rely on things like the copy constructors to do the right thing.
 /// </summary>
 /// <param name="source">A source object for the data.</param>
 /// <param name="destination">A destination object for the data.</param>
 public static void Copy(Runtime.CommonObject source, Runtime.CommonObject destination)
 {
   IntPtr const_source = source.ConstPointer();
   IntPtr ptr_destination = destination.NonConstPointer();
   UnsafeNativeMethods.ON_Object_CopyUserData(const_source, ptr_destination);
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:14,代码来源:opennurbs_userdata.cs


注:本文中的Runtime.ConstPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。