Katana Plug-in APIs 0.1

FnGLScaleUniformHandle.h

00001 // Copyright (c) 2017 The Foundry Visionmongers Ltd. All Rights Reserved.
00002 
00003 #ifndef GLSCALEUNIFORMHANDLE_H
00004 #define GLSCALEUNIFORMHANDLE_H
00005 
00006 #include <stdint.h>
00007 
00008 #include "FnGLTransformManipulator.h"
00009 
00010 #include <FnViewer/plugin/FnManipulatorHandle.h>
00011 #include <FnViewer/plugin/FnMathTypes.h>
00012 #include <FnViewer/utils/FnDrawable.h>
00013 
00014 using namespace Foundry::Katana::ViewerAPI;
00015 using namespace Foundry::Katana::ViewerUtils;
00016 
00026 class GLScaleUniformHandle : public GLTransformManipulatorHandle
00027 {
00028 public:
00030     GLScaleUniformHandle();
00031 
00033     virtual ~GLScaleUniformHandle();
00034 
00036     static Foundry::Katana::ViewerAPI::ManipulatorHandle* create()
00037     {
00038         return new GLScaleUniformHandle();
00039     }
00040 
00042     static void flush(){}
00043 
00047     void draw();
00048 
00054     void pickerDraw(int64_t pickerId);
00055 
00057     void setup();
00058 
00060     virtual FnKat::ViewerUtils::Orientation getOrientation() { return OBJECT; }
00061 
00062 protected:
00066     virtual std::string getComponentName() { return "scale"; }
00067 
00073     bool getDraggingPlane(Vec3d& origin, Vec3d& normal);
00074 
00079     void drag(const Vec3d& initialPointOnPlane,
00080               const Vec3d& previousPointOnPlane,
00081               const Vec3d& currentPointOnPlane,
00082               const Vec2i& initialMousePosition,
00083               const Vec2i& previousMousePosition,
00084               const Vec2i& currentMousePosition,
00085               bool isFinal);
00086 
00090     void applyXformToLocation(const std::string& locationPath,
00091                               const IMATH_NAMESPACE::M44d& xform,
00092                               bool isFinal);
00093 
00094 private:
00096     Drawable m_cubeMesh;
00097     IMATH_NAMESPACE::M44d m_scaleXform;
00098 };
00099 
00100 #endif  // GLScaleManipulator_H_
 All Classes Functions Variables Typedefs Enumerations Enumerator