1 #ifndef DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
2 #define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
5 * Copyright (c) 2021 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>
33 class WireframeVisual;
34 typedef IntrusivePtr<WireframeVisual> WireframeVisualPtr;
37 * @brief Renders a wireframe outline to the control's quad.
39 class WireframeVisual : public Visual::Base
43 * @brief Create a new wireframe visual.
45 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
46 * @param[in] properties A Property::Map containing settings for this visual
47 * @return A smart-pointer to the newly allocated visual.
49 static WireframeVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);
52 * @brief Create a new wireframe visual with an encapsulated actual visual.
54 * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
56 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
57 * @param[in] actualVisual The encapsulated actual visual.
58 * @return A smart-pointer to the newly allocated visual.
60 static WireframeVisualPtr New(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual);
63 * @brief Create a new wireframe visual with an encapsulated actual visual.
65 * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe
67 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
68 * @param[in] actualVisual The encapsulated actual visual.
69 * @param[in] properties A Property::Map containing settings for this visual
70 * @return A smart-pointer to the newly allocated visual.
72 static WireframeVisualPtr New(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties);
78 * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
79 * @param[in] actualVisual The encapsulated actual visual.
81 WireframeVisual(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual);
84 * @brief A reference counted object may only be deleted by calling Unreference().
86 virtual ~WireframeVisual();
88 protected: // from Visual::Base
90 * @copydoc Visual::Base::OnInitialize
92 void OnInitialize() override;
95 * @copydoc Visual::Base::GetHeightForWidth()
97 float GetHeightForWidth(float width) override;
100 * @copydoc Visual::Base::GetNaturalSize()
102 void GetNaturalSize(Vector2& naturalSize) override;
105 * @copydoc Visual::Base::CreatePropertyMap()
107 void DoCreatePropertyMap(Property::Map& map) const override;
110 * @copydoc Visual::Base::CreateInstancePropertyMap
112 void DoCreateInstancePropertyMap(Property::Map& map) const override;
115 * @copydoc Visual::Base::DoSetProperties()
117 void DoSetProperties(const Property::Map& propertyMap) override;
120 * @copydoc Visual::Base::DoSetOnScene
122 void DoSetOnScene(Actor& actor) override;
125 * @copydoc Visual::Base::OnSetTransform
127 void OnSetTransform() override;
130 * @copydoc Visual::Base::GetVisualObject
132 * Overriding as this visual can sometimes act as a proxy to the actual visual, i.e. when using debug rendering.
134 Base& GetVisualObject() override;
138 * Create the geometry which presents the quad wireframe.
139 * @return The border geometry
141 Geometry CreateQuadWireframeGeometry();
144 WireframeVisual(const WireframeVisual& visual);
147 WireframeVisual& operator=(const WireframeVisual& visual);
150 Visual::BasePtr mActualVisual;
153 } // namespace Internal
155 } // namespace Toolkit
159 #endif // DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H