1 #ifndef __DALI_INTERNAL_LIGHT_ATTACHMENT_H__
2 #define __DALI_INTERNAL_LIGHT_ATTACHMENT_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
23 #include <dali/internal/event/actor-attachments/actor-attachment-declarations.h>
24 #include <dali/internal/event/modeling/light-impl.h>
36 class LightAttachment;
41 * An attachment for managing the properties of a light in the scene
43 class LightAttachment : public ActorAttachment
47 * Create an initialised LightAttachment.
48 * @return A handle to a newly allocated Dali resource.
50 static LightAttachmentPtr New( const SceneGraph::Node& parentNode );
53 * Set the local properties of the light
54 * The light properties are copied into this attachment
55 * @param[in] light The light properties
57 void SetLight(Internal::LightPtr light);
60 * Get the local properties of the light
61 * @return A copy of the light properties
63 Internal::LightPtr GetLight() const;
66 * @copydoc Dali::Light::SetName
68 void SetName(const std::string& name);
71 * @copydoc Dali::Light::GetName
73 const std::string& GetName() const;
76 * @copydoc Dali::Light::SetType
78 void SetType(Dali::LightType type);
81 * @copydoc Dali::Light::GetType
83 Dali::LightType GetType() const;
86 * @copydoc Dali::Light::SetFallOff
88 void SetFallOff(const Vector2& fallOff);
91 * @copydoc Dali::Light::GetFallOff
93 const Vector2& GetFallOff() const;
96 * @copydoc Dali::Light::SetSpotAngle
98 void SetSpotAngle(const Vector2& angle);
101 * @copydoc Dali::Light::GetSpotAngle
103 const Vector2& GetSpotAngle() const;
106 * @copydoc Dali::Light::SetAmbientColor
108 void SetAmbientColor(const Vector3& color);
111 * @copydoc Dali::Light::GetAmbientColor
113 const Vector3& GetAmbientColor() const;
116 * @copydoc Dali::Light::SetDiffuseColor
118 void SetDiffuseColor(const Vector3& color);
121 * @copydoc Dali::Light::GetDiffuseColor
123 const Vector3& GetDiffuseColor() const;
126 * @copydoc Dali::Light::SetSpecularColor
128 void SetSpecularColor(const Vector3& color);
131 * @copydoc Dali::Light::GetSpecularColor
133 const Vector3& GetSpecularColor() const;
136 * @copydoc Dali::Light::SetDirection
138 void SetDirection(const Vector3& direction);
141 * @copydoc Dali::Light::GetDirection
143 const Vector3& GetDirection() const;
146 * @copydoc Dali::LightActor::SetActive
148 void SetActive(bool active);
153 * First stage construction of a LightAttachment.
154 * @param[in] stage Used to send messages to scene-graph.
156 LightAttachment( Stage& stage );
159 * @copydoc Dali::Internal::ActorAttachment::OnStageConnection()
161 virtual void OnStageConnection();
164 * @copydoc Dali::Internal::ActorAttachment::OnStageDisconnection()
166 virtual void OnStageDisconnection();
171 * A reference counted object may only be deleted by calling Unreference()
173 virtual ~LightAttachment();
177 const SceneGraph::LightAttachment* mSceneObject; ///< Not owned
179 Internal::LightPtr mCachedLight; ///< A local cache of the light properties
182 } // namespace Internal
186 #endif // __DALI_INTERNAL_LIGHT_ATTACHMENT_H__