本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}