Version: 9.16.0
DataProcessor.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20// Author: Guillaume Boulant (EDF/R&D)
21
22#ifndef _DATAPROCESSOR_H_
23#define _DATAPROCESSOR_H_
24
25#include "TreeData.hxx"
26
27#include "DataModel.hxx"
28#include "DataObject.hxx"
29#include <QStringList>
30#include <QString>
31
32#include <vector>
33typedef std::vector<DataObject *> DataObjectVector;
34
35//
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// =================================================================
43//
44
46
47public:
48 DataProcessor(DataModel * dataModel);
49
50 DataObjectVector * extract(QStringList itemNameIdList);
51 void process(QStringList itemNameIdList);
52
53
54protected:
55 virtual void preprocess(QStringList /*itemNameIdList*/) {
56 // Implement something to be executed at the begining of the process function
57 };
58 virtual void postprocess(QStringList /*itemNameIdList*/) {
59 // Implement something to be executed at the end of the process function
60 };
61 // Implement what must be done with each DataObject during the process function
62 virtual void processDataObject(DataObject * dataObject) = 0;
63
64private:
66};
67
68#endif
std::vector< DataObject * > DataObjectVector
Definition: DataProcessor.hxx:33
#define TREEDATA_EXPORT
Definition: TreeData.hxx:33
Definition: DataModel.hxx:31
Definition: DataObject.hxx:30
Definition: DataProcessor.hxx:45
DataModel * _dataModel
Definition: DataProcessor.hxx:65
virtual void processDataObject(DataObject *dataObject)=0
virtual void postprocess(QStringList)
Definition: DataProcessor.hxx:58
virtual void preprocess(QStringList)
Definition: DataProcessor.hxx:55