Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
ColorProperty.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
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 
20 #ifndef TULIP_COLORS_H
21 #define TULIP_COLORS_H
22 
23 #include <tulip/PropertyTypes.h>
24 #include <tulip/AbstractProperty.h>
25 
26 namespace tlp {
27 
28 class PropertyContext;
29 
30 typedef AbstractProperty<tlp::ColorType, tlp::ColorType> AbstractColorProperty;
31 
32 /**
33  * @ingroup Graph
34  * @brief A graph property that maps a tlp::Color value to graph elements.
35  */
36 class TLP_SCOPE ColorProperty:public AbstractColorProperty {
37 public :
38  ColorProperty (Graph *g, std::string n="") :AbstractColorProperty(g, n) {}
39  // PropertyInterface inherited methods
40  PropertyInterface* clonePrototype(Graph *, const std::string&);
41  static const std::string propertyTypename;
42  std::string getTypename() const {
43  return propertyTypename;
44  }
45 
46  int compare(const node n1, const node n2) const;
47  int compare(const edge e1, const edge e2) const;
48 
49 };
50 
51 /**
52  * @ingroup Graph
53  * @brief A graph property that maps a std::vector<tlp::Color> value to graph elements.
54  */
55 class TLP_SCOPE ColorVectorProperty:public AbstractVectorProperty<tlp::ColorVectorType, tlp::ColorType> {
56 public :
57  ColorVectorProperty(Graph *g, std::string n="") :AbstractVectorProperty<ColorVectorType, tlp::ColorType>(g, n) {}
58  // PropertyInterface inherited methods
59  PropertyInterface* clonePrototype(Graph *, const std::string&);
60  static const std::string propertyTypename;
61  std::string getTypename() const {
62  return propertyTypename;
63  }
64 };
65 
66 
67 }
68 #endif
69