Merge "Stop copying Property::Maps in ImageView SetProperty" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / wireframe / wireframe-visual.h
1 #ifndef DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/intrusive-ptr.h>
23
24 // INTERNAL INCLUDES
25 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 class WireframeVisual;
37 typedef IntrusivePtr< WireframeVisual > WireframeVisualPtr;
38
39 /**
40  * @brief Renders a wireframe outline to the control's quad.
41  */
42 class WireframeVisual: public Visual::Base
43 {
44 public:
45
46   /**
47    * @brief Create a new wireframe visual.
48    *
49    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
50    * @return A smart-pointer to the newly allocated visual.
51    */
52   static WireframeVisualPtr New( VisualFactoryCache& factoryCache );
53
54 protected:
55
56   /**
57    * @brief Constructor.
58    *
59    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
60    */
61   WireframeVisual( VisualFactoryCache& factoryCache );
62
63   /**
64    * @brief A reference counted object may only be deleted by calling Unreference().
65    */
66   virtual ~WireframeVisual();
67
68   /**
69    * @copydoc Visual::Base::DoSetProperties()
70    */
71   virtual void DoSetProperties( const Property::Map& propertyMap );
72
73   /**
74    * @copydoc Visual::Base::DoSetOnStage
75    */
76   virtual void DoSetOnStage( Actor& actor );
77
78   /**
79    * @copydoc Visual::Base::CreatePropertyMap
80    */
81   virtual void DoCreatePropertyMap( Property::Map& map ) const;
82
83   /**
84    * @copydoc Visual::Base::OnSetTransform
85    */
86   virtual void OnSetTransform();
87
88 private:
89   /**
90    * Create the geometry which presents the quad wireframe.
91    * @return The border geometry
92    */
93   Geometry CreateQuadWireframeGeometry();
94
95   /**
96    * @brief Initialise the renderer from the cache, if not available, create and save to the cache for sharing.
97    */
98   void InitializeRenderer();
99
100 private:
101
102   // Undefined
103   WireframeVisual( const WireframeVisual& visual);
104
105   // Undefined
106   WireframeVisual& operator=( const WireframeVisual& visual );
107
108 };
109
110 } // namespace Internal
111
112 } // namespace Toolkit
113
114 } // namespace Dali
115
116 #endif // DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H