Rhino C++ API  8.6
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
CRhRdkSdkRender Class Referenceabstract

#include <RhRdkSdkRender.h>

Inheritance diagram for CRhRdkSdkRender:
CRhRdkObject

Classes

class  CRenderingSourcesView
 

Public Member Functions

 CRhRdkSdkRender (const CRhinoCommandContext &context, CRhinoRenderPlugIn &plugIn, const ON_wString &sRenderer, UINT uIconId)
 
RDK_DEPRECATED CRhRdkSdkRender (const CRhinoCommandContext &context, CRhinoRenderPlugIn *pPlugIn, const ON_wString &sCaption, UINT uIconId)
 
virtual ~CRhRdkSdkRender ()
 
virtual BOOL32 AddLightToScene (const CRhinoLight &light)
 
virtual BOOL32 AddRenderMeshToScene (const CRhinoObject *pObject, const CRhinoMaterial &material, const ON_Mesh *pMesh)
 
virtual IRhRdkAsyncRenderContextAsyncRenderContext (void) const
 
virtual bool ClearLastRendering (void) const
 
virtual bool CloseWindow (void) const
 
virtual const CRhinoCommandContextCommandContext (void) const
 
virtual IRhRdkRenderWindowGetRenderWindow (void) const
 
virtual BOOL32 IgnoreRhinoObject (const CRhinoObject *pObject)
 
virtual bool IsRenderInitializing (void) const
 
virtual BOOL32 NeedToProcessGeometryTable ()
 
virtual BOOL32 NeedToProcessLightTable ()
 
virtual class IRhRdkSdkRenderMeshIteratorNewRenderMeshIterator (const ON_Viewport &vp, bool bForceTriMesh=true, bool bQuiet=false) const
 
virtual void PauseRendering (void)
 
CRhinoRenderPlugInPlugIn () const
 
virtual CRhinoSdkRender::RenderReturnCodes Render (const ON_2iSize &sizeImage)
 
virtual BOOL32 RenderContinueModal ()
 
virtual BOOL32 RenderEnterModalLoop ()
 
virtual BOOL32 RenderExitModalLoop ()
 
virtual BOOL32 RenderPreCreateWindow ()
 
virtual BOOL32 RenderSceneWithNoMeshes ()
 
virtual UUID RenderSessionId (void) const
 
virtual CRhinoSdkRender::RenderReturnCodes RenderWindow (CRhinoView *pView, const LPRECT pRect, bool bInWindow)
 
virtual void ResumeRendering (void)
 
virtual bool ReuseRenderWindow (void) const
 
virtual RDK_DEPRECATED bool SaveImage (const wchar_t *wszFilename) const
 
virtual IRhRdkRenderWindow::FileResult SaveImage (const wchar_t *wszFilename, bool bSaveAlpha) const
 
virtual void SetAsyncRenderContext (IRhRdkAsyncRenderContext *pRC)
 
virtual void SetConfirmationSeconds (int iSeconds)
 
virtual void StartRendering (void)=0
 
virtual BOOL32 StartRenderingInWindow (CRhinoView *pView, const LPCRECT rect)
 
virtual BOOL32 StartRenderingQuiet (LPSIZE sizeImage)
 
virtual void StopRendering ()
 
virtual bool SupportsPause (void) const
 
- Public Member Functions inherited from CRhRdkObject
 CRhRdkObject ()
 
virtual ~CRhRdkObject ()
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)
 
void operator delete (void *buf)
 
void operator delete[] (void *buf)
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 

Static Public Member Functions

static class IRhRdkSdkRenderMeshIteratorNewRenderMeshIterator (const CRhinoDoc &doc, const UUID &uuidRenderPlugIn, const ON_Viewport &vp, bool bForceTriMesh=true, bool bQuiet=false)
 
static RDK_DEPRECATED class IRhRdkSdkRenderMeshIteratorNewRenderMeshIterator (const UUID &uuidRenderPlugIn, const ON_Viewport &vp, bool bForceTriMesh=true)
 
static RDK_DEPRECATED ON_2iSize RenderSize (const CRhinoDoc &doc)
 
static ON_2iSize RenderSize (const CRhinoDoc &doc, bool bUseRenderingSources)
 
static RDK_DEPRECATED CSize RenderSize (void)
 
- Static Public Member Functions inherited from CRhRdkObject
static void CheckMemory (void)
 
static void PopulateDebuggingInfo (void)
 

Friends

class CRhRdkRenderSession
 
class CRhRdkSdkRenderImpl
 

Constructor & Destructor Documentation

◆ CRhRdkSdkRender() [1/2]

RDK_DEPRECATED CRhRdkSdkRender::CRhRdkSdkRender ( const CRhinoCommandContext context,
CRhinoRenderPlugIn pPlugIn,
const ON_wString sCaption,
UINT  uIconId 
)

◆ CRhRdkSdkRender() [2/2]

CRhRdkSdkRender::CRhRdkSdkRender ( const CRhinoCommandContext context,
CRhinoRenderPlugIn plugIn,
const ON_wString sRenderer,
UINT  uIconId 
)

Construct a subclass of this object on the stack in your Rhino plug-in's Render() or RenderWindow() implementation.

Parameters
contextis the command context passed to the render command in Rhino.
plugInis a reference to your Rhino plug-in.
sRendereris the name of the renderer.
uIconIdis the resource id of the icon to use for the frame window.

◆ ~CRhRdkSdkRender()

virtual CRhRdkSdkRender::~CRhRdkSdkRender ( )
virtual

Member Function Documentation

◆ AddLightToScene()

virtual BOOL32 CRhRdkSdkRender::AddLightToScene ( const CRhinoLight light)
virtual

◆ AddRenderMeshToScene()

virtual BOOL32 CRhRdkSdkRender::AddRenderMeshToScene ( const CRhinoObject pObject,
const CRhinoMaterial material,
const ON_Mesh pMesh 
)
virtual

◆ AsyncRenderContext()

virtual IRhRdkAsyncRenderContext* CRhRdkSdkRender::AsyncRenderContext ( void  ) const
virtual

Get a pointer to the object that was passed to SetAsyncRenderContext(). If SetAsyncRenderContext() has not been called, this method will return null. The returned pointer is managed by RDK and should not be stored.

◆ ClearLastRendering()

virtual bool CRhRdkSdkRender::ClearLastRendering ( void  ) const
virtual
Returns
true if the render window should be cleared at the start of rendering, else false.

◆ CloseWindow()

virtual bool CRhRdkSdkRender::CloseWindow ( void  ) const
virtual

Closes the render window associated with this render instance.

Returns
true if successful, else false.

◆ CommandContext()

virtual const CRhinoCommandContext& CRhRdkSdkRender::CommandContext ( void  ) const
virtual
Returns
the command context that was passed to the constructor.

◆ GetRenderWindow()

virtual IRhRdkRenderWindow& CRhRdkSdkRender::GetRenderWindow ( void  ) const
virtual

Get the render window interface. This interface is used to access the frame buffer to which computed pixels are written. Although this returns a reference, it is safe to store the address of the returned object for later use. The object is guaranteed to exist for the lifetime of the associated frame window. This is at least as long as the duration of your rendering procedure (render thread).

◆ IgnoreRhinoObject()

virtual BOOL32 CRhRdkSdkRender::IgnoreRhinoObject ( const CRhinoObject pObject)
virtual

◆ IsRenderInitializing()

virtual bool CRhRdkSdkRender::IsRenderInitializing ( void  ) const
virtual

◆ NeedToProcessGeometryTable()

virtual BOOL32 CRhRdkSdkRender::NeedToProcessGeometryTable ( )
virtual

◆ NeedToProcessLightTable()

virtual BOOL32 CRhRdkSdkRender::NeedToProcessLightTable ( )
virtual

◆ NewRenderMeshIterator() [1/3]

static class IRhRdkSdkRenderMeshIterator* CRhRdkSdkRender::NewRenderMeshIterator ( const CRhinoDoc doc,
const UUID &  uuidRenderPlugIn,
const ON_Viewport vp,
bool  bForceTriMesh = true,
bool  bQuiet = false 
)
static
Returns
A new render mesh iterator. The caller shall delete the iterator. Any meshes created by the iterator persist in memory for the lifetime of the iterator. Use this version if you are not using the CRhRdkSdkRender class to manage your render pipeline.

◆ NewRenderMeshIterator() [2/3]

virtual class IRhRdkSdkRenderMeshIterator* CRhRdkSdkRender::NewRenderMeshIterator ( const ON_Viewport vp,
bool  bForceTriMesh = true,
bool  bQuiet = false 
) const
virtual
Returns
A new render mesh iterator. The caller shall delete the iterator. Any meshes created by the iterator persist in memory for the lifetime of the iterator.
Parameters
bQuietindicates that the render mesh iterator does not display any progress UI.

◆ NewRenderMeshIterator() [3/3]

static RDK_DEPRECATED class IRhRdkSdkRenderMeshIterator* CRhRdkSdkRender::NewRenderMeshIterator ( const UUID &  uuidRenderPlugIn,
const ON_Viewport vp,
bool  bForceTriMesh = true 
)
static

This method is deprecated in favor of the one below.

◆ PauseRendering()

virtual void CRhRdkSdkRender::PauseRendering ( void  )
virtual

Override this method to pause rendering.

◆ PlugIn()

CRhinoRenderPlugIn* CRhRdkSdkRender::PlugIn ( ) const

◆ Render()

virtual CRhinoSdkRender::RenderReturnCodes CRhRdkSdkRender::Render ( const ON_2iSize sizeImage)
virtual

Render the scene normally. For synchronous renders, the function returns when rendering is complete (or canceled).

Parameters
sizeImageis the size of the image to be rendered. If you want RDK to provide this value, you can call RenderSize().

◆ RenderContinueModal()

virtual BOOL32 CRhRdkSdkRender::RenderContinueModal ( )
virtual

◆ RenderEnterModalLoop()

virtual BOOL32 CRhRdkSdkRender::RenderEnterModalLoop ( )
virtual

◆ RenderExitModalLoop()

virtual BOOL32 CRhRdkSdkRender::RenderExitModalLoop ( )
virtual

◆ RenderPreCreateWindow()

virtual BOOL32 CRhRdkSdkRender::RenderPreCreateWindow ( )
virtual

◆ RenderSceneWithNoMeshes()

virtual BOOL32 CRhRdkSdkRender::RenderSceneWithNoMeshes ( )
virtual

◆ RenderSessionId()

virtual UUID CRhRdkSdkRender::RenderSessionId ( void  ) const
virtual
Returns
The render session id associated with this render instance.

◆ RenderSize() [1/3]

static RDK_DEPRECATED ON_2iSize CRhRdkSdkRender::RenderSize ( const CRhinoDoc doc)
static

This method is deprecated in favor of the one below.

◆ RenderSize() [2/3]

static ON_2iSize CRhRdkSdkRender::RenderSize ( const CRhinoDoc doc,
bool  bUseRenderingSources 
)
static

Get the render size as specified in the ON_3dmRenderSettings.

Parameters
docis the document to use for the render settings.
bUseRenderingSourcesis false to get the active viewport size (the same as in previous versions of Rhino), true to use rendering sources: It will automatically return the correct size based on rendering sources or custom settings.
See also
ON_3dmRenderSettings::RenderingSources()

◆ RenderSize() [3/3]

static RDK_DEPRECATED CSize CRhRdkSdkRender::RenderSize ( void  )
static

This method is deprecated in favor of the one below.

◆ RenderWindow()

virtual CRhinoSdkRender::RenderReturnCodes CRhRdkSdkRender::RenderWindow ( CRhinoView pView,
const LPRECT  pRect,
bool  bInWindow 
)
virtual

Render the scene in a view window. The function returns when rendering is complete (or cancelled).

Parameters
pViewis a pointer to the view that the user selected a rectangle in.
pRectis the rectangle that the user selected.
bInWindowis true to render directly into the view window (Not used in Rhino 3).

◆ ResumeRendering()

virtual void CRhRdkSdkRender::ResumeRendering ( void  )
virtual

Override this method to resume (i.e., un-pause) rendering.

◆ ReuseRenderWindow()

virtual bool CRhRdkSdkRender::ReuseRenderWindow ( void  ) const
virtual

OBSOLETE. Not called.

◆ SaveImage() [1/2]

virtual RDK_DEPRECATED bool CRhRdkSdkRender::SaveImage ( const wchar_t *  wszFilename) const
virtual

Saves the rendered image to a file.

Note
This is a legacy method which does not work unless there is rendering UI on the screen. As a result, this method has been deprecated.
Parameters
wszFilenameis the full path to the file name to save to. If this parameter is null, the function prompts the user for a file name.
Returns
true if successful, else false.

◆ SaveImage() [2/2]

virtual IRhRdkRenderWindow::FileResult CRhRdkSdkRender::SaveImage ( const wchar_t *  wszFilename,
bool  bSaveAlpha 
) const
virtual

Saves the rendered image to a file. Does not prompt the user in any way.

Parameters
wszFilenameis the full path to the file name to save to.
bSaveAlphadetermines if alpha will be saved in files that support it (e.g., PNG).

◆ SetAsyncRenderContext()

virtual void CRhRdkSdkRender::SetAsyncRenderContext ( IRhRdkAsyncRenderContext pRC)
virtual

Set the rendering to be executed asynchronously. After this is called, Render() and RenderWindow() will return success immediately.

Parameters
pRCis a pointer to an instance of your implementation of IRhRdkAsyncRenderContext. Ownership of this object will be passed to RDK.

◆ SetConfirmationSeconds()

virtual void CRhRdkSdkRender::SetConfirmationSeconds ( int  iSeconds)
virtual

Set the number of seconds that need to elapse during rendering before the user is asked if the rendered image should be saved.

◆ StartRendering()

virtual void CRhRdkSdkRender::StartRendering ( void  )
pure virtual

Implement this method to start your rendering thread.

◆ StartRenderingInWindow()

virtual BOOL32 CRhRdkSdkRender::StartRenderingInWindow ( CRhinoView pView,
const LPCRECT  rect 
)
virtual

◆ StartRenderingQuiet()

virtual BOOL32 CRhRdkSdkRender::StartRenderingQuiet ( LPSIZE  sizeImage)
virtual

◆ StopRendering()

virtual void CRhRdkSdkRender::StopRendering ( )
virtual

◆ SupportsPause()

virtual bool CRhRdkSdkRender::SupportsPause ( void  ) const
virtual

Override this method and return true if your renderer supports pause / resume.

Friends And Related Function Documentation

◆ CRhRdkRenderSession

friend class CRhRdkRenderSession
friend

◆ CRhRdkSdkRenderImpl

friend class CRhRdkSdkRenderImpl
friend