1 #ifndef DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
5 * Copyright (c) 2020 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/common/intrusive-ptr.h>
25 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
26 #include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
38 typedef IntrusivePtr< ArcVisual > ArcVisualPtr;
41 * The visual which renders an arc to the control's quad
43 * The following properties are required for create an ArcVisual
45 * | %Property Name | Type |
46 * |-----------------|-------------|
47 * | THICKNESS | FLOAT |
48 * | START_ANGLE | FLOAT |
49 * | SWEEP_ANGLE | FLOAT |
52 class ArcVisual: public Visual::Base
57 * @brief Create a new arc visual.
59 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
60 * @param[in] properties A Property::Map containing settings for this visual
61 * @return A smart-pointer to the newly allocated visual.
63 static ArcVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
65 public: // from Visual
68 * @copydoc Visual::Base::CreatePropertyMap
70 void DoCreatePropertyMap( Property::Map& map ) const override;
73 * @copydoc Visual::Base::CreateInstancePropertyMap
75 void DoCreateInstancePropertyMap( Property::Map& map ) const override;
82 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
84 ArcVisual( VisualFactoryCache& factoryCache );
87 * @brief A reference counted object may only be deleted by calling Unreference().
92 * @copydoc Visual::Base::DoSetProperties
94 void DoSetProperties( const Property::Map& propertyMap ) override;
97 * @copydoc Visual::Base::DoSetOnScene
99 void DoSetOnScene( Actor& actor ) override;
102 * @copydoc Visual::Base::OnSetTransform
104 void OnSetTransform() override;
107 * @copydoc Visual::Base::OnDoAction
109 void OnDoAction( const Property::Index actionId, const Property::Value& attributes ) override;
114 * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
116 void InitializeRenderer();
121 ArcVisual( const ArcVisual& arcVisual ) = delete;
124 ArcVisual& operator=( const ArcVisual& arcVisual ) = delete;
128 float mThickness; ///< The thickness of the arc.
129 float mRadius; ///< The radius of the arc.
130 float mStartAngle; ///< The start angle of the arc.
131 float mSweepAngle; ///< The sweep angle of the arc.
132 Property::Index mRadiusIndex; ///< The index of the radius property.
133 Property::Index mThicknessIndex; ///< The index of the thickness property.
134 Property::Index mStartAngleIndex; ///< The index of the start angle property.
135 Property::Index mSweepAngleIndex; ///< The index of the sweep angle property.
136 DevelArcVisual::Cap::Type mCapType; ///< The cap type.
139 } // namespace Internal
141 } // namespace Toolkit
145 #endif /* DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H */