1 #ifndef __DALI_LIGHT_ACTOR_H__
2 #define __DALI_LIGHT_ACTOR_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/public-api/actors/actor.h>
23 #include <dali/public-api/common/light.h>
29 namespace Internal DALI_INTERNAL
35 * @brief Controls a light source loaded from a file containing a 3D scene.
37 * Allows the developer to use actor semantics to control a light source.
38 * see @ref Dali::Model
40 class DALI_IMPORT_API LightActor : public Actor
44 // Default Properties additional to Actor
45 static const Property::Index LIGHT_TYPE; ///< name "light-type", type STRING
46 static const Property::Index ENABLE; ///< name "enable", type BOOLEAN
47 static const Property::Index FALL_OFF; ///< name "fall-off", type VECTOR2
48 static const Property::Index SPOT_ANGLE; ///< name "spot-angle", type VECTOR2
49 static const Property::Index AMBIENT_COLOR; ///< name "ambient-color", type VECTOR3
50 static const Property::Index DIFFUSE_COLOR; ///< name "diffuse-color", type VECTOR3
51 static const Property::Index SPECULAR_COLOR; ///< name "specular-color", type VECTOR3
52 static const Property::Index DIRECTION; ///< name "direction", type VECTOR3
55 * @brief Create an uninitialized LightActor handle.
57 * This can be initialised with LightActor::New().
58 * Calling member functions with an uninitialized Dali::Object is not allowed.
63 * @brief Create a LightActor object.
65 * @return A handle to a newly allocated LightActor.
67 static LightActor New();
70 * @brief Downcast an Object handle to LightActor.
72 * If handle points to a LightActor the downcast produces valid
73 * handle. If not the returned handle is left uninitialized.
74 * @param[in] handle to An object
75 * @return handle to a LightActor or an uninitialized handle
77 static LightActor DownCast( BaseHandle handle );
82 * This is non-virtual since derived Handle types must not contain data or virtual methods.
87 * @brief Copy constructor
89 * @param [in] copy The actor to copy.
91 LightActor(const LightActor& copy);
94 * @brief Assignment operator
96 * @param [in] rhs The actor to copy.
98 LightActor& operator=(const LightActor& rhs);
101 * @brief Set the light properties for the actor.
103 * @param[in] light The light properties
105 void SetLight(Light light);
108 * @brief Get the current light properties for the actor.
110 * @return The light properties
115 * @brief Set this light's active state.
117 * @param[in] active Set to true to activate this light
119 void SetActive( bool active);
122 * @brief Get the active status of this light.
124 * @return true if this light is active
129 public: // Not intended for application developers
132 * @brief This constructor is used by Dali New() methods.
134 * @param [in] actor A pointer to a newly allocated Dali resource
136 explicit DALI_INTERNAL LightActor(Internal::LightActor* actor);
142 #endif // __DALI_LIGHT_ACTOR_H__