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


C# Rhino.ConstPointer方法代码示例

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


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

示例1: RhinoObjectConstPointer

 /// <summary>
 /// Returns the underlying const CRhinoObject* for a RhinoCommon class. You should only
 /// be interested in using this function if you are writing C++ code.
 /// </summary>
 /// <param name="rhinoObject">A Rhino object.</param>
 /// <returns>A pointer to the Rhino const object.</returns>
 public static IntPtr RhinoObjectConstPointer(Rhino.DocObjects.RhinoObject rhinoObject)
 {
   IntPtr rc = IntPtr.Zero;
   if (rhinoObject != null)
     rc = rhinoObject.ConstPointer();
   return rc;
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:13,代码来源:interop.cs

示例2: CreateBasicMaterial

 /// <summary>
 /// Constructs a new basic material from a <see cref="Rhino.DocObjects.Material">Material</see>.
 /// </summary>
 /// <param name="material">(optional)The material to create the basic material from.</param>
 /// <returns>A new basic material.</returns>
 public static RenderMaterial CreateBasicMaterial(Rhino.DocObjects.Material material)
 {
   IntPtr pConstSourceMaterial = (material == null ? IntPtr.Zero : material.ConstPointer());
   IntPtr pNewMaterial = UnsafeNativeMethods.Rdk_Globals_NewBasicMaterial(pConstSourceMaterial);
   NativeRenderMaterial newMaterial = RenderContent.FromPointer(pNewMaterial) as NativeRenderMaterial;
   if (newMaterial != null)
     newMaterial.AutoDelete = true;
   return newMaterial;
 }
开发者ID:kalvo,项目名称:rhinocommon,代码行数:14,代码来源:rdk_material.cs

示例3: CreateSunLight

    /// <summary>
    /// Constructs a light which simulates a <see cref="Rhino.Render.Sun"/>.
    /// </summary>
    /// <param name="sun">A Sun object from the Rhino.Render namespace.</param>
    /// <returns>A light.</returns>
    public static Light CreateSunLight(Rhino.Render.Sun sun)
    {
      Rhino.Runtime.HostUtils.CheckForRdk(true, true);

      Rhino.Geometry.Light rc = new Rhino.Geometry.Light();
      IntPtr pLight = rc.NonConstPointer();
      IntPtr pConstSun = sun.ConstPointer();
      UnsafeNativeMethods.Rdk_Sun_Light(pConstSun, pLight);

      return rc;
    }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:16,代码来源:opennurbs_light.cs

示例4: CaptureToBitmap

 /// <summary>
 /// Capture View contents to a bitmap using display attributes to define how
 /// drawing is performed.
 /// </summary>
 /// <param name="size">The width and height of the returned bitmap.</param>
 /// <param name="attributes">The specific display mode attributes.</param>
 /// <returns>A new bitmap.</returns>
 public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size, Rhino.Display.DisplayPipelineAttributes attributes)
 {
   IntPtr pConstView = ConstPointer();
   IntPtr pAttributes = attributes.ConstPointer();
   IntPtr pRhinoDib = UnsafeNativeMethods.CRhinoDib_New();
   System.Drawing.Bitmap rc = null;
   if (UnsafeNativeMethods.CRhinoView_CaptureToBitmap(pConstView, pRhinoDib, size.Width, size.Height, pAttributes))
   {
     IntPtr hBmp = UnsafeNativeMethods.CRhinoDib_Bitmap(pRhinoDib);
     if (IntPtr.Zero != hBmp)
       rc = System.Drawing.Image.FromHbitmap(hBmp);
   }
   UnsafeNativeMethods.CRhinoDib_Delete(pRhinoDib);
   return rc;
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:22,代码来源:rhinosdkview.cs

示例5: 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

示例6: ViewportInfo

 /// <summary>
 /// Copies all of the ViewportInfo data from an existing RhinoViewport.
 /// </summary>
 /// <param name="rhinoViewport">A viewport to copy.</param>
 public ViewportInfo(Rhino.Display.RhinoViewport rhinoViewport)
 {
   IntPtr pRhinoViewport = rhinoViewport.ConstPointer();
   m_pViewportPointer = UnsafeNativeMethods.ON_Viewport_New2(pRhinoViewport);
 }
开发者ID:mennodeij,项目名称:rhinocommon,代码行数:9,代码来源:opennurbs_viewport.cs

示例7: ForceObjectIntoPreviewCache

 public static void ForceObjectIntoPreviewCache(Rhino.DocObjects.RhinoObject obj)
 {
   UnsafeNativeMethods.Rdk_CRMManager_EVF("ForceObjectIntoPreviewCache", obj.ConstPointer());
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:4,代码来源:rdk_custom_render_meshes.cs

示例8: DrawCurveObject

 /// <summary>
 /// If Style==Wireframe, then the default decomposes the curve object into
 /// nurbs curve segments and calls the virtual DrawNurbsCurve for each segment.
 /// </summary>
 /// <param name="curve">A document curve object.</param>
 /// <param name="pipeline">The drawing pipeline.</param>
 protected virtual void DrawCurveObject(Rhino.DocObjects.CurveObject curve, DisplayPipeline pipeline )
 {
   IntPtr pConstThis = ConstPointer();
   IntPtr pConstCurve = curve.ConstPointer();
   IntPtr pPipeline = pipeline.NonConstPointer();
   UnsafeNativeMethods.CRhinoVisualAnalysisMode_DrawCurveObject(pConstThis, pConstCurve, pPipeline);
 }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:13,代码来源:rhinosdkanalysismodes.cs

示例9: ToIRhinoViewport

 /// <summary>
 /// Convert a Rhino.Display.Viewport to an RMA.Rhino.IRhinoViewport.
 /// </summary>
 /// <param name="source">A RhinoCommon viewport.</param>
 /// <returns>
 /// Rhino_DotNet IRhinoViewport object on success. This will be an independent copy.
 /// </returns>
 public static object ToIRhinoViewport(Rhino.Display.RhinoViewport source)
 {
   object rc = null;
   IntPtr pSource = source.ConstPointer();
   Type rhType = GetRhinoDotNetType("RMA.Rhino.MRhinoViewport");
   if (IntPtr.Zero != pSource && null != rhType)
   {
     System.Reflection.MethodInfo mi = rhType.GetMethod("WrapNativePointer", new Type[] { typeof(IntPtr), typeof(bool), typeof(bool) });
     const bool isConst = true;
     const bool doDelete = false;
     rc = mi.Invoke(null, new object[] { pSource, isConst, doDelete });
   }
   return rc;
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:21,代码来源:interop.cs

示例10: BoundingBox

    /// <summary>
    /// Returns a bounding box for the custom render meshes for the given object.
    /// </summary>
    /// <param name="vp">The viewport being rendered.</param>
    /// <param name="obj">The Rhino object of interest.</param>
    /// <param name="requestingPlugIn">UUID of the RDK plug-in requesting the meshes.</param>
    /// <param name="meshType">Type of mesh to build.</param>
    /// <returns>A bounding box value.</returns>
    public virtual Rhino.Geometry.BoundingBox BoundingBox(Rhino.DocObjects.ViewportInfo vp, Rhino.DocObjects.RhinoObject obj, Guid requestingPlugIn, MeshTypes meshType)
    {
      Geometry.Point3d min = new Geometry.Point3d();
      Geometry.Point3d max = new Geometry.Point3d();

      if (UnsafeNativeMethods.Rdk_RMPBoundingBoxImpl(m_runtime_serial_number, vp.ConstPointer(), obj.ConstPointer(), requestingPlugIn, (int)meshType, ref min, ref max))
        return new Rhino.Geometry.BoundingBox(min, max);

      return new Rhino.Geometry.BoundingBox();
    }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:18,代码来源:rdk_custom_render_meshes.cs

示例11: AddWireframeChannel

 /// <summary>
 /// A wireframe channel will not be added if none of the document properties settings
 /// indicate that one is needed. In other words, Rhino will not generate an empty wireframe channel
 /// just for the fun of it.
 /// </summary>
 /// <param name="doc">The document to display</param>
 /// <param name="viewport">The view to display</param>
 /// <param name="size">The size of the image without clipping (ie - if you have a region, it was the
 /// size of the image before you cut the region out.</param>
 /// <param name="region">The area of the rendering you want to display.  This should match the size
 /// of the render window itself (ie - the one set using SetSize)</param>
 /// <returns>Returns true if the wireframe channel was successfully added.</returns>
 public bool AddWireframeChannel(Rhino.RhinoDoc doc, Rhino.DocObjects.ViewportInfo viewport, System.Drawing.Size size, System.Drawing.Rectangle region)
 {
   int[] xy = { size.Width, size.Height };
   int[] lrtb = { region.Left, region.Right, region.Top, region.Bottom };
   return UnsafeNativeMethods.Rdk_RenderWindow_AddWireframeChannel(ConstPointer(), doc.DocumentId, viewport.ConstPointer(), ref xy[0], ref lrtb[0]);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:18,代码来源:rdk_render_window.cs

示例12: Add

 public void Add(Rhino.Geometry.Mesh mesh, RenderMaterial material)
 {
   UnsafeNativeMethods.Rdk_CustomMeshes_AddMesh(NonConstPointer(), mesh.ConstPointer(), material.ConstPointer());
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:4,代码来源:rdk_custom_render_meshes.cs

示例13: BuildCustomMeshes

 /// <summary>
 /// Build custom render mesh(es) for the given object.
 /// </summary>
 /// <param name="vp">the viewport being rendered.</param>
 /// <param name="objMeshes">The meshes object to fill with custom meshes - the Object property will already be set.</param>
 /// <param name="requestingPlugIn">the UUID of the RDK plug-in requesting the meshes.</param>
 /// <param name="meshType"> type of mesh(es) to build.</param>
 /// <returns>true if successful.</returns>
 public static bool BuildCustomMeshes(Rhino.DocObjects.ViewportInfo vp, ObjectMeshes objMeshes, Guid requestingPlugIn, MeshTypes meshType)
 {
   return UnsafeNativeMethods.Rdk_CRMManager_BuildCustomMeshes(vp.ConstPointer(), objMeshes.NonConstPointer(), requestingPlugIn, (int)meshType);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:12,代码来源:rdk_custom_render_meshes.cs

示例14: WillBuildCustomMeshes

 /// <summary>
 /// Determines if custom render meshes will be built for a particular object.
 /// </summary>
 /// <param name="vp">the viewport being rendered.</param>
 /// <param name="obj">the Rhino object of interest.</param>
 /// <param name="requestingPlugIn">type of mesh to build.</param>
 /// <param name="meshType">UUID of the plug-in requesting the meshes.</param>
 /// <param name="soleProviderId">the UUID of the sole provider to call.</param>
 /// <returns>true if BuildCustomMeshes() will build custom render mesh(es) for the given object.</returns>
 public static bool WillBuildCustomMeshes(Rhino.DocObjects.ViewportInfo vp, Rhino.DocObjects.RhinoObject obj, Guid requestingPlugIn, MeshTypes meshType, Guid soleProviderId)
 {
   return UnsafeNativeMethods.Rdk_CRMManager_WillBuildCustomMeshSole(vp.ConstPointer(), obj.ConstPointer(), requestingPlugIn, (int)meshType, soleProviderId);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:13,代码来源:rdk_custom_render_meshes.cs

示例15: UpdateToPointCloud

 public bool UpdateToPointCloud(Rhino.Geometry.PointCloud cloud, ObjectAttributes attributes)
 {
   IntPtr pCloud = cloud.ConstPointer();
   IntPtr pConstAttributes = (attributes == null) ? IntPtr.Zero : attributes.ConstPointer();
   return UnsafeNativeMethods.CRhinoObjectPairArray_UpdateResult2(m_parent.m_pObjectPairArray, m_index, pCloud, pConstAttributes);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:6,代码来源:rhinosdkcommand.cs


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