Пример #1
0
Property::Value PathConstrainer::GetDefaultProperty( Property::Index index ) const
{
  if( index == Dali::PathConstrainer::Property::FORWARD )
  {
    return Property::Value( mForward );
  }
  else
  {
    if( index == Dali::PathConstrainer::Property::POINTS )
    {
      Property::Value value( Property::ARRAY );
      Property::Array* array = value.GetArray();
      const Dali::Vector<Vector3>& point = mPath->GetPoints();
      Property::Array::SizeType pointCount = point.Size();

      if( array )
      {
        array->Reserve( pointCount );
        for( Property::Array::SizeType i = 0; i < pointCount; ++i )
        {
          array->PushBack( point[i] );
        }
      }
      return value;
    }
    else if( index == Dali::PathConstrainer::Property::CONTROL_POINTS )
    {
      Property::Value value( Property::ARRAY );
      Property::Array* array = value.GetArray();
      const Dali::Vector<Vector3>& point = mPath->GetControlPoints();
      Property::Array::SizeType pointCount = point.Size();

      if( array )
      {
        array->Reserve( pointCount );
        for( Property::Array::SizeType i = 0; i < pointCount; ++i )
        {
          array->PushBack( point[i] );
        }
      }
      return value;
    }
  }

  return Property::Value();
}
Пример #2
0
int UtcDaliPropertyArrayCapacityP(void)
{
  Property::Array array;
  DALI_TEST_CHECK( array.Empty() );

  array.Reserve(3);

  DALI_TEST_CHECK( 3 == array.Capacity() );
  END_TEST;
}
Пример #3
0
Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) const
{
  if( index == Dali::LinearConstrainer::Property::VALUE )
  {
    Property::Value value( Property::ARRAY );
    Property::Array* array = value.GetArray();
    size_t count( mValue.Size() );

    if( array )
    {
      array->Reserve( count );
      for( size_t i( 0 ); i != count; ++i )
      {
        array->PushBack( mValue[i] );
      }
    }
    return value;
  }
  else if( index == Dali::LinearConstrainer::Property::PROGRESS )
  {
    Property::Value value( Property::ARRAY );
    Property::Array* array = value.GetArray();
    size_t count( mValue.Size() );

    if( array )
    {
      array->Reserve( count );
      for( size_t i( 0 ); i != count; ++i )
      {
        array->PushBack( mProgress[i] );
      }
    }
    return value;
  }

  return Property::Value();
}
Пример #4
0
int UtcDaliPropertyArrayReserveP(void)
{
  Property::Array array;
  DALI_TEST_CHECK( array.Empty() );

  array.Reserve(3);

  DALI_TEST_CHECK( 3 == array.Capacity() );
  DALI_TEST_CHECK( 0 == array.Size() );

  array.PushBack( 1 );
  array.PushBack( "world" );
  array.PushBack( 3 );
  END_TEST;
}
Пример #5
0
int UtcDaliPropertyArrayIndexOperatorP(void)
{
  Property::Array array;

  array.Reserve(3);
  array.PushBack( 1 );
  array.PushBack( "world" );
  array.PushBack( 3 );

  DALI_TEST_CHECK( array[0].Get<int>() == 1 );
  DALI_TEST_CHECK( array[1].Get<std::string>() == "world" );
  DALI_TEST_CHECK( array[2].Get<int>() == 3 );

  END_TEST;
}
Пример #6
0
int UtcDaliPropertyArrayEmptyP(void)
{
  Property::Array array;
  DALI_TEST_CHECK( array.Empty() );

  array.Reserve(3);

  DALI_TEST_CHECK( array.Empty() );

  array.PushBack( 1 );
  array.PushBack( "world" );
  array.PushBack( 3 );

  DALI_TEST_CHECK( !array.Empty() );

  END_TEST;
}