1 #include <dali-toolkit/dali-toolkit.h>
2 #include <dali/public-api/object/property-map.h>
3 #include <dali-toolkit/public-api/controls/slider/slider.h>
6 using namespace Dali::Toolkit;
11 const char* BUTTON_IMAGE_URL[] =
13 DEMO_IMAGE_DIR "sphere-button.png",
14 DEMO_IMAGE_DIR "cone-button.png",
15 DEMO_IMAGE_DIR "conical-frustrum-button.png",
16 DEMO_IMAGE_DIR "cylinder-button.png",
17 DEMO_IMAGE_DIR "cube-button.png",
18 DEMO_IMAGE_DIR "bevelled-cube-button.png",
19 DEMO_IMAGE_DIR "octahedron-button.png"
22 //Shape property defaults
23 const int DEFAULT_SLICES = 32;
24 const int DEFAULT_STACKS = 32;
25 const float DEFAULT_SCALE_HEIGHT = 16.0f;
26 const float DEFAULT_SCALE_BOTTOM_RADIUS = 8.0f;
27 const float DEFAULT_SCALE_TOP_RADIUS = 4.0f;
28 const float DEFAULT_SCALE_RADIUS = 8.0f;
29 const float DEFAULT_BEVEL_PERCENTAGE = 0.3f;
30 const float DEFAULT_BEVEL_SMOOTHNESS = 0.0f;
32 //Shape property limits
33 const int SLICES_LOWER_BOUND = 3;
34 const int SLICES_UPPER_BOUND = 16;
35 const int STACKS_LOWER_BOUND = 2;
36 const int STACKS_UPPER_BOUND = 16;
38 //Used to the control rate of rotation when panning an object.
39 const float X_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
40 const float Y_ROTATION_DISPLACEMENT_FACTOR = 60.0f;
42 const int NUM_MODELS = 7; //Total number of possible base shapes.
43 const int MAX_PROPERTIES = 3; //Maximum number of properties a shape may require. (For displaying sliders.)
47 class PrimitiveShapesController : public ConnectionTracker
51 PrimitiveShapesController( Application& application )
52 : mApplication( application ),
53 mColor( Vector4( 0.3f, 0.7f, 1.0f, 1.0f ) ),
54 mRotation( Vector2::ZERO )
56 // Connect to the Application's Init signal
57 mApplication.InitSignal().Connect( this, &PrimitiveShapesController::Create );
60 ~PrimitiveShapesController()
64 // The Init signal is received once (only) during the Application lifetime
65 void Create( Application& application )
67 // Get a handle to the stage
68 Stage stage = Stage::GetCurrent();
69 stage.SetBackgroundColor( Color::WHITE );
71 // Hide the indicator bar
72 application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
74 //Set up layer to place UI on.
75 Layer layer = Layer::New();
76 layer.SetParentOrigin( ParentOrigin::CENTER );
77 layer.SetAnchorPoint( AnchorPoint::CENTER );
78 layer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
79 layer.SetBehavior( Layer::LAYER_2D ); //We use a 2D layer as this is closer to UI work than full 3D scene creation.
80 layer.SetDepthTestDisabled( false ); //Enable depth testing, as otherwise the 2D layer would not do so.
83 //Set up model selection buttons.
84 SetupButtons( layer );
86 //Set up model parameter sliders.
87 SetupSliders( layer );
92 //Allow for exiting of the application via key presses.
93 stage.KeyEventSignal().Connect( this, &PrimitiveShapesController::OnKeyEvent );
96 //Place buttons on the top of the screen, which allow for selection of the shape to be displayed.
97 //The buttons are laid out like so:
99 // ^ +--------------------------------+
101 // | | +----+ +----+ +----+ +----+ |
102 // | | | | | | | | | | |
103 // 30% | | +----+ +----+ +----+ +----+ |
105 // | | +----+ +----+ +----+ |
107 // v | +----+ +----+ +----+ |
127 // +--------------------------------+
129 void SetupButtons( Layer layer )
131 float containerPadding = 10.0f;
132 float buttonPadding = 5.0f;
134 //Create a variable-length container that can wrap buttons around as more are added.
135 FlexContainer buttonContainer = FlexContainer::New();
136 buttonContainer.SetParentOrigin( ParentOrigin::TOP_CENTER );
137 buttonContainer.SetAnchorPoint( AnchorPoint::TOP_CENTER );
138 buttonContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
139 buttonContainer.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::HEIGHT );
140 buttonContainer.SetSizeModeFactor( Vector3( 0.0, 0.3, 0.0 ) ); //30% of height.
141 buttonContainer.SetPadding( Padding( containerPadding, containerPadding, containerPadding, containerPadding ) );
142 buttonContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW );
143 buttonContainer.SetProperty( FlexContainer::Property::FLEX_WRAP, FlexContainer::WRAP );
145 layer.Add( buttonContainer );
147 //Create buttons and place them in the container.
148 for( int modelNumber = 0; modelNumber < NUM_MODELS; modelNumber++ )
150 PushButton button = Toolkit::PushButton::New();
151 button.SetParentOrigin( ParentOrigin::CENTER );
152 button.SetAnchorPoint( AnchorPoint::CENTER );
153 button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
154 button.SetPadding( Padding( buttonPadding, buttonPadding, buttonPadding, buttonPadding ) );
155 button.SetProperty( Button::Property::UNSELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
156 button.SetProperty( Button::Property::SELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
157 button.RegisterProperty( "modelNumber", Property::Value( modelNumber ) );
158 button.ClickedSignal().Connect( this, &PrimitiveShapesController::OnChangeShapeClicked );
160 buttonContainer.Add( button );
164 //Add sliders to the bottom of the screen, which allow for control of shape properties such as radius.
165 //Each slider is placed next to a label that states the property it affects.
166 //The sliders are laid out like so:
168 // +--------------------------------+
188 // ^ | Label +----------O-----------+ |
191 // | | Label +--O-------------------+ |
194 // | | Label +----------------------O |
196 // v +--------------------------------+
198 void SetupSliders( Layer layer )
200 //Create table to hold sliders and their corresponding labels.
201 mSliderTable = Toolkit::TableView::New( MAX_PROPERTIES, 2 );
202 mSliderTable.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
203 mSliderTable.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
204 mSliderTable.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
205 mSliderTable.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height.
206 mSliderTable.SetFitWidth( 0 ); //Label column should fit to natural size of label.
207 mSliderTable.SetRelativeWidth( 1, 1.0f ); //Slider column should fill remaining space.
208 mSliderTable.SetCellPadding( Vector2( 10.0f, 0.0f ) ); //Leave a gap between the slider and its label.
209 layer.Add( mSliderTable );
211 //Set up sliders, and place labels next to them.
212 for( int i = 0; i < MAX_PROPERTIES; i++ )
215 Slider slider = Slider::New();
216 slider.SetParentOrigin( ParentOrigin::CENTER );
217 slider.SetAnchorPoint( AnchorPoint::CENTER );
218 slider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
219 slider.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
220 slider.ValueChangedSignal().Connect( this, &PrimitiveShapesController::OnSliderValueChanged );
221 mSliders.push_back( slider );
223 //Setup slider cell properties
224 mSliderTable.AddChild( slider, TableView::CellPosition( i, 1 ) );
225 mSliderTable.SetCellAlignment( TableView::CellPosition( i, 1 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
227 //Create slider label
228 TextLabel sliderLabel = TextLabel::New();
229 sliderLabel.SetParentOrigin( ParentOrigin::CENTER );
230 sliderLabel.SetAnchorPoint( AnchorPoint::CENTER );
231 sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
232 mSliderLabels.push_back( sliderLabel );
234 //Setup slider-label cell properties
235 mSliderTable.AddChild( sliderLabel, TableView::CellPosition( i, 0 ) );
236 mSliderTable.SetCellAlignment( TableView::CellPosition( i, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
240 //Adds a control to the centre of the stage to display the 3D shapes.
241 //The model is placed in the center of the screen, like so:
243 // +--------------------------------+
271 // +--------------------------------+
273 void SetupModel( Layer layer )
275 //Create a container to house the visual-holding actor, to provide a constant hitbox.
276 Actor container = Actor::New();
277 container.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
278 container.SetSizeModeFactor( Vector3( 0.9, 0.3, 0.0 ) ); //90% of width, 30% of height.
279 container.SetParentOrigin( ParentOrigin::CENTER );
280 container.SetAnchorPoint( AnchorPoint::CENTER );
281 layer.Add( container );
283 //Create control to display the 3D primitive.
284 mModel = Control::New();
285 mModel.SetParentOrigin( ParentOrigin::CENTER );
286 mModel.SetAnchorPoint( AnchorPoint::CENTER);
287 mModel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
288 container.Add( mModel );
290 //Load default shape.
293 //Make model spin to demonstrate 3D.
294 mRotationAnimation = Animation::New(15.0f);
295 mRotationAnimation.AnimateBy( Property( mModel, Actor::Property::ORIENTATION ),
296 Quaternion( Degree( 0.0f ), Degree( 360.0f ), Degree( 0.0f ) ) );
297 mRotationAnimation.SetLooping(true);
298 mRotationAnimation.Play();
300 //Attach gesture detector to pan models when rotated.
301 mPanGestureDetector = PanGestureDetector::New();
302 mPanGestureDetector.Attach( container );
303 mPanGestureDetector.DetectedSignal().Connect( this, &PrimitiveShapesController::OnPan );
306 //Clears all sliders and resets the primitive visual property map.
307 void InitialiseSlidersAndModel()
310 for( unsigned i = 0; i < mSliders.size(); i++ )
312 mSliders.at( i ).SetProperty( Slider::Property::MARKS, Property::Value( 0 ) ); //Remove marks
313 mSliders.at( i ).SetVisible( false );
314 mSliderLabels.at( i ).SetProperty( TextLabel::Property::TEXT, Property::Value( "Default" ) );
315 mSliderLabels.at( i ).SetVisible( false );
318 //Visual map for model
320 mVisualMap[ Visual::Property::TYPE ] = Visual::PRIMITIVE;
321 mVisualMap[ PrimitiveVisual::Property::MIX_COLOR ] = mColor;
324 //Sets the 3D model to a sphere and modifies the sliders appropriately.
327 InitialiseSlidersAndModel();
329 //Set up specific visual properties.
330 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::SPHERE;
331 mVisualMap[ PrimitiveVisual::Property::SLICES ] = DEFAULT_SLICES;
332 mVisualMap[ PrimitiveVisual::Property::STACKS ] = DEFAULT_STACKS;
335 SetupSlider( 0, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
336 SetupMarks( mSliders.at( 0 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
337 SetupSlider( 1, STACKS_LOWER_BOUND, STACKS_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::STACKS, "stacks" );
338 SetupMarks( mSliders.at( 1 ), STACKS_LOWER_BOUND, STACKS_UPPER_BOUND );
340 //Set model in control.
341 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
344 //Sets the 3D model to a cone and modifies the sliders appropriately.
347 InitialiseSlidersAndModel();
349 //Set up specific visual properties.
350 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::CONE;
351 mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT ] = DEFAULT_SCALE_HEIGHT;
352 mVisualMap[ PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS ] = DEFAULT_SCALE_BOTTOM_RADIUS;
353 mVisualMap[ PrimitiveVisual::Property::SLICES ] = DEFAULT_SLICES;
356 SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
357 SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
358 SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
359 SetupMarks( mSliders.at( 2 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
361 //Set model in control.
362 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
365 //Sets the 3D model to a conical frustrum and modifies the sliders appropriately.
366 void LoadConicalFrustrum()
368 InitialiseSlidersAndModel();
370 //Set up specific visual properties.
371 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::CONICAL_FRUSTRUM;
372 mVisualMap[ PrimitiveVisual::Property::SCALE_TOP_RADIUS ] = DEFAULT_SCALE_TOP_RADIUS;
373 mVisualMap[ PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS ] = DEFAULT_SCALE_BOTTOM_RADIUS;
374 mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT ] = DEFAULT_SCALE_HEIGHT;
375 mVisualMap[ PrimitiveVisual::Property::SLICES ] = DEFAULT_SLICES;
377 //Set up used sliders.
378 SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
379 SetupSlider( 1, 0.0f, 32.0f, DEFAULT_SCALE_BOTTOM_RADIUS, PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, "scaleBottomRadius" );
380 SetupSlider( 2, 0.0f, 32.0f, DEFAULT_SCALE_TOP_RADIUS, PrimitiveVisual::Property::SCALE_TOP_RADIUS, "scaleTopRadius" );
382 //Set model in control.
383 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
386 //Sets the 3D model to a cylinder and modifies the sliders appropriately.
389 InitialiseSlidersAndModel();
391 //Set up specific visual properties.
392 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::CYLINDER;
393 mVisualMap[ PrimitiveVisual::Property::SCALE_HEIGHT ] = DEFAULT_SCALE_HEIGHT;
394 mVisualMap[ PrimitiveVisual::Property::SCALE_RADIUS ] = DEFAULT_SCALE_RADIUS;
395 mVisualMap[ PrimitiveVisual::Property::SLICES ] = DEFAULT_SLICES;
397 //Set up used sliders.
398 SetupSlider( 0, 1.0f, 32.0f, DEFAULT_SCALE_HEIGHT, PrimitiveVisual::Property::SCALE_HEIGHT, "scaleHeight" );
399 SetupSlider( 1, 1.0f, 32.0f, DEFAULT_SCALE_RADIUS, PrimitiveVisual::Property::SCALE_RADIUS, "scaleRadius" );
400 SetupSlider( 2, SLICES_LOWER_BOUND, SLICES_UPPER_BOUND, DEFAULT_STACKS, PrimitiveVisual::Property::SLICES, "slices" );
401 SetupMarks( mSliders.at( 2 ), SLICES_LOWER_BOUND, SLICES_UPPER_BOUND );
403 //Set model in control.
404 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
407 //Sets the 3D model to a cube and modifies the sliders appropriately.
410 InitialiseSlidersAndModel();
412 //Set up specific visual properties.
413 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::CUBE;
415 //Set model in control.
416 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
419 //Sets the 3D model to a bevelled cube and modifies the sliders appropriately.
420 void LoadBevelledCube()
422 InitialiseSlidersAndModel();
424 //Set up specific visual properties.
425 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::BEVELLED_CUBE;
426 mVisualMap[ PrimitiveVisual::Property::BEVEL_PERCENTAGE ] = DEFAULT_BEVEL_PERCENTAGE;
427 mVisualMap[ PrimitiveVisual::Property::BEVEL_SMOOTHNESS ] = DEFAULT_BEVEL_SMOOTHNESS;
429 //Set up used sliders.
430 SetupSlider( 0, 0.0f, 1.0f, DEFAULT_BEVEL_PERCENTAGE, PrimitiveVisual::Property::BEVEL_PERCENTAGE, "bevelPercentage" );
431 SetupSlider( 1, 0.0f, 1.0f, DEFAULT_BEVEL_SMOOTHNESS, PrimitiveVisual::Property::BEVEL_SMOOTHNESS, "bevelSmoothness" );
433 //Set model in control.
434 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
437 //Sets the 3D model to an octahedron and modifies the sliders appropriately.
438 void LoadOctahedron()
440 InitialiseSlidersAndModel();
442 //Set up specific visual properties.
443 mVisualMap[ PrimitiveVisual::Property::SHAPE ] = PrimitiveVisual::Shape::OCTAHEDRON;
445 //Set model in control.
446 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
449 //Sets up the slider at the given index for the supplied property, and labels it appropriately.
450 // visualProperty is the property that will be set by this slider.
451 void SetupSlider( int sliderIndex, float lowerBound, float upperBound, float startPoint,
452 Property::Index visualProperty, std::string visualPropertyLabel )
454 //Set up the slider itself.
455 mSliders.at( sliderIndex ).RegisterProperty( "visualProperty", Property::Value( visualProperty ), Property::READ_WRITE );
456 mSliders.at( sliderIndex ).SetProperty( Slider::Property::LOWER_BOUND, Property::Value( lowerBound ) );
457 mSliders.at( sliderIndex ).SetProperty( Slider::Property::UPPER_BOUND, Property::Value( upperBound ) );
458 mSliders.at( sliderIndex ).SetProperty( Slider::Property::VALUE, Property::Value( startPoint ) );
459 mSliders.at( sliderIndex ).SetVisible( true );
461 //Label the slider with the property.
462 //We reset the TextLabel to force a relayout of the table.
463 mSliderTable.RemoveChildAt( TableView::CellPosition(sliderIndex, 0) );
465 TextLabel sliderLabel = TextLabel::New( visualPropertyLabel );
466 sliderLabel.SetParentOrigin( ParentOrigin::CENTER );
467 sliderLabel.SetAnchorPoint( AnchorPoint::CENTER );
468 sliderLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
470 mSliderTable.AddChild( sliderLabel, TableView::CellPosition( sliderIndex, 0 ) );
471 mSliderTable.SetCellAlignment( TableView::CellPosition( sliderIndex, 0 ), HorizontalAlignment::LEFT, VerticalAlignment::CENTER );
473 mSliderLabels.at( sliderIndex ).SetVisible( true );
474 mSliderLabels.at( sliderIndex) = sliderLabel;
477 //Setup snapping to integer values between the two given values.
478 void SetupMarks( Slider& slider, int lower, int upper )
480 Property::Array marks;
482 for( int mark = lower; mark <= upper; mark++ )
484 marks.PushBack( Property::Value( mark ) );
487 slider.SetProperty( Slider::Property::MARKS, Property::Value( marks ) );
488 slider.SetProperty( Slider::Property::SNAP_TO_MARKS, Property::Value( true ) );
491 //When a shape button is tapped, switch to the corresponding shape.
492 bool OnChangeShapeClicked( Button button )
494 //Get the model number from the button.
496 button.GetProperty( button.GetPropertyIndex( "modelNumber" ) ).Get( modelNumber );
498 //Switch to the shape that corresponds to the model number.
499 switch( modelNumber )
513 LoadConicalFrustrum();
541 //When the slider is adjusted, change the corresponding shape property accordingly.
542 bool OnSliderValueChanged( Slider slider, float value )
544 //Update property map to reflect the change to the specific visual property.
546 slider.GetProperty( slider.GetPropertyIndex( "visualProperty" ) ).Get( visualProperty );
547 mVisualMap[ visualProperty ] = value;
549 //Reload the model to display the change.
550 mModel.SetProperty( Control::Property::BACKGROUND, Property::Value( mVisualMap ) );
555 //Panning around the shape rotates it.
556 void OnPan( Actor actor, const PanGesture& gesture )
558 switch( gesture.state )
560 case Gesture::Started:
562 //Pause animation, as the gesture will be used to manually rotate the model
563 mRotationAnimation.Pause();
567 case Gesture::Continuing:
569 //Rotate based off the gesture.
570 mRotation.x -= gesture.displacement.y / X_ROTATION_DISPLACEMENT_FACTOR; // Y displacement rotates around X axis
571 mRotation.y += gesture.displacement.x / Y_ROTATION_DISPLACEMENT_FACTOR; // X displacement rotates around Y axis
572 Quaternion rotation = Quaternion( Radian( mRotation.x ), Vector3::XAXIS) *
573 Quaternion( Radian( mRotation.y ), Vector3::YAXIS);
575 mModel.SetOrientation( rotation );
579 case Gesture::Finished:
581 //Return to automatic animation
582 mRotationAnimation.Play();
586 case Gesture::Cancelled:
588 //Return to automatic animation
589 mRotationAnimation.Play();
600 //If escape or the back button is pressed, quit the application (and return to the launcher)
601 void OnKeyEvent( const KeyEvent& event )
603 if( event.state == KeyEvent::Down )
605 if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
613 Application& mApplication;
615 std::vector<Slider> mSliders; ///< Holds the sliders on screen that each shape accesses.
616 std::vector<TextLabel> mSliderLabels; ///< Holds the labels to each slider.
617 TableView mSliderTable; ///< A table to layout the sliders next to their labels.
619 Property::Map mVisualMap; ///< Property map to create a primitive visual.
620 Control mModel; ///< Control to house the primitive visual.
622 PanGestureDetector mPanGestureDetector; ///< Detects pan gestures for rotation of the model.
623 Animation mRotationAnimation; ///< Automatically rotates the model, unless it is being panned.
625 Vector4 mColor; ///< Color to set all shapes.
626 Vector2 mRotation; ///< Keeps track of model rotation.
629 void RunTest( Application& application )
631 PrimitiveShapesController test( application );
633 application.MainLoop();
636 // Entry point for Linux & Tizen applications
638 int main( int argc, char **argv )
640 Application application = Application::New( &argc, &argv );
642 RunTest( application );