+PageTurnView::Page::Page()
+: isTurnBack( false )
+{
+ actor = Actor::New();
+ actor.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+ actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
+ actor.SetVisible( false );
+
+ propertyPanDisplacement = actor.RegisterProperty( PROPERTY_PAN_DISPLACEMENT, 0.f );
+ propertyPanCenter = actor.RegisterProperty(PROPERTY_PAN_CENTER, Vector2::ZERO);
+
+ propertyOriginalCenter = actor.RegisterProperty(PROPERTY_ORIGINAL_CENTER, Vector2::ZERO);
+ propertyCurrentCenter = actor.RegisterProperty(PROPERTY_CURRENT_CENTER, Vector2::ZERO);
+ Matrix zeroMatrix(true);
+ actor.RegisterProperty(PROPERTY_COMMON_PARAMETERS, zeroMatrix);
+ propertyTurnDirection = actor.RegisterProperty(PROPERTY_TURN_DIRECTION, -1.f);
+}
+
+void PageTurnView::Page::SetTexture( Texture texture )
+{
+ if( !textureSet )
+ {
+ textureSet = TextureSet::New();
+ }
+ textureSet.SetTexture( 0u, texture );
+}
+
+void PageTurnView::Page::UseEffect(Shader newShader)
+{
+ shader = newShader;
+ if( renderer )
+ {
+ renderer.SetShader( shader );
+ }
+}
+
+void PageTurnView::Page::UseEffect(Shader newShader, Geometry geometry)
+{
+ UseEffect( newShader );
+
+ if( !renderer )
+ {
+ renderer = Renderer::New( geometry, shader );
+
+ if( !textureSet )
+ {
+ textureSet = TextureSet::New();
+ }
+
+ renderer.SetTextures( textureSet );
+ renderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
+ actor.AddRenderer( renderer );
+ }
+}
+
+void PageTurnView::Page::ChangeTurnDirection()
+{
+ isTurnBack = !isTurnBack;
+ actor.SetProperty( propertyTurnDirection, isTurnBack ? 1.f : -1.f );
+}
+
+void PageTurnView::Page::SetPanDisplacement(float value)
+{
+ actor.SetProperty( propertyPanDisplacement, value );
+}
+
+void PageTurnView::Page::SetPanCenter( const Vector2& value )
+{
+ actor.SetProperty( propertyPanCenter, value );
+}
+
+void PageTurnView::Page::SetOriginalCenter( const Vector2& value )
+{
+ actor.SetProperty( propertyOriginalCenter, value );
+}
+
+void PageTurnView::Page::SetCurrentCenter( const Vector2& value )
+{
+ actor.SetProperty( propertyCurrentCenter, value );
+}
+