TuttleOFX  1
WarpOverlayInteract.hpp
Go to the documentation of this file.
00001  #ifndef _WARPOVERLAYINTERACT_HPP_
00002 #define _WARPOVERLAYINTERACT_HPP_
00003 
00004 #include "WarpPlugin.hpp"
00005 
00006 #include <tuttle/plugin/global.hpp>
00007 #include <tuttle/plugin/interact/interact.hpp>
00008 #include <tuttle/plugin/interact/InteractInfos.hpp>
00009 #include <tuttle/plugin/interact/InteractScene.hpp>
00010 #include <ofxsImageEffect.h>
00011 #include <ofxsInteract.h>
00012 
00013 namespace tuttle {
00014 namespace plugin {
00015 namespace warp {
00016 
00017 class WarpOverlayInteract : public OFX::OverlayInteract
00018 {
00019         typedef double Scalar;
00020 
00021         WarpPlugin* _plugin;
00022 
00023         interact::InteractInfos _infos;
00024         interact::InteractScene _interactScene;
00025         std::vector< point2<double> > _tgtPointsBezierIn;
00026         std::vector< point2<double> > _tgtPointsBezierOut;
00027 
00028 public:
00029         WarpOverlayInteract( OfxInteractHandle handle, OFX::ImageEffect* effect );
00030 
00031         bool bezier(const point2<double> _p1, const point2<double> _p2);
00032         bool draw( const OFX::DrawArgs& args );
00033         bool penDown( const OFX::PenArgs& args );
00034         bool penUp( const OFX::PenArgs& args );
00035         bool penMotion( const OFX::PenArgs& args );
00036         bool keyDown( const OFX::KeyArgs& args );
00037 };
00038 
00039 class WarpEffectOverlayDescriptor : public OFX::EffectOverlayDescriptor
00040 {
00041 public:
00042 
00043         OFX::Interact* createInstance( OfxInteractHandle handle, OFX::ImageEffect* effect )
00044         {
00045                 return new WarpOverlayInteract( handle, effect );
00046         }
00047 
00048 };
00049 
00050 }
00051 }
00052 }
00053 
00054 #endif