![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 00022 #ifndef _GRAPHTEST_H 00023 #define _GRAPHTEST_H 00024 00025 #include <tulip/Algorithm.h> 00026 00027 namespace tlp { 00028 class GraphTest : public tlp::Algorithm { 00029 public: 00030 GraphTest(const tlp::PluginContext* context) : Algorithm(context) { 00031 addOutParameter<bool>("result", 00032 HTML_HELP_OPEN() \ 00033 HTML_HELP_DEF( "type", "bool" ) \ 00034 HTML_HELP_BODY() \ 00035 "Whether the graph passed the test or not." \ 00036 HTML_HELP_CLOSE()); 00037 } 00038 00039 virtual bool run() { 00040 bool result = test(); 00041 00042 if (dataSet) { 00043 dataSet->set("result",result); 00044 } 00045 00046 return true; 00047 } 00048 00049 virtual bool test()=0; 00050 }; 00051 00052 } 00053 #endif //_GRAPHTEST_H 00054 ///@endcond