Rhino C++ API
8.14
|
#include <RhRdkTask.h>
Public Types | |
enum | Result : unsigned int { Result::Success, Result::Failure, Result::Cancel } |
enum | Separator : unsigned int { Separator::None, Separator::Before, Separator::After, Separator::Both } |
enum | SubMenus { SubMenus::None, SubMenus::CreateNew, SubMenus::Thumbnails, SubMenus::PlugIn } |
Public Member Functions | |
CRhRdkTask () | |
virtual | ~CRhRdkTask () |
Result | Error (const wchar_t *wszMessage) const |
virtual Result | Execute (const IRhRdkTaskOrigin &origin) const =0 |
virtual bool | IconIn (CRhRdkContent::Kinds kind, int width, int height, CRhinoDib &dibOut) const |
virtual bool | IconOut (CRhRdkContent::Kinds kind, int width, int height, CRhinoDib &dibOut) const |
virtual UUID | Id (void) const =0 |
virtual UUID | InterfaceId (void) const final override |
virtual bool | IsEnabled (const IRhRdkTaskOrigin &origin) const =0 |
virtual bool | IsForTopLevelContent (void) const |
virtual int | MenuOrder (const IRhRdkTaskOrigin &origin) const =0 |
virtual Separator | MenuSeparators (void) const |
virtual const wchar_t * | MenuString (const IRhRdkTaskOrigin &origin, CRhRdkContent::Kinds kind) const =0 |
virtual bool | Query (const IRhRdkTaskOrigin &origin, bool bOnItem) const |
virtual UUID | RenderEngineId (void) const |
virtual void | SetError (const wchar_t *wszMessage, RhRdkMbSeverity severity) const |
virtual SubMenus | SubMenu (void) const |
virtual bool | SupportsSandbox (void) const |
virtual void | Update (IRhRdkTaskUpdate &tu) const |
virtual Result | UserExecute (const IRhRdkTaskOrigin &origin) const |
virtual void | UserUpdate (IRhRdkTaskUpdate &tu) const |
Public Member Functions inherited from CRhRdkExtension | |
CRhRdkExtension () | |
virtual | ~CRhRdkExtension () |
virtual UUID | PlugInId (void) const =0 |
bool | Unregister (void) |
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 void | RequiredDataSources (OUT ON_SimpleArray< ON_UUID > &aId) |
Static Public Member Functions inherited from CRhRdkObject | |
static void | CheckMemory (void) |
static void | PopulateDebuggingInfo (void) |
Protected Member Functions | |
void | FullUndoString (const IRhRdkTaskOrigin &origin, ON_wString &sOut) const |
virtual bool | GetSureMessage (const IRhRdkTaskOrigin &origin, ON_wString &sMessageOut, ON_wString &sYesVerbOut, ON_wString &sNoVerbOut, ON_wString &sDontShowAgainIdOut) const |
virtual void | GetUndoString (const IRhRdkTaskOrigin &origin, ON_wString &sOut) const |
virtual void | SetSelection (const IRhRdkTaskOrigin &origin, const CRhRdkContentArray &aContent) const |
This class is the base class for all tasks. A task encapsulates the functionality of any operation the user can perform by clicking a menu item or pressing a key in a content editor.
|
strong |
Result codes for Execute()
Enumerator | |
---|---|
Success | |
Failure | |
Cancel |
|
strong |
This enum is for MenuSeparators()
Enumerator | |
---|---|
None | |
Before | |
After | |
Both |
|
strong |
This enum is for SubMenu()
Enumerator | |
---|---|
None | |
CreateNew | |
Thumbnails | |
PlugIn |
CRhRdkTask::CRhRdkTask | ( | ) |
|
virtual |
Result CRhRdkTask::Error | ( | const wchar_t * | wszMessage | ) | const |
Helper function to set error message with severity 'error' and return failure.
|
pure virtual |
Implement this method to execute the task.
Implemented in CRhRdkRequestTask.
|
protected |
|
protectedvirtual |
Implement this method to provide an 'Are you sure?' message. Only override and implement this if you want such a message.
origin | is the task origin. |
sMessageOut | accepts the message that will be displayed to the user. The message box will have 'Yes' and 'No' buttons and a 'Don't show me this again' check box. |
sYesVerbOut | provides alternative text for the 'Yes' button (only used on the Mac). |
sNoVerbOut | provides alternative text for the 'No' button (only used on the Mac). |
sDontShowAgainIdOut | accepts an identifier which is used to remember if the user chose to not be asked this question again. |
|
protectedvirtual |
Implement this method to provide a custom undo string. The default is automatically created from the menu string.
|
virtual |
|
virtual |
|
pure virtual |
|
finaloverridevirtual |
Returns the unique interface id of this extension.
Implements CRhRdkExtension.
|
pure virtual |
Implemented in CRhRdkMultipleContentTask, CRhRdkSingleContentTask, and CRhRdkSimpleTask.
|
virtual |
Reimplemented in CRhRdkMultipleTopLevelContentTask, and CRhRdkSingleTopLevelContentTask.
|
pure virtual |
|
virtual |
|
pure virtual |
kind | is the kind of top-level content being displayed in the UI that is showing the menu. |
|
virtual |
Query if the task should be displayed to the user in a menu etc. The default implementation returns the result of calling origin.SupportsTask().
origin | represents the UI that the menu was invoked in. |
bOnItem | is true if the user right-clicked on one or more items (thumbnail, tree node etc). It will be false if the menu was not a context menu, nothing was selected or the user right-clicked on a blank area of the UI. For content/sub-node controls, this is always true. |
Reimplemented in CRhRdkCustomTask, CRhRdkMultipleContentTask, and CRhRdkSingleContentTask.
|
virtual |
Get the render engine id associated with the task. Only tasks associated with the current renderer will be shown on menus. If this method returns uuidUniversalRenderEngine then the task will always be shown. This is the default.
|
static |
Returns the ids of the data sources needed to make tasks work.
|
virtual |
Set an error message and severity. This is typically called when a task is about to return failure.
|
protectedvirtual |
Set the selection so that the user can view and edit a collection of one or more contents.
origin | is the task origin which represents where the selection should be set. |
aContent | is the contents to set as the current selection. |
|
virtual |
Reimplemented in CRhRdkCustomTask.
|
virtual |
|
virtual |
Implement this method to update the UI element associated with the task (e.g., a menu). If you do not implement this, the task's UI elements will always appear in an active and unchecked state.
Reimplemented in CRhRdkRequestTask.
|
virtual |
|
virtual |
Update the UI element (e.g., a menu) associated with a task. This method should rarely if ever, be overridden. It first checks if the task is enabled generally by calling IsEnabled(). If the task is enabled, it updates the task's UI by calling Update(). The actual update is performed by an override of Update().