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
35 * |name |type |writable|animatable|constraint-input|enum for index-checking|
37 DALI_PROPERTY_TABLE_BEGIN
38 DALI_PROPERTY( "depth-index", INTEGER, true, true, true, Dali::Renderer::Property::DEPTH_INDEX )
39 DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX )
41 const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> RENDERER_IMPL = { DEFAULT_PROPERTY_DETAILS };
43 } // unnamed namespace
45 RendererPtr Renderer::New()
47 return RendererPtr( new Renderer() );
50 void Renderer::SetGeometry( Geometry& geometry )
52 mGeometryConnector.Set( geometry, OnStage() );
55 void Renderer::SetMaterial( Material& material )
57 mMaterialConnector.Set( material, OnStage() );
60 void Renderer::SetDepthIndex( int depthIndex )
62 //SceneGraph::NodePropertyMessage<Vector3>::Send( mStage->GetUpdateManager(), mNode, &mNode->mPosition, &AnimatableProperty<Vector3>::Bake, position );
64 DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
67 unsigned int Renderer::GetDefaultPropertyCount() const
69 return RENDERER_IMPL.GetDefaultPropertyCount();
72 void Renderer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
74 RENDERER_IMPL.GetDefaultPropertyIndices( indices );
77 const char* Renderer::GetDefaultPropertyName(Property::Index index) const
79 return RENDERER_IMPL.GetDefaultPropertyName( index );
82 Property::Index Renderer::GetDefaultPropertyIndex( const std::string& name ) const
84 return RENDERER_IMPL.GetDefaultPropertyIndex( name );
87 bool Renderer::IsDefaultPropertyWritable( Property::Index index ) const
89 return RENDERER_IMPL.IsDefaultPropertyWritable( index );
92 bool Renderer::IsDefaultPropertyAnimatable( Property::Index index ) const
94 return RENDERER_IMPL.IsDefaultPropertyAnimatable( index );
97 bool Renderer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
99 return RENDERER_IMPL.IsDefaultPropertyAConstraintInput( index );
102 Property::Type Renderer::GetDefaultPropertyType( Property::Index index ) const
104 return RENDERER_IMPL.GetDefaultPropertyType( index );
107 void Renderer::SetDefaultProperty( Property::Index index,
108 const Property::Value& propertyValue )
110 RENDERER_IMPL.SetDefaultProperty( index, propertyValue );
113 void Renderer::SetSceneGraphProperty( Property::Index index,
114 const CustomProperty& entry,
115 const Property::Value& value )
117 RENDERER_IMPL.SetSceneGraphProperty( index, entry, value );
120 Property::Value Renderer::GetDefaultProperty( Property::Index index ) const
122 return RENDERER_IMPL.GetDefaultProperty( index );
125 const SceneGraph::PropertyOwner* Renderer::GetPropertyOwner() const
127 return RENDERER_IMPL.GetPropertyOwner();
130 const SceneGraph::PropertyOwner* Renderer::GetSceneObject() const
132 return RENDERER_IMPL.GetSceneObject();
135 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Property::Index index ) const
137 return RENDERER_IMPL.GetSceneObjectAnimatableProperty( index );
140 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty( Property::Index index ) const
142 return RENDERER_IMPL.GetSceneObjectInputProperty( index );
145 int Renderer::GetPropertyComponentIndex( Property::Index index ) const
147 return RENDERER_IMPL.GetPropertyComponentIndex( index );
150 bool Renderer::OnStage() const
153 DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
157 void Renderer::Connect()
159 // TODO: MESH_REWORK : check this
160 mGeometryConnector.OnStageConnect();
161 mMaterialConnector.OnStageConnect();
164 void Renderer::Disconnect()
166 // TODO: MESH_REWORK : check this
167 mGeometryConnector.OnStageDisconnect();
168 mMaterialConnector.OnStageDisconnect();
175 } // namespace Internal