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

GLTranslatePlaneHandle Class Reference

A handle to translate the selected object along YZ, XZ and XY planes. More...

#include <FnGLTranslatePlaneHandle.h>

Inheritance diagram for GLTranslatePlaneHandle:
Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle Foundry::Katana::ViewerUtils::GLManipulatorHandle Foundry::Katana::ViewerAPI::ManipulatorHandle Foundry::Katana::ViewerAPI::ManipulatorHandlePluginBase

List of all members.

Public Member Functions

 GLTranslatePlaneHandle ()
 Constructor.
virtual ~GLTranslatePlaneHandle ()
 Destructor.
void draw ()
void pickerDraw (int64_t pickerId)
void setup (const IMATH_NAMESPACE::V3d &normal)
 Initializes the meshes. Called at handle creation.

Static Public Member Functions

static
Foundry::Katana::ViewerAPI::ManipulatorHandle
create ()
 Creates a new instance of GLTranslatePlaneHandle.
static void flush ()
 Flushes any cached data.

Protected Member Functions

virtual std::string getComponentName ()
bool getDraggingPlane (Vec3d &origin, Vec3d &normal)
void drag (const Vec3d &initialPointOnPlane, const Vec3d &previousPointOnPlane, const Vec3d &currentPointOnPlane, const Vec2i &initialMousePosition, const Vec2i &previousMousePosition, const Vec2i &currentMousePosition, bool isFinal)
void startDrag (const Vec3d &initialPointOnPlane, const Vec2i &initialMousePosition)
void endDrag ()
void applyXformToLocation (const std::string &locationPath, const IMATH_NAMESPACE::M44d &xform, bool isFinal)
virtual IMATH_NAMESPACE::M44d getOrientationXform (const std::string &locationPath)
virtual void calculateAndSetLocalXform (const std::string &locationPath)

Detailed Description

A handle to translate the selected object along YZ, XZ and XY planes.

This class represents a single handle that can be used to translate an object along an plane. The handle is represented by triangle. Dragging the triangle will translate the object along the plane the triangle is drawn onto.


Member Function Documentation

void GLTranslatePlaneHandle::applyXformToLocation ( const std::string &  locationPath,
const IMATH_NAMESPACE::M44d &  xform,
bool  isFinal 
) [protected, virtual]

Applies the given rotation transform to the given location. This will also take the rotation order into account.

Implements Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

virtual void GLTranslatePlaneHandle::calculateAndSetLocalXform ( const std::string &  locationPath) [protected, virtual]

Overridden to include the translation component as part of getting the current xform.

Reimplemented from Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

void GLTranslatePlaneHandle::drag ( const Vec3d &  initialPointOnPlane,
const Vec3d &  previousPointOnPlane,
const Vec3d &  currentPointOnPlane,
const Vec2i &  initialMousePosition,
const Vec2i &  previousMousePosition,
const Vec2i &  currentMousePosition,
bool  isFinal 
) [protected]

Detects the amount of rotation in either orbital or linear drag, depending on the direction of axis in relation to the camera direction, and applies the rotation to the manipulated locations.

void GLTranslatePlaneHandle::draw ( ) [virtual]

Draws the handle.

Reimplemented from Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

void GLTranslatePlaneHandle::endDrag ( ) [protected, virtual]

Callback received when the drag action ends.

Reimplemented from Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

virtual std::string GLTranslatePlaneHandle::getComponentName ( ) [inline, protected, virtual]

The transform component: xform.interactive.translate

Implements Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

bool GLTranslatePlaneHandle::getDraggingPlane ( Vec3d &  origin,
Vec3d &  normal 
) [protected]

Gets the dragging plane's origin and normal. The origin is always the same as in the whole manipulator and the normal is given by the normal of the plane handle in world space.

virtual IMATH_NAMESPACE::M44d GLTranslatePlaneHandle::getOrientationXform ( const std::string &  locationPath) [protected, virtual]

Overridden to use the initial orientation when the drag action has started.

When the manipulation has started, we want to use the initial orientation, so that manipulators whose translate operation imply an orientation change do not get affected (i.e. the COI manipulators).

For the standard Translate manipulator this makes no difference, as the orientation never changes.

Reimplemented from Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

void GLTranslatePlaneHandle::pickerDraw ( int64_t  pickerId) [virtual]

Draws the manipulator with a specific selection picker ID. Typically this id is converted to a color value, and the handle is then drawn with flat shading, so it can be identified in a look-up table.

Reimplemented from Foundry::Katana::ViewerUtils::GLTransformManipulatorHandle.

void GLTranslatePlaneHandle::startDrag ( const Vec3d &  initialPointOnPlane,
const Vec2i &  initialMousePosition 
) [protected]

Initializes some initial values at drag start.


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