22 template<
typename PropertyClass,
typename NodeType,
typename EdgeType>
25 return QVariant::fromValue<NodeType>(
static_cast<PropertyClass*
>(property)->getNodeValue(
tlp::node(
id)));
28 return QVariant::fromValue<EdgeType>(
static_cast<PropertyClass*
>(property)->getEdgeValue(
tlp::edge(
id)));
32 template<
typename PropertyClass,
typename NodeType,
typename EdgeType>
37 template<
typename PropertyClass,
typename NodeType,
typename EdgeType>
38 bool StandardPropertyToQVariantConverter<PropertyClass,NodeType,EdgeType>::setValue(
unsigned int id,
tlp::ElementType elementType,
tlp::PropertyInterface* property,
const QVariant& data)
const {
39 PropertyClass* p =
static_cast<PropertyClass*
>(property);
42 const NodeType& oldValue = p->getNodeValue(
tlp::node(
id));
43 NodeType newValue = data.value<NodeType>();
45 if(oldValue != newValue) {
51 const EdgeType& oldValue = p->getEdgeValue(
tlp::edge(
id));
52 EdgeType newValue = data.value<EdgeType>();
54 if(oldValue != newValue) {
55 p->setEdgeValue(
tlp::edge(
id),data.value<EdgeType>());
63 template<
typename PropertyClass,
typename NodeType,
typename EdgeType>
65 PropertyClass* p =
static_cast<PropertyClass*
>(property);
68 p->setAllNodeValue(data.value<NodeType>());
71 p->setAllEdgeValue(data.value<EdgeType>());
PropertyInterface describes the interface of a graph property.
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.