• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

engine.h

Go to the documentation of this file.
00001 /**********************************************************************
00002   Engine - Engine interface and plugin factory.
00003 
00004   Copyright (C) 2007 Donald Ephraim Curtis <donald-curtis@uiowa.edu>
00005 
00006   This file is part of the Avogadro molecular editor project.
00007   For more information, see <http://avogadro.sourceforge.net/>
00008 
00009   Avogadro is free software; you can redistribute it and/or modify 
00010   it under the terms of the GNU General Public License as published by 
00011   the Free Software Foundation; either version 2 of the License, or 
00012   (at your option) any later version.
00013 
00014   Avogadro is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with this program; if not, write to the Free Software
00021   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00022   02110-1301, USA.
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 } // end namespace Avogadro
00191 
00192 Q_DECLARE_METATYPE(Avogadro::Engine*)
00193 Q_DECLARE_INTERFACE(Avogadro::EngineFactory, "net.sourceforge.avogadro.enginefactory/1.0")
00194 
00195 #endif

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal