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

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

Fields

m_disposed

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

Properties

Name

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

NonObjectIds

#Since v8.0
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.
public virtual List<Guid> NonObjectIds { get; }

ProviderId

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

Methods

Dispose

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

Dispose

#
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.
protected virtual void Dispose(
isDisposing
)

GetParameter

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

HasCustomRenderMeshes

#Since v8.0
Determine if custom render primitives will be supplied for a particular object.
public abstract bool HasCustomRenderMeshes(
mt,
The mesh type to provide meshes for
vp,
The viewport being rendered
doc,
The Rhino document associated with the objectId
objectId,
The objectId for which the primitives should be supplied.
ref Flags
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,
The requesting plug-in - typically the render plug-in requesting the primitives.
attrs
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
Provides details on the progress of custom render meshes for a document or collection of objects
public virtual RenderMeshProviderProgress Progress(
doc,
Guid[]
optional_objectIds
)

ProgressForAll

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

RegisterProvider

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

RegisterProviders

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

RegisterProviders

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

RenderMeshes

#Since v8.0
Returns a complete set of custom render primitives for a given ObjectId.
public abstract RenderMeshes RenderMeshes(
mt,
The mesh type to provide meshes for
vp,
The viewport being rendered
doc,
The Rhino document associated with the objectId
objectId,
The objectId for which the primitives should be supplied.
ancestry,
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.
ref Flags
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.
RenderMeshes
previousPrimitives,
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,
The requesting plug-in - typically the render plug-in requesting the meshes.
attrs
The display attributes currently being used - nullptr if this is production rendering.
)

SetParameter

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