Rename of Control Renderers to Visuals
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / renderers / mesh / mesh-visual.cpp
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include "mesh-renderer.h"
+#include "mesh-visual.h"
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
@@ -26,8 +26,8 @@
 #include <fstream>
 
 //INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/renderers/renderer-string-constants.h>
-#include <dali-toolkit/internal/controls/renderers/control-renderer-data-impl.h>
+#include <dali-toolkit/internal/controls/renderers/visual-string-constants.h>
+#include <dali-toolkit/internal/controls/renderers/visual-data-impl.h>
 
 namespace Dali
 {
@@ -277,8 +277,8 @@ const char* NORMAL_MAP_FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 
 } // namespace
 
-MeshRenderer::MeshRenderer( RendererFactoryCache& factoryCache )
-: ControlRenderer( factoryCache ),
+MeshVisual::MeshVisual( VisualFactoryCache& factoryCache )
+: Visual( factoryCache ),
   mShaderType( ALL_TEXTURES ),
   mUseTexture( true ),
   mUseMipmapping( true ),
@@ -286,16 +286,16 @@ MeshRenderer::MeshRenderer( RendererFactoryCache& factoryCache )
 {
 }
 
-MeshRenderer::~MeshRenderer()
+MeshVisual::~MeshVisual()
 {
 }
 
-void MeshRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
+void MeshVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap )
 {
   Property::Value* objectUrl = propertyMap.Find( OBJECT_URL );
   if( !objectUrl || !objectUrl->Get( mObjectUrl ) )
   {
-    DALI_LOG_ERROR( "Fail to provide object URL to the MeshRenderer object.\n" );
+    DALI_LOG_ERROR( "Fail to provide object URL to the MeshVisual object.\n" );
   }
 
   Property::Value* materialUrl = propertyMap.Find( MATERIAL_URL );
@@ -332,7 +332,7 @@ void MeshRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap
       }
       else
       {
-        DALI_LOG_ERROR( "Unknown shader type provided to the MeshRenderer object.\n");
+        DALI_LOG_ERROR( "Unknown shader type provided to the MeshVisual object.\n");
       }
     }
   }
@@ -368,31 +368,31 @@ void MeshRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap
   }
 }
 
-void MeshRenderer::SetSize( const Vector2& size )
+void MeshVisual::SetSize( const Vector2& size )
 {
-  ControlRenderer::SetSize( size );
+  Visual::SetSize( size );
 
   // ToDo: renderer responds to the size change
 }
 
-void MeshRenderer::SetClipRect( const Rect<int>& clipRect )
+void MeshVisual::SetClipRect( const Rect<int>& clipRect )
 {
-  ControlRenderer::SetClipRect( clipRect );
+  Visual::SetClipRect( clipRect );
 
   //ToDo: renderer responds to the clipRect change
 }
 
-void MeshRenderer::SetOffset( const Vector2& offset )
+void MeshVisual::SetOffset( const Vector2& offset )
 {
   //ToDo: renderer applies the offset
 }
 
-void MeshRenderer::DoSetOnStage( Actor& actor )
+void MeshVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
 }
 
-void MeshRenderer::DoCreatePropertyMap( Property::Map& map ) const
+void MeshVisual::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( RENDERER_TYPE, MESH_RENDERER );
@@ -428,7 +428,7 @@ void MeshRenderer::DoCreatePropertyMap( Property::Map& map ) const
   map.Insert( LIGHT_POSITION_UNIFORM_NAME, mLightPosition );
 }
 
-void MeshRenderer::InitializeRenderer()
+void MeshVisual::InitializeRenderer()
 {
   //Try to load the geometry from the file.
   if( !LoadGeometry() )
@@ -468,7 +468,7 @@ void MeshRenderer::InitializeRenderer()
   mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
 }
 
-void MeshRenderer::SupplyEmptyGeometry()
+void MeshVisual::SupplyEmptyGeometry()
 {
   mGeometry = Geometry::New();
   mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
@@ -477,7 +477,7 @@ void MeshRenderer::SupplyEmptyGeometry()
   DALI_LOG_ERROR( "Initialisation error in mesh renderer.\n" );
 }
 
-void MeshRenderer::UpdateShaderUniforms()
+void MeshVisual::UpdateShaderUniforms()
 {
   Stage stage = Stage::GetCurrent();
   float width = stage.GetSize().width;
@@ -491,7 +491,7 @@ void MeshRenderer::UpdateShaderUniforms()
   mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix );
 }
 
-void MeshRenderer::CreateShader()
+void MeshVisual::CreateShader()
 {
   if( mShaderType == ALL_TEXTURES )
   {
@@ -509,7 +509,7 @@ void MeshRenderer::CreateShader()
   UpdateShaderUniforms();
 }
 
-bool MeshRenderer::CreateGeometry()
+bool MeshVisual::CreateGeometry()
 {
   //Determine if we need to use a simpler shader to handle the provided data
   if( !mUseTexture || !mObjLoader.IsDiffuseMapPresent() )
@@ -546,7 +546,7 @@ bool MeshRenderer::CreateGeometry()
   return false;
 }
 
-bool MeshRenderer::LoadGeometry()
+bool MeshVisual::LoadGeometry()
 {
   std::streampos fileSize;
   Dali::Vector<char> fileContent;
@@ -567,7 +567,7 @@ bool MeshRenderer::LoadGeometry()
   return false;
 }
 
-bool MeshRenderer::LoadMaterial()
+bool MeshVisual::LoadMaterial()
 {
   std::streampos fileSize;
   Dali::Vector<char> fileContent;
@@ -584,7 +584,7 @@ bool MeshRenderer::LoadMaterial()
   return false;
 }
 
-bool MeshRenderer::LoadTextures()
+bool MeshVisual::LoadTextures()
 {
   mTextureSet = TextureSet::New();