예제 #1
0
void DynamicsBodyConfig::SetShape( DynamicsShape shape )
{
  Internal::DynamicsShapePtr internal( &(GetImplementation(shape)) );

  GetImplementation(*this).SetShape( internal );
}
예제 #2
0
PanGestureDetector::DetectedSignalV2& PanGestureDetector::DetectedSignal()
{
  return GetImplementation(*this).DetectedSignal();
}
예제 #3
0
unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
{
  return GetImplementation(*this).GetMaximumTouchesRequired();
}
예제 #4
0
SoundPlayer::SoundPlayFinishedSignalV2& SoundPlayer::SoundPlayFinishedSignal()
{
  return GetImplementation(*this).SoundPlayFinishedSignal();
}
예제 #5
0
void PanGestureDetector::RemoveAngle( Radian angle )
{
  GetImplementation(*this).RemoveAngle( angle );
}
예제 #6
0
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;
}
예제 #7
0
int SoundPlayer::PlaySound(const std::string fileName)
{
  return GetImplementation(*this).PlaySound(fileName);
}
예제 #8
0
void DynamicsBodyConfig::SetFriction(const float friction)
{
  GetImplementation(*this).SetFriction( friction );
}
TargetPhraseCollection const*
PhraseDictionaryTreeAdaptor::GetTargetPhraseCollection(Phrase const &src) const
{
  return GetImplementation().GetTargetPhraseCollection(src);
}
예제 #10
0
void DynamicsBodyConfig::SetElasticity( const float elasticity )
{
  GetImplementation(*this).SetElasticity( elasticity );
}
예제 #11
0
float DynamicsBodyConfig::GetFriction() const
{
  return GetImplementation(*this).GetFriction();
}
예제 #12
0
float DynamicsBodyConfig::GetElasticity() const
{
  return GetImplementation(*this).GetElasticity();
}
예제 #13
0
void DynamicsBodyConfig::SetMass( const float mass )
{
  GetImplementation(*this).SetMass( mass );
}
예제 #14
0
DynamicsShape DynamicsBodyConfig::GetShape() const
{
  Internal::DynamicsShapePtr internal( GetImplementation(*this).GetShape() );

  return DynamicsShape( internal.Get() );
}
예제 #15
0
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();
}
예제 #17
0
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;
}
예제 #19
0
ObjectRegistry::ObjectDestroyedSignalV2& ObjectRegistry::ObjectDestroyedSignal()
{
  return GetImplementation(*this).ObjectDestroyedSignal();
}
void PhraseDictionaryTreeAdaptor::DisableCache()
{
  GetImplementation().useCache=0;
}
예제 #21
0
void SoundPlayer::Stop(int handle)
{
  GetImplementation(*this).Stop(handle);
}
예제 #22
0
bool BaseHandle::DoConnectSignal( ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor )
{
  return GetImplementation(*this).DoConnectSignal( connectionTracker, signalName, functor );
}
예제 #23
0
const PropertyCondition::ArgumentContainer& PropertyCondition::GetArguments() const
{
  return GetImplementation(*this).arguments;
}
예제 #24
0
bool BaseHandle::DoAction(const std::string& command, const Property::Map& attributes)
{
  return GetImplementation(*this).DoAction( command, attributes );
}
예제 #25
0
void PanGestureDetector::RemoveDirection( Radian direction )
{
  GetImplementation(*this).RemoveDirection( direction );
}
예제 #26
0
const std::string& BaseHandle::GetTypeName() const
{
  return GetImplementation(*this).GetTypeName();
}
예제 #27
0
void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
{
  GetImplementation(*this).SetMaximumTouchesRequired(maximum);
}
예제 #28
0
bool BaseHandle::GetTypeInfo(Dali::TypeInfo& typeInfo) const
{
  return GetImplementation(*this).GetTypeInfo(typeInfo);
}
예제 #29
0
void PanGestureDetector::AddAngle( Radian angle, Radian threshold )
{
  GetImplementation(*this).AddAngle( angle, threshold );
}
예제 #30
0
void DynamicsBodyConfig::SetShape( const DynamicsShape::ShapeType type, const Vector3& dimensions )
{
  GetImplementation(*this).SetShape( type, dimensions );
}