Tulip  5.2.0
Large graphs analysis and drawing
PluginContext.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 #ifndef _PLUGINCONTEXT
20 #define _PLUGINCONTEXT
21 
22 #include <tulip/DataSet.h>
23 
24 namespace tlp {
25 
26 class Graph;
27 class PropertyInterface;
28 class PluginProgress;
29 
30 /**
31  * @ingroup Plugins
32  * @brief Contains runtime parameters for a plugin.
33  *
34  * tlp::PluginContext is a data structure containing a set of parameters required by a plugin.
35  * Each tlp::Plugin subclass has its associated tlp::PluginContext subclass that contains specific
36  * parameters related to the Plugin.
37  * For instance, the tlp::AlgorithmContext (related to tlp::Algorithm) contains the Graph on which
38  * the algorithm should be run
39  * In essence, you will never have to access to a plugin's context since the base class constructor
40  * will copy its members into protected members of the plugin interface.
41  */
43 public:
44  // Required for dynamic casting
45  virtual ~PluginContext() {}
46 };
47 
48 /**
49  * @ingroup Plugins
50  * @brief Parameters structure for a tlp::Algorithm
51  *
52  * This class contains data required for a tlp::Algorithm to run. Each of its member is copied into
53  * a protected member at the object construction.
54  */
56 public:
57  /**
58  * @brief The pointer to the tlp::Graph on which the algorithm will be run.
59  */
61 
62  /**
63  * @brief Input parameters set by the user when running the plugin.
64  * @see tlp::DataSet
65  * @see tlp::WithDependency
66  */
68 
69  /**
70  * @brief A progress handler to notify the user about the progress state of the algorithm when
71  * run.
72  * @see tlp::PluginProgress
73  */
75 
76  AlgorithmContext(tlp::Graph *graph = nullptr, tlp::DataSet *dataSet = nullptr,
77  tlp::PluginProgress *progress = nullptr)
78  : graph(graph), dataSet(dataSet), pluginProgress(progress) {}
79  ~AlgorithmContext() override {}
80 };
81 }
82 #endif
PluginProgress * pluginProgress
A progress handler to notify the user about the progress state of the algorithm when run...
Definition: PluginContext.h:74
A container that can store data from any type.
Definition: DataSet.h:189
DataSet * dataSet
Input parameters set by the user when running the plugin.
Definition: PluginContext.h:67
Contains runtime parameters for a plugin.
Definition: PluginContext.h:42
PluginProcess subclasses are meant to notify about the progress state of some process (typically a pl...
Parameters structure for a tlp::Algorithm.
Definition: PluginContext.h:55
Graph * graph
The pointer to the tlp::Graph on which the algorithm will be run.
Definition: PluginContext.h:60