projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added position and size to Visuals
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
primitive
/
primitive-visual.h
diff --git
a/dali-toolkit/internal/visuals/primitive/primitive-visual.h
b/dali-toolkit/internal/visuals/primitive/primitive-visual.h
index
bc57a9b
..
c039fe3
100644
(file)
--- a/
dali-toolkit/internal/visuals/primitive/primitive-visual.h
+++ b/
dali-toolkit/internal/visuals/primitive/primitive-visual.h
@@
-44,8
+44,11
@@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/intrusive-ptr.h>
// INTERNAL INCLUDES
// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/visuals/primitive-visual-properties.h>
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
namespace Dali
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
namespace Dali
@@
-57,6
+60,9
@@
namespace Toolkit
namespace Internal
{
namespace Internal
{
+class PrimitiveVisual;
+typedef IntrusivePtr< PrimitiveVisual > PrimitiveVisualPtr;
+
/**
* The visual which renders a simple 3D shape to the control's quad
*
/**
* The visual which renders a simple 3D shape to the control's quad
*
@@
-96,63
+102,70
@@
class PrimitiveVisual: public Visual::Base
public:
/**
public:
/**
- * @brief C
onstructor
.
+ * @brief C
reate a new primitive visual
.
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+ * @return A smart-pointer to the newly allocated visual.
*/
*/
- PrimitiveVisual( VisualFactoryCache& factoryCache );
-
- /**
- * @brief A reference counted object may only be deleted by calling Unreference().
- */
- virtual ~PrimitiveVisual();
+ static PrimitiveVisualPtr New( VisualFactoryCache& factoryCache );
public: // from Visual
/**
public: // from Visual
/**
- * @copydoc Visual::SetSize
+ * @copydoc Visual::
Base::
SetSize
*/
virtual void SetSize( const Vector2& size );
/**
*/
virtual void SetSize( const Vector2& size );
/**
- * @copydoc Visual::
SetClipRect
+ * @copydoc Visual::
Base::GetNaturalSize
*/
*/
- virtual void
SetClipRect( const Rect<int>& clipRect )
;
+ virtual void
GetNaturalSize( Vector2& naturalSize ) const
;
/**
/**
- * @copydoc Visual::
SetOffset
+ * @copydoc Visual::
Base::CreatePropertyMap
*/
*/
- virtual void
SetOffset( const Vector2& offset )
;
+ virtual void
DoCreatePropertyMap( Property::Map& map ) const
;
/**
/**
- * @copydoc Visual::
CreatePropertyMap
+ * @copydoc Visual::
Base::DoSetProperty
*/
*/
- virtual void DoCreatePropertyMap( Property::Map& map ) const;
+ virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue );
+
+ /**
+ * @copydoc Visual::Base::DoGetProperty
+ */
+ virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index );
protected:
/**
protected:
/**
- * @copydoc Visual::DoInitialize
+ * @brief Constructor.
+ *
+ * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
*/
*/
- virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap );
+ PrimitiveVisual( VisualFactoryCache& factoryCache );
+
+ /**
+ * @brief A reference counted object may only be deleted by calling Unreference().
+ */
+ virtual ~PrimitiveVisual();
/**
/**
- * @copydoc Visual::DoSetOnStage
+ * @copydoc Visual::Base::DoSetProperties
+ */
+ virtual void DoSetProperties( const Property::Map& propertyMap );
+
+ /**
+ * @copydoc Visual::Base::DoSetOnStage
*/
virtual void DoSetOnStage( Actor& actor );
*/
virtual void DoSetOnStage( Actor& actor );
-private:
+ /**
+ * @copydoc Visual::Base::OnSetTransform
+ */
+ virtual void OnSetTransform();
- enum PrimitiveType
- {
- SPHERE,
- CONE,
- CONICAL_FRUSTRUM,
- CYLINDER,
- CUBE,
- OCTAHEDRON,
- BEVELLED_CUBE
- };
+private:
//Simple struct to store the position and normal of a single vertex.
struct Vertex
//Simple struct to store the position and normal of a single vertex.
struct Vertex
@@
-321,7
+334,6
@@
private:
Shader mShader;
Geometry mGeometry;
Shader mShader;
Geometry mGeometry;
- std::string mShape; //Shape to render, as string.
Vector4 mColor; //Color of shape.
Vector3 mObjectDimensions; //Dimensions of shape, scaled to be between 0.0 and 1.0.
Vector4 mColor; //Color of shape.
Vector3 mObjectDimensions; //Dimensions of shape, scaled to be between 0.0 and 1.0.
@@
-342,7
+354,7
@@
private:
int mSlices; ///< Number of slices to use when creating certain objects.
int mStacks; ///< Number of stacks to use when creating certain objects.
int mSlices; ///< Number of slices to use when creating certain objects.
int mStacks; ///< Number of stacks to use when creating certain objects.
-
Primitive
Type mPrimitiveType; //Shape to render, as enum.
+
Toolkit::PrimitiveVisual::Shape::
Type mPrimitiveType; //Shape to render, as enum.
};
} // namespace Internal
};
} // namespace Internal