Updates following Visual Property Changes 67/81667/3
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 27 Jul 2016 09:48:12 +0000 (10:48 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 Jul 2016 14:07:48 +0000 (15:07 +0100)
Change-Id: Ie5d0a5aa32a0fcee1448f4fb69277d4476048fdd

21 files changed:
com.samsung.dali-demo.xml
demo/dali-demo.cpp
examples/dissolve-effect/dissolve-effect-example.cpp
examples/gradients/gradients-example.cpp
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
examples/item-view/item-view-example.cpp
examples/mesh-renderer/mesh-renderer-example.cpp [deleted file]
examples/mesh-visual/mesh-visual-example.cpp [new file with mode: 0644]
examples/motion-blur/motion-blur-example.cpp
examples/primitive-shapes/primitive-shapes-example.cpp
examples/scroll-view/scroll-view-example.cpp
examples/text-scrolling/text-scrolling-example.cpp
examples/video-view/video-view-example.cpp
resources/scripts/animated-colors.json
resources/scripts/background.json
resources/scripts/clock.json
resources/scripts/table-view.json
resources/style/demo-theme.json.in
resources/style/mobile/demo-theme.json.in
shared/dali-demo-strings.h
shared/view.h

index 14f8f5839de37b409ee81c48f50e21a82ac7a646..6c856c36bcd683e142da8edcfdc32a73e26c12b5 100644 (file)
        <ui-application appid="video-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/video-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Video View</label>
        </ui-application>
-       <ui-application appid="mesh-renderer.example" exec="/usr/apps/com.samsung.dali-demo/bin/mesh-renderer.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
-               <label>Mesh Renderer</label>
+       <ui-application appid="mesh-visual.example" exec="/usr/apps/com.samsung.dali-demo/bin/mesh-visual.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
+               <label>Mesh Visual</label>
        </ui-application>
        <ui-application appid="primitive-shapes.example" exec="/usr/apps/com.samsung.dali-demo/bin/primitive-shapes.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Primitive Shapes</label>
index dc927a5d5f23d099206a2b108a119021d80776c8..d9444a5203be17cc83a4c6145dab4e35a3ca070b 100644 (file)
@@ -78,7 +78,7 @@ int DALI_EXPORT_API main(int argc, char **argv)
   demo.AddExample(Example("tilt.example", DALI_DEMO_STR_TITLE_TILT_SENSOR));
   demo.AddExample(Example("effects-view.example", DALI_DEMO_STR_TITLE_EFFECTS_VIEW));
   demo.AddExample(Example("native-image-source.example", DALI_DEMO_STR_TITLE_NATIVE_IMAGE_SOURCE));
-  demo.AddExample(Example("mesh-renderer.example", DALI_DEMO_STR_TITLE_MESH_RENDERER));
+  demo.AddExample(Example("mesh-visual.example", DALI_DEMO_STR_TITLE_MESH_VISUAL));
   demo.AddExample(Example("primitive-shapes.example", DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES));
 
   demo.SortAlphabetically( true );
index 9e18355970c418c621342afe37bba2fe6474a772..20f477f475e13717ea8f547890b8fd68c034376c 100644 (file)
@@ -91,13 +91,13 @@ Toolkit::ImageView CreateStageFillingImageView( const char * const imagePath )
   Size stageSize = Stage::GetCurrent().GetSize();
   Toolkit::ImageView imageView = Toolkit::ImageView::New();
   Property::Map map;
-  map["rendererType"] = "IMAGE";
-  map["url"] = imagePath;
-  map["desiredWidth"] = stageSize.x;
-  map["desiredHeight"] = stageSize.y;
-  map["fittingMode"] = "SCALE_TO_FILL";
-  map["samplingMode"] = "BOX_THEN_LINEAR";
-  map["synchronousLoading"] = true;
+  map[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+  map[Toolkit::ImageVisual::Property::URL] = imagePath;
+  map[Toolkit::ImageVisual::Property::DESIRED_WIDTH] = stageSize.x;
+  map[Toolkit::ImageVisual::Property::DESIRED_HEIGHT] = stageSize.y;
+  map[Toolkit::ImageVisual::Property::FITTING_MODE] = FittingMode::SCALE_TO_FILL;
+  map[Toolkit::ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
+  map[Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING] = true;
   imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
 
   return imageView;
index 96c485d8ebf87375f442a393b13624c9bfe5b31f..5d1ab6311340fae6a21cb2478b6fff6666d30bf7 100644 (file)
@@ -77,7 +77,7 @@ public:
 
 // ---- Gradient for background
 
-    mGradientMap.Insert("rendererType",  "GRADIENT");
+    mGradientMap.Insert( Visual::Property::TYPE,  Visual::GRADIENT );
 
     Property::Array stopOffsets;
     stopOffsets.PushBack( 0.0f );
@@ -85,7 +85,7 @@ public:
     stopOffsets.PushBack( 0.6f );
     stopOffsets.PushBack( 0.8f );
     stopOffsets.PushBack( 1.0f );
-    mGradientMap.Insert("stopOffset", stopOffsets );
+    mGradientMap.Insert( GradientVisual::Property::STOP_OFFSET, stopOffsets );
 
     Property::Array stopColors;
     stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
@@ -93,7 +93,7 @@ public:
     stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
     stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
     stopColors.PushBack( Color::YELLOW );
-    mGradientMap.Insert("stopColor",   stopColors);
+    mGradientMap.Insert( GradientVisual::Property::STOP_COLOR, stopColors );
 
     OnChangeIconClicked( changeButton );
   }
@@ -106,30 +106,30 @@ public:
     {
       case 0: // linear gradient with units as objectBoundingBox
       {
-        gradientMap.Insert("startPosition",   Vector2( 0.5f, 0.5f ));
-        gradientMap.Insert("endPosition",    Vector2( -0.5f, -0.5f ));
+        gradientMap.Insert( GradientVisual::Property::START_POSITION,   Vector2(  0.5f,  0.5f ) );
+        gradientMap.Insert( GradientVisual::Property::END_POSITION,     Vector2( -0.5f, -0.5f ) );
         break;
       }
       case 1: // linear gradient with units as userSpaceOnUse
       {
         Vector2 halfStageSize = Stage::GetCurrent().GetSize()*0.5f;
-        gradientMap.Insert("startPosition",   halfStageSize);
-        gradientMap.Insert("endPosition",    -halfStageSize );
-        gradientMap.Insert("units",  "USER_SPACE");
+        gradientMap.Insert( GradientVisual::Property::START_POSITION,  halfStageSize );
+        gradientMap.Insert( GradientVisual::Property::END_POSITION,   -halfStageSize );
+        gradientMap.Insert( GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE );
         break;
       }
       case 2: // radial gradient with units as objectBoundingBox
       {
-        gradientMap.Insert("center",  Vector2(0.5f, 0.5f));
-        gradientMap.Insert("radius",  1.414f);
+        gradientMap.Insert( GradientVisual::Property::CENTER, Vector2( 0.5f, 0.5f ) );
+        gradientMap.Insert( GradientVisual::Property::RADIUS, 1.414f );
         break;
       }
       default: // radial gradient with units as userSpaceOnUse
       {
         Vector2 stageSize = Stage::GetCurrent().GetSize();
-        gradientMap.Insert("center",  stageSize*0.5f);
-        gradientMap.Insert("radius",  stageSize.Length());
-        gradientMap.Insert("units",  "USER_SPACE");
+        gradientMap.Insert( GradientVisual::Property::CENTER, stageSize * 0.5f );
+        gradientMap.Insert( GradientVisual::Property::RADIUS, stageSize.Length());
+        gradientMap.Insert( GradientVisual::Property::UNITS,  GradientVisual::Units::USER_SPACE );
         break;
       }
     }
index 64b7a8417775b6458159f2eb26dba1cf9865d1ae..3af560d821e2f6006eab85a4e5ccbe36aeb673a3 100644 (file)
@@ -177,12 +177,12 @@ public:
 
     // Background image:
     Dali::Property::Map backgroundImage;
-    backgroundImage.Insert( "rendererType",  "IMAGE" );
-    backgroundImage.Insert( "url",  BACKGROUND_IMAGE );
-    backgroundImage.Insert( "desiredWidth",   stage.GetSize().width );
-    backgroundImage.Insert( "desiredHeight",   stage.GetSize().height );
-    backgroundImage.Insert( "fittingMode",   "SCALE_TO_FILL" );
-    backgroundImage.Insert( "samplingMode",   "BOX_THEN_NEAREST" );
+    backgroundImage.Insert( Toolkit::Visual::Property::TYPE,  Toolkit::Visual::IMAGE );
+    backgroundImage.Insert( Toolkit::ImageVisual::Property::URL,  BACKGROUND_IMAGE );
+    backgroundImage.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, stage.GetSize().width );
+    backgroundImage.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, stage.GetSize().height );
+    backgroundImage.Insert( Toolkit::ImageVisual::Property::FITTING_MODE,   FittingMode::SCALE_TO_FILL );
+    backgroundImage.Insert( Toolkit::ImageVisual::Property::SAMPLING_MODE,   SamplingMode::BOX_THEN_NEAREST );
 
     Toolkit::ImageView background = Toolkit::ImageView::New();
     background.SetProperty( Toolkit::ImageView::Property::IMAGE, backgroundImage );
index 156176e178226f22bc8d7c5378156ebdd1498424..f93aaec1555304a76b41f670f5dd336f593cd7b0 100644 (file)
@@ -878,10 +878,10 @@ public: // From ItemFactory
     borderActor.SetColorMode( USE_PARENT_COLOR );
 
     Property::Map borderProperty;
-    borderProperty.Insert( "rendererType", "BORDER" );
-    borderProperty.Insert( "borderColor", Color::WHITE );
-    borderProperty.Insert( "borderSize", ITEM_BORDER_SIZE );
-    borderProperty.Insert( "antiAliasing", true );
+    borderProperty.Insert( Visual::Property::TYPE, Visual::BORDER );
+    borderProperty.Insert( BorderVisual::Property::COLOR, Color::WHITE );
+    borderProperty.Insert( BorderVisual::Property::SIZE, ITEM_BORDER_SIZE );
+    borderProperty.Insert( BorderVisual::Property::ANTI_ALIASING, true );
     borderActor.SetProperty( ImageView::Property::IMAGE, borderProperty );
 
     actor.Add(borderActor);
@@ -902,8 +902,8 @@ public: // From ItemFactory
     checkbox.SetZ( 0.1f );
 
     Property::Map solidColorProperty;
-    solidColorProperty.Insert( "rendererType", "COLOR" );
-    solidColorProperty.Insert( "mixColor", Vector4(0.f, 0.f, 0.f, 0.6f) );
+    solidColorProperty.Insert( Visual::Property::TYPE, Visual::COLOR );
+    solidColorProperty.Insert( ColorVisual::Property::MIX_COLOR, Vector4(0.f, 0.f, 0.f, 0.6f) );
     checkbox.SetProperty( ImageView::Property::IMAGE, solidColorProperty );
 
     if( MODE_REMOVE_MANY  != mMode &&
diff --git a/examples/mesh-renderer/mesh-renderer-example.cpp b/examples/mesh-renderer/mesh-renderer-example.cpp
deleted file mode 100644 (file)
index b9286fa..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/public-api/object/property-map.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-  //Keeps information about each model for access.
-  struct Model
-  {
-    Control control; // Control housing the mesh renderer of the model.
-    Vector2 rotation; // Keeps track of rotation about x and y axis for manual rotation.
-    Animation rotationAnimation; // Automatically rotates when left alone.
-  };
-
-  //Files for meshes
-  const char * const MODEL_FILE[] =
-  {
-      DEMO_MODEL_DIR "Dino.obj",
-      DEMO_MODEL_DIR "ToyRobot-Metal.obj",
-      DEMO_MODEL_DIR "Toyrobot-Plastic.obj"
-  };
-
-  const char * const MATERIAL_FILE[] =
-  {
-      DEMO_MODEL_DIR "Dino.mtl",
-      DEMO_MODEL_DIR "ToyRobot-Metal.mtl",
-      DEMO_MODEL_DIR "Toyrobot-Plastic.mtl"
-  };
-
-  const char * const TEXTURES_PATH( DEMO_IMAGE_DIR "" );
-
-  //Possible shader options.
-  const char * const SHADER_TYPE[] =
-  {
-    "ALL_TEXTURES",
-    "DIFFUSE_TEXTURE",
-    "TEXTURELESS"
-  };
-
-  //Files for background and toolbar
-  const char * const BACKGROUND_IMAGE( DEMO_IMAGE_DIR "background-1.jpg");
-
-  const float X_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
-  const float Y_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
-  const float MODEL_SCALE = 0.75f;
-  const int NUM_MESHES = 3;
-
-  //Used to identify actors.
-  const int MODEL_TAG = 0;
-  const int LIGHT_TAG = 1;
-  const int LAYER_TAG = 2;
-
-} //End namespace
-
-class MeshRendererController : public ConnectionTracker
-{
-public:
-
-  MeshRendererController( Application& application )
-  : mApplication( application ),   //Store handle to the application.
-    mModelIndex( 1 ),              //Start with metal robot.
-    mShaderIndex( 0 ),             //Start with all textures.
-    mTag( -1 ),                    //Non-valid default, which will get set to a correct value when used.
-    mSelectedModelIndex( -1 ),     //Non-valid default, which will get set to a correct value when used.
-    mPaused( false )               //Animations play by default.
-  {
-    // Connect to the Application's Init signal
-    mApplication.InitSignal().Connect( this, &MeshRendererController::Create );
-  }
-
-  ~MeshRendererController()
-  {
-  }
-
-  // The Init signal is received once (only) during the Application lifetime
-  void Create( Application& application )
-  {
-    // Get a handle to the stage
-    Stage stage = Stage::GetCurrent();
-
-    //Add background
-    ImageView backView = ImageView::New( BACKGROUND_IMAGE );
-    backView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    stage.Add( backView );
-
-    //Setup and load the 3D models and buttons
-    LoadScene();
-
-    //Allow for exiting of the application via key presses.
-    stage.KeyEventSignal().Connect( this, &MeshRendererController::OnKeyEvent );
-  }
-
-  //Sets up the on-screen elements.
-  void LoadScene()
-  {
-    Stage stage = Stage::GetCurrent();
-
-    //Set up layer to place objects on.
-    Layer baseLayer = Layer::New();
-    baseLayer.SetParentOrigin( ParentOrigin::CENTER );
-    baseLayer.SetAnchorPoint( AnchorPoint::CENTER );
-    baseLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-    baseLayer.SetBehavior( Layer::LAYER_2D ); //We use a 2D layer as this is closer to UI work than full 3D scene creation.
-    baseLayer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so.
-    baseLayer.RegisterProperty( "Tag", LAYER_TAG ); //Used to differentiate between different kinds of actor.
-    baseLayer.TouchedSignal().Connect( this, &MeshRendererController::OnTouch );
-    stage.Add( baseLayer );
-
-    //Add containers to house each renderer-holding-actor.
-    for( int i = 0; i < NUM_MESHES; i++ )
-    {
-      mContainers[i] = Actor::New();
-      mContainers[i].SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mContainers[i].RegisterProperty( "Tag", MODEL_TAG ); //Used to differentiate between different kinds of actor.
-      mContainers[i].RegisterProperty( "Model", Property::Value( i ) ); //Used to index into the model.
-
-      //Position each container on screen
-      if( i == 0 )
-      {
-        //Main, central model
-        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE, MODEL_SCALE, 0.0f ) );
-        mContainers[i].SetParentOrigin( ParentOrigin::CENTER );
-        mContainers[i].SetAnchorPoint( AnchorPoint::CENTER );
-      }
-      else if( i == 1 )
-      {
-        //Top left model
-        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) );
-        mContainers[i].SetParentOrigin( Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left
-        mContainers[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
-      }
-      else if( i == 2 )
-      {
-        //Top right model
-        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) );
-        mContainers[i].SetParentOrigin( Vector3( 0.95, 0.03, 0.5 ) ); //Offset from top right
-        mContainers[i].SetAnchorPoint( AnchorPoint::TOP_RIGHT );
-      }
-
-      mContainers[i].TouchedSignal().Connect( this, &MeshRendererController::OnTouch );
-      baseLayer.Add( mContainers[i] );
-    }
-
-    //Set up models
-    for( int i = 0; i < NUM_MESHES; i++ )
-    {
-      //Create control to display model
-      Control control = Control::New();
-      control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      control.SetParentOrigin( ParentOrigin::CENTER );
-      control.SetAnchorPoint( AnchorPoint::CENTER );
-      mContainers[i].Add( control );
-
-      //Make model spin to demonstrate 3D
-      Animation rotationAnimation = Animation::New( 15.0f );
-      float spin = i % 2 == 0 ? 1.0f : -1.0f; //Make actors spin in different directions to better show independence.
-      rotationAnimation.AnimateBy( Property( control, Actor::Property::ORIENTATION ),
-                                   Quaternion( Degree( 0.0f ), Degree( spin * 360.0f ), Degree( 0.0f ) ) );
-      rotationAnimation.SetLooping( true );
-      rotationAnimation.Play();
-
-      //Store model information in corresponding structs.
-      mModels[i].control = control;
-      mModels[i].rotation.x = 0.0f;
-      mModels[i].rotation.y = 0.0f;
-      mModels[i].rotationAnimation = rotationAnimation;
-    }
-
-    //Calling this sets the model in the controls.
-    ReloadModel();
-
-    //Create button for model changing
-    Toolkit::PushButton modelButton = Toolkit::PushButton::New();
-    modelButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-    modelButton.ClickedSignal().Connect( this, &MeshRendererController::OnChangeModelClicked );
-    modelButton.SetParentOrigin( Vector3( 0.05, 0.95, 0.5 ) ); //Offset from bottom left
-    modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
-    modelButton.SetLabelText( "Change Model" );
-    baseLayer.Add( modelButton );
-
-    //Create button for shader changing
-    Toolkit::PushButton shaderButton = Toolkit::PushButton::New();
-    shaderButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-    shaderButton.ClickedSignal().Connect( this, &MeshRendererController::OnChangeShaderClicked );
-    shaderButton.SetParentOrigin( Vector3( 0.95, 0.95, 0.5 ) ); //Offset from bottom right
-    shaderButton.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
-    shaderButton.SetLabelText( "Change Shader" );
-    baseLayer.Add( shaderButton );
-
-    //Create button for pausing animations
-    Toolkit::PushButton pauseButton = Toolkit::PushButton::New();
-    pauseButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-    pauseButton.ClickedSignal().Connect( this, &MeshRendererController::OnPauseClicked );
-    pauseButton.SetParentOrigin( Vector3( 0.5, 0.95, 0.5 ) ); //Offset from bottom center
-    pauseButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    pauseButton.SetLabelText( " || " );
-    baseLayer.Add( pauseButton );
-
-    //Create control to act as light source of scene.
-    mLightSource = Control::New();
-    mLightSource.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
-    mLightSource.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
-    mLightSource.RegisterProperty( "Tag", LIGHT_TAG );
-
-    //Set position relative to top left, as the light source property is also relative to the top left.
-    mLightSource.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mLightSource.SetAnchorPoint( AnchorPoint::CENTER );
-    mLightSource.SetPosition( Stage::GetCurrent().GetSize().x * 0.5f, Stage::GetCurrent().GetSize().y * 0.1f );
-
-    //Make white background.
-    Property::Map lightMap;
-    lightMap.Insert( "rendererType", "COLOR" );
-    lightMap.Insert( "mixColor", Color::WHITE );
-    mLightSource.SetProperty( Control::Property::BACKGROUND, Property::Value( lightMap ) );
-
-    //Label to show what this actor is for the user.
-    TextLabel lightLabel = TextLabel::New( "Light" );
-    lightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
-    lightLabel.SetParentOrigin( ParentOrigin::CENTER );
-    lightLabel.SetAnchorPoint( AnchorPoint::CENTER );
-    float padding = 5.0f;
-    lightLabel.SetPadding( Padding( padding, padding, padding, padding ) );
-    mLightSource.Add( lightLabel );
-
-    //Connect to touch signal for dragging.
-    mLightSource.TouchedSignal().Connect( this, &MeshRendererController::OnTouch );
-
-    //Place the light source on a layer above the base, so that it is rendered above everything else.
-    Layer upperLayer = Layer::New();
-    baseLayer.Add( upperLayer );
-    upperLayer.Add( mLightSource );
-
-    //Calling this sets the light position of each model to that of the light source control.
-    UpdateLight();
-  }
-
-  //Updates the displayed models to account for parameter changes.
-  void ReloadModel()
-  {
-    //Create mesh property map
-    Property::Map map;
-    map.Insert( "rendererType", "MESH" );
-    map.Insert( "objectUrl", MODEL_FILE[mModelIndex] );
-    map.Insert( "materialUrl", MATERIAL_FILE[mModelIndex] );
-    map.Insert( "texturesPath", TEXTURES_PATH );
-    map.Insert( "shaderType", SHADER_TYPE[mShaderIndex] );
-    map.Insert( "useSoftNormals", false );
-
-    //Set the two controls to use the mesh
-    for( int i = 0; i < NUM_MESHES; i++ )
-    {
-      mModels[i].control.SetProperty( Control::Property::BACKGROUND, Property::Value( map ) );
-    }
-  }
-
-  //Updates the light position for each model to account for changes in the source on screen.
-  void UpdateLight()
-  {
-    //Set light position to the x and y of the light control, offset out of the screen.
-    Vector3 controlPosition = mLightSource.GetCurrentPosition();
-    Vector3 lightPosition = Vector3( controlPosition.x, controlPosition.y, Stage::GetCurrent().GetSize().x * 2.0f );
-
-    for( int i = 0; i < NUM_MESHES; ++i )
-    {
-      mModels[i].control.RegisterProperty( "lightPosition", lightPosition, Property::ANIMATABLE );
-    }
-  }
-
-  //If the light source is touched, move it by dragging it.
-  //If a model is touched, rotate it by panning around.
-  bool OnTouch( Actor actor, const TouchEvent& event )
-  {
-    //Get primary touch point.
-    const Dali::TouchPoint& point = event.GetPoint( 0 );
-
-    switch( point.state )
-    {
-      case TouchPoint::Down:
-      {
-        //Determine what was touched.
-        actor.GetProperty( actor.GetPropertyIndex( "Tag" ) ).Get( mTag );
-
-        if( mTag == MODEL_TAG )
-        {
-          //Find out which model has been selected
-          actor.GetProperty( actor.GetPropertyIndex( "Model" ) ).Get( mSelectedModelIndex );
-
-          //Pause current animation, as the touch gesture will be used to manually rotate the model
-          mModels[mSelectedModelIndex].rotationAnimation.Pause();
-
-          //Store start points.
-          mPanStart = point.screen;
-          mRotationStart = mModels[mSelectedModelIndex].rotation;
-        }
-
-        break;
-      }
-      case TouchPoint::Motion:
-      {
-        //Switch on the kind of actor we're interacting with.
-        switch( mTag )
-        {
-          case MODEL_TAG: //Rotate model
-          {
-            //Calculate displacement and corresponding rotation.
-            Vector2 displacement = point.screen - mPanStart;
-            mModels[mSelectedModelIndex].rotation = Vector2( mRotationStart.x - displacement.y / Y_ROTATION_DISPLACEMENT_FACTOR,   // Y displacement rotates around X axis
-                                                             mRotationStart.y + displacement.x / X_ROTATION_DISPLACEMENT_FACTOR ); // X displacement rotates around Y axis
-            Quaternion rotation = Quaternion( Radian( mModels[mSelectedModelIndex].rotation.x ), Vector3::XAXIS) *
-                                  Quaternion( Radian( mModels[mSelectedModelIndex].rotation.y ), Vector3::YAXIS);
-
-            //Apply rotation.
-            mModels[mSelectedModelIndex].control.SetOrientation( rotation );
-
-            break;
-          }
-          case LIGHT_TAG: //Drag light
-          {
-            //Set light source to new position and update the models accordingly.
-            mLightSource.SetPosition( Vector3( point.screen ) );
-            UpdateLight();
-
-            break;
-          }
-        }
-
-        break;
-      }
-      case TouchPoint::Interrupted: //Same as finished.
-      case TouchPoint::Finished:
-      {
-        if( mTag == MODEL_TAG )
-        {
-          //Return to automatic animation
-          if( !mPaused )
-          {
-            mModels[mSelectedModelIndex].rotationAnimation.Play();
-          }
-        }
-
-        break;
-      }
-      default:
-      {
-        //Other touch states do nothing.
-        break;
-      }
-    }
-
-    return true;
-  }
-
-  //Cycle through the list of models.
-  bool OnChangeModelClicked( Toolkit::Button button )
-  {
-    ++mModelIndex %= 3;
-
-    ReloadModel();
-
-    return true;
-  }
-
-  //Cycle through the list of shaders.
-  bool OnChangeShaderClicked( Toolkit::Button button )
-  {
-    ++mShaderIndex %= 3;
-
-    ReloadModel();
-
-    return true;
-  }
-
-  //Pause all animations, and keep them paused even after user panning.
-  //This button is a toggle, so pressing again will start the animations again.
-  bool OnPauseClicked( Toolkit::Button button )
-  {
-    //Toggle pause state.
-    mPaused = !mPaused;
-
-    //If we wish to pause animations, do so and keep them paused.
-    if( mPaused )
-    {
-      for( int i = 0; i < NUM_MESHES ; ++i )
-      {
-        mModels[i].rotationAnimation.Pause();
-      }
-
-      button.SetLabelText( " > " );
-    }
-    else //Unpause all animations again.
-    {
-      for( int i = 0; i < NUM_MESHES ; ++i )
-      {
-        mModels[i].rotationAnimation.Play();
-      }
-
-      button.SetLabelText( " || " );
-    }
-
-    return true;
-  }
-
-  //If escape or the back button is pressed, quit the application (and return to the launcher)
-  void OnKeyEvent( const KeyEvent& event )
-  {
-    if( event.state == KeyEvent::Down )
-    {
-      if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
-      {
-        mApplication.Quit();
-      }
-    }
-  }
-
-private:
-  Application&  mApplication;
-
-  //The models displayed on screen, including information about rotation.
-  Model mModels[NUM_MESHES];
-  Actor mContainers[NUM_MESHES];
-
-  //Acts as a global light source, which can be dragged around.
-  Control mLightSource;
-
-  //Used to detect panning to rotate the selected model.
-  Vector2 mPanStart;
-  Vector2 mRotationStart;
-
-  int mModelIndex; //Index of model to load.
-  int mShaderIndex; //Index of shader type to use.
-  int mTag; //Identifies what kind of actor has been selected in OnTouch.
-  int mSelectedModelIndex; //Index of model selected on screen.
-  bool mPaused; //If true, all animations are paused and should stay so.
-};
-
-void RunTest( Application& application )
-{
-  MeshRendererController test( application );
-
-  application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
-int main( int argc, char **argv )
-{
-  Application application = Application::New( &argc, &argv );
-
-  RunTest( application );
-
-  return 0;
-}
diff --git a/examples/mesh-visual/mesh-visual-example.cpp b/examples/mesh-visual/mesh-visual-example.cpp
new file mode 100644 (file)
index 0000000..b157f63
--- /dev/null
@@ -0,0 +1,446 @@
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/public-api/object/property-map.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+  //Keeps information about each model for access.
+  struct Model
+  {
+    Control control; // Control housing the mesh visual of the model.
+    Vector2 rotation; // Keeps track of rotation about x and y axis for manual rotation.
+    Animation rotationAnimation; // Automatically rotates when left alone.
+  };
+
+  //Files for meshes
+  const char * const MODEL_FILE[] =
+  {
+      DEMO_MODEL_DIR "Dino.obj",
+      DEMO_MODEL_DIR "ToyRobot-Metal.obj",
+      DEMO_MODEL_DIR "Toyrobot-Plastic.obj"
+  };
+
+  const char * const MATERIAL_FILE[] =
+  {
+      DEMO_MODEL_DIR "Dino.mtl",
+      DEMO_MODEL_DIR "ToyRobot-Metal.mtl",
+      DEMO_MODEL_DIR "Toyrobot-Plastic.mtl"
+  };
+
+  const char * const TEXTURES_PATH( DEMO_IMAGE_DIR "" );
+
+  //Possible shading modes.
+  MeshVisual::ShadingMode::Value SHADING_MODE_TABLE[] =
+  {
+    MeshVisual::ShadingMode::TEXTURED_WITH_DETAILED_SPECULAR_LIGHTING,
+    MeshVisual::ShadingMode::TEXTURED_WITH_SPECULAR_LIGHTING,
+    MeshVisual::ShadingMode::TEXTURELESS_WITH_DIFFUSE_LIGHTING
+  };
+
+  //Files for background and toolbar
+  const char * const BACKGROUND_IMAGE( DEMO_IMAGE_DIR "background-1.jpg");
+
+  const float X_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
+  const float Y_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
+  const float MODEL_SCALE = 0.75f;
+  const int NUM_MESHES = 3;
+
+  //Used to identify actors.
+  const int MODEL_TAG = 0;
+  const int LIGHT_TAG = 1;
+  const int LAYER_TAG = 2;
+
+} //End namespace
+
+class MeshVisualController : public ConnectionTracker
+{
+public:
+
+  MeshVisualController( Application& application )
+  : mApplication( application ),   //Store handle to the application.
+    mModelIndex( 1 ),              //Start with metal robot.
+    mShadingModeIndex( 0 ),        //Start with textured with detailed specular lighting.
+    mTag( -1 ),                    //Non-valid default, which will get set to a correct value when used.
+    mSelectedModelIndex( -1 ),     //Non-valid default, which will get set to a correct value when used.
+    mPaused( false )               //Animations play by default.
+  {
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect( this, &MeshVisualController::Create );
+  }
+
+  ~MeshVisualController()
+  {
+  }
+
+  // The Init signal is received once (only) during the Application lifetime
+  void Create( Application& application )
+  {
+    // Get a handle to the stage
+    Stage stage = Stage::GetCurrent();
+
+    //Add background
+    ImageView backView = ImageView::New( BACKGROUND_IMAGE );
+    backView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    stage.Add( backView );
+
+    //Setup and load the 3D models and buttons
+    LoadScene();
+
+    //Allow for exiting of the application via key presses.
+    stage.KeyEventSignal().Connect( this, &MeshVisualController::OnKeyEvent );
+  }
+
+  //Sets up the on-screen elements.
+  void LoadScene()
+  {
+    Stage stage = Stage::GetCurrent();
+
+    //Set up layer to place objects on.
+    Layer baseLayer = Layer::New();
+    baseLayer.SetParentOrigin( ParentOrigin::CENTER );
+    baseLayer.SetAnchorPoint( AnchorPoint::CENTER );
+    baseLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+    baseLayer.SetBehavior( Layer::LAYER_2D ); //We use a 2D layer as this is closer to UI work than full 3D scene creation.
+    baseLayer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so.
+    baseLayer.RegisterProperty( "Tag", LAYER_TAG ); //Used to differentiate between different kinds of actor.
+    baseLayer.TouchedSignal().Connect( this, &MeshVisualController::OnTouch );
+    stage.Add( baseLayer );
+
+    //Add containers to house each visual-holding-actor.
+    for( int i = 0; i < NUM_MESHES; i++ )
+    {
+      mContainers[i] = Actor::New();
+      mContainers[i].SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+      mContainers[i].RegisterProperty( "Tag", MODEL_TAG ); //Used to differentiate between different kinds of actor.
+      mContainers[i].RegisterProperty( "Model", Property::Value( i ) ); //Used to index into the model.
+
+      //Position each container on screen
+      if( i == 0 )
+      {
+        //Main, central model
+        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE, MODEL_SCALE, 0.0f ) );
+        mContainers[i].SetParentOrigin( ParentOrigin::CENTER );
+        mContainers[i].SetAnchorPoint( AnchorPoint::CENTER );
+      }
+      else if( i == 1 )
+      {
+        //Top left model
+        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) );
+        mContainers[i].SetParentOrigin( Vector3( 0.05, 0.03, 0.5 ) ); //Offset from top left
+        mContainers[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
+      }
+      else if( i == 2 )
+      {
+        //Top right model
+        mContainers[i].SetSizeModeFactor( Vector3( MODEL_SCALE / 3.0f, MODEL_SCALE / 3.0f, 0.0f ) );
+        mContainers[i].SetParentOrigin( Vector3( 0.95, 0.03, 0.5 ) ); //Offset from top right
+        mContainers[i].SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+      }
+
+      mContainers[i].TouchedSignal().Connect( this, &MeshVisualController::OnTouch );
+      baseLayer.Add( mContainers[i] );
+    }
+
+    //Set up models
+    for( int i = 0; i < NUM_MESHES; i++ )
+    {
+      //Create control to display model
+      Control control = Control::New();
+      control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+      control.SetParentOrigin( ParentOrigin::CENTER );
+      control.SetAnchorPoint( AnchorPoint::CENTER );
+      mContainers[i].Add( control );
+
+      //Make model spin to demonstrate 3D
+      Animation rotationAnimation = Animation::New( 15.0f );
+      float spin = i % 2 == 0 ? 1.0f : -1.0f; //Make actors spin in different directions to better show independence.
+      rotationAnimation.AnimateBy( Property( control, Actor::Property::ORIENTATION ),
+                                   Quaternion( Degree( 0.0f ), Degree( spin * 360.0f ), Degree( 0.0f ) ) );
+      rotationAnimation.SetLooping( true );
+      rotationAnimation.Play();
+
+      //Store model information in corresponding structs.
+      mModels[i].control = control;
+      mModels[i].rotation.x = 0.0f;
+      mModels[i].rotation.y = 0.0f;
+      mModels[i].rotationAnimation = rotationAnimation;
+    }
+
+    //Calling this sets the model in the controls.
+    ReloadModel();
+
+    //Create button for model changing
+    Toolkit::PushButton modelButton = Toolkit::PushButton::New();
+    modelButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    modelButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeModelClicked );
+    modelButton.SetParentOrigin( Vector3( 0.05, 0.95, 0.5 ) ); //Offset from bottom left
+    modelButton.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+    modelButton.SetLabelText( "Change Model" );
+    baseLayer.Add( modelButton );
+
+    //Create button for shader changing
+    Toolkit::PushButton shaderButton = Toolkit::PushButton::New();
+    shaderButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    shaderButton.ClickedSignal().Connect( this, &MeshVisualController::OnChangeShaderClicked );
+    shaderButton.SetParentOrigin( Vector3( 0.95, 0.95, 0.5 ) ); //Offset from bottom right
+    shaderButton.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
+    shaderButton.SetLabelText( "Change Shader" );
+    baseLayer.Add( shaderButton );
+
+    //Create button for pausing animations
+    Toolkit::PushButton pauseButton = Toolkit::PushButton::New();
+    pauseButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    pauseButton.ClickedSignal().Connect( this, &MeshVisualController::OnPauseClicked );
+    pauseButton.SetParentOrigin( Vector3( 0.5, 0.95, 0.5 ) ); //Offset from bottom center
+    pauseButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+    pauseButton.SetLabelText( " || " );
+    baseLayer.Add( pauseButton );
+
+    //Create control to act as light source of scene.
+    mLightSource = Control::New();
+    mLightSource.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
+    mLightSource.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+    mLightSource.RegisterProperty( "Tag", LIGHT_TAG );
+
+    //Set position relative to top left, as the light source property is also relative to the top left.
+    mLightSource.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mLightSource.SetAnchorPoint( AnchorPoint::CENTER );
+    mLightSource.SetPosition( Stage::GetCurrent().GetSize().x * 0.5f, Stage::GetCurrent().GetSize().y * 0.1f );
+
+    //Make white background.
+    Property::Map lightMap;
+    lightMap.Insert( Visual::Property::TYPE,  Visual::COLOR );
+    lightMap.Insert( ColorVisual::Property::MIX_COLOR, Color::WHITE );
+    mLightSource.SetProperty( Control::Property::BACKGROUND, Property::Value( lightMap ) );
+
+    //Label to show what this actor is for the user.
+    TextLabel lightLabel = TextLabel::New( "Light" );
+    lightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+    lightLabel.SetParentOrigin( ParentOrigin::CENTER );
+    lightLabel.SetAnchorPoint( AnchorPoint::CENTER );
+    float padding = 5.0f;
+    lightLabel.SetPadding( Padding( padding, padding, padding, padding ) );
+    mLightSource.Add( lightLabel );
+
+    //Connect to touch signal for dragging.
+    mLightSource.TouchedSignal().Connect( this, &MeshVisualController::OnTouch );
+
+    //Place the light source on a layer above the base, so that it is rendered above everything else.
+    Layer upperLayer = Layer::New();
+    baseLayer.Add( upperLayer );
+    upperLayer.Add( mLightSource );
+
+    //Calling this sets the light position of each model to that of the light source control.
+    UpdateLight();
+  }
+
+  //Updates the displayed models to account for parameter changes.
+  void ReloadModel()
+  {
+    //Create mesh property map
+    Property::Map map;
+    map.Insert( Visual::Property::TYPE,  Visual::MESH );
+    map.Insert( MeshVisual::Property::OBJECT_URL, MODEL_FILE[mModelIndex] );
+    map.Insert( MeshVisual::Property::MATERIAL_URL, MATERIAL_FILE[mModelIndex] );
+    map.Insert( MeshVisual::Property::TEXTURES_PATH, TEXTURES_PATH );
+    map.Insert( MeshVisual::Property::SHADING_MODE, SHADING_MODE_TABLE[mShadingModeIndex] );
+    map.Insert( MeshVisual::Property::USE_SOFT_NORMALS, false );
+
+    //Set the two controls to use the mesh
+    for( int i = 0; i < NUM_MESHES; i++ )
+    {
+      mModels[i].control.SetProperty( Control::Property::BACKGROUND, Property::Value( map ) );
+    }
+  }
+
+  //Updates the light position for each model to account for changes in the source on screen.
+  void UpdateLight()
+  {
+    //Set light position to the x and y of the light control, offset out of the screen.
+    Vector3 controlPosition = mLightSource.GetCurrentPosition();
+    Vector3 lightPosition = Vector3( controlPosition.x, controlPosition.y, Stage::GetCurrent().GetSize().x * 2.0f );
+
+    for( int i = 0; i < NUM_MESHES; ++i )
+    {
+      mModels[i].control.RegisterProperty( "lightPosition", lightPosition, Property::ANIMATABLE );
+    }
+  }
+
+  //If the light source is touched, move it by dragging it.
+  //If a model is touched, rotate it by panning around.
+  bool OnTouch( Actor actor, const TouchEvent& event )
+  {
+    //Get primary touch point.
+    const Dali::TouchPoint& point = event.GetPoint( 0 );
+
+    switch( point.state )
+    {
+      case TouchPoint::Down:
+      {
+        //Determine what was touched.
+        actor.GetProperty( actor.GetPropertyIndex( "Tag" ) ).Get( mTag );
+
+        if( mTag == MODEL_TAG )
+        {
+          //Find out which model has been selected
+          actor.GetProperty( actor.GetPropertyIndex( "Model" ) ).Get( mSelectedModelIndex );
+
+          //Pause current animation, as the touch gesture will be used to manually rotate the model
+          mModels[mSelectedModelIndex].rotationAnimation.Pause();
+
+          //Store start points.
+          mPanStart = point.screen;
+          mRotationStart = mModels[mSelectedModelIndex].rotation;
+        }
+
+        break;
+      }
+      case TouchPoint::Motion:
+      {
+        //Switch on the kind of actor we're interacting with.
+        switch( mTag )
+        {
+          case MODEL_TAG: //Rotate model
+          {
+            //Calculate displacement and corresponding rotation.
+            Vector2 displacement = point.screen - mPanStart;
+            mModels[mSelectedModelIndex].rotation = Vector2( mRotationStart.x - displacement.y / Y_ROTATION_DISPLACEMENT_FACTOR,   // Y displacement rotates around X axis
+                                                             mRotationStart.y + displacement.x / X_ROTATION_DISPLACEMENT_FACTOR ); // X displacement rotates around Y axis
+            Quaternion rotation = Quaternion( Radian( mModels[mSelectedModelIndex].rotation.x ), Vector3::XAXIS) *
+                                  Quaternion( Radian( mModels[mSelectedModelIndex].rotation.y ), Vector3::YAXIS);
+
+            //Apply rotation.
+            mModels[mSelectedModelIndex].control.SetOrientation( rotation );
+
+            break;
+          }
+          case LIGHT_TAG: //Drag light
+          {
+            //Set light source to new position and update the models accordingly.
+            mLightSource.SetPosition( Vector3( point.screen ) );
+            UpdateLight();
+
+            break;
+          }
+        }
+
+        break;
+      }
+      case TouchPoint::Interrupted: //Same as finished.
+      case TouchPoint::Finished:
+      {
+        if( mTag == MODEL_TAG )
+        {
+          //Return to automatic animation
+          if( !mPaused )
+          {
+            mModels[mSelectedModelIndex].rotationAnimation.Play();
+          }
+        }
+
+        break;
+      }
+      default:
+      {
+        //Other touch states do nothing.
+        break;
+      }
+    }
+
+    return true;
+  }
+
+  //Cycle through the list of models.
+  bool OnChangeModelClicked( Toolkit::Button button )
+  {
+    ++mModelIndex %= 3;
+
+    ReloadModel();
+
+    return true;
+  }
+
+  //Cycle through the list of shaders.
+  bool OnChangeShaderClicked( Toolkit::Button button )
+  {
+    ++mShadingModeIndex %= 3;
+
+    ReloadModel();
+
+    return true;
+  }
+
+  //Pause all animations, and keep them paused even after user panning.
+  //This button is a toggle, so pressing again will start the animations again.
+  bool OnPauseClicked( Toolkit::Button button )
+  {
+    //Toggle pause state.
+    mPaused = !mPaused;
+
+    //If we wish to pause animations, do so and keep them paused.
+    if( mPaused )
+    {
+      for( int i = 0; i < NUM_MESHES ; ++i )
+      {
+        mModels[i].rotationAnimation.Pause();
+      }
+
+      button.SetLabelText( " > " );
+    }
+    else //Unpause all animations again.
+    {
+      for( int i = 0; i < NUM_MESHES ; ++i )
+      {
+        mModels[i].rotationAnimation.Play();
+      }
+
+      button.SetLabelText( " || " );
+    }
+
+    return true;
+  }
+
+  //If escape or the back button is pressed, quit the application (and return to the launcher)
+  void OnKeyEvent( const KeyEvent& event )
+  {
+    if( event.state == KeyEvent::Down )
+    {
+      if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
+      {
+        mApplication.Quit();
+      }
+    }
+  }
+
+private:
+  Application&  mApplication;
+
+  //The models displayed on screen, including information about rotation.
+  Model mModels[NUM_MESHES];
+  Actor mContainers[NUM_MESHES];
+
+  //Acts as a global light source, which can be dragged around.
+  Control mLightSource;
+
+  //Used to detect panning to rotate the selected model.
+  Vector2 mPanStart;
+  Vector2 mRotationStart;
+
+  int mModelIndex; //Index of model to load.
+  int mShadingModeIndex; //Index of shader type to use.
+  int mTag; //Identifies what kind of actor has been selected in OnTouch.
+  int mSelectedModelIndex; //Index of model selected on screen.
+  bool mPaused; //If true, all animations are paused and should stay so.
+};
+
+// Entry point for Linux & Tizen applications
+//
+int main( int argc, char **argv )
+{
+  Application application = Application::New( &argc, &argv );
+  MeshVisualController test( application );
+  application.MainLoop();
+  return 0;
+}
index 6b6f0f296cd32f54c2b2874b0d2621819305d950..74c11fc8d548a15667a12943a8153c04f7fa5e08 100644 (file)
@@ -103,13 +103,13 @@ const float ORIENTATION_DURATION = 0.5f;                  ///< Time to rotate to
 void SetImageFittedInBox( ImageView& imageView, Property::Map& shaderEffect, const char * const imagePath, int maxWidth, int maxHeight )
 {
   Property::Map map;
-  map["rendererType"] = "IMAGE";
-  map["url"] = imagePath;
+  map[Visual::Property::TYPE] = Visual::IMAGE;
+  map[ImageVisual::Property::URL] = imagePath;
   // Load the image nicely scaled-down to fit within the specified max width and height:
-  map["desiredWidth"] = maxWidth;
-  map["desiredHeight"] = maxHeight;
-  map["fittingMode"] = "SHRINK_TO_FIT";
-  map["samplingMode"] = "BOX_THEN_LINEAR";
+  map[ImageVisual::Property::DESIRED_WIDTH] = maxWidth;
+  map[ImageVisual::Property::DESIRED_HEIGHT] = maxHeight;
+  map[ImageVisual::Property::FITTING_MODE] = FittingMode::SHRINK_TO_FIT;
+  map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
   map.Merge( shaderEffect );
 
   imageView.SetProperty( ImageView::Property::IMAGE, map );
index 6d6f1ade17f857cf54f06709957288eb56d214a8..bf8478dc324f7d7a5ed6ac1518f93323bc2bf82c 100644 (file)
@@ -19,15 +19,6 @@ namespace
     DEMO_IMAGE_DIR "octahedron-button.png"
   };
 
-  //Shape names
-  const char * const SHAPE_SPHERE = "SPHERE";
-  const char * const SHAPE_CONE = "CONE";
-  const char * const SHAPE_CONICAL_FRUSTRUM = "CONICAL_FRUSTRUM";
-  const char * const SHAPE_CYLINDER = "CYLINDER";
-  const char * const SHAPE_CUBE = "CUBE";
-  const char * const SHAPE_BEVELLED_CUBE = "BEVELLED_CUBE";
-  const char * const SHAPE_OCTAHEDRON = "OCTAHEDRON";
-
   //Shape property defaults
   const int DEFAULT_SLICES = 32;
   const int DEFAULT_STACKS = 32;
@@ -278,7 +269,7 @@ public:
   //
   void SetupModel( Layer layer )
   {
-    //Create a container to house the renderer-holding actor, to provide a constant hitbox.
+    //Create a container to house the visual-holding actor, to provide a constant hitbox.
     Actor container = Actor::New();
     container.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
     container.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) );  //90% of width, 30% of height.
@@ -309,7 +300,7 @@ public:
     mPanGestureDetector.DetectedSignal().Connect( this, &PrimitiveShapesController::OnPan );
   }
 
-  //Clears all sliders and resets the primitive renderer property map.
+  //Clears all sliders and resets the primitive visual property map.
   void InitialiseSlidersAndModel()
   {
     //Sliders
@@ -321,10 +312,10 @@ public:
       mSliderLabels.at( i ).SetVisible( false );
     }
 
-    //Renderer map for model
-    mRendererMap.Clear();
-    mRendererMap[ "rendererType" ] = "PRIMITIVE";
-    mRendererMap[ "shapeColor"   ] = mColor;
+    //Visual map for model
+    mVisualMap.Clear();
+    mVisualMap[ Visual::Property::TYPE           ] = Visual::PRIMITIVE;
+    mVisualMap[ PrimitiveVisual::Property::COLOR ] = mColor;
   }
 
   //Sets the 3D model to a sphere and modifies the sliders appropriately.
@@ -332,19 +323,19 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape"        ] = SHAPE_SPHERE;
-    mRendererMap[ "slices"       ] = DEFAULT_SLICES;
-    mRendererMap[ "stacks"       ] = DEFAULT_STACKS;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE  ] = PrimitiveVisual::Shape::SPHERE;
+    mVisualMap[ PrimitiveVisual::Property::SLICES ] = DEFAULT_SLICES;
+    mVisualMap[ PrimitiveVisual::Property::STACKS ] = DEFAULT_STACKS;
 
     //Set up sliders.
-    SetupSlider( 0, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, "slices" );
+    SetupSlider( 0, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
     SetupMarks( mSliders.at( 0 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
-    SetupSlider( 1, STACKS_LOWER_BOUND, STACKS_UPPER_BOUND, DEFAULT_STACKS, "stacks" );
+    SetupSlider( 1, STACKS_LOWER_BOUND, STACKS_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::STACKS, "stacks" );
     SetupMarks( mSliders.at( 1 ), STACKS_LOWER_BOUND, STACKS_UPPER_BOUND );
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to a cone and modifies the sliders appropriately.
@@ -352,20 +343,20 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape"             ] = SHAPE_CONE;
-    mRendererMap[ "scaleHeight"       ] = DEFAULT_SCALE_HEIGHT;
-    mRendererMap[ "scaleBottomRadius" ] = DEFAULT_SCALE_BOTTOM_RADIUS;
-    mRendererMap[ "slices"            ] = DEFAULT_SLICES;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE               ] = PrimitiveVisual::Shape::CONE;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT        ] = DEFAULT_SCALE_HEIGHT;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS ] = DEFAULT_SCALE_BOTTOM_RADIUS;
+    mVisualMap[ PrimitiveVisual::Property::SLICES              ] = DEFAULT_SLICES;
 
     //Set up sliders.
-    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, "scaleHeight" );
-    SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
-    SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, "slices" );
+    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
+    SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
+    SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
     SetupMarks( mSliders.at( 2 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to a conical frustrum and modifies the sliders appropriately.
@@ -373,20 +364,20 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape"             ] = SHAPE_CONICAL_FRUSTRUM;
-    mRendererMap[ "scaleTopRadius"    ] = DEFAULT_SCALE_TOP_RADIUS;
-    mRendererMap[ "scaleBottomRadius" ] = DEFAULT_SCALE_BOTTOM_RADIUS;
-    mRendererMap[ "scaleHeight"       ] = DEFAULT_SCALE_HEIGHT;
-    mRendererMap[ "slices"            ] = DEFAULT_SLICES;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE               ] = PrimitiveVisual::Shape::CONICAL_FRUSTRUM;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_TOP_RADIUS    ] = DEFAULT_SCALE_TOP_RADIUS;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS ] = DEFAULT_SCALE_BOTTOM_RADIUS;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT        ] = DEFAULT_SCALE_HEIGHT;
+    mVisualMap[ PrimitiveVisual::Property::SLICES              ] = DEFAULT_SLICES;
 
     //Set up used sliders.
-    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, "scaleHeight" );
-    SetupSlider( 1, 0.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
-    SetupSlider( 2, 0.0f, 32.0f, DEFAULT_SCALE_TOP_RADIUS, "scaleTopRadius" );
+    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
+    SetupSlider( 1, 0.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
+    SetupSlider( 2, 0.0f, 32.0f, DEFAULT_SCALE_TOP_RADIUS, PrimitiveVisual::Property::SCALE_TOP_RADIUS, "scaleTopRadius" );
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to a cylinder and modifies the sliders appropriately.
@@ -394,20 +385,20 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape"        ] = SHAPE_CYLINDER;
-    mRendererMap[ "scaleHeight"  ] = DEFAULT_SCALE_HEIGHT;
-    mRendererMap[ "scaleRadius"  ] = DEFAULT_SCALE_RADIUS;
-    mRendererMap[ "slices"       ] = DEFAULT_SLICES;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE        ] = PrimitiveVisual::Shape::CYLINDER;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT ] = DEFAULT_SCALE_HEIGHT;
+    mVisualMap[ PrimitiveVisual::Property::SCALE_RADIUS ] = DEFAULT_SCALE_RADIUS;
+    mVisualMap[ PrimitiveVisual::Property::SLICES       ] = DEFAULT_SLICES;
 
     //Set up used sliders.
-    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, "scaleHeight" );
-    SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_RADIUS, "scaleRadius" );
-    SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, "slices" );
+    SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
+    SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_RADIUS, PrimitiveVisual::Property::SCALE_RADIUS, "scaleRadius" );
+    SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
     SetupMarks( mSliders.at( 2 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to a cube and modifies the sliders appropriately.
@@ -415,11 +406,11 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape" ] = SHAPE_CUBE;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::CUBE;
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to a bevelled cube and modifies the sliders appropriately.
@@ -427,17 +418,17 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape"           ] = SHAPE_BEVELLED_CUBE;
-    mRendererMap[ "bevelPercentage" ] = DEFAULT_BEVEL_PERCENTAGE;
-    mRendererMap[ "bevelSmoothness" ] = DEFAULT_BEVEL_SMOOTHNESS;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE            ] = PrimitiveVisual::Shape::BEVELLED_CUBE;
+    mVisualMap[ PrimitiveVisual::Property::BEVEL_PERCENTAGE ] = DEFAULT_BEVEL_PERCENTAGE;
+    mVisualMap[ PrimitiveVisual::Property::BEVEL_SMOOTHNESS ] = DEFAULT_BEVEL_SMOOTHNESS;
 
     //Set up used sliders.
-    SetupSlider( 0, 0.0f, 1.0f, DEFAULT_BEVEL_PERCENTAGE, "bevelPercentage" );
-    SetupSlider( 1, 0.0f, 1.0f, DEFAULT_BEVEL_SMOOTHNESS, "bevelSmoothness" );
+    SetupSlider( 0, 0.0f, 1.0f, DEFAULT_BEVEL_PERCENTAGE, PrimitiveVisual::Property::BEVEL_PERCENTAGE, "bevelPercentage" );
+    SetupSlider( 1, 0.0f, 1.0f, DEFAULT_BEVEL_SMOOTHNESS, PrimitiveVisual::Property::BEVEL_SMOOTHNESS, "bevelSmoothness" );
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets the 3D model to an octahedron and modifies the sliders appropriately.
@@ -445,20 +436,20 @@ public:
   {
     InitialiseSlidersAndModel();
 
-    //Set up specific renderer properties.
-    mRendererMap[ "shape" ] = SHAPE_OCTAHEDRON;
+    //Set up specific visual properties.
+    mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::OCTAHEDRON;
 
     //Set model in control.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
   }
 
   //Sets up the slider at the given index for the supplied property, and labels it appropriately.
-  // rendererPropertyLabel is the property that will be set by this slider.
+  // visualProperty is the property that will be set by this slider.
   void SetupSlider( int sliderIndex, float lowerBound, float upperBound, float startPoint,
-                    std::string rendererPropertyLabel )
+                    Property::Index visualProperty, std::string visualPropertyLabel )
   {
     //Set up the slider itself.
-    mSliders.at( sliderIndex ).RegisterProperty( "rendererProperty", Property::Value( rendererPropertyLabel ), Property::READ_WRITE );
+    mSliders.at( sliderIndex ).RegisterProperty( "visualProperty", Property::Value( visualProperty ), Property::READ_WRITE );
     mSliders.at( sliderIndex ).SetProperty( Slider::Property::LOWER_BOUND, Property::Value( lowerBound ) );
     mSliders.at( sliderIndex ).SetProperty( Slider::Property::UPPER_BOUND, Property::Value( upperBound ) );
     mSliders.at( sliderIndex ).SetProperty( Slider::Property::VALUE, Property::Value( startPoint ) );
@@ -468,7 +459,7 @@ public:
     //We reset the TextLabel to force a relayout of the table.
     mSliderTable.RemoveChildAt( TableView::CellPosition(sliderIndex, 0) );
 
-    TextLabel sliderLabel = TextLabel::New( rendererPropertyLabel );
+    TextLabel sliderLabel = TextLabel::New( visualPropertyLabel );
     sliderLabel.SetParentOrigin( ParentOrigin::CENTER );
     sliderLabel.SetAnchorPoint( AnchorPoint::CENTER );
     sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
@@ -547,13 +538,13 @@ public:
   //When the slider is adjusted, change the corresponding shape property accordingly.
   bool OnSliderValueChanged( Slider slider, float value )
   {
-    //Update property map to reflect the change to the specific renderer property.
-    std::string rendererPropertyLabel;
-    slider.GetProperty( slider.GetPropertyIndex( "rendererProperty" ) ).Get( rendererPropertyLabel );
-    mRendererMap[ rendererPropertyLabel ] = value;
+    //Update property map to reflect the change to the specific visual property.
+    int visualProperty;
+    slider.GetProperty( slider.GetPropertyIndex( "visualProperty" ) ).Get( visualProperty );
+    mVisualMap[ visualProperty ] = value;
 
     //Reload the model to display the change.
-    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mRendererMap ) );
+    mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
 
     return true;
   }
@@ -622,8 +613,8 @@ private:
   std::vector<TextLabel> mSliderLabels; ///< Holds the labels to each slider.
   TableView mSliderTable; ///< A table to layout the sliders next to their labels.
 
-  Property::Map mRendererMap; ///< Property map to create a primitive renderer.
-  Control mModel; ///< Control to house the primitive renderer.
+  Property::Map mVisualMap; ///< Property map to create a primitive visual.
+  Control mModel; ///< Control to house the primitive visual.
 
   PanGestureDetector mPanGestureDetector; ///< Detects pan gestures for rotation of the model.
   Animation mRotationAnimation; ///< Automatically rotates the model, unless it is being panned.
index 7837be6e447976f32349c712607279295fce50a4..d45f1c9cc66da2ae5c08d8639d2b5aa380b9890a 100644 (file)
@@ -454,12 +454,12 @@ private:
   {
     ImageView actor = ImageView::New();
     Property::Map map;
-    map["rendererType"] = "IMAGE";
-    map["url"] = filename;
-    map["desiredWidth"] = width;
-    map["desiredHeight"] = height;
-    map["fittingMode"] = "SCALE_TO_FILL";
-    map["samplingMode"] = "BOX_THEN_LINEAR";
+    map[Visual::Property::TYPE] = Visual::IMAGE;
+    map[ImageVisual::Property::URL] = filename;
+    map[ImageVisual::Property::DESIRED_WIDTH] = width;
+    map[ImageVisual::Property::DESIRED_HEIGHT] = height;
+    map[ImageVisual::Property::FITTING_MODE] = FittingMode::SCALE_TO_FILL;
+    map[ImageVisual::Property::SAMPLING_MODE] = SamplingMode::BOX_THEN_LINEAR;
     actor.SetProperty( ImageView::Property::IMAGE, map );
 
     actor.SetName( filename );
index febac32b328c7e8d03b4742cff1a49a21e800311..ef0bcb0913d0b87516c2435ee27be135df53a46e 100644 (file)
@@ -77,9 +77,9 @@ public:
     parent.Add( box );
 
     Dali::Property::Map border;
-    border.Insert( "rendererType",  "BORDER" );
-    border.Insert( "borderColor",  Color::WHITE );
-    border.Insert( "borderSize",  1.f );
+    border.Insert( Visual::Property::TYPE,  Visual::BORDER );
+    border.Insert( BorderVisual::Property::COLOR,  Color::WHITE );
+    border.Insert( BorderVisual::Property::SIZE,  1.f );
     box.SetProperty( Control::Property::BACKGROUND, border );
   }
 
index 8c46b8a38c01177ca70453b29cb0564768e73431..ddbc1a8de79c6747ea79e417321ed08ba7c1abbd 100644 (file)
@@ -210,14 +210,14 @@ class VideoViewController: public ConnectionTracker
     Stage::GetCurrent().KeyEventSignal().Connect( this, &VideoViewController::OnKeyEvent );
 
     Property::Map customShader;
-    customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
-    mCustomShader.Insert( "rendererType", "IMAGE" );
-    mCustomShader.Insert( "shader", customShader );
+    customShader.Insert( Visual::Shader::Property::FRAGMENT_SHADER, FRAGMENT_SHADER );
+    mCustomShader.Insert( Visual::Property::TYPE, Visual::IMAGE );
+    mCustomShader.Insert( Visual::Property::SHADER, customShader );
 
     Property::Map defaultShader;
-    customShader.Insert( "fragmentShader", DEFAULT_FRAGMENT_SHADER );
-    mDefaultShader.Insert( "rendererType", "IMAGE" );
-    mDefaultShader.Insert( "shader", defaultShader );
+    customShader.Insert( Visual::Shader::Property::FRAGMENT_SHADER, DEFAULT_FRAGMENT_SHADER );
+    mDefaultShader.Insert( Visual::Property::TYPE, Visual::IMAGE );
+    mDefaultShader.Insert( Visual::Property::SHADER, customShader );
 
     mWindowSurfaceTarget.Insert( "RENDERING_TARGET", "windowSurfaceTarget" );
     mNativeImageTarget.Insert( "RENDERING_TARGET", "nativeImageTarget" );
index 9c51526ab98a0d80848c9fd5b10db9c8401d0549..e930a2b0f5ed2960604d7d3fd3178cb8d1ecb6ea 100644 (file)
@@ -42,7 +42,7 @@
           "heightResizePolicy":"FILL_TO_PARENT",
           "sizeAspectRatio": false,
           "background": {
-            "rendererType": "COLOR",
+            "visualType": "COLOR",
             "mixColor": [1,1,1,1]
           },
           "color": [
@@ -78,7 +78,7 @@
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
                       "heightResizePolicy":"FILL_TO_PARENT",
                       "sizeAspectRatio": false,
                       "background": {
-                        "rendererType": "COLOR",
+                        "visualType": "COLOR",
                         "mixColor": [1,1,1,1]
                       },
                       "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
                       "heightResizePolicy":"FILL_TO_PARENT",
                       "sizeAspectRatio": false,
                       "background": {
-                        "rendererType": "COLOR",
+                        "visualType": "COLOR",
                         "mixColor": [1,1,1,1]
                       },
                       "color": [
                           "heightResizePolicy":"FILL_TO_PARENT",
                           "sizeAspectRatio": false,
                           "background": {
-                            "rendererType": "COLOR",
+                            "visualType": "COLOR",
                             "mixColor": [1,1,1,1]
                           },
                           "color": [
                       "heightResizePolicy":"FILL_TO_PARENT",
                       "sizeAspectRatio": false,
                       "background": {
-                        "rendererType": "COLOR",
+                        "visualType": "COLOR",
                         "mixColor": [1,1,1,1]
                       },
                       "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
           "heightResizePolicy":"FILL_TO_PARENT",
           "sizeAspectRatio": false,
           "background": {
-            "rendererType": "COLOR",
+            "visualType": "COLOR",
             "mixColor": [1,1,1,1]
           },
           "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
           "heightResizePolicy":"FILL_TO_PARENT",
           "sizeAspectRatio": false,
           "background": {
-            "rendererType": "COLOR",
+            "visualType": "COLOR",
             "mixColor": [1,1,1,1]
           },
           "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
                       "heightResizePolicy":"FILL_TO_PARENT",
                       "sizeAspectRatio": false,
                       "background": {
-                        "rendererType": "COLOR",
+                        "visualType": "COLOR",
                         "mixColor": [1,1,1,1]
                       },
                       "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
                   "heightResizePolicy":"FILL_TO_PARENT",
                   "sizeAspectRatio": false,
                   "background": {
-                    "rendererType": "COLOR",
+                    "visualType": "COLOR",
                     "mixColor": [1,1,1,1]
                   },
                   "color": [
               "heightResizePolicy":"FILL_TO_PARENT",
               "sizeAspectRatio": false,
               "background": {
-                "rendererType": "COLOR",
+                "visualType": "COLOR",
                 "mixColor": [1,1,1,1]
               },
               "color": [
           "heightResizePolicy":"FILL_TO_PARENT",
           "sizeAspectRatio": false,
           "background": {
-            "rendererType": "COLOR",
+            "visualType": "COLOR",
             "mixColor": [1,1,1,1]
           },
           "color": [
       "sizeModeFactor": [0.25,0.166667,1],
       "sizeAspectRatio": false,
       "background": {
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [1,1,1,1]
       },
       "color": [
index 115ef5e15b8292da8d944b3e8070f9fd05aa570e..9a744bdf234c920683ad1a36b922fce5bc888b49 100644 (file)
@@ -30,7 +30,7 @@
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background":{
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [ 0.8, 0, 0.2, 1 ]
        }
     },
@@ -45,7 +45,7 @@
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background": {
-        "rendererType": "IMAGE",
+        "visualType": "IMAGE",
         "url": "{DEMO_IMAGE_DIR}Kid1.svg"
       }
     },
@@ -60,7 +60,7 @@
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background": {
-        "rendererType" : "BORDER",
+        "visualType" : "BORDER",
         "borderColor" : [ 0.5, 0.5, 0.5, 1 ],
         "borderSize" : 15.0
       }
@@ -76,7 +76,7 @@
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background": {
-        "rendererType": "IMAGE",
+        "visualType": "IMAGE",
         "url": "{DEMO_IMAGE_DIR}gallery-large-9.jpg"
       }
     },
@@ -91,7 +91,7 @@
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background":{
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [ 1, 1, 0, 1 ]
       }
     },
       "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT",
       "sizeModeFactor": [ 0.5, 0.333333333333, 1 ],
       "background": {
-        "rendererType" : "GRADIENT",
+        "visualType" : "GRADIENT",
         "startPosition" : [ -0.5, -0.5 ],
         "endPosition": [ 0.5, 0.5 ],
         "stopColor" : [
index d445f487810ab0f03c1f155e9c3bc28af13ecec1..e5e14170b79541d767bff8ebce6f1dcd048de443 100644 (file)
@@ -8,7 +8,7 @@
       "parentOrigin": [0.5, 0.5, 0.5],
       "anchorPoint": [0.5, 1, 0.5],
       "background": {
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [0.71, 0, 0, 1]
       },
       "selected": false,
@@ -27,7 +27,7 @@
       "parentOrigin": [0.5, 0.5, 0.5],
       "anchorPoint": [0.5, 1, 0.5],
       "background": {
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [0, 0.14200000000000013, 0.71, 0.7]
       },
       "signals": [
@@ -45,7 +45,7 @@
       "parentOrigin": [0.5, 0.5, 0.5],
       "anchorPoint": [0.5, 1, 0.5],
       "background": {
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [0.057450000000000064, 0.3, 0.0030000000000000027, 0.7]
       },
       "signals": [
index a6aa3c70aedf42cda48130f5e9f354c9c6a789f5..4d699a5509001efb2aaf6481a631b5dd5fba078d 100644 (file)
@@ -43,7 +43,7 @@
       "name":"simpleTable",
       "type":"TableView",
       "background":{
-        "rendererType": "COLOR",
+        "visualType": "COLOR",
         "mixColor": [0.5,0.5,0,1]
         },
       "parentOrigin": "CENTER",
index e2bce7509533c6084f57d58b0f8a69273cd717cf..3e680ba404d61f74f7d14df36cbd34eaa40fd33e 100644 (file)
@@ -69,7 +69,7 @@
     {
       "background":
       {
-        "rendererType": "GRADIENT",
+        "visualType": "GRADIENT",
         "center": [240, 400],
         "radius": 932,
         "units": "USER_SPACE",
index b5048da8ca6c10390af6604cc5724c8af2e5656d..86a6b572603392cb49b3a850e5411ea2c54f8233 100644 (file)
@@ -82,7 +82,7 @@
     {
       "background":
       {
-        "rendererType": "GRADIENT",
+        "visualType": "GRADIENT",
         "center": [360, 640],
         "radius": 1468,
         "units": "USER_SPACE",
index 1966ead4079da6380ec17b9fa0954deecc0bb196..092a2378b9659ba1f3d7291ef4b5454fbe67baa7 100644 (file)
@@ -109,7 +109,7 @@ extern "C"
 #define DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM          "Super Blur and Bloom"
 #define DALI_DEMO_STR_TITLE_EFFECTS_VIEW              "Effects View"
 #define DALI_DEMO_STR_TITLE_NATIVE_IMAGE_SOURCE       "Native Image Source"
-#define DALI_DEMO_STR_TITLE_MESH_RENDERER             "Mesh Renderer"
+#define DALI_DEMO_STR_TITLE_MESH_VISUAL               "Mesh Visual"
 #define DALI_DEMO_STR_TITLE_PRIMITIVE_SHAPES          "Primitive Shapes"
 
 #endif
index dc396a073e1e1594730d44ac135448bfce83c651..2606fd26461f1d4a2db9f5f5fdb6a8653ff19ac4 100644 (file)
@@ -131,13 +131,13 @@ Dali::Layer CreateView( Dali::Application& application,
   if ( !backgroundImagePath.empty() )
   {
     Dali::Property::Map map;
-    map["rendererType"] = "IMAGE";
-    map["url"] = backgroundImagePath;
-    map["desiredWidth"] = stage.GetSize().x;
-    map["desiredHeight"] = stage.GetSize().y;
-    map["fittingMode"] = "SCALE_TO_FILL";
-    map["samplingMode"] = "BOX_THEN_LINEAR";
-    map["synchronousLoading"] = true;
+    map[Dali::Toolkit::Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
+    map[Dali::Toolkit::ImageVisual::Property::URL] = backgroundImagePath;
+    map[Dali::Toolkit::ImageVisual::Property::DESIRED_WIDTH] = stage.GetSize().x;
+    map[Dali::Toolkit::ImageVisual::Property::DESIRED_HEIGHT] = stage.GetSize().y;
+    map[Dali::Toolkit::ImageVisual::Property::FITTING_MODE] = Dali::FittingMode::SCALE_TO_FILL;
+    map[Dali::Toolkit::ImageVisual::Property::SAMPLING_MODE] = Dali::SamplingMode::BOX_THEN_LINEAR;
+    map[Dali::Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING] = true;
     view.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
   }