#define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
namespace Internal
{
+class WireframeVisual;
+typedef IntrusivePtr< WireframeVisual > WireframeVisualPtr;
+
/**
- * The visual which renders a wireframe outline to the control's quad.
- *
+ * @brief Renders a wireframe outline to the control's quad.
*/
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, 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:
+protected: // from Visual::Base
+
+ /**
+ * @copydoc Visual::Base::GetHeightForWidth()
+ */
+ virtual float GetHeightForWidth( float width );
+
+ /**
+ * @copydoc Visual::Base::GetNaturalSize()
+ */
+ virtual void GetNaturalSize( Vector2& naturalSize );
+
+ /**
+ * @copydoc Visual::Base::CreatePropertyMap()
+ */
+ virtual void DoCreatePropertyMap( Property::Map& map ) const;
+
+ /**
+ * @copydoc Visual::Base::CreateInstancePropertyMap
+ */
+ virtual void DoCreateInstancePropertyMap( Property::Map& map ) const;
+
+ /**
+ * @copydoc Visual::Base::DoSetProperties()
+ */
+ virtual void DoSetProperties( const Property::Map& propertyMap );
/**
* @copydoc Visual::Base::DoSetOnStage
virtual void DoSetOnStage( Actor& actor );
/**
- * @copydoc Visual::Base::CreatePropertyMap
+ * @copydoc Visual::Base::OnSetTransform
*/
- virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ virtual void OnSetTransform();
+ /**
+ * @copydoc Visual::Base::GetVisualObject
+ *
+ * Overriding as this visual can sometimes act as a proxy to the actual visual, i.e. when using debug rendering.
+ */
+ virtual Base& GetVisualObject() override;
private:
/**
*/
void InitializeRenderer();
-private:
-
// Undefined
WireframeVisual( const WireframeVisual& visual);
// Undefined
WireframeVisual& operator=( const WireframeVisual& visual );
+private:
+
+ Visual::BasePtr mActualVisual;
+
};
} // namespace Internal