From a72f97ae7a1c7220834de718f3d7f5e7351414c9 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 7 Mar 2018 19:58:28 +0900 Subject: [PATCH] Add CONICAL_FRUSTUM in PrimitiveVisual - Deprecated CONICAL_FRUSTRUM because it is misspelled. - Added CONICAL_FRUSTUM. Change-Id: I4b7667ed720319d0da68c017b5a8bacd04ee7967 Signed-off-by: Seoyeon Kim --- .../src/dali-toolkit/utc-Dali-VisualFactory.cpp | 24 ++++++++++++++++++++++ build/tizen/docs/dali.doxy.in | 5 +++++ .../visuals/primitive/primitive-visual.cpp | 13 +++++++++--- .../visuals/primitive-visual-properties.h | 11 +++++----- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index 9556968..849cf7e 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -1882,6 +1882,30 @@ int UtcDaliVisualFactoryGetPrimitiveVisual17(void) END_TEST; } +//Test if primitive shape loads a conic section correctly. +int UtcDaliVisualFactoryGetPrimitiveVisual18(void) +{ + //Set up test application first, so everything else can be handled. + ToolkitTestApplication application; + + tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual18: Request primitive visual to display a conic section" ); + + //Set up visual properties. + Property::Map propertyMap; + propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE ); + propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); + propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); + propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f ); + propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f ); + + //Test to see if shape loads correctly. + TestPrimitiveVisualWithProperties( propertyMap, application ); + + END_TEST; +} + //Test if primitive shape visual handles the case of not being passed a specific shape to use. int UtcDaliVisualFactoryGetPrimitiveVisualN1(void) { diff --git a/build/tizen/docs/dali.doxy.in b/build/tizen/docs/dali.doxy.in index 1b23769..941fdbc 100755 --- a/build/tizen/docs/dali.doxy.in +++ b/build/tizen/docs/dali.doxy.in @@ -345,6 +345,7 @@ ALIASES += clip{3}="\dontinclude \1 \n \skip \2 \n \until \3" ALIASES += SINCE_1_0="@since 1.0" ALIASES += SINCE_1_1="@since 1.1" ALIASES += SINCE_1_2="@since 1.2" +ALIASES += SINCE_1_3="@since 1.3" # Extra tags for Tizen 3.0 ALIASES += SINCE_1_2_2="@since 1.2.2" @@ -359,11 +360,13 @@ ALIASES += SINCE_1_3_4="@since 1.3.4" ALIASES += SINCE_1_3_5="@since 1.3.5" ALIASES += SINCE_1_3_9="@since 1.3.9" ALIASES += SINCE_1_3_15="@since 1.3.15" + ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0" ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1" ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8" ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 1.2.10" ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 1.2" +ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 1.3" ALIASES += PLATFORM="" ALIASES += PRIVLEVEL_PLATFORM="" @@ -380,6 +383,7 @@ ALIASES += REMARK_RAWVIDEO="" #ALIASES += SINCE_1_0="\par Since:\n 2.4, DALi version 1.0" #ALIASES += SINCE_1_1="\par Since:\n 3.0, DALi version 1.1" #ALIASES += SINCE_1_2="\par Since:\n 4.0, DALi version 1.2" +#ALIASES += SINCE_1_3="\par Since:\n 5.0, DALi version 1.3" ## Extra tags for Tizen 3.0 #ALIASES += SINCE_1_2_2="\par Since:\n 3.0, DALi version 1.2.2" @@ -402,6 +406,7 @@ ALIASES += REMARK_RAWVIDEO="" #ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 3.0, DALi version 1.2.8" #ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 3.0, DALi version 1.2.10" #ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 4.0, DALi version 1.2" +#ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 5.0, DALi version 1.3" #ALIASES += PLATFORM="@platform" #ALIASES += PRIVLEVEL_PLATFORM="\par Privilege Level:\n platform" diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index 1b9df37..8a2ec88 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -46,12 +46,13 @@ namespace // shapes DALI_ENUM_TO_STRING_TABLE_BEGIN( SHAPE_TYPE ) DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, SPHERE ) -DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTRUM ) +DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTRUM ) // deprecated DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONE ) DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CYLINDER ) DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CUBE ) DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, OCTAHEDRON ) DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, BEVELLED_CUBE ) +DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTUM ) DALI_ENUM_TO_STRING_TABLE_END( SHAPE_TYPE ) //Property names @@ -90,11 +91,12 @@ const float MAX_SMOOTHNESS = 1.0; ///< Maximum bevel smoothness for bevell //Specific shape labels. const char * const SPHERE_LABEL( "SPHERE" ); const char * const CONE_LABEL( "CONE" ); -const char * const CONICAL_FRUSTRUM_LABEL( "CONICAL_FRUSTRUM" ); +const char * const CONICAL_FRUSTRUM_LABEL( "CONICAL_FRUSTRUM" ); // deprecated const char * const CYLINDER_LABEL( "CYLINDER" ); const char * const CUBE_LABEL( "CUBE" ); const char * const OCTAHEDRON_LABEL( "OCTAHEDRON" ); const char * const BEVELLED_CUBE_LABEL( "BEVELLED_CUBE" ); +const char * const CONICAL_FRUSTUM_LABEL( "CONICAL_FRUSTUM" ); //Shader properties const char * const OBJECT_MATRIX_UNIFORM_NAME( "uObjectMatrix" ); @@ -515,7 +517,7 @@ void PrimitiveVisual::CreateGeometry() CreateConic( vertices, indices, 0, mScaleBottomRadius, mScaleHeight, mSlices ); break; } - case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTRUM: + case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTRUM: // deprecated { CreateConic( vertices, indices, mScaleTopRadius, mScaleBottomRadius, mScaleHeight, mSlices ); break; @@ -543,6 +545,11 @@ void PrimitiveVisual::CreateGeometry() CreateBevelledCube( vertices, indices, mScaleDimensions, mBevelPercentage, mBevelSmoothness ); break; } + case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTUM: + { + CreateConic( vertices, indices, mScaleTopRadius, mScaleBottomRadius, mScaleHeight, mSlices ); + break; + } } mGeometry = Geometry::New(); diff --git a/dali-toolkit/public-api/visuals/primitive-visual-properties.h b/dali-toolkit/public-api/visuals/primitive-visual-properties.h index ccd4a8b..1e3afcf 100644 --- a/dali-toolkit/public-api/visuals/primitive-visual-properties.h +++ b/dali-toolkit/public-api/visuals/primitive-visual-properties.h @@ -78,7 +78,7 @@ enum * @note Optional. If not specified, the default is 128. * @note Applies to: * - Shape::SPHERE - * - Shape::CONICAL_FRUSTRUM + * - Shape::CONICAL_FRUSTUM * - Shape::CONE * - Shape::CYLINDER * @note The range is from 1 to 255. @@ -103,7 +103,7 @@ enum * @SINCE_1_1.45 * @note Optional. If not specified, the default is 1.0f. * @note Applies to: - * - Shape::CONICAL_FRUSTRUM + * - Shape::CONICAL_FRUSTUM * @note Only values greater than or equal to 0.0f are accepted. */ SCALE_TOP_RADIUS, @@ -114,7 +114,7 @@ enum * @SINCE_1_1.45 * @note Optional. If not specified, the default is 1.5f. * @note Applies to: - * - Shape::CONICAL_FRUSTRUM + * - Shape::CONICAL_FRUSTUM * - Shape::CONE * @note Only values greater than or equal to 0.0f are accepted. */ @@ -126,7 +126,7 @@ enum * @SINCE_1_1.45 * @note Optional. If not specified, the default is 3.0f. * @note Applies to: - * - Shape::CONICAL_FRUSTRUM + * - Shape::CONICAL_FRUSTUM * - Shape::CONE * - Shape::CYLINDER * @note Only values greater than or equal to 0.0f are accepted. @@ -208,12 +208,13 @@ namespace Shape enum Type { SPHERE, ///< A perfectly round geometrical object in three-dimensional space. @SINCE_1_1.45 - CONICAL_FRUSTRUM, ///< The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_1.45 + CONICAL_FRUSTRUM, ///< @DEPRECATED_1_3.15, use CONICAL_FRUSTUM instead. The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_1.45 CONE, ///< Equivalent to a conical frustum with top radius of zero. @SINCE_1_1.45 CYLINDER, ///< Equivalent to a conical frustum with equal radii for the top and bottom circles. @SINCE_1_1.45 CUBE, ///< Equivalent to a bevelled cube with a bevel percentage of zero. @SINCE_1_1.45 OCTAHEDRON, ///< Equivalent to a bevelled cube with a bevel percentage of one. @SINCE_1_1.45 BEVELLED_CUBE, ///< A cube/cuboid with all edges flattened to some degree. @SINCE_1_1.45 + CONICAL_FRUSTUM ///< The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_3.15 }; } -- 2.7.4