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


C# Rhino.NonConstPointer方法代码示例

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


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

示例1: RenderPipeline

    /// <summary>
    /// Constructs a subclass of this object on the stack in your Rhino plug-in's Render() or RenderWindow() implementation.
    /// </summary>
    /// <param name="doc">A Rhino document.</param>
    /// <param name="mode">A command running mode, such as scripted or interactive.</param>
    /// <param name="plugin">A plug-in.</param>
    /// <param name="sizeRendering">The width and height of the rendering.</param>
    /// <param name="caption">The caption to display in the frame window.</param>
    /// <param name="channels">The color channel or channels.</param>
    /// <param name="reuseRenderWindow">true if the rendering window should be reused; otherwise, a new one will be instanciated.</param>
    /// <param name="clearLastRendering">true if the last rendering should be removed.</param>
    protected RenderPipeline(RhinoDoc doc,
                          Rhino.Commands.RunMode mode,
                          Rhino.PlugIns.PlugIn plugin,
                          System.Drawing.Size sizeRendering,
                          string caption,
                          Rhino.Render.RenderWindow.StandardChannels channels,
                          bool reuseRenderWindow,
                          bool clearLastRendering
                          )
    {
      Debug.Assert(Rhino.PlugIns.RenderPlugIn.RenderCommandContextPointer != IntPtr.Zero);

      m_serial_number = m_current_serial_number++;
      m_all_render_pipelines.Add(m_serial_number, this);
      m_size = sizeRendering;
      m_channels = channels;

      m_pSdkRender = UnsafeNativeMethods.Rdk_SdkRender_New(m_serial_number, Rhino.PlugIns.RenderPlugIn.RenderCommandContextPointer, plugin.NonConstPointer(), caption, reuseRenderWindow, clearLastRendering);
      m_plugin = plugin;

      UnsafeNativeMethods.Rdk_RenderWindow_Initialize(m_pSdkRender, (int)channels, m_size.Width, m_size.Height);
    }
开发者ID:mennodeij,项目名称:rhinocommon,代码行数:33,代码来源:rdk_sdkrender.cs

示例2: TryCopyFromOnCurve

    /*
        public static Rhino.Geometry.Curve TryCopyFromOnCurve(object source)
        {
          if (source != null)
          {
            try
            {
              Type base_type = Type.GetType("RMA.OpenNURBS.OnCurve");
              System.Type t = source.GetType();
              if (t.IsAssignableFrom(base_type))
              {
                System.Reflection.PropertyInfo pi = t.GetProperty("InternalPointer");
                IntPtr ptr = (IntPtr)pi.GetValue(source, null);
                Rhino.Geometry.Curve crv = Rhino.Geometry.Curve.CreateCurveHelper(ptr, null);
                crv.NonConstPointer();
                return crv;
              }
            }
            catch (Exception)
            {
            }
          }
          return null;
        }

        /// <summary>
        /// Do not hold on to the returned class outside the scope of your current function.
        /// </summary>
        /// <param name="source">-</param>
        /// <returns>-</returns>
        public static Rhino.Display.DisplayPipeline ConvertFromMRhinoDisplayPipeline(object source)
        {
          if (source != null)
          {
            try
            {
              Type base_type = Type.GetType("RMA.Rhino.MRhinoDisplayPipeline");
              System.Type t = source.GetType();
              if (t.IsAssignableFrom(base_type))
              {
                System.Reflection.PropertyInfo pi = t.GetProperty("InternalPointer");
                IntPtr ptr = (IntPtr)pi.GetValue(source, null);
                return new Rhino.Display.DisplayPipeline(ptr);
              }
            }
            catch (Exception)
            {
            }
          }
          return null;
        }
        */
#if RHINO_SDK
    /// <summary>
    /// Gets a C++ plug-in pointer for a given RhinoCommon plug-in.
    /// <para>This is a Rhino SDK function.</para>
    /// </summary>
    /// <param name="plugin">A plug-in.</param>
    /// <returns>A pointer.</returns>
    public static IntPtr PlugInPointer(Rhino.PlugIns.PlugIn plugin)
    {
      return null == plugin ? IntPtr.Zero : plugin.NonConstPointer();
    }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:63,代码来源:interop.cs

示例3: ResetGrips

 /// <summary>
 /// Sets dynamic grip locations back to starting grip locations. This makes things
 /// like the Copy command work when grips are "copied".
 /// </summary>
 /// <param name="list">A list of object to transform. This is a special list type.</param>
 protected void ResetGrips(Rhino.Collections.TransformObjectList list)
 {
   IntPtr pList = list.NonConstPointer();
   UnsafeNativeMethods.CRhinoTransformCommand_ResetGrips(Id, pList);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:10,代码来源:rhinosdkcommand.cs

示例4: TransformObjects

 protected void TransformObjects(Rhino.Collections.TransformObjectList list, Rhino.Geometry.Transform xform, bool copy, bool autoHistory)
 {
   IntPtr pList = list.NonConstPointer();
   UnsafeNativeMethods.CRhinoTransformCommand_TransformObjects(Id, pList, ref xform, copy, autoHistory);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:5,代码来源:rhinosdkcommand.cs

示例5: SelectObjects

 /// <summary>
 /// Selects objects within the command.
 /// </summary>
 /// <param name="prompt">The selection prompt.</param>
 /// <param name="list">A list of objects to transform. This is a special list type.</param>
 /// <returns>The operation result.</returns>
 protected Result SelectObjects(string prompt, Rhino.Collections.TransformObjectList list)
 {
   IntPtr pList = list.NonConstPointer();
   int rc = UnsafeNativeMethods.CRhinoTransformCommand_SelectObjects(Id, prompt, pList);
   return (Result)rc;
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:12,代码来源:rhinosdkcommand.cs

示例6: PickGumball

 public bool PickGumball(Rhino.Input.Custom.PickContext pickContext, Rhino.Input.Custom.GetPoint getPoint)
 {
   IntPtr pThis = NonConstPointer();
   IntPtr pConstPickContext = pickContext.ConstPointer();
   IntPtr pGetPoint = IntPtr.Zero;
   if( getPoint!=null)
     getPoint.NonConstPointer();
   return UnsafeNativeMethods.CRhinoGumballDisplayConduit_PickGumball(pThis, pConstPickContext, pGetPoint);
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:9,代码来源:rhinosdkgumball.cs

示例7: AddGrip

    protected void AddGrip(Rhino.DocObjects.Custom.CustomGripObject grip)
    {
      m_grip_list.Add(grip);

      IntPtr pGrip = grip.NonConstPointer();
      IntPtr pThis = NonConstPointer();
      UnsafeNativeMethods.CRhinoObjectGrips_AddGrip(pThis, pGrip);      
    }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:8,代码来源:rhinosdkgrips.cs

示例8: 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(Rhino.Runtime.CommonObject source, Rhino.Runtime.CommonObject destination)
 {
   IntPtr pConstSource = source.ConstPointer();
   IntPtr pDestination = destination.NonConstPointer();
   UnsafeNativeMethods.ON_Object_CopyUserData(pConstSource, pDestination);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:14,代码来源:opennurbs_userdata.cs

示例9: GetRdkPlugIn

 public static RdkPlugIn GetRdkPlugIn(Rhino.PlugIns.PlugIn plugin)
 {
   for (int i = 0; i < m_all_rdk_plugins.Count; i++)
   {
     if (m_all_rdk_plugins[i].m_rhino_plugin_id == plugin.Id)
       return m_all_rdk_plugins[i];
   }
   IntPtr pRhinoPlugIn = plugin.NonConstPointer();
   return GetRdkPlugInHelper(pRhinoPlugIn, plugin.Id, plugin.m_runtime_serial_number);
 }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:10,代码来源:rdk_plugin.cs

示例10: EnableCustomGrips

 /// <summary>Turns on/off the object's editing grips.</summary>
 /// <param name="customGrips">The custom object grips.</param>
 /// <returns>
 /// true if the call succeeded.  If you attempt to add custom grips to an
 /// object that does not support custom grips, then false is returned.
 /// </returns>
 public bool EnableCustomGrips(Rhino.DocObjects.Custom.CustomObjectGrips customGrips)
 {
   IntPtr pConstThis = ConstPointer();
   IntPtr pGrips = customGrips==null?IntPtr.Zero:customGrips.NonConstPointer();
   bool rc = UnsafeNativeMethods.CRhinoObject_EnableCustomGrips(pConstThis, pGrips);
   if (rc && customGrips != null)
   {
     customGrips.OnAttachedToRhinoObject(this);
   }
   return rc;
 }
开发者ID:musamorena,项目名称:rhinocommon,代码行数:17,代码来源:rhinosdkobject.cs


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