Katana Plug-in APIs 0.1
Public Member Functions | Static Public Member Functions

Foundry::Katana::ViewerAPI::ViewerDelegate Class Reference

The ViewerDelegate class to be extended by plugins. More...

#include <FnViewerDelegate.h>

Inheritance diagram for Foundry::Katana::ViewerAPI::ViewerDelegate:
Foundry::Katana::ViewerAPI::ViewerDelegatePluginBase ExampleViewerDelegate

List of all members.

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.

Detailed Description

The ViewerDelegate class to be extended by plugins.


Member Function Documentation

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.

Parameters:
locationPathThe location path.
Returns:
The extent of the location in local space, or an invalid attribute if no extent was computed.
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.

Parameters:
locationPathThe location path.
Returns:
The bounds of the location in local space, or an invalid attribute if not available.
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.

Parameters:
optionIdThe ID of the option created from OptionIdGenerator or manually defined by users.
Returns:
Attribute with the value of the option.

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.

Parameters:
nameThe name of the option whose value to retrieve.
Returns:
The value of the option with the given name.
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.

Parameters:
inputDataA pointer to some input data that can be used to produce the returned data.
Returns:
The arbitrary private data. A void pointer that can be cast into specific object types by other plugins.
virtual bool Foundry::Katana::ViewerAPI::ViewerDelegate::isProcessing ( ) const [inline, virtual]

Queries the processing of the Viewer Delegate plug-in.

Returns:
true if the plug-in is processing anything that may result in a change to the Viewer.
virtual void Foundry::Katana::ViewerAPI::ViewerDelegate::locationEvent ( const ViewerLocationEvent event,
bool  locationHandled 
) [pure virtual]

Notification of scene graph location state changes.

Parameters:
eventStruct containing location event information (see "FnViewerLocationEvent.h" for details).
locationHandledTrue 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.

Parameters:
locationPathsThe 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.

Parameters:
optionIdThe ID of the option created from OptionIdGenerator or manually defined by users.
attrAttribute 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.

Parameters:
nameThe name of the option whose value to set.
attrAttribute 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.

Parameters:
eventStruct 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.


The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator