RenderWindow

References
public class RenderWindow : IDisposable

Properties

SessionId

#Since v5.11
public Guid SessionId { get; }

Methods

AddChannel

#Since v5.0
public bool AddChannel(StandardChannels channel)
Add a channel to the frame buffer in addition to the fixed Red, Green, Blue and Alpha channels.
channel (RenderWindow.StandardChannels)Channel to add
If the channel existed then true is returned otherwise; returns true if the channel was added or false if not.

AddWireframeChannel

#Since v5.0
public bool AddWireframeChannel(RhinoDoc doc, ViewportInfo viewport, Size size, Rectangle region)
This method sets the frame buffer size and adds all the necessary wireframe channels automatically. It also creates the wireframe channel data automatically so that your renderer doesn't have to. You typically call this method only when your renderer does not support wireframe rendering itself. If you call this method, then you should not add any wireframe channels returned by GetRenderChannels(). If your renderer is capable of rendering the wireframe channels itself, you should not call this method. Instead, you must make sure you add the wireframe channels if GetRenderChannels() requests them. See IRhRdkRenderWindow::GetRenderChannels(). After the wires are rendered, the wireframe post effects will composite them into the final rendered image. Note: This method should really be called AddWireframeChannels(). [SDK_UNFREEZE] */
doc (RhinoDoc)The document to display
viewport (ViewportInfo)The view to display
size (Size)The size of the image without clipping (i.e., if you have a region, it is the size of the image before you cut the region out.
region (Rectangle)The area of the rendering you want to display. This should match the size of the render window itself (i.e, - the one set using SetSize)
Returns true if all of the wireframe channels were added successfully.

ChannelId

#Since v5.0
public static Guid ChannelId(StandardChannels ch)

Create

#Since v6.0
public static RenderWindow Create(Size szSize)
szSize (Size)

Dispose

#Since v6.0
public void Dispose()

EnableDebugThreadCheck

#
public void EnableDebugThreadCheck(bool enabled)
Expert use only. Note that it is critical that when you disable the check, you absolutely ensure that there can not be access to the render window from multiple threads during the period it is disabled. Set it back on as soon as possible.
enabled (bool)Sets the status of the thread check flag on the render window in debug builds

EndAsyncRender

#Since v6.0
public void EndAsyncRender(RenderSuccessCode successCode)
Must be called when an asynchronous render has finished or ended for any reason.
successCode (RenderWindow.RenderSuccessCode)Completed for a correct or canceled render, Failed for errors.

FromSessionId

#Since v5.11
public static RenderWindow FromSessionId(Guid sessionId)
sessionId (Guid)

GetAdjust

#Since v6.0 Obsolete v7.0
public RenderWindow.ImageAdjust GetAdjust()
obsoleteThe Render Window UI now uses post effects for gamma, tone mapping, etc.
OBSOLETE. NOT IMPLEMENTED.

GetBitmap

#Since v6.0
public Bitmap GetBitmap()

GetRequestedRenderChannels

#Since v7.0
public Guid[] GetRequestedRenderChannels()
Get array of Guids representing the channels requested by the post effect pipeline for this RenderWindow.
Array of Guid

GetRequestedRenderChannelsAsStandardChannels

#Since v7.0
public RenderWindow.StandardChannels[] GetRequestedRenderChannelsAsStandardChannels()
Get array of StandardChannels enum values representing the channels requested by the post effect pipeline for this RenderWindow.
Array of StandardChannels

Invalidate

#Since v5.0
public void Invalidate()
Invalidate the entire view window so that the pixels get painted.

InvalidateArea

#Since v5.0
public void InvalidateArea(Rectangle rect)
rect (Rectangle)

IsChannelAvailable

#Since v7.0
public bool IsChannelAvailable(Guid id)
Query if a channel is available.
id (Guid)
Returns true if the channel is available.

IsChannelShown

#Since v7.0
public bool IsChannelShown(Guid id)
Query if a channel is being shown.
id (Guid)
Returns true if the channel is being shown.

OpenChannel

#Since v5.0
public RenderWindow.Channel OpenChannel(StandardChannels id)

RegisterPostEffectExecutionControl

#Since v8.0
public void RegisterPostEffectExecutionControl(PostEffectExecutionControl ec)
Register an instance of PostEffectExecutionControl.

SaveDibAsBitmap

#Since v6.0
public void SaveDibAsBitmap(string filename)
Save current Dib of RenderWindow as file Helper function for debugging purposes.
filename (string)

SaveRenderImageAs

#Since v6.0
public void SaveRenderImageAs(string filename, bool saveAlpha)
Like RenderWindow.SaveRenderImageAs(string,Guid,bool), but with Guid set to Guid.Empty.
filename (string)Filename of image file to be created
saveAlpha (bool)True if alpha channel should be saved.

SaveRenderImageAs

#Since v6.0
public void SaveRenderImageAs(string filename, Guid renderEngineGuid, bool saveAlpha)
Save current RenderWindow contents as an image file with the given name. The filetype will be determine. Pass in render engine Guid if an engine implements saving to a format that is not supported by Rhino. Guid.Empty if there is no need for that.
filename (string)Filename of image file to be created
renderEngineGuid (Guid)render engine ID
saveAlpha (bool)True if alpha channel should be saved.

SetAdjust

#Since v6.0 Obsolete v7.0
public void SetAdjust(ImageAdjust imageAdjust)
obsoleteThe Render Window UI now uses post effects for gamma, tone mapping, etc.
OBSOLETE. NOT IMPLEMENTED.
imageAdjust (RenderWindow.ImageAdjust)OBSOLETE

SetIsRendering

#Since v7.1
public void SetIsRendering(bool is_rendering)
Set whether or not rendering is in progress. Added to support raytraced mode.
is_rendering (bool)

SetProgress

#Since v5.0
public void SetProgress(string text, float progress)
Accepts a rendering progress value to inform the user of the rendering advances.
text (string)The progress text.
progress (float)A progress value in the domain [0.0f; 1.0f].

SetRenderOutputRect

#Since v8.0
public void SetRenderOutputRect(Rectangle rect)
Specify a sub-rectangle of the render window to indicate where the relevant render output has been written. For example, if a renderer chooses to render at half resolution, it could write its data to the top left quadrant of the render window, which can be indicated by setting the render output rectangle. This is set to the full render window size by default. When the render window size is modified, the render output rectangle will be set to reflect the new size.
rect (Rectangle)Rectangle

SetRGBAChannelColors

#Since v5.0
public void SetRGBAChannelColors(Rectangle rectangle, Color4f[] colors)
Call this method to open the RenderWindow.StandardChannels.RGBA channel and set a block of color values
rectangle (Rectangle)rectangle.X is the horizontal pixel position of the left edge. No validation is done on this value. The caller is responsible for ensuring that it is within the frame buffer. rectangle.Y is the vertical pixel position of the top edge. No validation is done on this value. The caller is responsible for ensuring that it is within the frame buffer. rectangle.Width is the width of the rectangle in pixels. No validation is done on this value. rectangle.Height is the height of the rectangle in pixels. No validation is done on this value.
colors (Color4f[])Array of Color4f values used to set the RenderWindow.StandardChannels.RGBA

SetRGBAChannelColors

#Since v5.0
public void SetRGBAChannelColors(Size size, Color4f[] colors)
Call this method to open the RenderWindow.StandardChannels.RGBA channel and set a block of color values
size (Size)Size of the area to set. No validation is done on this value
colors (Color4f[])Array of Color4f values used to set the RenderWindow.StandardChannels.RGBA

SetSize

#Since v5.0
public void SetSize(Size size)
size (Size)

SetView

#Since v6.0
public void SetView(ViewInfo view)
view (ViewInfo)

Size

#Since v5.0
public Size Size()

StandardChannelForGuid

#Since v7.0
public static RenderWindow.StandardChannels StandardChannelForGuid(Guid id)
Get the StandardChannels for the given Guid
id (Guid)

Events

Cloned

#Since v5.11
public static event EventHandler<RenderWindowClonedEventArgs> Cloned