123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- #ifndef GEOMETRY_H_
- #define GEOMETRY_H_
- #include <e32math.h>
- #include <e32base.h>
- #include <gdi.h>
- #include <w32adll.h>
- // ’®çª ¢ âà¥å¬¥à®¬ ¯à®áâà á⢥
- class T3DPoint
- {
- public:
- T3DPoint(): iX( 0 ), iY( 0 ), iZ( 0 ) {}
- T3DPoint( TInt aX, TInt aY, TInt aZ ): iX( aX ), iY( aY ), iZ( aZ ) {}
-
- T3DPoint( const T3DPoint& aItem );
- T3DPoint& operator = ( const T3DPoint& aPoint );
- public:
- TInt iX, iY, iZ;
- };
- // Š« áá TDouble3DPoint ¨á¯®«ì§ã¥âáï ¤«ï à áç¥â ®¢ëå ª®®à¤¨ â ¢¥àè¨
- // ¯ à ««¥«¥¯¨¯¥¤ , ¯à¨ í⮬ ⥪ã饥 § 票¥ iCurrent ¢ëç¨á«ï¥âáï ®á®¢¥
- // ç «ì®£® iOriginal
- class TDouble3DPoint
- {
- public:
- TDouble3DPoint( TInt aX, TInt aY, TInt aZ );
- TDouble3DPoint( const TDouble3DPoint& aItem );
- TDouble3DPoint& operator = ( const TDouble3DPoint& aPoint );
-
- public:
- T3DPoint iOriginal, iCurrent;
- };
- // Œ âà¨æ ¯®¢®à®â ¢ âà¥å¬¥à®¬ ¯à®áâà á⢥
- // á¬. http://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D1%82%D1%80%D0%B8%D1%86%D0%B0_%D0%BF%D0%BE%D0%B2%D0%BE%D1%80%D0%BE%D1%82%D0%B0
- class CTransformMatrix : public CBase
- {
- public:
- ~CTransformMatrix();
- static CTransformMatrix* NewL();
-
- void Refine( TReal anAngleXoffs, TReal anAngleYoffs, TReal anAngleZoffs );
- void Reset();
- void Multiply( T3DPoint& aMultiplier, T3DPoint& aResult );
-
- private:
- CTransformMatrix() {}
- void ConstructL();
- CArrayFixFlat<TReal>* InitLineL();
-
- private:
- CArrayFixFlat<TReal> *iLine1, *iLine2, *iLine3;
- TReal angleX, angleY, angleZ;
- };
- // �®«¨£® á ¯®¬®éìî ª®â®à®£® ®âà¨á®¢ë¢ ¥âáï £à ì ¯ à ««¥«¥¯¨¯¥¤
- class TParallelepipedPoly
- {
- public:
- TParallelepipedPoly(TRgb aColor): iColor( aColor ), iVisible( ETrue ) {}
- TParallelepipedPoly( const TParallelepipedPoly& aPoly );
-
- TParallelepipedPoly& operator = ( const TParallelepipedPoly& aPoly );
-
- void SetArray( TPoint* anArray );
- void SetPoint( TInt aPointIdx, TInt aX, TInt aY );
-
- public:
- TPoint iPoint1, iPoint2, iPoint3, iPoint4;
- TRgb iColor;
- TBool iVisible;
- };
- class CFbsBitmapDevice;
- class CFbsBitGc;
- // Š« áá à ááç¨âë¢ ¥â ª®®à¤¨ âë ¢¥àè¨ ¯ à ««¥«¥¯¨¯¥¤ , ®âà¨á®¢ë¢ ¥â ¥£® ¨
- // ¨¤¨ª â®àë ¯à¨à 饨ï 㣫®¢ ¯®¢®à®â
- class CParallelepiped : public CBase
- {
- public:
- CParallelepiped( TReal aMultiplier, TDisplayMode aMode );
- void ConstructL();
- ~CParallelepiped();
- void SetPolyPoint( TInt aPolyNo, TInt aPointNo, TInt aValueX, TInt aValueY );
- void SetInitPoints( const TRect& aRect, const TPoint& aPoint );
- void SetFocused( TInt aFocus );
- void SetGauge( TInt aGauge );
- void SetCurrentGaugeValue( TInt aValue );
- void Calc();
- void Reset();
- void SizeChanged( const TRect& aRect, const TPoint& aPoint );
- void Draw( CAnimGc& aGc ) const;
- void DrawGauge( CFbsBitGc& aGc, TBool aActive, TInt aValue, TInt aYOffset ) const;
-
- TBool Focused() const;
-
- private:
- CArrayFixFlat<TDouble3DPoint> *iPoints; // ¢¥àè¨ë ¯ à ««¥«¥¯¨¯¥¤
- CArrayFixFlat<TParallelepipedPoly> *iPolies; // ¯®«¨£®ë ¤«ï ®â®¡à ¦¥¨ï £à ¥©
- CTransformMatrix* iMatrix; // ¬ âà¨æ ¯®¢®à®â
- TPoint* iPoly; // ¢á¯®¬®£ ⥫ìë© ¬ áᨢ ¤«ï ®âà¨á®¢ª¨ £à ¨
- TPoint* iGaugePoly; // ¢á¯®¬®£ ⥫ìë© ¬ áᨢ ¤«ï ®âà¨á®¢ª¨ ¨¤¨ª â®à
-
- private:
- TPoint iPoint; // ᬥ饨¥ «¥¢®£® ¢¥à奣® 㣫 iOffScreenBitmap
- TRect iRect; // ®¡« áâì, ¨á¯®«ì§ã¥¬ ï ¤«ï ®âà¨á®¢ª¨
- TInt iDx, iDy, iDz; // ⥪ã騥 § ç¥¨ï ¯à¨à 饨© 㣫®¢ ¯®¢®à®â
- TInt* iDCurrent; // ⥪ã騩 ¨¤¨ª â®à
- TReal iMultiplier;
- TBool iFocused;
- // ¨§®¡à ¦¥¨¥ ¯¥à¢® ç «ì® ®âà¨á®¢ë¢ ¥âáï iOffScreenBitmap
- TDisplayMode iMode;
- CFbsBitmap* iOffScreenBitmap;
- CFbsBitmapDevice* iOffScreenBitmapDevice;
- CFbsBitGc* iOffScreenBitmapGc;
- };
- #endif /*GEOMETRY_H_*/
|