|
Katana Plug-in APIs 0.1
|
The ViewportCamera class to be extended by plugins. More...
#include <FnViewportCamera.h>
Public Member Functions | |
| virtual int | getCameraTypeID ()=0 |
| Returns an integer indicating the type of the camera. | |
| virtual void | setViewportDimensions (unsigned int width, unsigned int height)=0 |
| Processes Viewport resizing. | |
| 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 | startInteraction ()=0 |
| Called when the user starts interacting with the camera. | |
| virtual void | endInteraction ()=0 |
| Called when the user finishes interacting with the camera. | |
| virtual void | translate (double x, double y, double z)=0 |
| Handles translation movement of the camera. | |
| virtual void | rotate (double x, double y, double z)=0 |
| Handles rotation movement of the camera. | |
| virtual void | setup (FnAttribute::GroupAttribute attr)=0 |
| Initializes the camera with values from an attribute. | |
| virtual FnAttribute::GroupAttribute | asAttribute ()=0 |
| Returns the camera settings as a GroupAttribute. | |
| virtual bool | getPointOnPlane (int x, int y, const Vec3d &planeOrigin, const Vec3d &planeNormal, Vec3d &intersection)=0 |
| Maps window coordinates to a 3D point on a plane. | |
| virtual void | getRay (int x, int y, Vec3d &pos, Vec3d &dir)=0 |
| Calculates the ray from the camera through the given window coordinates. | |
| virtual Vec3d | projectObjectIntoWindow (Vec3d point)=0 |
| Converts a 3D point in the scene into window co-ordinates. | |
| virtual Vec3d | projectWindowIntoObject (Vec3d point)=0 |
| Converts a window co-ordinates into a point in the scene. | |
| virtual void * | getPrivateData (void *inputData) |
| Returns some arbitrary data. | |
| virtual void | setDirty (CameraDirtyBits dirtyBits)=0 |
| Specifies what has changed in the camera. | |
Static Public Member Functions | |
| static void | flush () |
| Flush plugin Caches. | |
The ViewportCamera class to be extended by plugins.
| virtual FnAttribute::GroupAttribute Foundry::Katana::ViewerAPI::ViewportCamera::asAttribute | ( | ) | [pure virtual] |
Returns the camera settings as a GroupAttribute.
This function should return a GroupAttribute that fully represents the current camera settings in a format that can be passed into the setup() function (as a way of duplicating the camera) or into a scene graph location in order to populate a camera location.
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::endInteraction | ( | ) | [pure virtual] |
Called when the user finishes interacting with the camera.
This is called when finishes interacting with this camera while, for example, is viewing through it. This allows the camera to commit or tear down some values used during the user interaction. One example could be set the final camera transform values back into the node graph in a location-backed camera. The translate() and rotate() functions are expected to be called after startInteraction() and before endInteraction().
| static void Foundry::Katana::ViewerAPI::ViewportCamera::flush | ( | ) | [inline, static] |
Flush plugin Caches.
Allows to discard any cache for this plugin when a Flush Caches event occurs.
| virtual int Foundry::Katana::ViewerAPI::ViewportCamera::getCameraTypeID | ( | ) | [pure virtual] |
Returns an integer indicating the type of the camera.
Can be kPERSPECTIVE_CAMERA, kORTHOGRAPHIC_CAMERA, or another custom type.
| virtual FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewportCamera::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. |
| FnAttribute::Attribute Foundry::Katana::ViewerAPI::ViewportCamera::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 bool Foundry::Katana::ViewerAPI::ViewportCamera::getPointOnPlane | ( | int | x, |
| int | y, | ||
| const Vec3d & | planeOrigin, | ||
| const Vec3d & | planeNormal, | ||
| Vec3d & | intersection | ||
| ) | [pure virtual] |
Maps window coordinates to a 3D point on a plane.
| x | The X co-ordinate of the window. |
| y | The Y co-ordinate of the window. |
| planeOrigin | The coordinates of the plane origin. |
| planeNormal | The normal direction of the plane. |
| intersection | Output argument where the intersection position (if any) is set. |
| virtual void* Foundry::Katana::ViewerAPI::ViewportCamera::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.
| inputData | A pointer to some input data that can be used to produce the returned data. |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::getRay | ( | int | x, |
| int | y, | ||
| Vec3d & | pos, | ||
| Vec3d & | dir | ||
| ) | [pure virtual] |
Calculates the ray from the camera through the given window coordinates.
| x | The X co-ordinate of the window. |
| y | The Y co-ordinate of the window. |
| pos | Output argument where the line position is set. |
| dir | Output argument where the line direction is set. |
| virtual Vec3d Foundry::Katana::ViewerAPI::ViewportCamera::projectObjectIntoWindow | ( | Vec3d | point | ) | [pure virtual] |
Converts a 3D point in the scene into window co-ordinates.
| point | The point in world space to transform. |
| virtual Vec3d Foundry::Katana::ViewerAPI::ViewportCamera::projectWindowIntoObject | ( | Vec3d | point | ) | [pure virtual] |
Converts a window co-ordinates into a point in the scene.
| point | The point in window space to transform into world space. point.x and point.y indicate the X and Y position in pixels and point.z indicates the depth into the scene in world space. |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::rotate | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | [pure virtual] |
Handles rotation movement of the camera.
This is expected to be called after startInteraction() and before endInteraction().
| x | The X-axis rotation in camera's local space. |
| y | The Y-axis rotation in camera's local space. |
| z | The Z-axis rotation in camera's local space. |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::setDirty | ( | CameraDirtyBits | dirtyBits | ) | [pure virtual] |
Specifies what has changed in the camera.
Something has changed and the camera needs to be updated. DirtyFlag is passed to specify what has been changed so the plugin can update accordingly.
| dirtyBits | Flag to specify what has changed. |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::setOption | ( | OptionIdGenerator::value_type | optionId, |
| FnAttribute::Attribute | attr | ||
| ) | [inline, virtual] |
Sets a generic option.
Reacts to a generic option being set by other C++ Viewer plugin classes. This can be used as a message passing mechanism from the outside into the ViewportCamera.
| optionId | The ID of the option created from OptionIdGenerator or manually defined by users. |
| attr | Attribute with the value being set. |
| void Foundry::Katana::ViewerAPI::ViewportCamera::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::ViewportCamera::setup | ( | FnAttribute::GroupAttribute | attr | ) | [pure virtual] |
Initializes the camera with values from an attribute.
If the camera is based on a scene graph camera, the passed attribute will be the relevant attributes from the scene graph location.
| attr | Attribute with the initial camera state values. |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::setViewportDimensions | ( | unsigned int | width, |
| unsigned int | height | ||
| ) | [pure virtual] |
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::startInteraction | ( | ) | [pure virtual] |
Called when the user starts interacting with the camera.
This is called when starts interacting with this camera while, for example, is viewing through it. This allows the camera to initialize some initial values used during the user interaction. The translate() and rotate() functions are expected to be called after startInteraction() and before endInteraction().
| virtual void Foundry::Katana::ViewerAPI::ViewportCamera::translate | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) | [pure virtual] |
Handles translation movement of the camera.
This is expected to be called after startInteraction() and before endInteraction().
| x | The X-axis translation in camera's local space. |
| y | The Y-axis translation in camera's local space. |
| z | The Z-axis translation in camera's local space. |
1.7.3