// -----------------------------------------------------------------------------
// CTestPlatAlfVisual::TestRealRectMethods
// -----------------------------------------------------------------------------
//
TInt CTestPlatAlfVisual::TestRealRectMethods( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
    _LIT( KTestRealRectMethods, "TestRealRectMethods" );
    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealRectMethods );
    // Print to log file
    iLog->Log( KTestRealRectMethods );
    
    TAlfRealRect realRect;
    
    TRect rect;
    rect == realRect; //operator TRect() const
    
    realRect.Width(); //TReal32 Width() const
    realRect.Height(); //TReal32 Height() const
    realRect.TopRight(); //TAlfRealPoint TopRight() const
    realRect.BottomLeft(); //TAlfRealPoint BottomLeft() const
    realRect.Size(); //TAlfRealSize Size() const
    realRect.Center(); //TAlfRealPoint Center() const
    realRect.Grow( 1.0, 1.0 ); //void Grow(TReal32 aX, TReal32 aY)
    realRect.Shrink( 1.0, 1.0 ); //void Shrink(TReal32 aX, TReal32 aY)
    
    TPoint point( 1, 1 );
    realRect.Shrink( point ); //void Shrink(const TPoint& aPoint)
    
    TAlfRealPoint realPoint( 1.0, 1.0 );
    realRect.Shrink( realPoint ); //void Shrink(const TAlfRealPoint& aPoint)
    
    realRect.Shrink( realRect ); //void Shrink(const TAlfRealRect& aRect)
    realRect.Move( 1.0, 1.0 ); //void Move(TReal32 aDx, TReal32 aDy)
    
    return KErrNone;
    }
Esempio n. 2
0
Vector3 Test::GetRealPoint(const Vector2& point)
{
    Vector3 realPoint(point);

	Landscape *land = GetLandscape();
    land->PlacePoint(realPoint, realPoint);

    realPoint.z += SettingsManager::Instance()->GetCameraElevation();
    
    return realPoint;
}
// -----------------------------------------------------------------------------
// CTestPlatAlfVisual::TestTimedPointTargetMethods
// -----------------------------------------------------------------------------
//
TInt CTestPlatAlfVisual::TestTimedPointTargetMethods( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
    _LIT( KTestTimedPointTargetMethods, "TestTimedPointTargetMethods" );
    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointTargetMethods );
    // Print to log file
    iLog->Log( KTestTimedPointTargetMethods );
    
    TAlfTimedPoint point;
    TAlfRealPoint realPoint( 1.0, 1.0 );
    point.SetTarget( realPoint, KGeneralNum );
    point.SetTarget( 1.0, KGeneralNum );
    point.SetTargetWithSpeed( realPoint, KGeneralNum );
    point.SetTargetWithSpeed( 1.0, KGeneralNum );
    point.Target();
    point.TimeToTargetinMilliSeconds();
    point.IntTarget();
    
    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestPlatAlfVisual::TestRealSizeMethods
// -----------------------------------------------------------------------------
//
TInt CTestPlatAlfVisual::TestRealSizeMethods( CStifItemParser& /*aItem*/ )
    {
    // Print to UI
    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
    _LIT( KTestRealSizeMethods, "TestRealSizeMethods" );
    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealSizeMethods );
    // Print to log file
    iLog->Log( KTestRealSizeMethods );
    
    TAlfRealSize realSize1( 2.0, 2.0 );
    
    TSize size( 2, 2 );
    TAlfRealSize realSize2( size );
    
    TAlfRealPoint realPoint( 2.0, 2.0 );
    TAlfRealSize realSize3( realPoint );
    
    TSize size2;
    size2 += realSize1;
    
    return KErrNone;
    }