![]() |
University of Murcia ![]() |
src/qvblockprogramming/qvguiblocks/qvdesigner/facade/itemfactory.h00001 /* 00002 * Copyright (C) 2008, 2009. PARP Research Group. 00003 * <http://perception.inf.um.es> 00004 * University of Murcia, Spain. 00005 * 00006 * This file is part of the QVision library. 00007 * 00008 * QVision is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as 00010 * published by the Free Software Foundation, version 3 of the License. 00011 * 00012 * QVision is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with QVision. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 00022 #ifndef ITEMFACTORY_H 00023 #define ITEMFACTORY_H 00024 00025 #include <QObject> 00026 #include <QList> 00027 #include <QString> 00028 #include "itemproperties.h" 00029 #include <qvippblocks.h> 00030 00031 #ifndef DOXYGEN_IGNORE_THIS 00032 00033 // Clase que se encargará de implemetar la obtención de los tipos de blocks de que disponemos (parecido a un Factory) 00034 class ItemFactory: QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 ItemFactory(); 00040 00041 // devuelve la lista de Items disponibles en el sistema, cada uno de estos items es un elemento del diseño de los programas de QVision 00042 QMap<QString, QList<QString> > getItemTypes() const; 00043 00044 // devuelve la lista de Items de entrada disponibles en el sistema, cada uno de estos items es un elemento del diseño de los programas de QVision 00045 QMap<QString, QList<QString> > getInputItemTypes() const; 00046 00047 // devuelve la lista de Items intermedios disponibles en el sistema, cada uno de estos items es un elemento del diseño de los programas de QVision 00048 QMap<QString, QList<QString> > getMiddleItemTypes() const; 00049 00050 // devuelve la lista de Items de salida disponibles en el sistema, cada uno de estos items es un elemento del diseño de los programas de QVision 00051 QMap<QString, QList<QString> > getOutputItemTypes() const; 00052 00053 QVPropertyContainer *createContainer(QString type, QString name) const; 00054 00055 bool deleteContainer(QVPropertyContainer *cont) const; 00056 00057 QString containerType(QVPropertyContainer *cont) const; 00058 00059 // registra en tiempo de ejecución un nuevo tipo de block a partir de un objeto de ese tipo, posteriormente se podrán crear objetos de este tipo 00060 const QString registerUserBlock(QVProcessingBlock * block); 00061 00062 bool isUserType(QString type) const; 00063 00064 private: 00065 const char *typeName(QVPropertyContainer *cont) const; 00066 00067 QMap<QString, QList<QString> > inputItems, middleItems, outputItems; 00068 QMap<QString, int> userBlocks; 00069 }; 00070 00071 #endif 00072 #endif |