RenderMeshProvider

References
public abstract class RenderMeshProvider : IDisposable
A RenderMeshProvider delivers custom render primitives (in the form of RenderMeshes). Derive a public class from this with a public constructor, and this primitive provider will be added to the RDK forming a collection of providers. Each RenderMeshProvider::HasCustomRenderMeshes will be called and if it returns true, a call to RenderMeshes will be made. It is up to the provider to cache its own primitives - the IRenderMeshes::ProviderTracking class is provided for that. A provider may optionally return a collection of non-object Ids that it will provide custom render primitives for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component. Override this class if you are a plug-in developer intending to supply a custom set of primitives for a given object, or objectId. Examples of IRenderMeshProviders are CurvePiping, EdgeSoftening, Displacement, Shutlining, Grasshopper's CustomPreview component.

Finalizer

~RenderMeshProvider

#
~RenderMeshProvider()
Finalizer to ensure correctly implemented dispose pattern.

Fields

m_disposed

#
protected bool m_disposed
m_disposed available for sub-classes to check.

Properties

Name

#Since v8.0
public abstract string Name { get; }
The localized name of the provider for UI display.

NonObjectIds

#Since v8.0
public virtual List<Guid> NonObjectIds { get; }
A provider may optionally return a collection of non-object Ids that it will provide custom render primitives for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component.

ProviderId

#Since v8.0
public virtual Guid ProviderId { get; }
The localized name of the provider for UI display.

Methods

Dispose

#Since v8.0
public void Dispose()
Dispose method

Dispose

#
protected virtual void Dispose(bool isDisposing)
Dispose method. Note that you should only ever call Dispose if you explicitly registered this RenderMeshProvider using RegisterProvider If this provider was created using automatic registration, the Dispose function will thrown an exception.
isDisposing (bool)

GetParameter

#Since v8.0
public virtual object GetParameter(RhinoDoc doc, Guid objectId, string parameterName)
Runtime access to specific parameters on for a given objectId relating to this primitive provider.
doc (RhinoDoc)The Rhino document of interest.
objectId (Guid)The objectId for which the parameter should be supplied.
parameterName (string)The name of the parameter.
The value of the parameter for the specified ObjectId. IConvertable.

HasCustomRenderMeshes

#Since v8.0
public abstract bool HasCustomRenderMeshes(MeshType mt, ViewportInfo vp, RhinoDoc doc, Guid objectId, ref Flags flags, PlugIn plugin, DisplayPipelineAttributes attrs)
Determine if custom render primitives will be supplied for a particular object.
mt (MeshType)The mesh type to provide meshes for
vp (ViewportInfo)The viewport being rendered
doc (RhinoDoc)The Rhino document associated with the objectId
objectId (Guid)The objectId for which the primitives should be supplied.
flags (ref RenderMeshProvider.Flags)See RenderMeshProvider.Flags. This is an in/out parameter: set RenderMeshProvider.Flags.Incomplete on return if the meshes supplied are provisional because asynchronous work has not finished.
plugin (PlugIn)The requesting plug-in - typically the render plug-in requesting the primitives.
attrs (DisplayPipelineAttributes)The display attributes currently being used - nullptr if this is production rendering.
True if RenderMeshes will return a set of primitives, otherwise false. RenderMeshes may still return an empty collection - in case of cancelation something similar.

Progress

#Since v8.0
public virtual RenderMeshProviderProgress Progress(RhinoDoc doc, Guid[] optional_objectIds)
Provides details on the progress of custom render meshes for a document or collection of objects
doc (RhinoDoc)
optional_objectIds (Guid[])

ProgressForAll

#Since v8.0
public static RenderMeshProviderProgress[] ProgressForAll(RhinoDoc doc, Guid[] optional_objectIds)
Returns a complete list of progress reports for all providers for either the document or a collection of objects
doc (RhinoDoc)
optional_objectIds (Guid[])

RegisterProvider

#Since v8.0
public static bool RegisterProvider(RenderMeshProvider provider, PlugIn plugin)
Register RenderMeshProvider without relying on the auto-plug-in registration.
provider (RenderMeshProvider)
plugin (PlugIn)

RegisterProviders

#Since v8.0
public static void RegisterProviders(Assembly assembly, PlugIn plugin)
Register RenderMeshProviders without relying on the auto-plug-in registration
assembly (Assembly)
plugin (PlugIn)

RegisterProviders

#Since v8.0
public static void RegisterProviders(PlugIn plugin)
Register RenderMeshProviders without relying on the auto-plug-in registration
plugin (PlugIn)

RenderMeshes

#Since v8.0
public abstract RenderMeshes RenderMeshes(MeshType mt, ViewportInfo vp, RhinoDoc doc, Guid objectId, List<InstanceObject> ancestry, ref Flags flags, RenderMeshes previousPrimitives, PlugIn plugin, DisplayPipelineAttributes attrs)
Returns a complete set of custom render primitives for a given ObjectId.
mt (MeshType)The mesh type to provide meshes for
vp (ViewportInfo)The viewport being rendered
doc (RhinoDoc)The Rhino document associated with the objectId
objectId (Guid)The objectId for which the primitives should be supplied.
ancestry (List<InstanceObject>)The ancestry of the object - ie, block references referring to this definition. This is only used to handle ByParent attributes, and should not be used to transform geometry.
flags (ref RenderMeshProvider.Flags)See RenderMeshProvider.Flags. This is an in/out parameter: set RenderMeshProvider.Flags.Incomplete on return if the meshes supplied are provisional because asynchronous work has not finished.
previousPrimitives (RenderMeshes)Optionally a custom set of initial primitives. If this parameter is empty, the standard render primitives for the object will be used, or an empty set of primitives will be used where they are not available. This is typically used in meshing exporters, which produce specific meshes for the output rather than using the render primitives.
plugin (PlugIn)The requesting plug-in - typically the render plug-in requesting the meshes.
attrs (DisplayPipelineAttributes)The display attributes currently being used - nullptr if this is production rendering.

SetParameter

#Since v8.0
public virtual void SetParameter(RhinoDoc doc, Guid objectId, string parameterName, object value)
doc (RhinoDoc)The Rhino document of interest.
objectId (Guid)The objectId for which the parameter should be supplied.
parameterName (string)The name of the parameter.
value (object)The value to set.