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
Returns the LinearWorkflow data for this realtime display mode.
public LinearWorkflow LinearWorkflow { get; }

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
Override to communicate the progress of a capture.
public virtual double CaptureProgress()
A number between 0.0 and 1.0 inclusive. 1.0 means 100%.

ComputeViewportCrc

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

CreateWorld

#Since v6.0
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.
public virtual void CreateWorld(
doc,
Rhino document
viewInfo,
active viewport info
displayPipelineAttributes
display pipeline attributes
)

DrawOpenGl

#Since v6.0
public virtual bool DrawOpenGl()

GetRealtimeViewport

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

GetRealtimeViewport

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

GetRenderSize

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

GetView

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

HudAllowEditMaxPasses

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

HudCustomStatusText

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

HudLastRenderedPass

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

HudMaximumPasses

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

HudProductName

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

HudRendererLocked

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

HudRendererPaused

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

HudShow

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

HudShowControls

#Since v6.0
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.
public virtual bool HudShowControls()

HudShowCustomStatusText

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

HudShowMaxPasses

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

HudShowPasses

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

HudStartTime

#Since v6.0
public virtual DateTime HudStartTime()

IsCompleted

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

IsFrameBufferAvailable

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

IsRendererStarted

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

LastRenderedPass

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

OnRenderSizeChanged

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

OpenGlVersion

#Since v6.0
public int OpenGlVersion()

PostConstruct

#Since v6.0
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.
public virtual void PostConstruct()

RegisterDisplayModes

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

RegisterDisplayModes

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

RemoveRealtimeViewport

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

SetUseDrawOpenGl

#Since v6.0
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.
public virtual void SetUseDrawOpenGl(
use
Set to true if OpenGL drawing is wanted, set to false if RenderWindow method is needed.
)

SetView

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

ShowCaptureProgress

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

ShutdownRenderer

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

SignalRedraw

#Since v6.0
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.
public void SignalRedraw()

StartRenderer

#Since v6.0
Override to start your render engine. Note that before using the RenderWindow you *must* call SetSize to properly initialize the underlying DIB.
public abstract bool StartRenderer(
w,
Width of resolution
h,
Height of resolution
doc,
Rhino document
view,
active view
viewportInfo,
active viewport info
forCapture,
true if renderer is started for capture purposes (ViewCaptureTo*), false for regular interactive rendering
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,
pluginId
)

UnregisterDisplayModes

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

UseFastDraw

#Since v6.0
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.
public virtual bool UseFastDraw()

Events

HudLockButtonDoubleClicked

#Since v7.0
public event EventHandler HudLockButtonDoubleClicked

HudLockButtonLeftClicked

#Since v7.0
public event EventHandler HudLockButtonLeftClicked

HudLockButtonPressed

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

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
Listen tot his event if you want to handle the pause button control
public event EventHandler HudPauseButtonPressed
obsoleteUse HUDPauseButtonLeftClicked instead

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
Listen to this event if you want to handle the play button control.
public event EventHandler HudPlayButtonPressed
obsoleteUse HUDPlayButtonLeftClicked instead

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
Listen tot his event if you want to handle a press on the product name component
public event EventHandler HudProductNamePressed
obsoleteUse HUDProductNameLeftClicked instead

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
Listen tot his event if you want to handle a press on the status text component
public event EventHandler HudStatusTextPressed
obsoleteUse HUDStatusTextLeftClicked instead

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
Listen tot his event if you want to handle a press press on the time component
public event EventHandler HudTimePressed
obsoleteUse HUDTimeLeftClicked instead

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
Listen tot his event if you want to handle the unlock button control
public event EventHandler HudUnlockButtonPressed
obsoleteUse HUDUnlockButtonLeftClicked instead

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