Rhino C++ API  8.13
Classes | Public Types | Public Member Functions | List of all members
IRhRdkPostEffect Class Referenceabstract

#include <RhRdkNewPostEffectPlugIn.h>

Inheritance diagram for IRhRdkPostEffect:
CRhRdkPostEffect CRhRdkEarlyPostEffect CRhRdkLatePostEffect CRhRdkToneMappingPostEffect

Classes

class  IState
 

Public Types

enum  : unsigned int {
  uf_ExecuteForProductionRendering = 0x0001, uf_ExecuteForRealtimeRendering = 0x0002, uf_ExecuteForViewportDisplay = 0x0004, uf_Fixed = 0x0100,
  uf_DefaultShown = 0x0200, uf_DefaultOn = 0x0400, uf_UsesRenderingSettings = 0x0800
}
 
enum  ExecuteWhileRenderingOptions { ExecuteWhileRenderingOptions::Never, ExecuteWhileRenderingOptions::Always, ExecuteWhileRenderingOptions::UseDelay }
 
enum  Types : int { Types::Early, Types::ToneMapping, Types::Late }
 

Public Member Functions

virtual ~IRhRdkPostEffect ()
 
virtual void AddUISections (class IRhRdkPostEffectUI &ui)=0
 
virtual IRhRdkPostEffectBeginChange (RhRdkChangeContext cc) const =0
 
virtual unsigned int BitFlags (void) const =0
 
virtual bool CanDisplayHelp (void) const =0
 
virtual bool CanExecute (const class IRhRdkPostEffectPipeline &pepl) const =0
 
virtual void Changed (void)=0
 
virtual ON__UINT32 CRC (void) const =0
 
virtual bool DisplayHelp (void) const =0
 
virtual bool EndChange (void)=0
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)=0
 
virtual bool Execute (IRhRdkPostEffectPipeline &pepl, const ON_4iRect &rect) const =0
 
virtual int ExecuteWhileRenderingDelayMS (void) const =0
 
virtual ExecuteWhileRenderingOptions GetExecuteWhileRenderingOption (void) const =0
 
virtual bool GetParameter (const wchar_t *wszName, OUT CRhRdkVariant &vValue) const =0
 
virtual UUID Id (void) const =0
 
virtual bool IsActive (void) const =0
 
virtual bool IsSelected (void) const =0
 
virtual bool IsVisible (void) const =0
 
virtual const IRhRdkListablePostEffectListable (void) const =0
 
virtual IRhRdkListablePostEffectListable (void)=0
 
virtual ON_wString LocalName (void) const =0
 
virtual RDK_DEPRECATED bool ReadFromDocumentDefaults (const CRhinoDoc &doc)=0
 
virtual_su bool ReadFromRenderSettings (const ON_3dmRenderSettings &rs)
 
virtual bool ReadState (const IState &state)=0
 
virtual void RequiredChannels (OUT ON_SimpleArray< UUID > &aChan) const =0
 
virtual void ResetToFactoryDefaults (void)=0
 
virtual void SetManager (class CRhRdkPostEffectManager &)=0
 
virtual bool SetParameter (const wchar_t *wszName, const CRhRdkVariant &vValue)=0
 
virtual Types Type (void) const =0
 
virtual bool WriteState (IState &state) const =0
 
virtual RDK_DEPRECATED bool WriteToDocumentDefaults (CRhinoDoc &doc) const =0
 
virtual_su bool WriteToRenderSettings (ON_3dmRenderSettings &rs) const
 

Detailed Description

This is the new post effect interface. It is implemented by both the RDK for built-in post effects and (partly) by 3rd-party plug-ins for custom post effects.

In the new system, post effects consist of:

Post effects can be implemented to run on the CPU or the GPU at the discretion of the implementer.

The post-processing runs in a 'pipeline' as follows:

Old system (V5, V6) New system (V7+)


Notes for 3rd-party post effect developers

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int
Enumerator
uf_ExecuteForProductionRendering 
uf_ExecuteForRealtimeRendering 
uf_ExecuteForViewportDisplay 
uf_Fixed 
uf_DefaultShown 
uf_DefaultOn 
uf_UsesRenderingSettings 

◆ ExecuteWhileRenderingOptions

Enumerator
Never 
Always 
UseDelay 

◆ Types

enum IRhRdkPostEffect::Types : int
strong
Enumerator
Early 
ToneMapping 
Late 

Constructor & Destructor Documentation

◆ ~IRhRdkPostEffect()

virtual IRhRdkPostEffect::~IRhRdkPostEffect ( )
inlinevirtual

Member Function Documentation

◆ AddUISections()

virtual void IRhRdkPostEffect::AddUISections ( class IRhRdkPostEffectUI ui)
pure virtual

Create each of your UI sections using 'new' and then call ui.AddSection() on them. RDK takes ownership of the sections. If your post effect does not need a UI, then your implementation of this method can be a no-op.

◆ BeginChange()

virtual IRhRdkPostEffect& IRhRdkPostEffect::BeginChange ( RhRdkChangeContext  cc) const
pure virtual

Call this method to get a non-const object upon which you can call non-const methods. Calls to this method are counted; you must call EndChange() once for every call to BeginChange(). Please do not use const_cast or any other means of circumventing this requirement.

Implemented in CRhRdkPostEffect.

◆ BitFlags()

virtual unsigned int IRhRdkPostEffect::BitFlags ( void  ) const
pure virtual

Flags describing when the post effect executes and its attributes. See enum above.

◆ CanDisplayHelp()

virtual bool IRhRdkPostEffect::CanDisplayHelp ( void  ) const
pure virtual
Returns
true if the post effect can display a help page, else false.

◆ CanExecute()

virtual bool IRhRdkPostEffect::CanExecute ( const class IRhRdkPostEffectPipeline pepl) const
pure virtual
Returns
true if the post effect can execute, else false. The default implementation checks if the post effect is 'on' and 'shown'. Post effect authors can override this to include other criteria but please be sure to call the base class.

◆ Changed()

virtual void IRhRdkPostEffect::Changed ( void  )
pure virtual

Called when the state of the post effect is changed. If your post effect subclass implements a member variable that affects rendering and/or appears in the post effect's user interface, then you should call this method from your Set... method when the Set... method detects a change to the value of the member.

Implemented in CRhRdkPostEffect.

◆ CRC()

virtual ON__UINT32 IRhRdkPostEffect::CRC ( void  ) const
pure virtual
Returns
A CRC of the state of this post effect.

Implemented in CRhRdkPostEffect.

◆ DisplayHelp()

virtual bool IRhRdkPostEffect::DisplayHelp ( void  ) const
pure virtual

Displays the post effect's help page, if any.

Returns
true if successful, else false.

◆ EndChange()

virtual bool IRhRdkPostEffect::EndChange ( void  )
pure virtual

Call this method after finishing a batch of changes. You must call EndChange() once for every call to BeginChange().

Returns
true if successful, else false.

Implemented in CRhRdkPostEffect.

◆ EVF()

virtual void* IRhRdkPostEffect::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
pure virtual

Emergency virtual function for future expansion.

Implemented in CRhRdkPostEffect.

◆ Execute()

virtual bool IRhRdkPostEffect::Execute ( IRhRdkPostEffectPipeline pepl,
const ON_4iRect rect 
) const
pure virtual

Execute the post effect.

Parameters
peplprovides access to the post-effect pipeline.
rectis the pixel area to process.
See also
IRhRdkPostEffectPipeline
Returns
true if successful, else false.

◆ ExecuteWhileRenderingDelayMS()

virtual int IRhRdkPostEffect::ExecuteWhileRenderingDelayMS ( void  ) const
pure virtual

If GetExecuteWhileRenderingOption() returns UseDelay then this method returns the delay in milliseconds before the post effect should execute for the first time. After the first time, the post effect will execute every time the dib is updated during rendering.

See also
enum ExecuteWhileRenderingOptions above.

Implemented in CRhRdkPostEffect.

◆ GetExecuteWhileRenderingOption()

virtual ExecuteWhileRenderingOptions IRhRdkPostEffect::GetExecuteWhileRenderingOption ( void  ) const
pure virtual

As rendering proceeds, in order for progress to be seen on the screen, small areas of the frame buffer that have been rendered are post-processed and written to an area of the dib which is then shown on the screen. Some post effects will not be able to support this as they need the whole frame buffer in order to operate. This method allows a post effect to report whether or not it is able to support execution during rendering, and if so, when it should be done.

See also
enum ExecuteWhileRenderingOptions above.

◆ GetParameter()

virtual bool IRhRdkPostEffect::GetParameter ( const wchar_t *  wszName,
OUT CRhRdkVariant vValue 
) const
pure virtual

Get a parameter.

Parameters
wszNameis the name of the parameter to get.
vValueaccepts the parameter value.
Returns
true if successful or false if the parameter was not found.

◆ Id()

virtual UUID IRhRdkPostEffect::Id ( void  ) const
pure virtual
Returns
The unique identifier of this post effect.

◆ IsActive()

virtual bool IRhRdkPostEffect::IsActive ( void  ) const
pure virtual
Returns
true if the post effect is active. For early and late post effects, this is equivalent to 'shown' and 'on'. For tone-mapping post effects, this is equivalent to 'selected'.

Implemented in CRhRdkPostEffect.

◆ IsSelected()

virtual bool IRhRdkPostEffect::IsSelected ( void  ) const
pure virtual
Returns
true if the post effect is selected in the user interface.

Implemented in CRhRdkPostEffect.

◆ IsVisible()

virtual bool IRhRdkPostEffect::IsVisible ( void  ) const
pure virtual
Returns
true if the post effect is visible to the user. For early and late post effects, this is equivalent to 'shown'. For tone-mapping post effects, this is equivalent to 'selected'.

Implemented in CRhRdkPostEffect.

◆ Listable() [1/2]

virtual const IRhRdkListablePostEffect* IRhRdkPostEffect::Listable ( void  ) const
pure virtual

Get the listable interface (const version). Returns null if the post effect is not listable. Therefore, it only returns an object if it's an early or late post effect.

Implemented in CRhRdkPostEffect.

◆ Listable() [2/2]

virtual IRhRdkListablePostEffect* IRhRdkPostEffect::Listable ( void  )
pure virtual

Get the listable interface. Returns null if the post effect is not listable. Therefore, it only returns an object if it's an early or late post effect.

Implemented in CRhRdkPostEffect.

◆ LocalName()

virtual ON_wString IRhRdkPostEffect::LocalName ( void  ) const
pure virtual
Returns
The localized name of this post effect.

◆ ReadFromDocumentDefaults()

virtual RDK_DEPRECATED bool IRhRdkPostEffect::ReadFromDocumentDefaults ( const CRhinoDoc doc)
pure virtual

Because post effects are now in the render settings, this function can no longer be called. ReadFromRenderSettings() is called instead.

Implemented in CRhRdkPostEffect.

◆ ReadFromRenderSettings()

virtual_su bool IRhRdkPostEffect::ReadFromRenderSettings ( const ON_3dmRenderSettings rs)

◆ ReadState()

virtual bool IRhRdkPostEffect::ReadState ( const IState state)
pure virtual

Read the state. If your post effect has no state, you must still return true for success.

Returns
true if successful, else false.

◆ RequiredChannels()

virtual void IRhRdkPostEffect::RequiredChannels ( OUT ON_SimpleArray< UUID > &  aChan) const
pure virtual

The RDK calls this method to determine which channels a post effect requires. If a required channel is not available, the RDK will hide the post effect's UI and display explanatory text instead.

Parameters
aChanaccepts the channels. The post effect should add all channels used by its implementation to this array. The post effect should not clear the array as other post effects may have previously added their channels to it.
Note
As a convenience, the default implementation adds IRhRdkRenderWindow::chanRGBA to the output array. Most post effects should be able to use this default with no need to override the method.

Implemented in CRhRdkPostEffect.

◆ ResetToFactoryDefaults()

virtual void IRhRdkPostEffect::ResetToFactoryDefaults ( void  )
pure virtual

Reset the state to factory defaults.

◆ SetManager()

virtual void IRhRdkPostEffect::SetManager ( class CRhRdkPostEffectManager &  )
pure virtual

Implemented in CRhRdkPostEffect.

◆ SetParameter()

virtual bool IRhRdkPostEffect::SetParameter ( const wchar_t *  wszName,
const CRhRdkVariant vValue 
)
pure virtual

Set a parameter.

Parameters
wszNameis the name of the parameter to get.
vValuespecifies the type and value to set.
Returns
true if successful or false if the parameter could not be set.

◆ Type()

virtual Types IRhRdkPostEffect::Type ( void  ) const
pure virtual
Returns
the Type of this post effect.

Implemented in CRhRdkPostEffect.

◆ WriteState()

virtual bool IRhRdkPostEffect::WriteState ( IState state) const
pure virtual

Write the state. If your post effect has no state, you must still return true for success.

Returns
true if successful, else false.

◆ WriteToDocumentDefaults()

virtual RDK_DEPRECATED bool IRhRdkPostEffect::WriteToDocumentDefaults ( CRhinoDoc doc) const
pure virtual

Because post effects are now in the render settings, this function can no longer be called. WriteToRenderSettings() is called instead.

Implemented in CRhRdkPostEffect.

◆ WriteToRenderSettings()

virtual_su bool IRhRdkPostEffect::WriteToRenderSettings ( ON_3dmRenderSettings rs) const