kalzium
engine.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __ENGINE_H
00026 #define __ENGINE_H
00027
00028 #include <avogadro/global.h>
00029 #include <avogadro/primitive.h>
00030 #include <avogadro/color.h>
00031
00032 #include <QString>
00033 #include <QVector>
00034 #include <QList>
00035
00036 namespace Avogadro {
00037 class GLWidget;
00038
00050 class EnginePrivate;
00051 class A_EXPORT Engine : public QObject
00052 {
00053 Q_OBJECT
00054
00055 public:
00057 Engine(QObject *parent = 0);
00059 virtual ~Engine();
00060
00065 virtual QString name() = 0;
00070 virtual QString description() = 0;
00071
00122 virtual bool render(GLWidget *gl) = 0;
00123
00124 const PrimitiveQueue& queue() const;
00125
00130 virtual double radius(const Primitive *primitive = 0);
00131
00132 void clearQueue();
00133 bool isEnabled();
00134 void setEnabled(bool enabled);
00135
00140 virtual QWidget *settingsWidget();
00141
00142 Q_SIGNALS:
00143 void changed();
00144
00145 public Q_SLOTS:
00146 virtual void addPrimitive(Primitive *primitive);
00147 virtual void updatePrimitive(Primitive *primitive);
00148 virtual void removePrimitive(Primitive *primitive);
00149
00154 virtual void setColorMap(Color &map);
00155
00158 virtual Color &colorMap();
00159
00160 private:
00161 EnginePrivate *const d;
00162 };
00163
00175 class A_EXPORT EngineFactory
00176 {
00177 public:
00181 virtual ~EngineFactory() {}
00182
00186 virtual Engine *createInstance(QObject *parent=0) = 0;
00187 };
00188
00189
00190 }
00191
00192 Q_DECLARE_METATYPE(Avogadro::Engine*)
00193 Q_DECLARE_INTERFACE(Avogadro::EngineFactory, "net.sourceforge.avogadro.enginefactory/1.0")
00194
00195 #endif