{
GestureReceivedFunctor(SignalData& data) : signalData(data) { }
- void operator()(Actor actor, PanGesture pan)
+ void operator()(Actor actor, const PanGesture& pan)
{
signalData.functorCalled = true;
signalData.receivedGesture = pan;
{
}
- void operator()( Actor actor, PanGesture pan )
+ void operator()( Actor actor, const PanGesture& pan )
{
GestureReceivedFunctor::operator()( actor, pan );
{
PanConstraint( ConstraintData& data ) : constraintData(data) { }
- Vector3 operator()(const Vector3& current,
- const PropertyInput& screenPositionProperty,
- const PropertyInput& screenDisplacementProperty,
- const PropertyInput& screenVelocityProperty,
- const PropertyInput& localPositionProperty,
- const PropertyInput& localDisplacementProperty,
- const PropertyInput& localVelocityProperty)
+ void operator()( Vector3& current, const PropertyInputContainer& inputs )
{
- constraintData.screenPosition = screenPositionProperty.GetVector2();
- constraintData.screenDisplacement = screenDisplacementProperty.GetVector2();
- constraintData.screenVelocity = screenVelocityProperty.GetVector2();
- constraintData.localPosition = localPositionProperty.GetVector2();
- constraintData.localDisplacement = localDisplacementProperty.GetVector2();
- constraintData.localVelocity = localVelocityProperty.GetVector2();
+ constraintData.screenPosition = inputs[0]->GetVector2();
+ constraintData.screenDisplacement = inputs[1]->GetVector2();
+ constraintData.screenVelocity = inputs[2]->GetVector2();
+ constraintData.localPosition = inputs[3]->GetVector2();
+ constraintData.localDisplacement = inputs[4]->GetVector2();
+ constraintData.localVelocity = inputs[5]->GetVector2();
constraintData.called = true;
- return Vector3::ZERO;
+ current = Vector3::ZERO;
}
ConstraintData& constraintData;
END_TEST;
}
+int UtcDaliPanGestureDetectorCopyConstructorP(void)
+{
+ TestApplication application;
+
+ PanGestureDetector detector = PanGestureDetector::New();;
+
+ PanGestureDetector copy( detector );
+ DALI_TEST_CHECK( detector );
+ END_TEST;
+}
+
+int UtcDaliPanGestureDetectorAssignmentOperatorP(void)
+{
+ TestApplication application;
+
+ PanGestureDetector detector = PanGestureDetector::New();;
+
+ PanGestureDetector assign;
+ assign = detector;
+ DALI_TEST_CHECK( detector );
+
+ DALI_TEST_CHECK( detector == assign );
+ END_TEST;
+}
// Negative test case for a method
int UtcDaliPanGestureDetectorNew(void)
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
Stage::GetCurrent().Add(actor);
// Render and notify
DALI_TEST_EQUALS(Vector2(8.0f, -5.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
// Rotate actor again and render a couple of times
- actor.SetRotation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
application.SendNotification();
application.Render();
DALI_TEST_EQUALS(Vector2(-5.0f, -8.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
// Rotate actor again and render a couple of times
- actor.SetRotation(Dali::Degree(270.0f), Vector3::ZAXIS);
+ actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS);
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetAnchorPoint(AnchorPoint::CENTER);
child.SetParentOrigin(ParentOrigin::CENTER);
- child.SetRotation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
parent.Add(child);
TouchEventFunctor touchFunctor;
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();
application.Render();
- Vector2 direction(Vector2::XAXIS * -5.0f);
+ Vector2 direction(Vector2::XAXIS * -1.0f);
Vector2 previousPosition( 20.0f, 20.0f );
Vector2 currentPosition( 20.0f, 10.0f );
PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, true);
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();
application.Render();
- Vector2 direction(Vector2::XAXIS * -5.0f);
+ Vector2 direction(Vector2::XAXIS * -1.0f);
Vector2 previousPosition( 20.0f, 20.0f );
Vector2 currentPosition( 20.0f, 10.0f );
PerformSwipeGestureSwipe(application, Vector2(1.0f, 1.0f), direction, PAN_GESTURE_UPDATE_COUNT, true);
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();
Property::Index property = actor.RegisterProperty( "Dummy Property", Vector3::ZERO );
ConstraintData constraintData;
- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::SCREEN_POSITION ),
- Source( detector, PanGestureDetector::SCREEN_DISPLACEMENT ),
- Source( detector, PanGestureDetector::SCREEN_VELOCITY ),
- Source( detector, PanGestureDetector::LOCAL_POSITION ),
- Source( detector, PanGestureDetector::LOCAL_DISPLACEMENT ),
- Source( detector, PanGestureDetector::LOCAL_VELOCITY ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();
// Render and notify
application.SendNotification();