Public Types | |
enum | Mode { Mode::Set, Mode::RestoreDefault, Mode::NoChange } |
Possible authoring modes. More... | |
Public Member Functions | |
Authoring (Knob *knob, const AuthoringSettings &settings) | |
Authoring (const Authoring &)=delete | |
Don't allow copy constructor however, knob pointer shouldn't be copied. | |
Authoring & | operator= (const AuthoringSettings &settings) |
Copy a set of settings. | |
int | getIndex (Mode mode) const |
Mode | getMode (int index) const |
std::vector< Mode > | getModes () const |
void | setModes (const std::vector< Mode > &modes) |
void | setDefaultMode (Mode defaultMode) |
Mode | getDefaultMode () const |
Gets the mode that will be selected by default. | |
std::vector< std::string > | getModeNames () const |
std::string | getModeName () const |
Returns the authoring mode name. | |
Mode | getMode () const |
Returns the authoring mode type. | |
bool | setMode (Mode mode) |
bool | setMode (int mode) |
bool | setMode (const std::string &name) |
Static Public Member Functions | |
static Mode | getMode (const std::string &name) |
Returns the authoring mode type from the name. | |
static std::string | getModeName (Mode mode) |
Returns the name of the authoring mode from the type. | |
Provides the interface for authoring. Authoring is a USD concept, which means writing to USD layers. So, this is designed for interacting with the USD stage of the 3D system.
|
strong |
DD::Image::Authoring::Authoring | ( | Knob * | knob, |
const AuthoringSettings & | settings | ||
) |
Create an authoring control for a knob using specific settings
knob | |
settings |
int DD::Image::Authoring::getIndex | ( | Mode | mode | ) | const |
Gets the choice index of the mode (as in a dropdown)
mode | to get the choice index for |
Authoring::Mode DD::Image::Authoring::getMode | ( | int | index | ) | const |
Gets the mode from the choice index (as in a dropdown)
index | the choice number to get the mode for |
std::vector< Authoring::Mode > DD::Image::Authoring::getModes | ( | ) | const |
Returns the available authoring mode types if authoring is supported, otherwise an empty list.
Referenced by DD::Image::WriteAuthoring().
void DD::Image::Authoring::setModes | ( | const std::vector< Mode > & | modes | ) |
Sets the available authoring modes. Without setting this, authoring is disabled. This will update the set mode and the default mode if the currently set mode isn't in the list of modes.
References getModeName().
void DD::Image::Authoring::setDefaultMode | ( | Mode | defaultMode | ) |
Sets the mode that will be selected by default - won't set values if the default doesn't exist in the modes
std::vector< std::string > DD::Image::Authoring::getModeNames | ( | ) | const |
Returns the available authoring mode names if authoring is supported, otherwise an empty list.
bool DD::Image::Authoring::setMode | ( | Mode | mode | ) |
Sets the authoring mode from the type. Returns true if successfully set, otherwise false, e.g. if the mode is not a supported authoring mode by the Node (Op).
References DD::Image::Knob::changed(), and DD::Image::Knob::force_new_undo().
Referenced by DD::Image::ReadAuthoring(), and setMode().
bool DD::Image::Authoring::setMode | ( | int | mode | ) |
bool DD::Image::Authoring::setMode | ( | const std::string & | name | ) |
Sets the authoring mode from the name. Returns true if successfully set, otherwise false, e.g. if the string is not a valid authoring mode name.
References setMode().
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |