2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/actors/renderer-impl.h> // Dali::Internal::Renderer
22 #include <dali/public-api/actors/renderer.h> // Dali::Renderer
23 #include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
24 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
25 #include <dali/internal/update/node-attachments/scene-graph-renderer-attachment.h>
36 * |name |type |writable|animatable|constraint-input|enum for index-checking|
38 DALI_PROPERTY_TABLE_BEGIN
39 DALI_PROPERTY( "depth-index", INTEGER, true, true, true, Dali::Renderer::Property::DEPTH_INDEX )
40 DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
42 const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> RENDERER_IMPL = { DEFAULT_PROPERTY_DETAILS };
44 } // unnamed namespace
46 RendererPtr Renderer::New()
48 return RendererPtr( new Renderer() );
51 void Renderer::SetGeometry( Geometry& geometry )
53 mGeometryConnector.Set( geometry, OnStage() );
56 void Renderer::SetMaterial( Material& material )
58 mMaterialConnector.Set( material, OnStage() );
61 void Renderer::SetDepthIndex( int depthIndex )
63 //SceneGraph::NodePropertyMessage<Vector3>::Send( mStage->GetUpdateManager(), mNode, &mNode->mPosition, &AnimatableProperty<Vector3>::Bake, position );
65 DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
68 unsigned int Renderer::GetDefaultPropertyCount() const
70 return RENDERER_IMPL.GetDefaultPropertyCount();
73 void Renderer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
75 RENDERER_IMPL.GetDefaultPropertyIndices( indices );
78 const char* Renderer::GetDefaultPropertyName(Property::Index index) const
80 return RENDERER_IMPL.GetDefaultPropertyName( index );
83 Property::Index Renderer::GetDefaultPropertyIndex( const std::string& name ) const
85 return RENDERER_IMPL.GetDefaultPropertyIndex( name );
88 bool Renderer::IsDefaultPropertyWritable( Property::Index index ) const
90 return RENDERER_IMPL.IsDefaultPropertyWritable( index );
93 bool Renderer::IsDefaultPropertyAnimatable( Property::Index index ) const
95 return RENDERER_IMPL.IsDefaultPropertyAnimatable( index );
98 bool Renderer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
100 return RENDERER_IMPL.IsDefaultPropertyAConstraintInput( index );
103 Property::Type Renderer::GetDefaultPropertyType( Property::Index index ) const
105 return RENDERER_IMPL.GetDefaultPropertyType( index );
108 void Renderer::SetDefaultProperty( Property::Index index,
109 const Property::Value& propertyValue )
111 RENDERER_IMPL.SetDefaultProperty( index, propertyValue );
114 void Renderer::SetSceneGraphProperty( Property::Index index,
115 const CustomProperty& entry,
116 const Property::Value& value )
118 RENDERER_IMPL.SetSceneGraphProperty( index, entry, value );
121 Property::Value Renderer::GetDefaultProperty( Property::Index index ) const
123 return RENDERER_IMPL.GetDefaultProperty( index );
126 const SceneGraph::PropertyOwner* Renderer::GetPropertyOwner() const
128 return RENDERER_IMPL.GetPropertyOwner();
131 const SceneGraph::PropertyOwner* Renderer::GetSceneObject() const
136 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Property::Index index ) const
138 return RENDERER_IMPL.GetSceneObjectAnimatableProperty( index );
141 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty( Property::Index index ) const
143 return RENDERER_IMPL.GetSceneObjectInputProperty( index );
146 int Renderer::GetPropertyComponentIndex( Property::Index index ) const
148 return RENDERER_IMPL.GetPropertyComponentIndex( index );
151 bool Renderer::OnStage() const
154 DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
158 void Renderer::Connect()
160 // TODO: MESH_REWORK : check this
161 mGeometryConnector.OnStageConnect();
162 mMaterialConnector.OnStageConnect();
165 void Renderer::Disconnect()
167 // TODO: MESH_REWORK : check this
168 mGeometryConnector.OnStageDisconnect();
169 mMaterialConnector.OnStageDisconnect();
177 } // namespace Internal