X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fwireframe%2Fwireframe-visual.h;h=e1ba79c1ad350eca64cbe68a31f8b8ef9e0b3a15;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=19cbc4676947c8146e8401c79df156a79edf7c12;hpb=be7711b99f7e5db0b712194636745045d4da1154;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h index 19cbc46..e1ba79c 100644 --- a/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h +++ b/dali-toolkit/internal/visuals/wireframe/wireframe-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,95 +26,128 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - class WireframeVisual; -typedef IntrusivePtr< WireframeVisual > WireframeVisualPtr; +typedef IntrusivePtr WireframeVisualPtr; /** * @brief Renders a wireframe outline to the control's quad. */ -class WireframeVisual: public Visual::Base +class WireframeVisual : public Visual::Base { public: - /** * @brief Create a new wireframe visual. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + * @param[in] properties A Property::Map containing settings for this visual * @return A smart-pointer to the newly allocated visual. */ - static WireframeVisualPtr New( VisualFactoryCache& factoryCache ); + static WireframeVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties); -protected: + /** + * @brief Create a new wireframe visual with an encapsulated actual visual. + * + * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe + * + * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + * @param[in] actualVisual The encapsulated actual visual. + * @return A smart-pointer to the newly allocated visual. + */ + static WireframeVisualPtr New(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual); /** + * @brief Create a new wireframe visual with an encapsulated actual visual. + * + * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe + * + * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + * @param[in] actualVisual The encapsulated actual visual. + * @param[in] properties A Property::Map containing settings for this visual + * @return A smart-pointer to the newly allocated visual. + */ + static WireframeVisualPtr New(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties); + +protected: + /** * @brief Constructor. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + * @param[in] actualVisual The encapsulated actual visual. */ - WireframeVisual( VisualFactoryCache& factoryCache ); + WireframeVisual(VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual); /** * @brief A reference counted object may only be deleted by calling Unreference(). */ virtual ~WireframeVisual(); +protected: // from Visual::Base /** - * @copydoc Visual::Base::DoSetProperties() + * @copydoc Visual::Base::OnInitialize */ - virtual void DoSetProperties( const Property::Map& propertyMap ); + void OnInitialize() override; /** - * @copydoc Visual::Base::DoSetOnStage + * @copydoc Visual::Base::GetHeightForWidth() */ - virtual void DoSetOnStage( Actor& actor ); + float GetHeightForWidth(float width) override; /** - * @copydoc Visual::Base::CreatePropertyMap + * @copydoc Visual::Base::GetNaturalSize() */ - virtual void DoCreatePropertyMap( Property::Map& map ) const; + void GetNaturalSize(Vector2& naturalSize) override; /** - * @copydoc Visual::Base::DoSetProperty + * @copydoc Visual::Base::CreatePropertyMap() */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); + void DoCreatePropertyMap(Property::Map& map) const override; /** - * @copydoc Visual::Base::DoGetProperty + * @copydoc Visual::Base::CreateInstancePropertyMap */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); + void DoCreateInstancePropertyMap(Property::Map& map) const override; /** - * @copydoc Visual::Base::OnSetTransform + * @copydoc Visual::Base::DoSetProperties() */ - virtual void OnSetTransform(); + void DoSetProperties(const Property::Map& propertyMap) override; -private: /** - * Create the geometry which presents the quad wireframe. - * @return The border geometry + * @copydoc Visual::Base::DoSetOnScene */ - Geometry CreateQuadWireframeGeometry(); + void DoSetOnScene(Actor& actor) override; + + /** + * @copydoc Visual::Base::OnSetTransform + */ + void OnSetTransform() override; /** - * @brief Initialise the renderer from the cache, if not available, create and save to the cache for sharing. + * @copydoc Visual::Base::GetVisualObject + * + * Overriding as this visual can sometimes act as a proxy to the actual visual, i.e. when using debug rendering. */ - void InitializeRenderer(); + Base& GetVisualObject() override; private: + /** + * Create the geometry which presents the quad wireframe. + * @return The border geometry + */ + Geometry CreateQuadWireframeGeometry(); // Undefined - WireframeVisual( const WireframeVisual& visual); + WireframeVisual(const WireframeVisual& visual); // Undefined - WireframeVisual& operator=( const WireframeVisual& visual ); + WireframeVisual& operator=(const WireframeVisual& visual); +private: + Visual::BasePtr mActualVisual; }; } // namespace Internal