当前位置: 首页>>代码示例>>C++>>正文


C++ Model::GetLoadingState方法代码示例

本文整理汇总了C++中Model::GetLoadingState方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::GetLoadingState方法的具体用法?C++ Model::GetLoadingState怎么用?C++ Model::GetLoadingState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model的用法示例。


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

示例1: UtcDaliModelBuildAnimation08

int UtcDaliModelBuildAnimation08(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::MeshActor::New()");

  Dali::ModelData modelData = BuildTreeModel();

  // Raise a request
  Model model = Model::New("Tree");

  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest(); // Return modelData
  if(request)
  {
    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
  }
  application.Render();
  application.SendNotification();

  Actor actor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded

  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
  DALI_TEST_CHECK(actor);
  DALI_TEST_CHECK(actor.GetName().compare("root") == 0);

  DALI_TEST_EQUALS(model.NumberOfAnimations(), static_cast<size_t>(1), TEST_LOCATION);

  Animation twigAnim = ModelActorFactory::BuildAnimation(model, actor, 10);
  DALI_TEST_CHECK(!twigAnim);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:34,代码来源:utc-Dali-Model.cpp

示例2: UtcDaliModelGetLoadingState01

int UtcDaliModelGetLoadingState01(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::Model::New()");
  Model model = Model::New(gModelFile);
  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest();
  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoading);
  DALI_TEST_EQUALS(request->GetPath(), gModelFile, TEST_LOCATION);
  DALI_TEST_EQUALS(request->GetType()->id, Integration::ResourceModel, TEST_LOCATION);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:15,代码来源:utc-Dali-Model.cpp

示例3: UtcDaliModelActorFactory

int UtcDaliModelActorFactory(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::ModelActorFactory");

  Dali::ModelData modelData = BuildTreeModel();

  // Raise a request
  Model model = Model::New("Tree");

  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest(); // Return modelData
  if(request)
  {
    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
  }
  application.Render();
  application.SendNotification();

  Actor modelRootActor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded

  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
  DALI_TEST_CHECK(modelRootActor);
  DALI_TEST_CHECK(modelRootActor.GetName().compare("root") == 0);

  Actor trunk = modelRootActor.FindChildByName("trunk");
  DALI_TEST_CHECK(trunk);
  Actor branch = modelRootActor.FindChildByName("branch");
  DALI_TEST_CHECK(branch);
  Actor twig = modelRootActor.FindChildByName("twig");
  DALI_TEST_CHECK(twig);
  MeshActor twigMeshActor = MeshActor::DownCast(twig);
  DALI_TEST_CHECK(!twigMeshActor);
  Actor leaf = modelRootActor.FindChildByName("leaf");
  DALI_TEST_CHECK(leaf);
  MeshActor leafMeshActor = MeshActor::DownCast(leaf);
  DALI_TEST_CHECK(leafMeshActor);

  Material leafMaterial = leafMeshActor.GetMaterial();
  DALI_TEST_CHECK(leafMaterial);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:45,代码来源:utc-Dali-Model.cpp

示例4: UtcDaliModelGetLoadingState03

int UtcDaliModelGetLoadingState03(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::Model::New()");
  Model model = Model::New(gModelFile);
  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest();
  if(request)
  {
    platform.SetResourceLoadFailed(request->GetId(), Integration::FailureFileNotFound);
  }
  application.Render();
  application.SendNotification();

  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingFailed);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:20,代码来源:utc-Dali-Model.cpp

示例5: UtcDaliModelGetLoadingState02

int UtcDaliModelGetLoadingState02(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::Model::New()");
  Dali::ModelData modelData = BuildTreeModel();
  Model model = Model::New(gModelFile);
  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest();
  if(request)
  {
    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
  }

  // Get resources into resource cache
  application.Render();
  application.SendNotification();

  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:23,代码来源:utc-Dali-Model.cpp

示例6: UtcDaliModelBuildAnimation01

int UtcDaliModelBuildAnimation01(void)
{
  TestApplication application;
  TestPlatformAbstraction& platform = application.GetPlatform();

  tet_infoline("Testing Dali::MeshActor::New()");

  Dali::ModelData modelData = BuildTreeModel();

  // Raise a request
  Model model = Model::New("Tree");

  application.SendNotification();
  application.Render();
  Integration::ResourceRequest* request = platform.GetRequest(); // Return modelData
  if(request)
  {
    platform.SetResourceLoaded(request->GetId(), request->GetType()->id, Integration::ResourcePointer(&(modelData.GetBaseObject())));
  }
  application.Render();
  application.SendNotification();

  Actor actor = ModelActorFactory::BuildActorTree(model, ""); // model should be loaded
  Stage::GetCurrent().Add(actor);

  DALI_TEST_CHECK(model.GetLoadingState() == ResourceLoadingSucceeded);
  DALI_TEST_CHECK(actor);
  DALI_TEST_CHECK(actor.GetName().compare("root") == 0);

  DALI_TEST_EQUALS(model.NumberOfAnimations(), static_cast<size_t>(1), TEST_LOCATION);
  unsigned int animIndex=0;
  bool found = model.FindAnimation("Anim1", animIndex);
  DALI_TEST_CHECK(found);

  Animation twigAnim = ModelActorFactory::BuildAnimation(model, actor, animIndex);
  DALI_TEST_CHECK(twigAnim);
  DALI_TEST_EQUALS(twigAnim.GetDuration(), 10.0f, 0.001, TEST_LOCATION);
  DALI_TEST_CHECK(twigAnim.GetDefaultAlphaFunction() == Dali::AlphaFunctions::Linear);

  Actor twigActor = actor.FindChildByName("twig");
  DALI_TEST_CHECK(twigActor);

  // Start the animation
  twigAnim.Play();

  float durationSeconds = 10.0f;

  bool signalReceived(false);
  AnimationFinishCheck finishCheck(signalReceived);
  twigAnim.FinishedSignal().Connect(&application, finishCheck);
  application.SendNotification();
  application.Render();
  finishCheck.CheckSignalNotReceived();
  DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(2.0f, 1.0f, 0.0f), 0.01f, TEST_LOCATION );

  application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
  application.SendNotification();
  DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(2.5f, 1.0f, 2.5f), 0.01f, TEST_LOCATION );

  application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 75% progress */);
  application.SendNotification();
  DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(3.5f, 1.0f, 7.5f), 0.01f, TEST_LOCATION );

  application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* Past Finished */);
  application.SendNotification();
  DALI_TEST_EQUALS( twigActor.GetCurrentPosition(), Vector3(4.0f, 1.0f, 10.0f), 0.01f, TEST_LOCATION );

  finishCheck.CheckSignalReceived();
  END_TEST;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:70,代码来源:utc-Dali-Model.cpp


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