• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ToolkitTestApplication类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ToolkitTestApplication的典型用法代码示例。如果您正苦于以下问题:C++ ToolkitTestApplication类的具体用法?C++ ToolkitTestApplication怎么用?C++ ToolkitTestApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ToolkitTestApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: UtcDaliMagnifierSetSourceActorP

int UtcDaliMagnifierSetSourceActorP(void)
{
  ToolkitTestApplication application;

  Stage stage = Stage::GetCurrent();

  Magnifier view = Magnifier::New();
  stage.Add( view );

  application.SendNotification();
  application.Render();

  RenderTaskList renderTaskList = stage.GetRenderTaskList();
  DALI_TEST_CHECK( renderTaskList.GetTaskCount() > 1 );

  Actor actor = Actor::New();
  stage.Add( actor );
  DALI_TEST_CHECK( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor() != actor );

  view.SetSourceActor( actor );

  application.SendNotification();
  application.Render();

  DALI_TEST_EQUALS( stage.GetRenderTaskList().GetTask( 1 ).GetSourceActor(), actor, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:28,代码来源:utc-Dali-Magnifier.cpp


示例2: UtcDaliIrisEffectCustomValues

static void UtcDaliIrisEffectCustomValues()
{
  ToolkitTestApplication application;

  Toolkit::IrisEffect effect = Toolkit::IrisEffect::New();
  DALI_TEST_CHECK( effect );

  BitmapImage image = CreateBitmapImage();

  ImageActor actor = ImageActor::New( image );
  actor.SetSize( 100.0f, 100.0f );

  const float radiusValue(23.0f);
  const Vector2 centerValue(0.2f, 0.7f);
  const float blendFactorValue(10.0f);

  effect.SetRadius( radiusValue );
  effect.SetCenter( centerValue );
  effect.SetBlendFactor( blendFactorValue );

  actor.SetShaderEffect(effect);
  Stage::GetCurrent().Add(actor);

  application.SendNotification();
  application.Render();

  TestGlAbstraction& gl = application.GetGlAbstraction();
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetRadiusPropertyName().c_str(), radiusValue ) );
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetCenterPropertyName().c_str(), centerValue ) );
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetBlendFactorPropertyName().c_str(), blendFactorValue ) );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:31,代码来源:utc-Dali-IrisEffect.cpp


示例3: UtcDaliPushButtonSetLabelText

static void UtcDaliPushButtonSetLabelText()
{
    ToolkitTestApplication application;
    tet_infoline(" UtcDaliPushButtonSetLabelText");

    const std::string STR( "Hola!" );

    PushButton pushButton = PushButton::New();

    application.SendNotification();
    application.Render();

    TextView textView;

    pushButton.SetLabelText( STR );

    textView = TextView::DownCast( pushButton.GetLabelText() );
    DALI_TEST_CHECK( STR == textView.GetText() );

    TextView text = TextView::New( STR );
    pushButton.SetLabelText( text );

    textView = TextView::DownCast( pushButton.GetLabelText() );
    DALI_TEST_CHECK( STR == textView.GetText() );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:25,代码来源:utc-Dali-PushButton.cpp


示例4: UtcDaliShearEffectCustomValues

static void UtcDaliShearEffectCustomValues()
{
  ToolkitTestApplication application;

  Toolkit::ShearEffect effect = Toolkit::ShearEffect::New();
  DALI_TEST_CHECK( effect );

  BitmapImage image = CreateBitmapImage();

  ImageActor actor = ImageActor::New( image );
  actor.SetSize( 100.0f, 100.0f );

  const float angleXAxis(10.0f);
  const float angleYAxis(22.5f);
  const Vector2 centerValue(50.0f, 100.0f);

  effect.SetAngleXAxis( angleXAxis );
  effect.SetAngleYAxis( angleYAxis );
  effect.SetCenter( centerValue );

  actor.SetShaderEffect(effect);
  Stage::GetCurrent().Add(actor);

  application.SendNotification();
  application.Render();

  TestGlAbstraction& gl = application.GetGlAbstraction();
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetAngleXAxisPropertyName().c_str(), angleXAxis ) );
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetAngleYAxisPropertyName().c_str(), angleYAxis ) );
  DALI_TEST_CHECK( gl.CheckUniformValue( effect.GetCenterPropertyName().c_str(), ToScreenPosition(centerValue) ) );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:31,代码来源:utc-Dali-ShearEffect.cpp


示例5: UtcDaliGaussianBlurViewFinishedSignalN

int UtcDaliGaussianBlurViewFinishedSignalN(void)
{
  ToolkitTestApplication application;
  tet_infoline("UtcDaliGaussianBlurViewSetGetRenderTarget");

  Toolkit::GaussianBlurView view = Toolkit::GaussianBlurView::New(5, 1.5f, Pixel::RGB888, 0.5f, 0.5f, true);
  DALI_TEST_CHECK( view );

  view.SetParentOrigin(ParentOrigin::CENTER);
  view.SetSize(Stage::GetCurrent().GetSize());
  view.Add(Actor::New());
  Stage::GetCurrent().Add(view);
  view.Activate();

  TestCallback callback( view );
  DALI_TEST_CHECK( callback.mFinished == false );

  callback.Connect();

  view.Deactivate();
  application.SendNotification();

  // FinishedSignal is only for ActivateOnce()
  DALI_TEST_CHECK( callback.mFinished == false );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:27,代码来源:utc-Dali-GaussianBlurView.cpp


示例6: UtcDaliRipple2DEffectCustomValues

static void UtcDaliRipple2DEffectCustomValues()
{
  ToolkitTestApplication application;

  Toolkit::Ripple2DEffect effect = Toolkit::Ripple2DEffect::New();
  DALI_TEST_CHECK( effect );

  BitmapImage image = CreateBitmapImage();

  ImageActor actor = ImageActor::New( image );
  actor.SetSize( 100.0f, 100.0f );
  actor.SetShaderEffect( effect );

  effect.SetAmplitude( 5.0f );
  effect.SetTime( 2.0f );

  Stage::GetCurrent().Add( actor );

  application.SendNotification();
  application.Render();

  DALI_TEST_CHECK(
      application.GetGlAbstraction().CheckUniformValue(
          effect.GetAmplitudePropertyName().c_str(),
          5.0f ) );
  DALI_TEST_CHECK(
      application.GetGlAbstraction().CheckUniformValue(
          effect.GetTimePropertyName().c_str(),
          2.0f ) );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:30,代码来源:utc-Dali-Ripple2DEffect.cpp


示例7: UtcDaliTextInputTextSelection

int UtcDaliTextInputTextSelection(void)
{
  ToolkitTestApplication application;

  tet_infoline("Testing Text Selection");

  const std::string initialString = "initial text";

  TextInput textInput = TextInput::New();
  textInput.SetInitialText( initialString );

  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  textInput.SetEditable( true );

  tet_infoline("Testing IsTextSelected negative");
  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);

  textInput.SelectText(1,7);
  DALI_TEST_EQUALS( true, textInput.IsTextSelected(), TEST_LOCATION);

  textInput.DeSelectText();
  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:27,代码来源:utc-Dali-TextInput.cpp


示例8: UtcDaliSpotCustomValuesEffect

int UtcDaliSpotCustomValuesEffect(void)
{
  ToolkitTestApplication application;

  Toolkit::SpotEffect effect = Toolkit::SpotEffect::New();
  DALI_TEST_CHECK( effect );

  BitmapImage image = CreateBitmapImage();

  ImageActor actor = ImageActor::New( image );
  actor.SetSize( 100.0f, 100.0f );

  effect.SetCenter( Vector2(480.0f, 800.0f) );
  effect.SetRadius( 5.0f );

  actor.SetShaderEffect( effect );
  Stage::GetCurrent().Add( actor );

  application.SendNotification();
  application.Render();

  // Gets converted to opengl viewport coordinates
  DALI_TEST_CHECK(
      application.GetGlAbstraction().CheckUniformValue(
          effect.GetCenterPropertyName().c_str(),
          Vector2(480.0f, 800.0f) ) );

  DALI_TEST_CHECK(
      application.GetGlAbstraction().CheckUniformValue(
          effect.GetRadiusPropertyName().c_str(),
          5.0f ) );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:33,代码来源:utc-Dali-SpotEffect.cpp


示例9: UtcDaliTextInputSetAndGetFadeBoundary

int UtcDaliTextInputSetAndGetFadeBoundary(void)
{
  tet_infoline("UtcDaliTextViewSetAndGetFadeBoundary: ");

  ToolkitTestApplication application;

  TextView::FadeBoundary fadeBoundary( PixelSize( 0 ), PixelSize( 20 ), PixelSize( 0 ), PixelSize( 10 ) );

  TextInput textInput = TextInput::New();
  textInput.SetInitialText( "Hello world!" );

  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  textInput.SetFadeBoundary( fadeBoundary );

  TextView::FadeBoundary fadeBoundary2 = textInput.GetFadeBoundary();

  DALI_TEST_EQUALS( fadeBoundary.mLeft, fadeBoundary2.mLeft, TEST_LOCATION );
  DALI_TEST_EQUALS( fadeBoundary.mRight, fadeBoundary2.mRight, TEST_LOCATION );
  DALI_TEST_EQUALS( fadeBoundary.mTop, fadeBoundary2.mTop, TEST_LOCATION );
  DALI_TEST_EQUALS( fadeBoundary.mBottom, fadeBoundary2.mBottom, TEST_LOCATION );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:25,代码来源:utc-Dali-TextInput.cpp


示例10: UtcDaliKeyInputFocusManagerSignalUnhandledKeyEvent

static void UtcDaliKeyInputFocusManagerSignalUnhandledKeyEvent()
{
  ToolkitTestApplication application;

  tet_infoline("UtcDaliKeyInputFocusManagerSignalUnhandledKeyEvent");

  SignalData data;
  SignalUnhandledKeyEventCallback callback( data );

  KeyInputFocusManager manager = KeyInputFocusManager::Get();
  manager.UnhandledKeyEventSignal().Connect( &callback, &SignalUnhandledKeyEventCallback::Callback );


  Integration::KeyEvent event("a", "a", 0, 0, 0, Integration::KeyEvent::Up);
  application.ProcessEvent(event);

  DALI_TEST_CHECK(data.functorCalled);
  DALI_TEST_CHECK(event.keyName == data.receivedKeyEvent.keyPressedName );
  DALI_TEST_CHECK(event.keyCode == data.receivedKeyEvent.keyCode);
  DALI_TEST_CHECK(event.keyString == data.receivedKeyEvent.keyPressed );
  DALI_TEST_CHECK(event.state == data.receivedKeyEvent.state );

  data.Reset();

  Integration::KeyEvent event2("v", "v", 0, 0, 0, Integration::KeyEvent::Up);
  application.ProcessEvent(event2);

  DALI_TEST_CHECK(data.functorCalled);
  DALI_TEST_CHECK(event2.keyName == data.receivedKeyEvent.keyPressedName );
  DALI_TEST_CHECK(event2.keyCode == data.receivedKeyEvent.keyCode);
  DALI_TEST_CHECK(event2.keyString == data.receivedKeyEvent.keyPressed );
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:32,代码来源:utc-Dali-KeyInputFocusManager.cpp


示例11: utcDaliTextFieldTextChangedP

// Positive test for the text-changed signal.
int utcDaliTextFieldTextChangedP(void)
{
  ToolkitTestApplication application;
  tet_infoline(" utcDaliTextFieldTextChangedP");
  TextField field = TextField::New();
  DALI_TEST_CHECK( field );

  Stage::GetCurrent().Add( field );

  field.TextChangedSignal().Connect(&TestTextChangedCallback);

  gTextChangedCallBackCalled = false;
  field.SetProperty( TextField::Property::TEXT, "ABC" );
  DALI_TEST_CHECK( gTextChangedCallBackCalled );

  application.SendNotification();

  field.SetKeyInputFocus();

  gTextChangedCallBackCalled = false;
  application.ProcessEvent( GenerateKey( "D", "D", 0, 0, 0, Integration::KeyEvent::Down ) );
  DALI_TEST_CHECK( gTextChangedCallBackCalled );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:26,代码来源:utc-Dali-TextField.cpp


示例12: utcDaliTextFieldAtlasRenderP

// Positive Atlas Text Renderer test
int utcDaliTextFieldAtlasRenderP(void)
{
  ToolkitTestApplication application;
  tet_infoline(" UtcDaliToolkitTextFieldAtlasRenderP");
  StyleManager styleManager = StyleManager::Get();
  styleManager.RequestDefaultTheme();
  TextField field = TextField::New();
  DALI_TEST_CHECK( field );

  field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "CENTER" );

  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );

  Stage::GetCurrent().Add( field );

  try
  {
    // Render some text with the shared atlas backend
    field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
    application.SendNotification();
    application.Render();
  }
  catch( ... )
  {
    tet_result(TET_FAIL);
  }
  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:29,代码来源:utc-Dali-TextField.cpp


示例13: UtcDaliBubbleEmitterSetBubbleScale

int UtcDaliBubbleEmitterSetBubbleScale(void)
{
  ToolkitTestApplication application;
  tet_infoline( " UtcDaliBubbleEmitterSetBubbleScale " );

  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f ));
  DALI_TEST_CHECK(emitter);
  Actor root = emitter.GetRootActor();
  Stage::GetCurrent().Add( root );
  root.SetPosition( Vector3::ZERO );
  root.SetParentOrigin( ParentOrigin::CENTER );
  root.SetAnchorPoint( AnchorPoint::CENTER );

  TestGlAbstraction& gl = application.GetGlAbstraction();

  Wait(application);

  float scaleValue;
  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
  DALI_TEST_EQUALS( scaleValue, 1.f, TEST_LOCATION );

  emitter.SetBubbleScale( 2.f );
  Wait(application);
  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
  DALI_TEST_EQUALS( scaleValue, 2.f, TEST_LOCATION );

  emitter.SetBubbleScale( 0.5f );
  Wait(application);
  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
  DALI_TEST_EQUALS( scaleValue, 0.5f, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:34,代码来源:utc-Dali-BubbleEmitter.cpp


示例14: UtcDaliConfirmationPopupTypeRegistryCreation

int UtcDaliConfirmationPopupTypeRegistryCreation(void)
{
  ToolkitTestApplication application;
  tet_infoline( " UtcDaliConfirmationPopupTypeRegistryCreation" );

  TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( "ConfirmationPopup" );
  DALI_TEST_CHECK( typeInfo )

  BaseHandle baseHandle = typeInfo.CreateInstance();
  DALI_TEST_CHECK( baseHandle )

  Toolkit::Popup popup = Toolkit::Popup::DownCast( baseHandle );
  popup.SetProperty( Popup::Property::ANIMATION_DURATION, 0.0f );

  Stage::GetCurrent().Add( popup );
  popup.SetDisplayState( Toolkit::Popup::SHOWN );

  application.SendNotification();
  application.Render();

  // Check the popup is shown.
  DALI_TEST_EQUALS( popup.GetDisplayState(), Popup::SHOWN, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:25,代码来源:utc-Dali-ConfirmationPopup.cpp


示例15: UtcDaliBubbleEmitterRestore

int UtcDaliBubbleEmitterRestore(void)
{
  ToolkitTestApplication application;
  tet_infoline( " UtcDaliBubbleEmitterRestore " );

  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 90, Vector2( 5.f, 10.f ));
  Actor root = emitter.GetRootActor();
  Stage::GetCurrent().Add( root );
  root.SetPosition( Vector3::ZERO );
  root.SetParentOrigin( ParentOrigin::CENTER );
  root.SetAnchorPoint( AnchorPoint::CENTER );

  Actor bubbleMesh = root.GetChildAt( 0 );
  Renderer renderer = bubbleMesh.GetRendererAt( 0 );
  DALI_TEST_CHECK( renderer );

  TestGlAbstraction& gl = application.GetGlAbstraction();

  float percentageValue;
  Vector4 startEndPosValue;

  Animation animation = Animation::New( 0.5f );
  emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );

  Wait(application);

  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
  DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );

  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
  DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
  DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );

  animation.Play();
  Wait(application, 200);
  animation.Clear();

  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
  DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4);

  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
  DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
  DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );

  emitter.Restore();
  application.SendNotification();
  application.Render();

  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
  DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );

  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartEndPosition[0]", startEndPosValue ) );
  DALI_TEST_EQUALS( startEndPosValue,  Vector4::ZERO, TEST_LOCATION );

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:57,代码来源:utc-Dali-BubbleEmitter.cpp


示例16: UtcDaliGridLayoutConstraintUp

static void UtcDaliGridLayoutConstraintUp()
{
  ToolkitTestApplication application;

  // Create the ItemView actor
  TestItemFactory factory;
  ItemView view = ItemView::New(factory);
  Vector3 vec(480.0f, 800.0f, 0.0f);
  GridLayoutPtr gridLayout = GridLayout::New();
  gridLayout->SetNumberOfColumns(6);

  view.SetName("view actor");
  view.AddLayout(*gridLayout);
  view.SetSize(vec);

  Stage::GetCurrent().Add(view);
  gridLayout->SetOrientation(ControlOrientation::Up);
  view.ActivateLayout(0, vec, 0.0f);

  application.SendNotification();
  application.Render(0);

  // render 10 frames
  for(int i = 0; i < 10; ++i)
  {
    application.Render(16); // 60hz frames
  }

  // Confirm: we have actors in the view and they are positioned some distance from the origin.
  int nonZeroCount = 0;
  int elementsFound = 0;
  for(unsigned int i = 0; i < 10; i++)
  {
    Actor testActor = view.GetItem(i);
    if (testActor)
    {
      elementsFound++;
      Vector3 pos = testActor.GetCurrentPosition();

      if (pos.LengthSquared() > 0.0f)
      {
        nonZeroCount++;
      }
    }
  }

  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));

  ItemLayoutPtr layout = gridLayout;
  layout->GetClosestOnScreenLayoutPosition(0, 0.0f, vec);
  int nextItem = layout->GetNextFocusItemID(0, 10, Dali::Toolkit::Control::Right, false);
  DALI_TEST_CHECK(nextItem == 1);

  Stage::GetCurrent().Remove(view);
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:55,代码来源:utc-Dali-GridLayout.cpp


示例17: UtcDaliDisplacementEffectTestSetProperty

// Positive test case for a method
int UtcDaliDisplacementEffectTestSetProperty(void)
{
  ToolkitTestApplication application;
  tet_infoline("UtcDaliDisplacementEffectTestSetProperty");

  Toolkit::DisplacementEffect effect = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::DISPLACED);
  DALI_TEST_CHECK( effect );

  ImageActor actor = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
  actor.SetSize( 100.0f, 100.0f );
  actor.SetShaderEffect( effect );
  Stage::GetCurrent().Add( actor );

  Toolkit::DisplacementEffect effect2 = Toolkit::DisplacementEffect::New(Toolkit::DisplacementEffect::FIXED);
  DALI_TEST_CHECK( effect );

  ImageActor actor2 = ImageActor::New( Image::New(TEST_IMAGE_FILE_NAME) );
  actor2.SetSize( 100.0f, 100.0f );
  actor2.SetShaderEffect( effect2 );
  Stage::GetCurrent().Add( actor2 );

  Vector3 testVector3 = Vector3(45.0f, 55.0f, 65.0f);
  float testFloat = 0.623f;
  effect.SetLightDirection(testVector3);
  effect.SetAmbientLightColorProperty(testVector3);
  effect.SetDiffuseLightColorProperty(testVector3);
  effect.SetStateProperty(testFloat);
  effect.SetLightingMultiplierProperty(testFloat);
  effect.SetHeightScaleProperty(testFloat);

  effect2.SetFixedNormalProperty(testVector3);

  application.SendNotification();
  application.Render(0);
  application.SendNotification();
  application.Render();

  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightDirectionPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetAmbientLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetDiffuseLightColorPropertyName() ) ).Get<Vector3>(), testVector3, TEST_LOCATION );
  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetStatePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetLightingMultiplierPropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );
  DALI_TEST_EQUALS( effect.GetProperty( effect.GetPropertyIndex( effect.GetHeightScalePropertyName().c_str() ) ).Get<float>(), testFloat, TEST_LOCATION );

  Vector3 normalizedVector3(testVector3);
  normalizedVector3.Normalize();
  DALI_TEST_EQUALS( effect2.GetProperty( effect2.GetPropertyIndex( effect2.GetFixedNormalPropertyName() ) ).Get<Vector3>(), normalizedVector3, TEST_LOCATION );
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:50,代码来源:utc-Dali-DisplacementEffect.cpp


示例18: UtcDaliRollLayoutConstraintDown

int UtcDaliRollLayoutConstraintDown(void)
{
  ToolkitTestApplication application;

  // Create the ItemView actor
  TestItemFactory factory;
  ItemView view = ItemView::New(factory);
  Vector3 vec(480.0f, 800.0f, 0.0f);
  RollLayoutPtr rollLayout = RollLayout::New();

  view.SetName("view actor");
  view.AddLayout(*rollLayout);
  view.SetSize(vec);

  Stage::GetCurrent().Add(view);
  rollLayout->SetOrientation(ControlOrientation::Down);
  view.ActivateLayout(0, vec, 0.0f);

  application.SendNotification();
  application.Render(0);

  // render 10 frames
  for(int i = 0; i < 10; ++i)
  {
    application.Render(16); // 60hz frames
  }

  // Confirm: we have actors in the view and they are positioned some distance from the origin.
  int nonZeroCount = 0;
  int elementsFound = 0;
  for(unsigned int i = 0; i < 10; i++)
  {
    Actor testActor = view.GetItem(i);
    if (testActor)
    {
      elementsFound++;
      Vector3 pos = testActor.GetCurrentPosition();

      if (pos.LengthSquared() > 0.0f)
      {
        nonZeroCount++;
      }
    }
  }

  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
  Stage::GetCurrent().Remove(view);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:49,代码来源:utc-Dali-RollLayout.cpp


示例19: UtcDaliTextInputSetAndGetTextAlignment

int UtcDaliTextInputSetAndGetTextAlignment(void)
{
  ToolkitTestApplication application;

  TextInput textInput = TextInput::New();
  Stage::GetCurrent().Add(textInput);
  application.SendNotification();
  application.Render();

  textInput.SetTextAlignment(static_cast<Alignment::Type>( Alignment::HorizontalCenter) );
  application.SendNotification();
  application.Render();

  DALI_TEST_CHECK( static_cast<Alignment::Type>( Alignment::HorizontalCenter) & textInput.GetTextAlignment()) ;
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dal-toolkit,代码行数:16,代码来源:utc-Dali-TextInput.cpp


示例20: UtcDaliMagnifierNew

int UtcDaliMagnifierNew(void)
{
  ToolkitTestApplication application;

  Magnifier magnifier;
  DALI_TEST_CHECK( !magnifier );

  magnifier = Magnifier::New();
  DALI_TEST_CHECK( magnifier );

  Stage::GetCurrent().Add( magnifier );

  application.SendNotification();
  application.Render();

  END_TEST;
}
开发者ID:mettalla,项目名称:dali,代码行数:17,代码来源:utc-Dali-Magnifier.cpp



注:本文中的ToolkitTestApplication类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Tools类代码示例发布时间:2022-05-31
下一篇:
C++ ToolSystem类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap