![]() |
Universidad de Murcia ![]() |
src/qvblockprogramming/qvguiblocks/qvdesigner/facade/itemfactory.h00001 /* 00002 * Copyright (C) 2008, 2009, 2010, 2011, 2012. 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 <QVProcessingBlock> 00030 00031 #ifdef QVIPP 00032 #include <qvippblocks.h> 00033 #endif 00034 00035 #ifndef DOXYGEN_IGNORE_THIS 00036 00037 // Clase que se encargará de implemetar la obtención de los tipos de blocks de que disponemos (parecido a un Factory) 00038 class ItemFactory: QObject 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 ItemFactory(); 00044 00045 // 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 00046 QMap<QString, QList<QString> > getItemTypes() const; 00047 00048 // 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 00049 QMap<QString, QList<QString> > getInputItemTypes() const; 00050 00051 // 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 00052 QMap<QString, QList<QString> > getMiddleItemTypes() const; 00053 00054 // 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 00055 QMap<QString, QList<QString> > getOutputItemTypes() const; 00056 00057 QVPropertyContainer *createContainer(QString type, QString name) const; 00058 00059 bool deleteContainer(QVPropertyContainer *cont) const; 00060 00061 QString containerType(QVPropertyContainer *cont) const; 00062 00063 // 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 00064 const QString registerUserBlock(QVProcessingBlock * block); 00065 00066 bool isUserType(QString type) const; 00067 00068 private: 00069 const char *typeName(QVPropertyContainer *cont) const; 00070 00071 QMap<QString, QList<QString> > inputItems, middleItems, outputItems; 00072 QMap<QString, int> userBlocks; 00073 }; 00074 00075 #endif 00076 #endif |