void DynamicsBodyConfig::SetShape( DynamicsShape shape ) { Internal::DynamicsShapePtr internal( &(GetImplementation(shape)) ); GetImplementation(*this).SetShape( internal ); }
PanGestureDetector::DetectedSignalV2& PanGestureDetector::DetectedSignal() { return GetImplementation(*this).DetectedSignal(); }
unsigned int PanGestureDetector::GetMaximumTouchesRequired() const { return GetImplementation(*this).GetMaximumTouchesRequired(); }
SoundPlayer::SoundPlayFinishedSignalV2& SoundPlayer::SoundPlayFinishedSignal() { return GetImplementation(*this).SoundPlayFinishedSignal(); }
void PanGestureDetector::RemoveAngle( Radian angle ) { GetImplementation(*this).RemoveAngle( angle ); }
bool PanGestureProcessor::CheckGestureDetector( GestureDetector* detector, Actor* actor ) { DALI_ASSERT_DEBUG( mCurrentPanEvent ); bool retVal( false ); PanGestureDetector* panDetector( static_cast< PanGestureDetector* >( detector ) ); if ( ( mCurrentPanEvent->numberOfTouches >= panDetector->GetMinimumTouchesRequired() ) && ( mCurrentPanEvent->numberOfTouches <= panDetector->GetMaximumTouchesRequired() ) ) { // Check if the detector requires directional panning. if ( panDetector->RequiresDirectionalPan() && mCurrentRenderTask ) { // It does, calculate the angle of the pan in local actor coordinates and ensures it fits // the detector's criteria. RenderTask& renderTaskImpl( GetImplementation( mCurrentRenderTask ) ); Vector2 startPosition, currentPosition; actor->ScreenToLocal( renderTaskImpl, startPosition.x, startPosition.y, mPossiblePanPosition.x, mPossiblePanPosition.y ); actor->ScreenToLocal( renderTaskImpl, currentPosition.x, currentPosition.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y ); Vector2 displacement( currentPosition - startPosition ); Radian angle( atan( displacement.y / displacement.x ) ); ///////////////////////////// // | // // | // // Q3 (-,-) | Q4 (+,-) // // | // // ----------------- +x // // | // // Q2 (-,+) | Q1 (+,+) // // | // // | // // +y // ///////////////////////////// // Quadrant 1: As is // Quadrant 2: 180 degrees + angle // Quadrant 3: angle - 180 degrees // Quadrant 4: As is ///////////////////////////// if ( displacement.x < 0.0f ) { if ( displacement.y >= 0.0f ) { // Quadrant 2 angle.radian += Math::PI; } else { // Quadrant 3 angle.radian -= Math::PI; } } if ( panDetector->CheckAngleAllowed( angle ) ) { retVal = true; } } else { // Directional panning not required so we can use this actor and gesture detector. retVal = true; } } return retVal; }
int SoundPlayer::PlaySound(const std::string fileName) { return GetImplementation(*this).PlaySound(fileName); }
void DynamicsBodyConfig::SetFriction(const float friction) { GetImplementation(*this).SetFriction( friction ); }
TargetPhraseCollection const* PhraseDictionaryTreeAdaptor::GetTargetPhraseCollection(Phrase const &src) const { return GetImplementation().GetTargetPhraseCollection(src); }
void DynamicsBodyConfig::SetElasticity( const float elasticity ) { GetImplementation(*this).SetElasticity( elasticity ); }
float DynamicsBodyConfig::GetFriction() const { return GetImplementation(*this).GetFriction(); }
float DynamicsBodyConfig::GetElasticity() const { return GetImplementation(*this).GetElasticity(); }
void DynamicsBodyConfig::SetMass( const float mass ) { GetImplementation(*this).SetMass( mass ); }
DynamicsShape DynamicsBodyConfig::GetShape() const { Internal::DynamicsShapePtr internal( GetImplementation(*this).GetShape() ); return DynamicsShape( internal.Get() ); }
void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent ) { switch( panEvent.state ) { case Gesture::Possible: { mCurrentPanEmitters.clear(); ResetActor(); HitTestAlgorithm::Results hitTestResults; if( HitTest( mStage, panEvent.currentPosition, hitTestResults ) ) { SetActor( &GetImplementation( hitTestResults.actor ) ); mPossiblePanPosition = panEvent.currentPosition; } break; } case Gesture::Started: { if ( GetCurrentGesturedActor() ) { // The pan gesture should only be sent to the gesture detector which first received it so that // it can be told when the gesture ends as well. HitTestAlgorithm::Results hitTestResults; HitTest( mStage, mPossiblePanPosition, hitTestResults ); // Hit test original possible position... if ( hitTestResults.actor && ( GetCurrentGesturedActor() == &GetImplementation( hitTestResults.actor ) ) ) { // Record the current render-task for Screen->Actor coordinate conversions mCurrentRenderTask = hitTestResults.renderTask; // Set mCurrentPanEvent to use inside overridden methods called in ProcessAndEmit() mCurrentPanEvent = &panEvent; ProcessAndEmit( hitTestResults ); mCurrentPanEvent = NULL; } else { ResetActor(); mCurrentPanEmitters.clear(); } } break; } case Gesture::Continuing: case Gesture::Finished: case Gesture::Cancelled: { // Only send subsequent pan gesture signals if we processed the pan gesture when it started. // Check if actor is still touchable. Actor* currentGesturedActor = GetCurrentGesturedActor(); if ( currentGesturedActor ) { if ( currentGesturedActor->IsHittable() && !mCurrentPanEmitters.empty() && mCurrentRenderTask ) { GestureDetectorContainer outsideTouchesRangeEmitters; // Removes emitters that no longer have the actor attached // Also remove emitters whose touches are outside the range of the current pan event and add them to outsideTouchesRangeEmitters GestureDetectorContainer::iterator endIter = std::remove_if( mCurrentPanEmitters.begin(), mCurrentPanEmitters.end(), IsNotAttachedAndOutsideTouchesRangeFunctor(currentGesturedActor, panEvent.numberOfTouches, outsideTouchesRangeEmitters) ); mCurrentPanEmitters.erase( endIter, mCurrentPanEmitters.end() ); Vector2 actorCoords; if ( !outsideTouchesRangeEmitters.empty() || !mCurrentPanEmitters.empty() ) { currentGesturedActor->ScreenToLocal( GetImplementation( mCurrentRenderTask ), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y ); // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan. EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, Gesture::Finished, mCurrentRenderTask); EmitPanSignal( currentGesturedActor, mCurrentPanEmitters, panEvent, actorCoords, panEvent.state, mCurrentRenderTask); } if ( mCurrentPanEmitters.empty() ) { // If we have no emitters attached then clear pan actor as well. ResetActor(); } // Clear current gesture detectors if pan gesture has ended or been cancelled. if ( ( panEvent.state == Gesture::Finished ) || ( panEvent.state == Gesture::Cancelled ) ) { mCurrentPanEmitters.clear(); ResetActor(); } } else { mCurrentPanEmitters.clear(); ResetActor(); } } break; } case Gesture::Clear: DALI_ASSERT_ALWAYS( false && "Incorrect state received from Integration layer: Clear\n" ); break; } }
void PhraseDictionaryTreeAdaptor::CleanUpAfterSentenceProcessing(InputType const& source) { PDTAimp &obj = GetImplementation(); obj.CleanUp(); }
void PanGestureProcessor::EmitPanSignal( Actor* actor, const GestureDetectorContainer& gestureDetectors, const Integration::PanGestureEvent& panEvent, Vector2 localCurrent, Gesture::State state, Dali::RenderTask renderTask ) { if ( actor && !gestureDetectors.empty() ) { PanGesture pan(state); pan.time = panEvent.time; pan.numberOfTouches = panEvent.numberOfTouches; pan.screenPosition = panEvent.currentPosition; pan.position = localCurrent; RenderTask& renderTaskImpl( GetImplementation( renderTask ) ); Vector2 localPrevious; actor->ScreenToLocal( renderTaskImpl, localPrevious.x, localPrevious.y, panEvent.previousPosition.x, panEvent.previousPosition.y ); pan.displacement = localCurrent - localPrevious; Vector2 previousPos( panEvent.previousPosition ); if ( state == Gesture::Started ) { previousPos = mPossiblePanPosition; } pan.screenDisplacement = panEvent.currentPosition - previousPos; // Avoid dividing by 0 if ( panEvent.timeDelta > 0 ) { pan.velocity.x = pan.displacement.x / panEvent.timeDelta; pan.velocity.y = pan.displacement.y / panEvent.timeDelta; pan.screenVelocity.x = pan.screenDisplacement.x / panEvent.timeDelta; pan.screenVelocity.y = pan.screenDisplacement.y / panEvent.timeDelta; } // When the gesture ends, we may incorrectly get a ZERO velocity (as we have lifted our finger without any movement) // so we should use the last recorded velocity instead in this scenario. if ( ( state == Gesture::Finished ) && ( pan.screenVelocity == Vector2::ZERO ) && ( panEvent.timeDelta < MAXIMUM_TIME_WITH_VALID_LAST_VELOCITY ) ) { pan.velocity = mLastVelocity; pan.screenVelocity = mLastScreenVelocity; } else { // Store the current velocity for future iterations. mLastVelocity = pan.velocity; mLastScreenVelocity = pan.screenVelocity; } if ( mSceneObject ) { // We update the scene object directly rather than sending a message. // Sending a message could cause unnecessary delays, the scene object ensure thread safe behaviour. mSceneObject->AddGesture( pan ); } Dali::Actor actorHandle( actor ); const GestureDetectorContainer::const_iterator endIter = gestureDetectors.end(); for ( GestureDetectorContainer::const_iterator iter = gestureDetectors.begin(); iter != endIter; ++iter ) { static_cast< PanGestureDetector* >( *iter )->EmitPanGestureSignal( actorHandle, pan ); } } }
TargetPhraseCollection const* PhraseDictionaryTreeAdaptor::GetTargetPhraseCollectionNonCacheLEGACY(Phrase const &src) const { const TargetPhraseCollection *ret = GetImplementation().GetTargetPhraseCollection(src); return ret; }
ObjectRegistry::ObjectDestroyedSignalV2& ObjectRegistry::ObjectDestroyedSignal() { return GetImplementation(*this).ObjectDestroyedSignal(); }
void PhraseDictionaryTreeAdaptor::DisableCache() { GetImplementation().useCache=0; }
void SoundPlayer::Stop(int handle) { GetImplementation(*this).Stop(handle); }
bool BaseHandle::DoConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor ) { return GetImplementation(*this).DoConnectSignal( connectionTracker, signalName, functor ); }
const PropertyCondition::ArgumentContainer& PropertyCondition::GetArguments() const { return GetImplementation(*this).arguments; }
bool BaseHandle::DoAction(const std::string& command, const Property::Map& attributes) { return GetImplementation(*this).DoAction( command, attributes ); }
void PanGestureDetector::RemoveDirection( Radian direction ) { GetImplementation(*this).RemoveDirection( direction ); }
const std::string& BaseHandle::GetTypeName() const { return GetImplementation(*this).GetTypeName(); }
void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum) { GetImplementation(*this).SetMaximumTouchesRequired(maximum); }
bool BaseHandle::GetTypeInfo(Dali::TypeInfo& typeInfo) const { return GetImplementation(*this).GetTypeInfo(typeInfo); }
void PanGestureDetector::AddAngle( Radian angle, Radian threshold ) { GetImplementation(*this).AddAngle( angle, threshold ); }
void DynamicsBodyConfig::SetShape( const DynamicsShape::ShapeType type, const Vector3& dimensions ) { GetImplementation(*this).SetShape( type, dimensions ); }