1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/geometrystructs.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,86 @@
1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/*
1.20 + Function to calculate sine and cosine values for points of a circle
1.21 + composed of n segments.
1.22 + The function is taken from freeglut_geometry.cpp, which is distributed
1.23 + under the following terms:
1.24 + *
1.25 + * ******************************************************************
1.26 + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
1.27 + * Written by Pawel W. Olszta, <olszta@sourceforge.net>
1.28 + * Creation date: Fri Dec 3 1999
1.29 + *
1.30 + * Permission is hereby granted, free of charge, to any person obtaining a
1.31 + * copy of this software and associated documentation files (the "Software"),
1.32 + * to deal in the Software without restriction, including without limitation
1.33 + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1.34 + * and/or sell copies of the Software, and to permit persons to whom the
1.35 + * Software is furnished to do so, subject to the following conditions:
1.36 + *
1.37 + * The above copyright notice and this permission notice shall be included
1.38 + * in all copies or substantial portions of the Software.
1.39 + * ********************************************************************
1.40 + *
1.41 + */
1.42 +
1.43 +
1.44 +#ifndef GEOMETRYSTRUCTS_H_
1.45 +#define GEOMETRYSTRUCTS_H_
1.46 +
1.47 +
1.48 +#include <e32base.h>
1.49 +
1.50 +
1.51 +float sin(float x);
1.52 +float cos(float x);
1.53 +
1.54 +struct Vertex3F
1.55 + {
1.56 + Vertex3F(float x, float y, float z);
1.57 + Vertex3F();
1.58 + float iX;
1.59 + float iY;
1.60 + float iZ;
1.61 + };
1.62 +
1.63 +int fghCircleTable(float **sint,float **cost,const int n);
1.64 +
1.65 +
1.66 +class CSolidSphere : public CBase
1.67 + {
1.68 +public:
1.69 + static CSolidSphere* NewLC(TReal aRadius, TInt aSlices, TInt aStacks);
1.70 + ~CSolidSphere();
1.71 + void Draw() const;
1.72 +
1.73 +private:
1.74 + CSolidSphere(TInt aSlices, TInt aStacks);
1.75 + void ConstructL(TReal aRadius);
1.76 +
1.77 +private:
1.78 + TInt iSlices;
1.79 + TInt iStacks;
1.80 + Vertex3F* iTopVertices;
1.81 + Vertex3F* iTopNormals;
1.82 + Vertex3F* iBottomVertices;
1.83 + Vertex3F* iBottomNormals;
1.84 + Vertex3F* iStackVertices;
1.85 + Vertex3F* iStackNormals;
1.86 + };
1.87 +
1.88 +
1.89 +#endif /* GEOMETRYSTRUCTS_H_ */