DaliLog::PrintPass();
}
+void ActorSetInheritPositionP()
+{
+
+ Actor parent = Actor::New();
+ Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
+ parent.SetPosition( parentPosition );
+ parent.SetParentOrigin( ParentOrigin::CENTER );
+ parent.SetAnchorPoint( AnchorPoint::CENTER );
+ Stage::GetCurrent().Add( parent );
+
+ Actor child = Actor::New();
+ child.SetParentOrigin( ParentOrigin::CENTER );
+ child.SetAnchorPoint( AnchorPoint::CENTER );
+ Vector3 childPosition( 10.0f, 11.0f, 12.0f );
+ child.SetPosition( childPosition );
+ parent.Add( child );
+
+ // The actors should not have a world position yet
+ DALI_CHECK_FAIL(parent.GetCurrentWorldPosition() != Vector3::ZERO, "Position of parent is wrong." );
+ DALI_CHECK_FAIL(child.GetCurrentWorldPosition() != Vector3::ZERO, "Position of child is wrong." );
+
+ // first test default, which is to inherit position
+ DALI_CHECK_FAIL(child.IsPositionInherited() != true, "Inherited Position of child is wrong." );
+
+ //Change child position
+ Vector3 childOffset( -1.0f, 1.0f, 0.0f );
+ child.SetPosition( childOffset );
+
+ // Use local position as world postion
+ child.SetInheritPosition( false );
+ DALI_CHECK_FAIL(child.IsPositionInherited() != false, "Inherited Position of child is wrong." );
+
+ DaliLog::PrintPass();
+
+}
+
+void ActorIsPositionInheritedP()
+{
+
+ Actor parent = Actor::New();
+ Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
+ parent.SetPosition( parentPosition );
+ parent.SetParentOrigin( ParentOrigin::CENTER );
+ parent.SetAnchorPoint( AnchorPoint::CENTER );
+ Stage::GetCurrent().Add( parent );
+
+ Actor child = Actor::New();
+ child.SetParentOrigin( ParentOrigin::CENTER );
+ child.SetAnchorPoint( AnchorPoint::CENTER );
+ Vector3 childPosition( 10.0f, 11.0f, 12.0f );
+ child.SetPosition( childPosition );
+ parent.Add( child );
+
+ // The actors should not have a world position yet
+ DALI_CHECK_FAIL(parent.GetCurrentWorldPosition() != Vector3::ZERO, "Position of parent is wrong." );
+ DALI_CHECK_FAIL(child.GetCurrentWorldPosition() != Vector3::ZERO, "Position of child is wrong." );
+
+ // first test default, which is to inherit position
+ DALI_CHECK_FAIL(child.IsPositionInherited() != true, "Inherited Position of child is wrong." );
+
+ DaliLog::PrintPass();
+}
ACTOR_GET_LEAVE_REQUIRED_P2,
ACTOR_GET_TARGET_SIZE_P,
ACTOR_SCREEN_TO_LOCAL_P,
- ACTOR_REMOVE_P
+ ACTOR_REMOVE_P,
+ ACTOR_SET_INHERIT_POSITION_P,
+ ACTOR_IS_POSITION_INHERITED_P
+
};
struct Actor_TestApp : public ConnectionTracker
case ACTOR_REMOVE_P:
ActorRemoveP();
break;
+
+ case ACTOR_SET_INHERIT_POSITION_P:
+ ActorSetInheritPositionP();
+ break;
+
+ case ACTOR_IS_POSITION_INHERITED_P:
+ ActorIsPositionInheritedP();
+ break;
}
}
/**
* @testcase UtcDaliActorNewP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if New api works or not.
*/
/**
* @testcase UtcDaliActorDowncastP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if DownCast api works or not.
*/
/**
* @testcase UtcDaliActorGetIdP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetId api works or not.
*/
/**
* @testcase UtcDaliActorGetChildCountP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetChildCount api works or not.
*/
/**
* @testcase UtcDaliActorSetNameP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetName api works or not.
*/
/**
* @testcase UtcDaliActorGetNameP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetName api works or not.
*/
/**
* @testcase UtcDaliActorSetDrawmodeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetDrawmode api works or not.
*/
/**
* @testcase UtcDaliActorGetDrawmodeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetDrawmode api works or not.
*/
/**
* @testcase UtcDaliActorGetChildAtP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetChildAt api works or not.
*/
/**
* @testcase UtcDaliActorGetParentP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetParent api works or not.
*/
/**
* @testcase UtcDaliActorFindChildByNameP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if FindChildByName api works or not.
*/
/**
* @testcase UtcDaliActorFindChildByIdP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if FindChildById api works or not.
*/
/**
* @testcase UtcDaliActorUnparentP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if Unparent api works or not.
*/
/**
* @testcase UtcDaliActorUnparentAndResetP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if UnparentAndReset api works or not.
*/
/**
* @testcase UtcDaliActorAddP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if Add api works or not.
*/
/**
* @testcase UtcDaliActorSetKeyboardFocusableP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetKeyboardFocusable api works or not.
*/
/**
* @testcase UtcDaliActorIsKeyboardFocusableP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsKeyboardFocusable api works or not.
*/
/**
* @testcase UtcDaliActorSetVisibleP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetVisible api works or not.
*/
/**
* @testcase UtcDaliActorIsVisibleP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsVisible api works or not.
*/
/**
* @testcase UtcDaliActorSetXYZP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetXYZ api works or not.
*/
/**
* @testcase UtcDaliActorOnStageP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if OnStage api works or not.
*/
/**
* @testcase UtcDaliActorGetLayerP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetLayer api works or not.
*/
/**
* @testcase UtcDaliActorIsLayerP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsLayer api works or not.
*/
/**
* @testcase UtcDaliActorIsRootP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsRoot api works or not.
*/
/**
* @testcase UtcDaliActorOnStageSignalP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if OnStageSignal api works or not.
*/
/**
* @testcase UtcDaliActorOffStageSignalP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if OffStageSignal api works or not.
*/
/**
* @testcase UtcDaliActorSetAnchorPointP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetAnchorPoint api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentAnchorPointP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentAnchorPoint api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentWorldColorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentWorldColor api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentColorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentColor api works or not.
*/
/**
* @testcase UtcDaliActorSetColorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetColor api works or not.
*/
/**
* @testcase UtcDaliActorSetColorModeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetColorMode api works or not.
*/
/**
* @testcase UtcDaliActorGetColorModeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetColorMode api works or not.
*/
/**
* @testcase UtcDaliActorSetOpacityP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetOpacity api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentOpacityP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentOpacity api works or not.
*/
/**
* @testcase UtcDaliActorSetParentOriginP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetParentOrigin api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentParentOriginP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentParentOrigin api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentWorldPositionP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentWorldPosition api works or not.
*/
/**
* @testcase UtcDaliActorSetPositionInheritanceModeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetPositionInheritanceMode api works or not.
*/
/**
* @testcase UtcDaliActorGetPositionInheritanceModeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetPositionInheritanceMode api works or not.
*/
/**
* @testcase UtcDaliActorSetPositionP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetPosition api works or not.
*/
/**
* @testcase UtcDaliActorSetPositionP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetPosition api works or not.
*/
/**
* @testcase UtcDaliActorSetPositionP3
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetPosition api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentPositionP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentPosition api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentPositionP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentPosition api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentPositionP3
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentPosition api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentWorldOrientationP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentWorldOrientation api works or not.
*/
/**
* @testcase UtcDaliActorIsOrientationInheritedP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsOrientationInherited api works or not.
*/
/**
* @testcase UtcDaliActorSetOrientationP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetOrientation api works or not.
*/
/**
* @testcase UtcDaliActorSetOrientationP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetOrientation api works or not.
*/
/**
* @testcase UtcDaliActorSetOrientationP3
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetOrientation api works or not.
*/
/**
* @testcase UtcDaliActorSetInheritOrientationP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetInheritOrientation api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentOrientationP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentOrientation api works or not.
*/
/**
* @testcase UtcDaliActorSetInheritScaleP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetInheritScale api works or not.
*/
/**
* @testcase UtcDaliActorIsScaleInheritedP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsScaleInherited api works or not.
*/
/**
* @testcase UtcDaliActorSetScaleP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetScale api works or not.
*/
/**
* @testcase UtcDaliActorSetScaleP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetScale api works or not.
*/
/**
* @testcase UtcDaliActorSetScaleP3
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetScale api works or not.
*/
/**
* @testcase UtcDaliActorScaleByP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if ScaleBy api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentWorldScaleP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentWorldScale api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentWorldMatrixP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentWorldMatrix api works or not.
*/
/**
* @testcase UtcDaliActorSetSensitiveP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSensitive api works or not.
*/
/**
* @testcase UtcDaliActorIsSensitiveP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if IsSensitive api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSize api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSize api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeP3
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSize api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeP4
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSize api works or not.
*/
/**
* @testcase UtcDaliActorGetCurrentSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetCurrentSize api works or not.
*/
/**
* @testcase UtcDaliActorSetPaddingP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetPadding api works or not.
*/
/**
* @testcase UtcDaliActorGetPaddingP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetPadding api works or not.
*/
/**
* @testcase UtcDaliActorTranslateByP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if TranslateBy api works or not.
*/
/**
* @testcase UtcDaliActorSetMaximumSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetMaximumSize api works or not.
*/
/**
* @testcase UtcDaliActorGetMaximumSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetMaximumSize api works or not.
*/
/**
* @testcase UtcDaliActorGetMinimumSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetMinimumSize api works or not.
*/
/**
* @testcase UtcDaliActorSetMinimumSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetMinimumSize api works or not.
*/
/**
* @testcase UtcDaliActorOnRelayoutSignalP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if OnRelayoutSignal api works or not.
*/
/**
* @testcase UtcDaliActorSetResizePolicyP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetResizePolicy api works or not.
*/
/**
* @testcase UtcDaliActorGetHeightForWidthP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetHeightForWidth api works or not.
*/
/**
* @testcase UtcDaliActorGetWidthForHeightP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetWidthForHeight api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeModeFactorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSizeModeFactor api works or not.
*/
/**
* @testcase UtcDaliActorGetSizeModeFactorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetSizeModeFactor api works or not.
*/
/**
* @testcase UtcDaliActorSetSizeScalePolicyP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetSizeScalePolicy api works or not.
*/
/**
* @testcase UtcDaliActorGetSizeScalePolicyP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetSizeScalePolicy api works or not.
*/
/**
* @testcase UtcDaliActorRotateByP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if RotateBy api works or not.
*/
/**
* @testcase UtcDaliActorRotateByP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if RotateBy api works or not.
*/
/**
* @testcase UtcDaliActorGetNaturalSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetNaturalSize api works or not.
*/
/**
* @testcase UtcDaliActorResizePolicyP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if ResizePolicy api works or not.
*/
/**
* @testcase UtcDaliActorOperatorAssignmentP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if OperatorAssignment api works or not.
*/
/**
* @testcase UtcDaliActorGetRelayoutSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetRelayoutSize api works or not.
*/
/**
* @testcase UtcDaliActorConstructorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if Constructor api works or not.
*/
/**
* @testcase UtcDaliActorCopyConstructorP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if CopyConstructor api works or not.
*/
/**
* @testcase UtcDaliActorGetHierarchyDepthP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetHierarchyDepth api works or not.
*/
/**
* @testcase UtcDaliActorSetLeaveRequiredP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetLeaveRequired api works or not.
*/
/**
* @testcase UtcDaliActorSetLeaveRequiredP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if SetLeaveRequired api works or not.
*/
/**
* @testcase UtcDaliActorGetLeaveRequiredP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetLeaveRequired api works or not.
*/
/**
* @testcase UtcDaliActorGetLeaveRequiredP2
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetLeaveRequired api works or not.
*/
/**
* @testcase UtcDaliActorGetTargetSizeP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if GetTargetSize api works or not.
*/
/**
* @testcase UtcDaliActorScreenToLocalP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if ScreenToLocal api works or not.
*/
/**
* @testcase UtcDaliActorRemoveP
- * @since_tizen 2.4
+ * @since_tizen 2.4
* @description check if Remove api works or not.
*/
return test_return_value;
}
+/**
+ * @testcase UtcDaliActorSetInheritPositionP
+ * @since_tizen 2.4
+ * @description check if SetInheritPosition api works or not.
+ */
+
+int UtcDaliActorSetInheritPositionP(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv);
+ CHECK_GL;
+ Actor_TestApp testApp(application, ACTOR_SET_INHERIT_POSITION_P );
+ application.MainLoop();
+
+ return test_return_value;
+}
+
+/**
+ * @testcase UtcDaliActorIsPositionInheritedP
+ * @since_tizen 2.4
+ * @description check if IsPositionInherited api works or not.
+ */
+
+int UtcDaliActorIsPositionInheritedP(void)
+{
+ DaliLog::PrintExecStarted( SUITE_NAME, __FUNCTION__ );
+
+ Application application = Application::New( &gArgc, &gArgv);
+ CHECK_GL;
+ Actor_TestApp testApp(application, ACTOR_IS_POSITION_INHERITED_P );
+ application.MainLoop();
+
+ return test_return_value;
+}