TuttleOFX
1
|
00001 #ifndef _PINNINGOVERLAYINTERACT_HPP_ 00002 #define _PINNINGOVERLAYINTERACT_HPP_ 00003 00004 #include "PinningPlugin.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 <tuttle/plugin/interact/InteractObject.hpp> 00011 00012 #include <ofxsImageEffect.h> 00013 #include <ofxsInteract.h> 00014 00015 namespace tuttle { 00016 namespace plugin { 00017 namespace pinning { 00018 00019 using namespace boost::numeric::ublas; 00020 00021 class PinningOverlayInteract : public OFX::OverlayInteract 00022 { 00023 typedef double Scalar; 00024 00025 PinningPlugin* _plugin; 00026 00027 interact::InteractInfos _infos; 00028 interact::InteractScene _interactScene; 00029 00030 bool _beginSelection; 00031 OfxRectD _multiSelectionRec; 00032 bool _multiSelection; 00033 /* 00034 bool _keyPressed_ctrl; 00035 bool _keyPressed_shift; 00036 */ 00037 00038 public: 00039 PinningOverlayInteract( OfxInteractHandle handle, OFX::ImageEffect* effect ); 00040 00041 bool draw( const OFX::DrawArgs& args ); 00042 00043 bool penDown( const OFX::PenArgs& args ); 00044 bool penUp( const OFX::PenArgs& args ); 00045 bool penMotion( const OFX::PenArgs& args ); 00046 00047 //void calculCentre( const std::vector< bounded_vector<double, 2> > pSelect); 00048 //void rotatePts( std::vector< bounded_vector<double, 2> > pSelect, double angle); 00049 //void scalePts( std::vector< bounded_vector<double, 2> > pSelect, double coef); 00050 /* 00051 bool keyDown( const KeyArgs& args ); 00052 bool keyUp( const KeyArgs& args ); 00053 bool keyRepeat( const KeyArgs& args ); 00054 */ 00055 }; 00056 00057 00058 class PinningEffectOverlayDescriptor : public OFX::EffectOverlayDescriptor 00059 { 00060 public: 00061 00062 OFX::Interact* createInstance( OfxInteractHandle handle, OFX::ImageEffect* effect ) 00063 { 00064 return new PinningOverlayInteract( handle, effect ); 00065 } 00066 00067 }; 00068 00069 00070 } 00071 } 00072 } 00073 00074 #endif