#define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
* @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 );
+
+ /**
+ * @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::GetHeightForWidth()
+ */
+ float GetHeightForWidth( float width ) override;
+
+ /**
+ * @copydoc Visual::Base::GetNaturalSize()
+ */
+ void GetNaturalSize( Vector2& naturalSize ) override;
+
/**
- * @copydoc Visual::Base::DoSetOnStage
+ * @copydoc Visual::Base::CreatePropertyMap()
*/
- virtual void DoSetOnStage( Actor& actor );
+ void DoCreatePropertyMap( Property::Map& map ) const override;
/**
- * @copydoc Visual::Base::CreatePropertyMap
+ * @copydoc Visual::Base::CreateInstancePropertyMap
*/
- virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ void DoCreateInstancePropertyMap( Property::Map& map ) const override;
/**
- * @copydoc Visual::Base::DoSetProperty
+ * @copydoc Visual::Base::DoSetProperties()
*/
- virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
+ void DoSetProperties( const Property::Map& propertyMap ) override;
/**
- * @copydoc Visual::Base::DoGetProperty
+ * @copydoc Visual::Base::DoSetOnScene
*/
- virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
+ void DoSetOnScene( Actor& actor ) override;
+
+ /**
+ * @copydoc Visual::Base::OnSetTransform
+ */
+ void OnSetTransform() override;
+
+ /**
+ * @copydoc Visual::Base::GetVisualObject
+ *
+ * Overriding as this visual can sometimes act as a proxy to the actual visual, i.e. when using debug rendering.
+ */
+ Base& GetVisualObject() override;
private:
/**
*/
void InitializeRenderer();
-private:
-
// Undefined
WireframeVisual( const WireframeVisual& visual);
// Undefined
WireframeVisual& operator=( const WireframeVisual& visual );
+private:
+
+ Visual::BasePtr mActualVisual;
+
};
} // namespace Internal