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

Foundry::Katana::ViewerAPI::Manipulator Class Reference

Manipulator plug-in base class. More...

#include <FnManipulator.h>

Inheritance diagram for Foundry::Katana::ViewerAPI::Manipulator:
Foundry::Katana::ViewerAPI::ManipulatorPluginBase Foundry::Katana::ViewerUtils::GLManipulator Foundry::Katana::ViewerUtils::GLTransformManipulator GLCoiManipulator GLRotateManipulator GLScaleManipulator GLTranslateManipulator

List of all members.

Public Member Functions

 Manipulator ()
 Constructor.
virtual ~Manipulator ()
 Destructor.
virtual void setup ()=0
 Initializes the GL components of the Viewport.
virtual bool event (const FnEventWrapper &eventData)
 Processes UI events.
virtual void draw ()
 Draws the Manipulator.
virtual void pickerDraw (int64_t pickerId)
 Draws the Manipulator for picking.
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.

Static Public Member Functions

static bool matches (const FnAttribute::GroupAttribute &locationAttrs)
 Specifies if the Manipulator can be applied to a location.
static FnAttribute::GroupAttribute getTags ()
 Gets the Manipulator tags.

Detailed Description

Manipulator plug-in base class.


Member Function Documentation

virtual void Foundry::Katana::ViewerAPI::Manipulator::draw ( ) [virtual]

Draws the Manipulator.

Called when the scene needs to be drawn in the correct GL context. In a non-GL renderer the generated image should be drawn in the GL framebuffer in order to be displayed.

Reimplemented in GLCoiManipulator.

virtual bool Foundry::Katana::ViewerAPI::Manipulator::event ( const FnEventWrapper eventData) [virtual]

Processes UI events.

Called whenever a user interaction event occurs.

Parameters:
eventDataThe event data (see FnEventWrapper).
Returns:
True if the event has been handled, false otherwise. By default this returns false.
virtual FnAttribute::Attribute Foundry::Katana::ViewerAPI::Manipulator::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 Foundry::Katana::ViewerUtils::GLTransformManipulator.

FnAttribute::Attribute Foundry::Katana::ViewerAPI::Manipulator::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::Manipulator::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.
static FnAttribute::GroupAttribute Foundry::Katana::ViewerAPI::Manipulator::getTags ( ) [static]

Gets the Manipulator tags.

Returns the tags for this Manipulator. These tags are key:value pairs containing meta-data that can be used by the Viewers to categorize and identify the available Manipulators. For example, a possible tag could be {type:transform}, meaning that the Manipulator allows to manipulate object transforms (manipulators like rotate, translate, scale could be tagged like this). The Viewer tab can use these tags to, for example, group the Manipulators according to their functionality on a UI menu, or it can discard Manipulators that are not meant to be available on on that Viewer.

Returns:
A GroupAttribute containing the key:value pairs that define the tags of the manipulator.

Reimplemented in GLCoiManipulator, GLRotateManipulator, GLScaleManipulator, and GLTranslateManipulator.

static bool Foundry::Katana::ViewerAPI::Manipulator::matches ( const FnAttribute::GroupAttribute locationAttrs) [static]

Specifies if the Manipulator can be applied to a location.

Specifies if the passed locations attributes has the attributes that are required by this Manipulator. This should be extended in sub-classes.

virtual void Foundry::Katana::ViewerAPI::Manipulator::pickerDraw ( int64_t  pickerId) [virtual]

Draws the Manipulator for picking.

Called when the scene needs to be drawn in order to perform objects selection. This will run in the correct GL context. In a non-GL renderer the generated image should be drawn in the GL framebuffer in order to be displayed.

Reimplemented in GLCoiManipulator.

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

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

Reimplemented in Foundry::Katana::ViewerUtils::GLTransformManipulator.

void Foundry::Katana::ViewerAPI::Manipulator::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::Manipulator::setup ( ) [pure virtual]

Initializes the GL components of the Viewport.

Called when a Manipulator is created. It runs inside the correct GL context. This can be used to initialize anything GL related.

Implemented in GLCoiManipulator, GLRotateManipulator, GLScaleManipulator, and GLTranslateManipulator.


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