20 #ifndef PROPERTY_INTERFACE_H 21 #define PROPERTY_INTERFACE_H 27 #include <tulip/tulipconf.h> 28 #include <tulip/Observable.h> 30 #include <tulip/Edge.h> 38 template <
class itType>
60 friend class PropertyManager;
77 virtual void erase(
const node) = 0;
83 virtual void erase(
const edge) = 0;
95 bool ifNotDefault =
false) = 0;
106 bool ifNotDefault =
false) = 0;
131 virtual const std::string &getTypename()
const = 0;
147 bool rename(
const std::string &newName);
181 virtual std::string getNodeStringValue(
const node n)
const = 0;
188 virtual std::string getEdgeStringValue(
const edge e)
const = 0;
197 virtual bool setNodeStringValue(
const node n,
const std::string &value) = 0;
206 virtual bool setEdgeStringValue(
const edge e,
const std::string &value) = 0;
212 virtual std::string getNodeDefaultStringValue()
const = 0;
218 virtual std::string getEdgeDefaultStringValue()
const = 0;
231 virtual bool setNodeDefaultStringValue(
const std::string &value) = 0;
244 virtual bool setAllNodeStringValue(
const std::string &value) = 0;
266 _DEPRECATED
virtual bool setAllNodeStringValue(
const std::string &value,
const Graph *graph) = 0;
285 virtual bool setStringValueToGraphNodes(
const std::string &value,
const Graph *graph) = 0;
298 virtual bool setEdgeDefaultStringValue(
const std::string &value) = 0;
311 virtual bool setAllEdgeStringValue(
const std::string &value) = 0;
333 _DEPRECATED
virtual bool setAllEdgeStringValue(
const std::string &value,
const Graph *graph) = 0;
352 virtual bool setStringValueToGraphEdges(
const std::string &value,
const Graph *graph) = 0;
359 virtual DataMem *getNodeDefaultDataMemValue()
const = 0;
366 virtual DataMem *getEdgeDefaultDataMemValue()
const = 0;
373 virtual void setAllNodeDataMemValue(
const DataMem *value) = 0;
380 virtual void setAllEdgeDataMemValue(
const DataMem *v) = 0;
389 virtual DataMem *getNodeDataMemValue(
const node n)
const = 0;
398 virtual DataMem *getEdgeDataMemValue(
const edge e)
const = 0;
407 virtual DataMem *getNonDefaultDataMemValue(
const node n)
const = 0;
416 virtual DataMem *getNonDefaultDataMemValue(
const edge e)
const = 0;
423 virtual void setNodeDataMemValue(
const node n,
const DataMem *value) = 0;
430 virtual void setEdgeDataMemValue(
const edge e,
const DataMem *v) = 0;
448 virtual bool hasNonDefaultValuatedNodes(
const Graph * =
nullptr)
const = 0;
457 virtual unsigned int numberOfNonDefaultValuatedNodes(
const Graph * =
nullptr)
const = 0;
475 virtual bool hasNonDefaultValuatedEdges(
const Graph * =
nullptr)
const = 0;
482 virtual unsigned int numberOfNonDefaultValuatedEdges(
const Graph * =
nullptr)
const = 0;
489 virtual unsigned int nodeValueSize()
const = 0;
495 virtual void writeNodeDefaultValue(std::ostream &)
const = 0;
501 virtual void writeNodeValue(std::ostream &,
node)
const = 0;
507 virtual bool readNodeDefaultValue(std::istream &) = 0;
513 virtual bool readNodeValue(std::istream &,
node) = 0;
520 virtual unsigned int edgeValueSize()
const = 0;
526 virtual void writeEdgeDefaultValue(std::ostream &)
const = 0;
532 virtual void writeEdgeValue(std::ostream &,
edge)
const = 0;
538 virtual bool readEdgeDefaultValue(std::istream &) = 0;
544 virtual bool readEdgeValue(std::istream &,
edge) = 0;
554 virtual void computeMetaValue(
node metaNode,
Graph *subgraph,
Graph *metaGraph) = 0;
577 return metaValueCalculator;
588 metaValueCalculator = calculator;
598 virtual int compare(
const node n1,
const node n2)
const = 0;
607 virtual int compare(
const edge e1,
const edge e2)
const = 0;
613 void notifyBeforeSetNodeValue(
const node n);
614 void notifyAfterSetNodeValue(
const node n);
615 void notifyBeforeSetEdgeValue(
const edge e);
616 void notifyAfterSetEdgeValue(
const edge e);
617 void notifyBeforeSetAllNodeValue();
618 void notifyAfterSetAllNodeValue();
619 void notifyBeforeSetAllEdgeValue();
620 void notifyAfterSetAllEdgeValue();
621 void notifyDestroy();
622 void notifyRename(
const std::string &newName);
648 virtual bool tokenize(
const std::string &str, std::vector<std::string> &vect,
char openChar =
'(',
649 char sepChar =
',',
char closeChar =
')') = 0;
659 virtual bool setNodeStringValueAsVector(
const node n,
const std::vector<std::string> &values) = 0;
669 virtual bool setEdgeStringValueAsVector(
const edge e,
const std::vector<std::string> &values) = 0;
683 virtual bool setNodeStringValueAsVector(
const node n,
const std::string &value,
684 char openChar =
'(',
char sepChar =
',',
685 char closeChar =
')') = 0;
699 virtual bool setEdgeStringValueAsVector(
const edge e,
const std::string &value,
700 char openChar =
'(',
char sepChar =
',',
701 char closeChar =
')') = 0;
714 enum PropertyEventType {
715 TLP_BEFORE_SET_NODE_VALUE = 0,
716 TLP_AFTER_SET_NODE_VALUE,
717 TLP_BEFORE_SET_ALL_NODE_VALUE,
718 TLP_AFTER_SET_ALL_NODE_VALUE,
719 TLP_BEFORE_SET_ALL_EDGE_VALUE,
720 TLP_AFTER_SET_ALL_EDGE_VALUE,
721 TLP_BEFORE_SET_EDGE_VALUE,
722 TLP_AFTER_SET_EDGE_VALUE
725 Event::EventType evtType = Event::TLP_MODIFICATION,
unsigned int id = UINT_MAX)
726 :
Event(prop, evtType), evtType(propEvtType), eltId(
id) {}
732 node getNode()
const {
733 assert(evtType < TLP_BEFORE_SET_ALL_NODE_VALUE);
737 edge getEdge()
const {
738 assert(evtType > TLP_AFTER_SET_ALL_EDGE_VALUE);
742 PropertyEventType getType()
const {
747 PropertyEventType evtType;
774 #endif // PROPERTY_INTERFACE_H
Interface for Tulip iterators. Allows basic iteration operations only.
PropertyInterface describes the interface of a graph property.
Contains additional information about events on a property, such as the property it happened on...
MetaValueCalculator * getMetaValueCalculator()
Gets the MetaValueCalculator of this property.
const std::string & getName() const
Gets the name of the property (e.g. viewLayout).
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
VectorPropertyInterface describes the interface of a graph property whose holded value is a vector (s...
Event is the base class for all events used in the Observation mechanism.
virtual void setMetaValueCalculator(MetaValueCalculator *calculator)
Sets the Calculator for meta nodes and edges.
The Observable class is the base of Tulip's observation system.