00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DISCSECTIONRENDERERCOMPONENT_H
00021 #define DISCSECTIONRENDERERCOMPONENT_H
00022
00023 #include <engine/gluon_engine_export.h>
00024 #include <engine/component.h>
00025
00026 namespace GluonEngine
00027 {
00028 class Asset;
00029
00030 class GLUON_ENGINE_EXPORT DiscSectionRendererComponent : public Component
00031 {
00032 Q_OBJECT
00033 GLUON_OBJECT( GluonEngine::DiscSectionRendererComponent )
00034 Q_PROPERTY( float radius READ radius WRITE setRadius )
00035 Q_PROPERTY( uint nbPoints READ nbPoints WRITE setNbPoints )
00036 Q_PROPERTY( float arcCenter READ arcCenter WRITE setArcCenter )
00037 Q_PROPERTY( float degrees READ degrees WRITE setDegrees )
00038 Q_PROPERTY( QColor color READ color WRITE setColor )
00039 Q_PROPERTY( GluonEngine::Asset* texture READ texture WRITE setTexture )
00040 Q_INTERFACES( GluonEngine::Component )
00041
00042 public:
00043 Q_INVOKABLE DiscSectionRendererComponent( QObject* parent = 0 );
00044 DiscSectionRendererComponent( const DiscSectionRendererComponent& other );
00045 virtual ~DiscSectionRendererComponent();
00046 virtual QString category() const;
00047
00048 virtual void initialize();
00049 virtual void start();
00050 virtual void draw( int timeLapse = 0 );
00051 virtual void cleanup();
00052
00053 virtual float radius();
00054 virtual void setRadius( float newRadius );
00055 virtual uint nbPoints();
00056 virtual void setNbPoints( uint newNbPoints );
00057 virtual float degrees();
00058 virtual void setDegrees( float newDegrees );
00059
00060 virtual QColor color();
00061 virtual Asset* texture();
00062
00063 virtual float arcCenter();
00064 virtual void setArcCenter( float newArcCenter );
00065
00066 public slots:
00067 virtual void setColor( const QColor& color );
00068 virtual void setColor( int r, int g, int b, int a = 255 );
00069 virtual void setTexture( Asset* asset );
00070
00071 private:
00072 void setDiscSection( QVector3D position, float radius, uint nbPoints, float degrees, float arcCenter, QColor color );
00073
00074 class DiscSectionRendererComponentPrivate;
00075 DiscSectionRendererComponentPrivate* const d;
00076 };
00077
00078 }
00079
00080 Q_DECLARE_METATYPE( GluonEngine::DiscSectionRendererComponent )
00081 Q_DECLARE_METATYPE( GluonEngine::DiscSectionRendererComponent* )
00082
00083 #endif