TuttleOFX
1
|
To create a group of overlay/interact objects. Inherit from InteractObject, because a group of overlay/interact objects is itself an overlay/interact object. More...
#include <InteractScene.hpp>
Public Types | |
typedef double | Scalar |
typedef boost::gil::point2 < Scalar > | Point2 |
typedef boost::ptr_vector < InteractObject > | InteractObjectsVector |
typedef boost::ptr_vector < IsActiveFunctor > | IsActiveFunctorVector |
typedef boost::ptr_vector< IColor > | ColorVector |
typedef std::pair < InteractObject *, Point2 > | SelectedObject |
typedef std::vector < SelectedObject > | SelectedObjectVector |
Public Member Functions | |
InteractScene (OFX::ParamSet ¶ms, const InteractInfos &infos) | |
virtual | ~InteractScene () |
InteractObjectsVector & | getObjects () |
const InteractObjectsVector & | getObjects () const |
void | push_back (InteractObject *obj, IsActiveFunctor *isActive=new AlwaysActiveFunctor<>(), IColor *color=new Color()) |
void | setManipulator (InteractObject *obj, IColor *color=new Color()) |
bool | draw (const OFX::DrawArgs &args) const |
the function called to draw in the interact | |
bool | penMotion (const OFX::PenArgs &args) |
bool | penDown (const OFX::PenArgs &args) |
bool | penUp (const OFX::PenArgs &args) |
Private Member Functions | |
SelectedObjectVector & | getSelectedObjects () |
const SelectedObjectVector & | getSelectedObjects () const |
bool | drawSelection (const OFX::DrawArgs &args) const |
void | translate (const Point2 &vec) |
void | rotate (const Point2 ¢er, const Point2 &from, const Point2 &vec) |
void | scale (const Point2 ¢er, const Point2 &factor) |
Private Attributes | |
OFX::ParamSet & | _params |
const InteractInfos & | _infos |
bool | _mouseDown |
MotionType | _motionType |
InteractObjectsVector | _objects |
IsActiveFunctorVector | _isActive |
ColorVector | _colors |
Point2 | _beginPenPosition |
bool | _multiSelectionEnabled |
bool | _creatingSelection |
InteractObject * | _manipulator |
IColor * | _manipulatorColor |
bool | _hasSelection |
SelectedObjectVector | _selected |
OfxRectD | _selectionRect |
To create a group of overlay/interact objects. Inherit from InteractObject, because a group of overlay/interact objects is itself an overlay/interact object.
Definition at line 25 of file InteractScene.hpp.
typedef boost::ptr_vector<IColor> tuttle::plugin::interact::InteractScene::ColorVector |
Definition at line 32 of file InteractScene.hpp.
typedef boost::ptr_vector<InteractObject> tuttle::plugin::interact::InteractScene::InteractObjectsVector |
Definition at line 30 of file InteractScene.hpp.
typedef boost::ptr_vector<IsActiveFunctor> tuttle::plugin::interact::InteractScene::IsActiveFunctorVector |
Definition at line 31 of file InteractScene.hpp.
typedef boost::gil::point2<Scalar> tuttle::plugin::interact::InteractScene::Point2 |
Definition at line 29 of file InteractScene.hpp.
typedef double tuttle::plugin::interact::InteractScene::Scalar |
Definition at line 28 of file InteractScene.hpp.
typedef std::pair< InteractObject*, Point2 > tuttle::plugin::interact::InteractScene::SelectedObject |
Definition at line 34 of file InteractScene.hpp.
typedef std::vector< SelectedObject > tuttle::plugin::interact::InteractScene::SelectedObjectVector |
Definition at line 35 of file InteractScene.hpp.
tuttle::plugin::interact::InteractScene::InteractScene | ( | OFX::ParamSet & | params, |
const InteractInfos & | infos | ||
) |
Definition at line 12 of file InteractScene.cpp.
References _selectionRect.
tuttle::plugin::interact::InteractScene::~InteractScene | ( | ) | [virtual] |
Definition at line 25 of file InteractScene.cpp.
bool tuttle::plugin::interact::InteractScene::draw | ( | const OFX::DrawArgs & | args | ) | const [virtual] |
the function called to draw in the interact
Reimplemented from tuttle::plugin::interact::InteractObject.
Definition at line 28 of file InteractScene.cpp.
References _colors, _isActive, _objects, and drawSelection().
bool tuttle::plugin::interact::InteractScene::drawSelection | ( | const OFX::DrawArgs & | args | ) | const [private] |
Definition at line 278 of file InteractScene.cpp.
References _creatingSelection, _hasSelection, _manipulator, _manipulatorColor, _selectionRect, tuttle::plugin::overlay::displayRect(), tuttle::plugin::interact::InteractObject::draw(), and tuttle::plugin::interact::IColor::getColor().
Referenced by draw().
InteractObjectsVector& tuttle::plugin::interact::InteractScene::getObjects | ( | ) | [inline] |
Definition at line 62 of file InteractScene.hpp.
References _objects.
const InteractObjectsVector& tuttle::plugin::interact::InteractScene::getObjects | ( | ) | const [inline] |
Definition at line 63 of file InteractScene.hpp.
References _objects.
SelectedObjectVector& tuttle::plugin::interact::InteractScene::getSelectedObjects | ( | ) | [inline, private] |
Definition at line 87 of file InteractScene.hpp.
References _selected.
const SelectedObjectVector& tuttle::plugin::interact::InteractScene::getSelectedObjects | ( | ) | const [inline, private] |
Definition at line 88 of file InteractScene.hpp.
References _selected.
bool tuttle::plugin::interact::InteractScene::penDown | ( | const OFX::PenArgs & | args | ) |
Definition at line 122 of file InteractScene.cpp.
References tuttle::plugin::interact::MotionType::_axis, _beginPenPosition, _creatingSelection, _hasSelection, _isActive, _manipulator, tuttle::plugin::interact::MotionType::_mode, _motionType, _mouseDown, _multiSelectionEnabled, _objects, _params, _selected, _selectionRect, tuttle::plugin::interact::eAxisNone, tuttle::plugin::interact::eAxisXY, tuttle::plugin::interact::eMotionNone, tuttle::plugin::interact::InteractObject::intersect(), and tuttle::plugin::ofxToGil().
bool tuttle::plugin::interact::InteractScene::penMotion | ( | const OFX::PenArgs & | args | ) |
Definition at line 51 of file InteractScene.cpp.
References _beginPenPosition, _creatingSelection, _hasSelection, _isActive, _manipulator, tuttle::plugin::interact::MotionType::_mode, _motionType, _mouseDown, _objects, _selected, _selectionRect, tuttle::plugin::interact::eMotionNone, tuttle::plugin::interact::eMotionRotate, tuttle::plugin::interact::eMotionScale, tuttle::plugin::interact::eMotionTranslate, tuttle::plugin::interact::InteractObject::getPosition(), tuttle::plugin::ofxToGil(), rotate(), scale(), translate(), TUTTLE_LOG_INFOS, TUTTLE_TLOG, and TUTTLE_TRACE.
bool tuttle::plugin::interact::InteractScene::penUp | ( | const OFX::PenArgs & | args | ) |
Definition at line 235 of file InteractScene.cpp.
References _creatingSelection, _hasSelection, _isActive, _mouseDown, _objects, _params, _selected, and _selectionRect.
void tuttle::plugin::interact::InteractScene::push_back | ( | InteractObject * | obj, |
IsActiveFunctor * | isActive = new AlwaysActiveFunctor<>() , |
||
IColor * | color = new Color() |
||
) | [inline] |
Definition at line 65 of file InteractScene.hpp.
void tuttle::plugin::interact::InteractScene::scale | ( | const Point2 & | center, |
const Point2 & | factor | ||
) | [private] |
Definition at line 343 of file InteractScene.cpp.
References tuttle::plugin::interact::MotionType::_axis, _motionType, _selected, tuttle::plugin::interact::eAxisNone, tuttle::plugin::interact::eAxisX, tuttle::plugin::interact::eAxisXY, and tuttle::plugin::interact::eAxisY.
Referenced by penMotion().
void tuttle::plugin::interact::InteractScene::setManipulator | ( | InteractObject * | obj, |
IColor * | color = new Color() |
||
) | [inline] |
Definition at line 71 of file InteractScene.hpp.
References _manipulator, and _manipulatorColor.
void tuttle::plugin::interact::InteractScene::translate | ( | const Point2 & | vec | ) | [private] |
Definition at line 300 of file InteractScene.cpp.
References tuttle::plugin::interact::MotionType::_axis, _motionType, _selected, tuttle::plugin::interact::eAxisNone, tuttle::plugin::interact::eAxisX, tuttle::plugin::interact::eAxisXY, and tuttle::plugin::interact::eAxisY.
Referenced by penMotion().
Definition at line 51 of file InteractScene.hpp.
Referenced by penDown(), and penMotion().
Definition at line 49 of file InteractScene.hpp.
Referenced by draw(), and push_back().
bool tuttle::plugin::interact::InteractScene::_creatingSelection [private] |
Definition at line 54 of file InteractScene.hpp.
Referenced by drawSelection(), penDown(), penMotion(), and penUp().
bool tuttle::plugin::interact::InteractScene::_hasSelection [private] |
Definition at line 57 of file InteractScene.hpp.
Referenced by drawSelection(), penDown(), penMotion(), and penUp().
const InteractInfos& tuttle::plugin::interact::InteractScene::_infos [private] |
Definition at line 43 of file InteractScene.hpp.
Definition at line 48 of file InteractScene.hpp.
Referenced by draw(), penDown(), penMotion(), penUp(), and push_back().
Definition at line 55 of file InteractScene.hpp.
Referenced by drawSelection(), penDown(), penMotion(), and setManipulator().
Definition at line 56 of file InteractScene.hpp.
Referenced by drawSelection(), and setManipulator().
Definition at line 45 of file InteractScene.hpp.
Referenced by penDown(), penMotion(), scale(), and translate().
bool tuttle::plugin::interact::InteractScene::_mouseDown [private] |
Definition at line 44 of file InteractScene.hpp.
Referenced by penDown(), penMotion(), and penUp().
Definition at line 53 of file InteractScene.hpp.
Referenced by penDown().
Definition at line 47 of file InteractScene.hpp.
Referenced by draw(), getObjects(), penDown(), penMotion(), penUp(), and push_back().
OFX::ParamSet& tuttle::plugin::interact::InteractScene::_params [private] |
Definition at line 42 of file InteractScene.hpp.
Reimplemented from tuttle::plugin::interact::InteractObject.
Definition at line 58 of file InteractScene.hpp.
Referenced by getSelectedObjects(), penDown(), penMotion(), penUp(), rotate(), scale(), and translate().
OfxRectD tuttle::plugin::interact::InteractScene::_selectionRect [private] |
Definition at line 59 of file InteractScene.hpp.
Referenced by drawSelection(), InteractScene(), penDown(), penMotion(), and penUp().