1 #ifndef DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
5 * Copyright (c) 2016 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>
36 class WireframeVisual;
37 typedef IntrusivePtr< WireframeVisual > WireframeVisualPtr;
40 * @brief Renders a wireframe outline to the control's quad.
42 class WireframeVisual: public Visual::Base
47 * @brief Create a new wireframe visual.
49 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
50 * @param[in] properties A Property::Map containing settings for this visual
51 * @return A smart-pointer to the newly allocated visual.
53 static WireframeVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
56 * @brief Create a new wireframe visual with an encapsulated actual visual.
58 * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
60 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
61 * @param[in] actualVisual The encapsulated actual visual.
62 * @return A smart-pointer to the newly allocated visual.
64 static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual );
67 * @brief Create a new wireframe visual with an encapsulated actual visual.
69 * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
71 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
72 * @param[in] actualVisual The encapsulated actual visual.
73 * @param[in] properties A Property::Map containing settings for this visual
74 * @return A smart-pointer to the newly allocated visual.
76 static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties );
84 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
85 * @param[in] actualVisual The encapsulated actual visual.
87 WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual );
90 * @brief A reference counted object may only be deleted by calling Unreference().
92 virtual ~WireframeVisual();
94 protected: // from Visual::Base
97 * @copydoc Visual::Base::GetHeightForWidth()
99 virtual float GetHeightForWidth( float width );
102 * @copydoc Visual::Base::GetNaturalSize()
104 virtual void GetNaturalSize( Vector2& naturalSize );
107 * @copydoc Visual::Base::CreatePropertyMap()
109 virtual void DoCreatePropertyMap( Property::Map& map ) const;
112 * @copydoc Visual::Base::CreateInstancePropertyMap
114 virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
117 * @copydoc Visual::Base::DoSetProperties()
119 virtual void DoSetProperties( const Property::Map& propertyMap );
122 * @copydoc Visual::Base::DoSetOnStage
124 virtual void DoSetOnStage( Actor& actor );
127 * @copydoc Visual::Base::OnSetTransform
129 virtual void OnSetTransform();
133 * Create the geometry which presents the quad wireframe.
134 * @return The border geometry
136 Geometry CreateQuadWireframeGeometry();
139 * @brief Initialise the renderer from the cache, if not available, create and save to the cache for sharing.
141 void InitializeRenderer();
144 WireframeVisual( const WireframeVisual& visual);
147 WireframeVisual& operator=( const WireframeVisual& visual );
151 Visual::BasePtr mActualVisual;
155 } // namespace Internal
157 } // namespace Toolkit
161 #endif // DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H