X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fprimitive%2Fprimitive-visual.h;h=6b38bd7b858b85a96183403293eddbc8d5049bf1;hb=9ba637ea132bb3fd6df2941047c1f61f640ad33b;hp=054e9f0b8e4471a5df44d2e8c4d3ac0a1e877c1e;hpb=c3f9162ab11786380e2ec9c55f217c2daf7722e8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.h b/dali-toolkit/internal/visuals/primitive/primitive-visual.h index 054e9f0..6b38bd7 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.h +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.h @@ -44,6 +44,8 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// EXTERNAL INCLUDES +#include // INTERNAL INCLUDES #include @@ -58,6 +60,9 @@ namespace Toolkit namespace Internal { +class PrimitiveVisual; +typedef IntrusivePtr< PrimitiveVisual > PrimitiveVisualPtr; + /** * The visual which renders a simple 3D shape to the control's quad * @@ -74,11 +79,11 @@ namespace Internal * | %Property Name | Type | Shapes Affected | * |-------------------|-------------|------------------------------------------| * | shapeColor | VECTOR4 | all | - * | slices | INTEGER | sphere, cone, conical frustrum, cylinder | + * | slices | INTEGER | sphere, cone, conical frustum, cylinder | * | stacks | INTEGER | sphere | - * | scaleTopRadius | FLOAT | conical frustrum | - * | scaleBottomRadius | FLOAT | cone, conical frustrum | - * | scaleHeight | FLOAT | cone, conical frustrum, cylinder | + * | scaleTopRadius | FLOAT | conical frustum | + * | scaleBottomRadius | FLOAT | cone, conical frustum | + * | scaleHeight | FLOAT | cone, conical frustum, cylinder | * | scaleRadius | FLOAT | cylinder | * | scaleDimensions | VECTOR3 | cube, octahedron, bevelled cube | * | bevelPercentage | FLOAT | bevelled cube | @@ -97,46 +102,60 @@ class PrimitiveVisual: public Visual::Base public: /** - * @brief Constructor. + * @brief Create a new primitive 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. */ - PrimitiveVisual( VisualFactoryCache& factoryCache ); - - /** - * @brief A reference counted object may only be deleted by calling Unreference(). - */ - virtual ~PrimitiveVisual(); + static PrimitiveVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties ); public: // from Visual /** - * @copydoc Visual::Base::SetSize - */ - virtual void SetSize( const Vector2& size ); - - /** * @copydoc Visual::Base::GetNaturalSize */ - virtual void GetNaturalSize( Vector2& naturalSize ) const; + 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; + protected: /** - * @copydoc Visual::Base::DoInitialize + * @brief Constructor. + * + * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + */ + PrimitiveVisual( VisualFactoryCache& factoryCache ); + + /** + * @brief A reference counted object may only be deleted by calling Unreference(). */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + virtual ~PrimitiveVisual(); + + /** + * @copydoc Visual::Base::DoSetProperties + */ + virtual void DoSetProperties( const Property::Map& propertyMap ); /** * @copydoc Visual::Base::DoSetOnStage */ virtual void DoSetOnStage( Actor& actor ); + /** + * @copydoc Visual::Base::OnSetTransform + */ + virtual void OnSetTransform(); + private: //Simple struct to store the position and normal of a single vertex. @@ -306,7 +325,6 @@ private: Shader mShader; Geometry mGeometry; - Vector4 mColor; //Color of shape. Vector3 mObjectDimensions; //Dimensions of shape, scaled to be between 0.0 and 1.0. Vector3 mSceneCenter;