1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Author: Guillaume Boulant (EDF/R&D)
22 #ifndef _DATAPROCESSOR_H_
23 #define _DATAPROCESSOR_H_
25 #include "TreeData.hxx"
27 #include "DataModel.hxx"
28 #include "DataObject.hxx"
29 #include <QStringList>
33 typedef std::vector<DataObject *> DataObjectVector;
36 // =================================================================
37 // This class can be used to automize processing on data objects.
38 // The inputs of public functions are list of selected items in the
39 // tree view. The function automize the extraction of associated
40 // DataObject and can automize the processing of these object if the
41 // virtual function processDataObject is implemented.
42 // =================================================================
45 class TREEDATA_EXPORT DataProcessor {
48 DataProcessor(DataModel * dataModel);
50 DataObjectVector * extract(QStringList itemNameIdList);
51 void process(QStringList itemNameIdList);
55 virtual void preprocess(QStringList itemNameIdList) {
56 // Implement something to be executed at the begining of the process function
58 virtual void postprocess(QStringList itemNameIdList) {
59 // Implement something to be executed at the end of the process function
61 // Implement what must be done with each DataObject during the process function
62 virtual void processDataObject(DataObject * dataObject) = 0;
65 DataModel * _dataModel;