|
Katana Plug-in APIs 0.1
|
The ViewerDelegate class to be extended by plugins. More...
#include <FnViewerDelegate.h>
Public Member Functions | |
| ViewerDelegate () | |
| Constructor. | |
| virtual | ~ViewerDelegate () |
| Destructor. | |
| virtual void | setup ()=0 |
| Initializes the ViewportDelegate's resources. | |
| virtual void | cleanup ()=0 |
| Cleans up the ViewportDelegate's resources. | |
| virtual FnAttribute::DoubleAttribute | getBounds (const std::string &locationPath) |
| Gets the bounds of the given location, if available. | |
| virtual FnAttribute::DoubleAttribute | computeExtent (const std::string &locationPath) |
| Computes the extent of any local geometry representation of this location. | |
| virtual void * | getPrivateData (void *inputData) |
| Returns some arbitrary data. | |
| virtual void | locationEvent (const ViewerLocationEvent &event, bool locationHandled)=0 |
| Notification of scene graph location state changes. | |
| virtual void | sourceLocationEvent (const ViewerLocationEvent &event)=0 |
| Notification of 'sources' scene graph location state changes. | |
| virtual void | locationsSelected (const std::vector< std::string > &locationPaths)=0 |
| Called when the location selection changes in Katana. | |
| virtual bool | isProcessing () const |
| Queries the processing of the Viewer Delegate plug-in. | |
| virtual void | setOption (OptionIdGenerator::value_type optionId, FnAttribute::Attribute attr) |
| Sets a generic option. | |
| virtual FnAttribute::Attribute | getOption (OptionIdGenerator::value_type optionId) |
| Gets the value of a generic option. | |
| void | setOption (const std::string &name, FnAttribute::Attribute attr) |
| Sets a generic option by generating an option ID from the passed name. | |
| FnAttribute::Attribute | getOption (const std::string &name) |
| Gets a generic option by generating an option ID from the passed name. | |
| virtual void | freeze ()=0 |
| Freezes the ViewerDelegate when the Viewer is hidden. | |
| virtual void | thaw ()=0 |
| Thaws the ViewerDelegate when the Viewer is shown. | |
Static Public Member Functions | |
| static void | flush () |
| Flush plugin Caches. | |
The ViewerDelegate class to be extended by plugins.
| virtual FnAttribute::DoubleAttribute Foundry::Katana::ViewerAPI::ViewerDelegate::computeExtent | ( | const std::string & | locationPath | ) | [virtual] |
Computes the extent of any local geometry representation of this location.
The computed extent returned by this function will be merged with a default extent computed from standard "geometry.point" attribute.
| locationPath | The location path. |
| static void Foundry::Katana::ViewerAPI::ViewerDelegate::flush | ( | ) | [inline, static] |
Flush plugin Caches.
Allows to discard any cache for this plugin when a Flush Caches event occurs.
Reimplemented in ExampleViewerDelegate.
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::freeze | ( | ) | [pure virtual] |
Freezes the ViewerDelegate when the Viewer is hidden.
Allows the ViewerDelegate to freeze its activities when the Viewer is not visible. This allows the ViewerDelegate to stop any kind of unecessary processing that might happen durging that time.
This function is exposed in the ViewerDelegate Python class and in the ViewerDelegateWrapper wrapper class.
Implemented in ExampleViewerDelegate.
| virtual FnAttribute::DoubleAttribute Foundry::Katana::ViewerAPI::ViewerDelegate::getBounds | ( | const std::string & | locationPath | ) | [virtual] |
Gets the bounds of the given location, if available.
This function is called only if bounds are not given by the "bound" attribute on the scene graph location. It should not traverse scene graph in order to compute bounds.
| locationPath | The location path. |
| virtual FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewerDelegate::getOption | ( | OptionIdGenerator::value_type | optionId | ) | [virtual] |
Gets the value of a generic option.
Optional. Returns the value of a generic option being requested from Python or from other C++ Viewer plugin classes.
| optionId | The ID of the option created from OptionIdGenerator or manually defined by users. |
Reimplemented in ExampleViewerDelegate.
| FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewerDelegate::getOption | ( | const std::string & | name | ) |
Gets a generic option by generating an option ID from the passed name.
This generates an Option ID from the passed string and passes it to getOption(OptionIdGenerator::value_type optionId). Since the ID is generated on every call, it is more efficient to generate the ID once, and store it for future use.
| name | The name of the option whose value to retrieve. |
| virtual void* Foundry::Katana::ViewerAPI::ViewerDelegate::getPrivateData | ( | void * | inputData | ) | [inline, virtual] |
Returns some arbitrary data.
This can be used by other plugins to access some data that is specific to this object after it is compiled, allowing built-in parts of existing Viewers to be extendable by other plugins like ViewerDelegateComponents, Viewports and ViewportLayers.
This function should be called by other plugins after getting a ManipulatorWrapperPtr and converting it into a concrete instance via ManipulatorWrapper::getPluginInstance(). These other plugins will have to be built with the same compiler and using the same compiler flags as the ViewerDelegate so that this data can be cast and used without running into C++ name mangling issues.
An example: A ViewerDelegate maintains some renderer specific data structure that contains the expanded scene data in a format that the render can use. A ViewerDelegateComponent could be added to the Viewer and through this function an access this data so that new location types can be interpreted, added to the data structure and rendered.
| inputData | A pointer to some input data that can be used to produce the returned data. |
| virtual bool Foundry::Katana::ViewerAPI::ViewerDelegate::isProcessing | ( | ) | const [inline, virtual] |
Queries the processing of the Viewer Delegate plug-in.
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::locationEvent | ( | const ViewerLocationEvent & | event, |
| bool | locationHandled | ||
| ) | [pure virtual] |
Notification of scene graph location state changes.
| event | Struct containing location event information (see "FnViewerLocationEvent.h" for details). |
| locationHandled | True if a ViewerDelegateComponent has, on processing this event, stated that it is handling this location. In this case, the Viewer Delegate should not draw its own representation. |
Implemented in ExampleViewerDelegate.
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::locationsSelected | ( | const std::vector< std::string > & | locationPaths | ) | [pure virtual] |
Called when the location selection changes in Katana.
| locationPaths | The selected location paths. |
Implemented in ExampleViewerDelegate.
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::setOption | ( | OptionIdGenerator::value_type | optionId, |
| FnAttribute::Attribute | attr | ||
| ) | [inline, virtual] |
Sets a generic option.
Optional. Reacts to a generic option being set from Python or called directly by other C++ Viewer plugin classes. This can be used as a message passing mechanism from the outside into the ViewerDelegate.
This function is exposed in the ViewerDelegate Python class.
| optionId | The ID of the option created from OptionIdGenerator or manually defined by users. |
| attr | Attribute with the value being set. |
Reimplemented in ExampleViewerDelegate.
| void Foundry::Katana::ViewerAPI::ViewerDelegate::setOption | ( | const std::string & | name, |
| FnAttribute::Attribute | attr | ||
| ) |
Sets a generic option by generating an option ID from the passed name.
This generates an Option ID from the passed string and passes it to setOption(OptionIdGenerator::value_type optionId, FnAttribute::Attribute attr). Since the ID is generated on every call, it is more efficient to generate the ID once, and store it for future use.
| name | The name of the option whose value to set. |
| attr | Attribute with the value to set for the option. |
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::sourceLocationEvent | ( | const ViewerLocationEvent & | event | ) | [pure virtual] |
Notification of 'sources' scene graph location state changes.
| event | Struct containing location event information (see "FnViewerLocationEvent.h" for details). |
Implemented in ExampleViewerDelegate.
| virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::thaw | ( | ) | [pure virtual] |
Thaws the ViewerDelegate when the Viewer is shown.
Allows the ViewerDelegate to restart its activities when the Viewer becomes visible. This restarts the activities paused by freeze().
This function is exposed in the ViewerDelegate Python class.
Implemented in ExampleViewerDelegate.
1.7.3