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

Foundry::Katana::ViewerAPI::ViewerDelegateComponent Class Reference

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

#include <FnViewerDelegateComponent.h>

Inheritance diagram for Foundry::Katana::ViewerAPI::ViewerDelegateComponent:
Foundry::Katana::ViewerAPI::ViewerDelegateComponentPluginBase BallComponent Foundry::Katana::ViewerUtils::FnBaseLocatorVDC IgnoreComponent LoggingComponent ExampleSpotlightLocatorVDC

List of all members.

Public Member Functions

virtual void setup ()=0
 Initializes the ViewportDelegateComponent's resources.
virtual void cleanup ()=0
 Cleans up the ViewportDelegateComponent's resources.
virtual bool locationEvent (const ViewerLocationEvent &event, bool locationHandled)=0
 Notification of 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 Component plug-in.
virtual void * getPrivateData (void *inputData)
 Returns some arbitrary data.
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
FnAttribute::DoubleAttribute 
getBounds (const std::string &locationPath)
 Gets the bounds of the given location.
virtual
FnAttribute::DoubleAttribute 
computeExtent (const std::string &locationPath)
 Calculates the extent of the given location.

Static Public Member Functions

static void flush ()
 Flush plugin Caches.

Detailed Description

The ViewerDelegateComponent class to be extended by plugins.


Member Function Documentation

virtual FnAttribute::DoubleAttribute Foundry::Katana::ViewerAPI::ViewerDelegateComponent::computeExtent ( const std::string &  locationPath) [virtual]

Calculates the extent of the given location.

It calculates the extent of the location based on its geometry.

Parameters:
locationPathThe location path.
Returns:
The extent of the location (or an invalid attribute if no extent was computed).

Reimplemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC.

static void Foundry::Katana::ViewerAPI::ViewerDelegateComponent::flush ( ) [inline, static]

Flush plugin Caches.

Allows to discard any cache for this plugin when a Flush Caches event occurs.

Reimplemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC, BallComponent, ExampleSpotlightLocatorVDC, IgnoreComponent, and LoggingComponent.

virtual FnAttribute::DoubleAttribute Foundry::Katana::ViewerAPI::ViewerDelegateComponent::getBounds ( const std::string &  locationPath) [virtual]

Gets the bounds of the given location.

Parameters:
locationPathThe location path.
Returns:
The bounds of the location (or an invalid attribute if not found).

Reimplemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC.

virtual FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewerDelegateComponent::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.
FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewerDelegateComponent::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::ViewerDelegateComponent::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.

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.

Reimplemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC, and BallComponent.

virtual bool Foundry::Katana::ViewerAPI::ViewerDelegateComponent::isProcessing ( ) const [inline, virtual]

Queries the processing of the Viewer Delegate Component plug-in.

Returns:
true if the plug-in is processing anything that may result in a change to the Viewer.
virtual bool Foundry::Katana::ViewerAPI::ViewerDelegateComponent::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 an already processed (later added) ViewerDelegateComponent has stated that it is handling this location by returning true. In this case, the ViewerDelegateComponent should not draw its own representation.
Returns:
true if the other ViewerDelegateComponents added to the ViewerDelegate before this one should receive locationHandled=true, false otherwise.

Implemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC, BallComponent, ExampleSpotlightLocatorVDC, IgnoreComponent, and LoggingComponent.

virtual void Foundry::Katana::ViewerAPI::ViewerDelegateComponent::locationsSelected ( const std::vector< std::string > &  locationPaths) [pure virtual]

Called when the location selection changes in Katana.

Parameters:
locationPathsThe selected location paths.

Implemented in Foundry::Katana::ViewerUtils::FnBaseLocatorVDC, BallComponent, IgnoreComponent, and LoggingComponent.

virtual void Foundry::Katana::ViewerAPI::ViewerDelegateComponent::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 ViewerDelegateComponent.

Parameters:
optionIdThe ID of the option created from OptionIdGenerator or manually defined by users.
attrAttribute with the value being set.

Reimplemented in ExampleSpotlightLocatorVDC.

void Foundry::Katana::ViewerAPI::ViewerDelegateComponent::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.

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