21 #ifndef TULIPMETATYPES_H
22 #define TULIPMETATYPES_H
24 #include <tulip/DataSet.h>
25 #include <tulip/Graph.h>
26 #include <tulip/Color.h>
27 #include <tulip/Coord.h>
28 #include <tulip/Size.h>
29 #include <tulip/BooleanProperty.h>
30 #include <tulip/DoubleProperty.h>
31 #include <tulip/ColorProperty.h>
32 #include <tulip/SizeProperty.h>
33 #include <tulip/StringProperty.h>
34 #include <tulip/LayoutProperty.h>
35 #include <tulip/GraphProperty.h>
36 #include <tulip/IntegerProperty.h>
37 #include <tulip/ColorScale.h>
38 #include <tulip/GlGraphStaticData.h>
39 #include <tulip/GlLabel.h>
40 #include <tulip/TulipFont.h>
41 #include <tulip/StringCollection.h>
44 struct TulipFileDescriptor {
45 enum FileType {File,Directory};
47 TulipFileDescriptor() {}
48 TulipFileDescriptor(
const QString& absolutePath,FileType fileType):absolutePath(absolutePath),type(fileType) {}
49 TulipFileDescriptor(
const TulipFileDescriptor& d) {
50 absolutePath = d.absolutePath;
55 QString fileFilterPattern;
60 unsigned int nodeShapeId;
61 NodeShape(
unsigned int nodeShapeId=0):nodeShapeId(nodeShapeId) {}
62 operator unsigned int()
const {
67 struct EdgeExtremityShape {
68 unsigned int edgeExtremityShapeId;
69 EdgeExtremityShape(
unsigned int edgeExtremityShapeId=0):edgeExtremityShapeId(edgeExtremityShapeId) {}
70 operator unsigned int()
const {
71 return edgeExtremityShapeId;
78 Q_DECLARE_METATYPE(tlp::DoubleProperty*)
79 Q_DECLARE_METATYPE(tlp::DoubleVectorProperty*)
80 Q_DECLARE_METATYPE(std::vector<
double>)
82 Q_DECLARE_METATYPE(tlp::Color)
83 Q_DECLARE_METATYPE(tlp::ColorProperty*)
84 Q_DECLARE_METATYPE(tlp::ColorVectorProperty*)
85 Q_DECLARE_METATYPE(std::vector<tlp::Color>)
87 Q_DECLARE_METATYPE(tlp::Size)
88 Q_DECLARE_METATYPE(tlp::SizeProperty*)
89 Q_DECLARE_METATYPE(tlp::SizeVectorProperty*)
90 Q_DECLARE_METATYPE(std::vector<tlp::Size>)
92 Q_DECLARE_METATYPE(std::
string)
93 Q_DECLARE_METATYPE(tlp::StringProperty*)
94 Q_DECLARE_METATYPE(tlp::StringVectorProperty*)
95 Q_DECLARE_METATYPE(std::vector<std::
string>)
98 Q_DECLARE_METATYPE(tlp::LayoutProperty*)
99 Q_DECLARE_METATYPE(tlp::CoordVectorProperty*)
102 Q_DECLARE_METATYPE(tlp::Graph*)
103 Q_DECLARE_METATYPE(tlp::GraphProperty*)
105 Q_DECLARE_METATYPE(tlp::IntegerProperty*)
106 Q_DECLARE_METATYPE(tlp::IntegerVectorProperty*)
107 Q_DECLARE_METATYPE(std::vector<
int>)
109 Q_DECLARE_METATYPE(tlp::BooleanProperty*)
110 Q_DECLARE_METATYPE(tlp::BooleanVectorProperty*)
111 Q_DECLARE_METATYPE(std::vector<
bool>)
113 Q_DECLARE_METATYPE(std::set<tlp::edge>)
115 Q_DECLARE_METATYPE(tlp::NumericProperty*)
117 Q_DECLARE_METATYPE(tlp::PropertyInterface*)
119 Q_DECLARE_METATYPE(tlp::ColorScale)
121 Q_DECLARE_METATYPE(tlp::StringCollection)
123 Q_DECLARE_METATYPE(TulipFileDescriptor)
125 Q_DECLARE_METATYPE(NodeShape)
126 Q_DECLARE_METATYPE(tlp::EdgeShape)
127 Q_DECLARE_METATYPE(EdgeExtremityShape)
129 Q_DECLARE_METATYPE(tlp::LabelPosition)
130 Q_DECLARE_METATYPE(tlp::TulipFont)
132 Q_DECLARE_METATYPE(QStringList)
135 class TLP_QT_SCOPE TulipMetaTypes {
143 result = *((T*)dm->
value);
145 return QVariant::fromValue<T>(result);
150 static QVariant dataTypeToQvariant(
tlp::DataType *,
const std::string& paramName);
153 class TLP_QT_SCOPE QStringListType:
public TypeInterface<QStringList> {
155 static void write(std::ostream&,
const RealType&);
156 static bool read(std::istream&, RealType&);
157 FORWARD_STRING_METHODS(QStringListType)
160 class TLP_QT_SCOPE QStringType:
public TypeInterface<QString> {
162 static void write(std::ostream&,
const RealType&);
163 static bool read(std::istream&, RealType&);
164 static std::string toString(
const RealType &);
165 static bool fromString(RealType &,
const std::string &);
168 extern void initQTypeSerializers();
172 #endif // TULIPMETATYPES_H