kalzium
engine.cpp
Go to the documentation of this file.00001 /********************************************************************** 00002 Engine - Engine interface and plugin factory. 00003 00004 Copyright (C) 2006,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 #include "engine.h" 00026 00027 namespace Avogadro { 00028 00029 class EnginePrivate 00030 { 00031 public: 00032 EnginePrivate() : enabled(false) {} 00033 00034 PrimitiveQueue queue; 00035 Color colorMap; 00036 bool enabled; 00037 }; 00038 00039 Engine::Engine(QObject *parent) : QObject(parent), d(new EnginePrivate) 00040 { 00041 } 00042 00043 Engine::~Engine() 00044 { 00045 delete d; 00046 } 00047 00048 const PrimitiveQueue& Engine::queue() const 00049 { 00050 return d->queue; 00051 } 00052 00053 double Engine::radius(const Primitive *primitive) 00054 { 00055 Q_UNUSED(primitive); 00056 return 0.0; 00057 } 00058 00059 void Engine::clearQueue() 00060 { 00061 d->queue.clear(); 00062 } 00063 00064 bool Engine::isEnabled() 00065 { 00066 return d->enabled; 00067 } 00068 00069 void Engine::setEnabled(bool enabled) 00070 { 00071 d->enabled = enabled; 00072 } 00073 00074 void Engine::addPrimitive(Primitive *primitive) 00075 { 00076 d->queue.addPrimitive(primitive); 00077 } 00078 00079 void Engine::updatePrimitive(Primitive *primitive) 00080 { 00081 Q_UNUSED(primitive); 00082 } 00083 00084 void Engine::removePrimitive(Primitive *primitive) 00085 { 00086 d->queue.removePrimitive(primitive); 00087 } 00088 00089 void Engine::setColorMap(Color &map) 00090 { 00091 d->colorMap = map; 00092 } 00093 00094 QWidget *Engine::settingsWidget() 00095 { 00096 return 0; 00097 } 00098 00099 Color &Engine::colorMap() 00100 { 00101 return d->colorMap; 00102 } 00103 00104 } 00105 00106 #include "engine.moc"
KDE 4.0 API Reference