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 00020 #ifndef TULIP_COLORS_H 00021 #define TULIP_COLORS_H 00022 00023 #include <tulip/PropertyTypes.h> 00024 #include <tulip/AbstractProperty.h> 00025 00026 namespace tlp { 00027 00028 class PropertyContext; 00029 00030 typedef AbstractProperty<tlp::ColorType, tlp::ColorType> AbstractColorProperty; 00031 00032 /** 00033 * @ingroup Graph 00034 * @brief A graph property that maps a tlp::Color value to graph elements. 00035 */ 00036 class TLP_SCOPE ColorProperty:public AbstractColorProperty { 00037 public : 00038 ColorProperty (Graph *g, const std::string& n="") :AbstractColorProperty(g, n) {} 00039 // PropertyInterface inherited methods 00040 PropertyInterface* clonePrototype(Graph *, const std::string&); 00041 static const std::string propertyTypename; 00042 const std::string& getTypename() const { 00043 return propertyTypename; 00044 } 00045 00046 int compare(const node n1, const node n2) const; 00047 int compare(const edge e1, const edge e2) const; 00048 00049 }; 00050 00051 /** 00052 * @ingroup Graph 00053 * @brief A graph property that maps a std::vector<tlp::Color> value to graph elements. 00054 */ 00055 class TLP_SCOPE ColorVectorProperty:public AbstractVectorProperty<tlp::ColorVectorType, tlp::ColorType> { 00056 public : 00057 ColorVectorProperty(Graph *g, const std::string& n="") :AbstractVectorProperty<ColorVectorType, tlp::ColorType>(g, n) {} 00058 // PropertyInterface inherited methods 00059 PropertyInterface* clonePrototype(Graph *, const std::string&); 00060 static const std::string propertyTypename; 00061 const std::string& getTypename() const { 00062 return propertyTypename; 00063 } 00064 }; 00065 00066 00067 } 00068 #endif 00069