00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DISCRENDERERCOMPONENT_H
00021 #define DISCRENDERERCOMPONENT_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 DiscRendererComponent : public Component
00031 {
00032 Q_OBJECT
00033 GLUON_OBJECT( GluonEngine::DiscRendererComponent )
00034 Q_PROPERTY( float radius READ radius WRITE setRadius )
00035 Q_PROPERTY( uint nbPoints READ nbPoints WRITE setNbPoints )
00036 Q_PROPERTY( QColor color READ color WRITE setColor )
00037 Q_PROPERTY( GluonEngine::Asset* texture READ texture WRITE setTexture )
00038 Q_INTERFACES( GluonEngine::Component )
00039
00040 public:
00041 Q_INVOKABLE DiscRendererComponent( QObject* parent = 0 );
00042 DiscRendererComponent( const DiscRendererComponent& other );
00043 virtual ~DiscRendererComponent();
00044 virtual QString category() const;
00045
00046 virtual void initialize();
00047 virtual void start();
00048 virtual void draw( int timeLapse = 0 );
00049 virtual void cleanup();
00050
00051 virtual float radius();
00052 virtual void setRadius( float newRadius );
00053 virtual uint nbPoints();
00054 virtual void setNbPoints( uint newNbPoints );
00055
00056 virtual QColor color();
00057 virtual Asset* texture();
00058
00059 public slots:
00060 virtual void setColor( const QColor& color );
00061 virtual void setColor( int r, int g, int b, int a = 255 );
00062 virtual void setTexture( Asset* asset );
00063
00064 private:
00065 void setDisc( QVector3D position, float radius, uint nbPoints, QColor color );
00066
00067 class DiscRendererComponentPrivate;
00068 DiscRendererComponentPrivate* const d;
00069 };
00070 }
00071
00072 Q_DECLARE_METATYPE( GluonEngine::DiscRendererComponent )
00073 Q_DECLARE_METATYPE( GluonEngine::DiscRendererComponent* )
00074
00075 #endif