RealtimeDisplayMode

References
public abstract class RealtimeDisplayMode
Base class for implementing real-time display modes in .NET. Pay special attention that in StartRenderer the RenderWindow.SetSize() function is called if the implementation relies on the RenderWindow to do the drawing to the viewport. If i.e. OpenGL is used to draw render results to the viewport then SetSize() doesn't have to be called, nor should the implementation then access channels on the RenderWindow, as those then don't exist. For OpenGL-based drawing the RenderWindow is used as a container for ViewInfo management, nothing else.

Constructors

RealtimeDisplayMode

#
protected RealtimeDisplayMode()

Properties

LinearWorkflow

#Since v6.0
public LinearWorkflow LinearWorkflow { get; }
Returns the LinearWorkflow data for this realtime display mode.

Locked

#Since v6.6
public bool Locked { get; set; }

MaxPasses

#Since v6.6
public int MaxPasses { get; set; }

Paused

#Since v6.6
public bool Paused { get; set; }

PostEffectsOn

#Since v7.1
public bool PostEffectsOn { get; set; }

Methods

CaptureProgress

#Since v6.0
public virtual double CaptureProgress()
Override to communicate the progress of a capture.
A number between 0.0 and 1.0 inclusive. 1.0 means 100%.

ComputeViewportCrc

#Since v6.0
[CLSCompliant(false)] public uint ComputeViewportCrc(ViewInfo view)
Compute viewport CRC for the given ViewInfo
view (ViewInfo)
the CRC for the given view

CreateWorld

#Since v6.0
public virtual void CreateWorld(RhinoDoc doc, ViewInfo viewInfo, DisplayPipelineAttributes displayPipelineAttributes)
Implement if you need to handle the initial CreateWorld call initiated by the display pipeline system. Note that this is not the same as the CreateWorld call in Rhino.Render.ChangeQueue.ChangeQueue, although related.
doc (RhinoDoc)Rhino document
viewInfo (ViewInfo)active viewport info
displayPipelineAttributes (DisplayPipelineAttributes)display pipeline attributes

DrawOpenGl

#Since v6.0
public virtual bool DrawOpenGl()

GetRealtimeViewport

#Since v6.0
public static RealtimeDisplayMode GetRealtimeViewport(nint realtimeViewport, bool create)
Retrieve RealtimeDisplayMode instance. If create is set to true then a new instance is created if not found, null is returned for false.
realtimeViewport (nint)IntPtr
create (bool)true to create if not found, false to return null if not found.

GetRealtimeViewport

#Since v6.0
public static RealtimeDisplayMode GetRealtimeViewport(nint realtimeViewport)
Retrieve RealtimeDisplayMode instance that the IntPtr refers to.
realtimeViewport (nint)IntPtr of the instance searched for. If the instance doesn't exist, a new one is created.

GetRenderSize

#Since v6.0
public abstract void GetRenderSize(out int width, out int height)
Get the current render resolution for the running render session.
width (out int)
height (out int)

GetView

#Since v6.0
[CLSCompliant(false)] public ViewInfo GetView()
Get ViewInfo that has been registered with this RealtimeDisplayMode instance.

HudAllowEditMaxPasses

#Since v6.0
public virtual bool HudAllowEditMaxPasses()
Override to allow maximum pass editing. By default disabled.
Return true to allow users to edit the maximum pass count.

HudCustomStatusText

#Since v6.0
public virtual string HudCustomStatusText()
Override to display status of the render engine.
Status text to display

HudLastRenderedPass

#Since v6.0
public virtual int HudLastRenderedPass()
Override to communicate the last completed pass. Can be shown in the HUD
Last completed pass

HudMaximumPasses

#Since v6.0
public virtual int HudMaximumPasses()
Override to communicate the maximum passes count currently in use for the render session. Can be shown in the HUD
Maximum passes

HudProductName

#Since v6.0
public virtual string HudProductName()
Override to return the name of your product. This will be printed in the HUD.
Name of the product.

HudRendererLocked

#Since v6.0
public virtual bool HudRendererLocked()
Implement to support locking in the viewport
Return true if the render engine is locked.

HudRendererPaused

#Since v6.0
public virtual bool HudRendererPaused()
Implement to support pausing and resuming in the viewport
Return true if the render engine is paused.

HudShow

#Since v6.0
public virtual bool HudShow()
Override if you want to hide the HUD. Shown by default
Return false to hide the HUD.

HudShowControls

#Since v6.0
public virtual bool HudShowControls()
Show control buttons on the realtime display HUD. By default these are shown, override this function and return false if HUD controls aren't needed.

HudShowCustomStatusText

#Since v6.0
public virtual bool HudShowCustomStatusText()
Override to show status text in HUD. By default disabled.
Return true to show status text in HUD

HudShowMaxPasses

#Since v6.0
public virtual bool HudShowMaxPasses()
Override to show maximum passes in HUD. By default disabled.
Return true to show maximum passes.

HudShowPasses

#Since v6.0
public virtual bool HudShowPasses()
Override to show current pass in HUD. By default disabled.
Return true to show current pass in HUD.

HudStartTime

#Since v6.0
public virtual DateTime HudStartTime()

IsCompleted

#Since v6.0
public abstract bool IsCompleted()
Implement to tell if your render engine has completed a frame for drawing into the viewport

IsFrameBufferAvailable

#Since v6.0
public abstract bool IsFrameBufferAvailable(ViewInfo view)
Implement to tell the render pipeline that a framebuffer is ready
view (ViewInfo)
Return true when a framebuffer is ready. This is generally the case when StartRenderer as returned successfully.

IsRendererStarted

#Since v6.0
public abstract bool IsRendererStarted()
Override to tell the started state of your render engine.
true if render engine is ready and rendering

LastRenderedPass

#Since v6.0
public virtual int LastRenderedPass()
Implement to communicate last completed pass to the underlying system.
the last completed pass

OnRenderSizeChanged

#Since v6.0
public virtual bool OnRenderSizeChanged(int width, int height)
Override to restart your render engine
width (int)
height (int)

OpenGlVersion

#Since v6.0
public int OpenGlVersion()

PostConstruct

#Since v6.0
public virtual void PostConstruct()
Override PostConstruct if you need to initialize where the underlying RealtimeDisplayMode is available. The connection is made right after RealtimeDisplayMode has been instantiated, but just before PostConstruct is called. For instance finding out OpenGL information can be done in PostConstruct.

RegisterDisplayModes

#Since v6.0
public static RealtimeDisplayModeClassInfo[] RegisterDisplayModes(Assembly assembly, Guid pluginId)
Find and register classes that derive from RealtimeDisplayMode from the given plug-in. The plug-in is found in the given assembly
assembly (Assembly)
pluginId (Guid)

RegisterDisplayModes

#Since v6.0
public static RealtimeDisplayModeClassInfo[] RegisterDisplayModes(PlugIn plugin)
Find and register classes that derive from RealtimeDisplayMode from the given plug-in.
plugin (PlugIn)

RemoveRealtimeViewport

#Since v6.0
public static void RemoveRealtimeViewport(nint realtimeViewport)
Remove RealtimeDisplayMode instance from internal dictionary.
realtimeViewport (nint)IntPtr to the RealtimeDisplayMode instance to remove.

SetUseDrawOpenGl

#Since v6.0
public virtual void SetUseDrawOpenGl(bool use)
During run-time change whether to use OpenGL drawing of results or not. For instance offline rendering (viewcapture* with different resolution than viewport) could use RenderWindow instead of direct OpenGL drawing.
use (bool)Set to true if OpenGL drawing is wanted, set to false if RenderWindow method is needed.

SetView

#Since v6.0
[CLSCompliant(false)] public void SetView(ViewInfo view)
Set ViewInfo for this RealtimeDisplayMode instance.
view (ViewInfo)The ViewInfo to set for subsequent tests.

ShowCaptureProgress

#Since v6.0
public virtual bool ShowCaptureProgress()
Override if you want to i.e. hide the progress dialog for capture progress.
Return true to show, false to hide

ShutdownRenderer

#Since v6.0
public abstract void ShutdownRenderer()
Override to shutdown your render engine

SignalRedraw

#Since v6.0
public void SignalRedraw()
Use to signal the underlying pipeline a redraw is wanted. This can be used for instance when a renderer has completed a pass which should be updated in the associated viewport.

StartRenderer

#Since v6.0
public abstract bool StartRenderer(int w, int h, RhinoDoc doc, ViewInfo view, ViewportInfo viewportInfo, bool forCapture, RenderWindow renderWindow)
Override to start your render engine. Note that before using the RenderWindow you *must* call SetSize to properly initialize the underlying DIB.
w (int)Width of resolution
h (int)Height of resolution
doc (RhinoDoc)Rhino document
view (ViewInfo)active view
viewportInfo (ViewportInfo)active viewport info
forCapture (bool)true if renderer is started for capture purposes (ViewCaptureTo*), false for regular interactive rendering
renderWindow (RenderWindow)RenderWindow to hold render results in.
Return true when your render engine started correctly, false when that failed

UnregisterDisplayModes

#Since v6.0
public static void UnregisterDisplayModes(Assembly assembly, Guid pluginId)
assembly (Assembly)
pluginId (Guid)

UnregisterDisplayModes

#Since v6.0
public static void UnregisterDisplayModes(PlugIn plugin)
plugin (PlugIn)

UseFastDraw

#Since v6.0
public virtual bool UseFastDraw()
Implement and return true if you want the display pipeline to not wait for IsFramebufferAvailable during the MiddleGround draw phase. This will also tell the pipeline to draw a complete middleground pass in OpenGL.

Events

HudLockButtonDoubleClicked

#Since v7.0
public event EventHandler HudLockButtonDoubleClicked

HudLockButtonLeftClicked

#Since v7.0
public event EventHandler HudLockButtonLeftClicked

HudLockButtonPressed

#Since v6.0
public event EventHandler HudLockButtonPressed
obsoleteUse HUDLockButtonLeftClicked instead
Listen tot his event if you want to handle the lock button control

HudLockButtonRightClicked

#Since v7.0
public event EventHandler HudLockButtonRightClicked

HudPauseButtonDoubleClicked

#Since v7.0
public event EventHandler HudPauseButtonDoubleClicked

HudPauseButtonLeftClicked

#Since v7.0
public event EventHandler HudPauseButtonLeftClicked

HudPauseButtonPressed

#Since v6.0
public event EventHandler HudPauseButtonPressed
obsoleteUse HUDPauseButtonLeftClicked instead
Listen tot his event if you want to handle the pause button control

HudPauseButtonRightClicked

#Since v7.0
public event EventHandler HudPauseButtonRightClicked

HudPlayButtonDoubleClicked

#Since v7.0
public event EventHandler HudPlayButtonDoubleClicked

HudPlayButtonLeftClicked

#Since v7.0
public event EventHandler HudPlayButtonLeftClicked

HudPlayButtonPressed

#Since v6.0
public event EventHandler HudPlayButtonPressed
obsoleteUse HUDPlayButtonLeftClicked instead
Listen to this event if you want to handle the play button control.

HudPlayButtonRightClicked

#Since v7.0
public event EventHandler HudPlayButtonRightClicked

HudPostEffectsOffButtonDoubleClicked

#Since v7.0
public event EventHandler HudPostEffectsOffButtonDoubleClicked

HudPostEffectsOffButtonLeftClicked

#Since v7.0
public event EventHandler HudPostEffectsOffButtonLeftClicked

HudPostEffectsOffButtonRightClicked

#Since v7.0
public event EventHandler HudPostEffectsOffButtonRightClicked

HudPostEffectsOnButtonDoubleClicked

#Since v7.0
public event EventHandler HudPostEffectsOnButtonDoubleClicked

HudPostEffectsOnButtonLeftClicked

#Since v7.0
public event EventHandler HudPostEffectsOnButtonLeftClicked

HudPostEffectsOnButtonRightClicked

#Since v7.0
public event EventHandler HudPostEffectsOnButtonRightClicked

HudProductNameDoubleClicked

#Since v7.0
public event EventHandler HudProductNameDoubleClicked

HudProductNameLeftClicked

#Since v7.0
public event EventHandler HudProductNameLeftClicked

HudProductNamePressed

#Since v6.0
public event EventHandler HudProductNamePressed
obsoleteUse HUDProductNameLeftClicked instead
Listen tot his event if you want to handle a press on the product name component

HudProductNameRightClicked

#Since v7.0
public event EventHandler HudProductNameRightClicked

HudStatusTextDoubleClicked

#Since v7.0
public event EventHandler HudStatusTextDoubleClicked

HudStatusTextLeftClicked

#Since v7.0
public event EventHandler HudStatusTextLeftClicked

HudStatusTextPressed

#Since v6.0
public event EventHandler HudStatusTextPressed
obsoleteUse HUDStatusTextLeftClicked instead
Listen tot his event if you want to handle a press on the status text component

HudStatusTextRightClicked

#Since v7.0
public event EventHandler HudStatusTextRightClicked

HudTimeDoubleClicked

#Since v7.0
public event EventHandler HudTimeDoubleClicked

HudTimeLeftClicked

#Since v7.0
public event EventHandler HudTimeLeftClicked

HudTimePressed

#Since v6.0
public event EventHandler HudTimePressed
obsoleteUse HUDTimeLeftClicked instead
Listen tot his event if you want to handle a press press on the time component

HudTimeRightClicked

#Since v7.0
public event EventHandler HudTimeRightClicked

HudUnlockButtonDoubleClicked

#Since v7.0
public event EventHandler HudUnlockButtonDoubleClicked

HudUnlockButtonLeftClicked

#Since v7.0
public event EventHandler HudUnlockButtonLeftClicked

HudUnlockButtonPressed

#Since v6.0
public event EventHandler HudUnlockButtonPressed
obsoleteUse HUDUnlockButtonLeftClicked instead
Listen tot his event if you want to handle the unlock button control

HudUnlockButtonRightClicked

#Since v7.0
public event EventHandler HudUnlockButtonRightClicked

MaxPassesChanged

#Since v6.0
Listen to this if you want to handle changes in maximum pass count through the HUD.

OnDisplayPipelineSettingsChanged

#Since v6.0
public event EventHandler<RealtimeDisplayMode.DisplayPipelineSettingsChangedEventArgs> OnDisplayPipelineSettingsChanged

OnDrawMiddleground

#Since v6.0

OnInitFramebuffer

#Since v6.0