Tulip  5.1.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 parameters related to the Plugin.
36  * For instance, the tlp::AlgorithmContext (related to tlp::Algorithm) contains the Graph on which the algorithm should be run
37  * In essence, you will never have to access to a plugin's context since the base class constructor will copy its members into protected members of the plugin interface.
38  */
40 public:
41  // Required for dynamic casting
42  virtual ~PluginContext() {}
43 };
44 
45 /**
46  * @ingroup Plugins
47  * @brief Parameters structure for a tlp::Algorithm
48  *
49  * This class contains data required for a tlp::Algorithm to run. Each of its member is copied into a protected member at the object construction.
50  */
52 public :
53  /**
54  * @brief The pointer to the tlp::Graph on which the algorithm will be run.
55  */
57 
58  /**
59  * @brief Input parameters set by the user when running the plugin.
60  * @see tlp::DataSet
61  * @see tlp::WithDependency
62  */
64 
65  /**
66  * @brief A progress handler to notify the user about the progress state of the algorithm when run.
67  * @see tlp::PluginProgress
68  */
70 
71  AlgorithmContext (tlp::Graph* graph = NULL, tlp::DataSet* dataSet = NULL, tlp::PluginProgress* progress = NULL): graph(graph), dataSet(dataSet), pluginProgress(progress) {}
72  ~AlgorithmContext() {}
73 };
74 
75 
76 }
77 #endif
PluginProgress * pluginProgress
A progress handler to notify the user about the progress state of the algorithm when run...
Definition: PluginContext.h:69
A container that can store data from any type.
Definition: DataSet.h:190
DataSet * dataSet
Input parameters set by the user when running the plugin.
Definition: PluginContext.h:63
Contains runtime parameters for a plugin.
Definition: PluginContext.h:39
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:51
Graph * graph
The pointer to the tlp::Graph on which the algorithm will be run.
Definition: PluginContext.h:56