Tulip  5.6.0
Large graphs analysis and drawing
tlp::AbstractProperty< Tnode, Tedge, Tprop > Class Template Reference

#include <AbstractProperty.h>

+ Inheritance diagram for tlp::AbstractProperty< Tnode, Tedge, Tprop >:
+ Collaboration diagram for tlp::AbstractProperty< Tnode, Tedge, Tprop >:

Classes

class  MetaValueCalculator
 

Public Member Functions

 AbstractProperty (Graph *, const std::string &n="")
 
int compare (const edge e1, const edge e2) const override
 
int compare (const node n1, const node n2) const override
 
void computeMetaValue (edge e, tlp::Iterator< edge > *itE, Graph *mg) override
 
void computeMetaValue (node n, Graph *sg, Graph *mg) override
 
bool copy (const edge destination, const edge source, PropertyInterface *property, bool ifNotDefault=false) override
 
bool copy (const node destination, const node source, PropertyInterface *property, bool ifNotDefault=false) override
 
void copy (PropertyInterface *property) override
 
unsigned int edgeValueSize () const override
 
void erase (const edge e) override
 
void erase (const node n) override
 
DataMem * getEdgeDataMemValue (const edge e) const override
 
DataMem * getEdgeDefaultDataMemValue () const override
 
std::string getEdgeDefaultStringValue () const override
 
Tedge::RealType getEdgeDefaultValue () const
 
virtual tlp::Iterator< edge > * getEdgesEqualTo (typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue v, const Graph *g=nullptr) const
 
std::string getEdgeStringValue (const edge e) const override
 
tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue getEdgeValue (const edge e) const
 
DataMem * getNodeDataMemValue (const node n) const override
 
DataMem * getNodeDefaultDataMemValue () const override
 
std::string getNodeDefaultStringValue () const override
 
Tnode::RealType getNodeDefaultValue () const
 
virtual tlp::Iterator< node > * getNodesEqualTo (typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue v, const Graph *g=nullptr) const
 
std::string getNodeStringValue (const node n) const override
 
tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue getNodeValue (const node n) const
 
DataMem * getNonDefaultDataMemValue (const edge e) const override
 
DataMem * getNonDefaultDataMemValue (const node n) const override
 
tlp::Iterator< edge > * getNonDefaultValuatedEdges (const Graph *g=nullptr) const override
 
tlp::Iterator< node > * getNonDefaultValuatedNodes (const Graph *g=nullptr) const override
 
bool hasNonDefaultValuatedEdges (const Graph *g=nullptr) const override
 
bool hasNonDefaultValuatedNodes (const Graph *g=nullptr) const override
 
unsigned int nodeValueSize () const override
 
unsigned int numberOfNonDefaultValuatedEdges (const Graph *=nullptr) const override
 
unsigned int numberOfNonDefaultValuatedNodes (const Graph *g=nullptr) const override
 
virtual AbstractProperty< Tnode, Tedge, Tprop > & operator= (AbstractProperty< Tnode, Tedge, Tprop > &prop)
 
bool readEdgeDefaultValue (std::istream &) override
 
bool readEdgeValue (std::istream &, edge) override
 
bool readNodeDefaultValue (std::istream &) override
 
bool readNodeValue (std::istream &, node) override
 
void setAllEdgeDataMemValue (const DataMem *v) override
 
bool setAllEdgeStringValue (const std::string &inV) override
 
virtual void setAllEdgeValue (typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue v)
 
void setAllNodeDataMemValue (const DataMem *v) override
 
bool setAllNodeStringValue (const std::string &inV) override
 
virtual void setAllNodeValue (typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue v)
 
void setEdgeDataMemValue (const edge e, const DataMem *v) override
 
bool setEdgeDefaultStringValue (const std::string &inV) override
 
virtual void setEdgeDefaultValue (typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue v)
 
bool setEdgeStringValue (const edge inE, const std::string &inV) override
 
virtual void setEdgeValue (const edge e, typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue v)
 
void setMetaValueCalculator (PropertyInterface::MetaValueCalculator *mvCalc) override
 
void setNodeDataMemValue (const node n, const DataMem *v) override
 
bool setNodeDefaultStringValue (const std::string &inV) override
 
virtual void setNodeDefaultValue (typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue v)
 
bool setNodeStringValue (const node inN, const std::string &inV) override
 
virtual void setNodeValue (const node n, typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue v)
 
bool setStringValueToGraphEdges (const std::string &inV, const Graph *graph) override
 
bool setStringValueToGraphNodes (const std::string &inV, const Graph *graph) override
 
virtual void setValueToGraphEdges (typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue v, const Graph *graph)
 
virtual void setValueToGraphNodes (typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue v, const Graph *graph)
 
void writeEdgeDefaultValue (std::ostream &) const override
 
void writeEdgeValue (std::ostream &, edge) const override
 
void writeNodeDefaultValue (std::ostream &) const override
 
void writeNodeValue (std::ostream &, node) const override
 
- Public Member Functions inherited from tlp::PropertyInterface
virtual PropertyInterfaceclonePrototype (Graph *graph, const std::string &name) const =0
 
virtual const std::string & getCppClassName () const =0
 
tlp::GraphgetGraph () const
 
MetaValueCalculatorgetMetaValueCalculator ()
 
const std::string & getName () const
 
virtual const std::string & getTypename () const =0
 
bool rename (const std::string &newName)
 
- Public Member Functions inherited from tlp::Observable
void addListener (Observable &listener) const
 
void addListener (Observable *const listener) const
 
void addObserver (Observable &observer) const
 
void addObserver (Observable *const observer) const
 
unsigned int countListeners () const
 
unsigned int countObservers () const
 
unsigned int getReceived () const
 
unsigned int getSent () const
 
void removeListener (Observable &listener) const
 
void removeListener (Observable *const listener) const
 
void removeObserver (Observable &observer) const
 
void removeObserver (Observable *const observer) const
 

Protected Member Functions

virtual void clone_handler (AbstractProperty< Tnode, Tedge, Tprop > &)
 
- Protected Member Functions inherited from tlp::PropertyInterface
void notifyAfterSetAllEdgeValue ()
 
void notifyAfterSetAllNodeValue ()
 
void notifyAfterSetEdgeValue (const edge e)
 
void notifyAfterSetNodeValue (const node n)
 
void notifyBeforeSetAllEdgeValue ()
 
void notifyBeforeSetAllNodeValue ()
 
void notifyBeforeSetEdgeValue (const edge e)
 
void notifyBeforeSetNodeValue (const node n)
 
void notifyDestroy ()
 
void notifyRename (const std::string &newName)
 
- Protected Member Functions inherited from tlp::Observable
 Observable (const Observable &)
 
bool hasOnlookers () const
 
void observableDeleted ()
 
Observableoperator= (const Observable &)
 
void sendEvent (const Event &message)
 
virtual void treatEvent (const Event &message)
 
virtual void treatEvents (const std::vector< Event > &events)
 

Protected Attributes

Tedge::RealType edgeDefaultValue
 
MutableContainer< typename Tedge::RealType > edgeProperties
 
Tnode::RealType nodeDefaultValue
 
MutableContainer< typename Tnode::RealType > nodeProperties
 
- Protected Attributes inherited from tlp::PropertyInterface
Graphgraph
 
MetaValueCalculatormetaValueCalculator
 
std::string name
 

Friends

class Graph
 
class GraphView
 

Additional Inherited Members

- Static Public Member Functions inherited from tlp::Observable
static void disableEventNotification ()
 
static void enableEventNotification ()
 
static tlp::node getNode (const tlp::Observable *obs)
 
static ObservablegetObject (tlp::node n)
 
static const tlp::VectorGraph & getObservableGraph ()
 
static unsigned int getScheduled (tlp::node n)
 
static void holdObservers ()
 
static bool isAlive (tlp::node n)
 
static unsigned int observersHoldCounter ()
 
static void unholdObservers ()
 

Detailed Description

template<class Tnode, class Tedge, class Tprop = PropertyInterface>
class tlp::AbstractProperty< Tnode, Tedge, Tprop >

This class extends upon PropertyInterface, and adds type-safe methods to get and set the node and edge values, through the magic of template programming.

Nodes and Edges can have different types (e.g. tlp::LayoutProperty has tlp::PointType as node type and tlp::LineType as edge type), but most of the time they have the same type (e.g. tlp::DoubleProperty, tlp::IntegerProperty).

Some of the pure virtual functions of PropertyInterface are implemented in this class (e.g. erase()).

The actual data is stored in this class, and it manages the default values.

Definition at line 55 of file AbstractProperty.h.

Member Function Documentation

◆ clone_handler()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
virtual void tlp::AbstractProperty< Tnode, Tedge, Tprop >::clone_handler ( AbstractProperty< Tnode, Tedge, Tprop > &  )
inlineprotectedvirtual

Enable to clone part of sub_class.

Definition at line 543 of file AbstractProperty.h.

◆ compare() [1/2]

template<class Tnode , class Tedge , class Tprop >
int tlp::AbstractProperty< Tnode, Tedge, Tprop >::compare ( const edge  e1,
const edge  e2 
) const
overridevirtual

Compares the value this property holds for the two given edges.

Parameters
e1The first edge to compare the value of.
e2The second edge to compare the value of.
Returns
0 if the values are identical, a positive value if e1 is greater than e2, and a negative value if e1 is less than e2.

Implements tlp::PropertyInterface.

Reimplemented in tlp::StringProperty, and tlp::ColorProperty.

Definition at line 264 of file AbstractProperty.cxx.

◆ compare() [2/2]

template<class Tnode , class Tedge , class Tprop >
int tlp::AbstractProperty< Tnode, Tedge, Tprop >::compare ( const node  n1,
const node  n2 
) const
overridevirtual

Compares the value this property holds for the two given nodes.

Parameters
n1The first node to compare the value of.
n2The second node to compare the value of.
Returns
0 if the values are identical, a positive value if n1 is greater than n2, and a negative value if n1 is less than n2.

Implements tlp::PropertyInterface.

Reimplemented in tlp::SizeProperty, tlp::StringProperty, and tlp::ColorProperty.

Definition at line 257 of file AbstractProperty.cxx.

◆ computeMetaValue() [1/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::computeMetaValue ( edge  metaEdge,
tlp::Iterator< edge > *  it,
Graph metaGraph 
)
inlineoverridevirtual

Sets the value of the metaedge to a computed value.

Parameters
metaEdgeThe meta edge to compute a value on.
itThe edges represented by the meta edge.
metaGraphThe graph who owns the meta edge.

Implements tlp::PropertyInterface.

Definition at line 496 of file AbstractProperty.h.

◆ computeMetaValue() [2/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::computeMetaValue ( node  metaNode,
Graph subgraph,
Graph metaGraph 
)
inlineoverridevirtual

Sets the value of the metanode to a computed value.

The value is computed by this property's MetaValueCalculator.

Parameters
metaNodeThe metanode to compute a value on.
subgraphThe subgraph pointed by the metanode.
metaGraphThe graph who owns the meta node.

Implements tlp::PropertyInterface.

Definition at line 488 of file AbstractProperty.h.

◆ copy() [1/3]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::copy ( const edge  destination,
const edge  source,
PropertyInterface property,
bool  ifNotDefault = false 
)
inlineoverridevirtual

Copies the value of an edge in another property to an edge in this property.

Parameters
destinationThe edge whose value will be set.
sourceThe edge whose value to copy.
propertyThe property from which to copy the source edge value.
ifNotDefaultIf true, the copy will only be performed if the source edge's value is not the default value.
Returns
True if the copy was performed, false otherwise.

Implements tlp::PropertyInterface.

Definition at line 415 of file AbstractProperty.h.

◆ copy() [2/3]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::copy ( const node  destination,
const node  source,
PropertyInterface property,
bool  ifNotDefault = false 
)
inlineoverridevirtual

Copies the value of a node in another property to a node in this property.

Parameters
destinationThe node whose value will be set.
sourceThe node whose value to copy.
propertyThe property from which to copy the source node value.
ifNotDefaultIf true, the copy will only be performed if the source node's value is not the default value.
Returns
True if the copy was performed, false otherwise.

Implements tlp::PropertyInterface.

Definition at line 397 of file AbstractProperty.h.

◆ copy() [3/3]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::copy ( PropertyInterface source)
inlineoverridevirtual

Copies the values of the source property to this property.

Parameters
sourceThe property from which to copy values.
Warning
Be careful when using this method, if you are interested by observing the updates of the values of the current property, because no event is sent for nodes/edges whose value is the default value of the source property.

Implements tlp::PropertyInterface.

Definition at line 433 of file AbstractProperty.h.

◆ edgeValueSize()

template<class Tnode , class Tedge , class Tprop >
unsigned int tlp::AbstractProperty< Tnode, Tedge, Tprop >::edgeValueSize ( ) const
overridevirtual

Returns the size in bytes of an edge's value.

Returns
the size of a node's value (0 means the size is not fixed)

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty, and tlp::StringProperty.

Definition at line 492 of file AbstractProperty.cxx.

◆ erase() [1/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::erase ( const edge  e)
inlineoverridevirtual

Resets the value of an edge to the default value.

Parameters
eThe edge to reset the value of.

Implements tlp::PropertyInterface.

Definition at line 240 of file AbstractProperty.h.

◆ erase() [2/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::erase ( const node  n)
inlineoverridevirtual

Resets the value of a node to the default value.

Parameters
nThe node to reset the value of.

Implements tlp::PropertyInterface.

Definition at line 229 of file AbstractProperty.h.

◆ getEdgeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeDataMemValue ( const edge  e) const
inlineoverridevirtual

Gets the edge value, contained in a tlp::DataMem structure.

Parameters
nThe edge to get the value of.
Returns
The value of the edge, in a tlp::DataMem.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 449 of file AbstractProperty.h.

◆ getEdgeDefaultDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeDefaultDataMemValue ( ) const
inlineoverridevirtual

Gets a pointer to the tlp::DataMem structure that contains the edge default value.

Returns
The DataMem structure containing the edge default value.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 443 of file AbstractProperty.h.

◆ getEdgeDefaultStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
std::string tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeDefaultStringValue ( ) const
inlineoverridevirtual

Gets a string representation of the edge default value.

Returns
A string representation of the edge default value.

Implements tlp::PropertyInterface.

Definition at line 297 of file AbstractProperty.h.

◆ getEdgeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
Tedge::RealType tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeDefaultValue
inline

Gets the default edge value of the property.

Returns
The default value of edges.

Definition at line 41 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ getEdgesEqualTo()

template<class Tnode , class Tedge , class Tprop >
tlp::Iterator< tlp::edge > * tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgesEqualTo ( typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue  v,
const Graph g = nullptr 
) const
virtual

Returns an iterator through all edges belonging to g whose associated value is equal to val. If g is nullptr, the graph given when creating the property is considered.

Definition at line 78 of file AbstractProperty.cxx.

◆ getEdgeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
std::string tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeStringValue ( const edge  e) const
inlineoverridevirtual

Gets a string representation of the edge value.

Parameters
eThe edge to get the value of.
Returns
A string representation of the edge value.

Implements tlp::PropertyInterface.

Definition at line 305 of file AbstractProperty.h.

◆ getEdgeValue()

template<class Tnode , class Tedge , class Tprop >
tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue tlp::AbstractProperty< Tnode, Tedge, Tprop >::getEdgeValue ( const edge  e) const
inline

Returns the value associated to the edge e in this property. If there is no value, it returns the default edge value.

Parameters
eThe edge for which we want to get the value of the property.
Returns
:StoredType< Tedge::RealType >::ReturnedConstValue The value of the property for this edge.

Definition at line 54 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ getNodeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeDataMemValue ( const node  n) const
inlineoverridevirtual

Gets the node value, contained in a tlp::DataMem structure.

Parameters
nThe node to get the value of.
Returns
The value of the node, in a tlp::DataMem.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 446 of file AbstractProperty.h.

◆ getNodeDefaultDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeDefaultDataMemValue ( ) const
inlineoverridevirtual

Gets a pointer to the tlp::DataMem structure that contains the node default value.

Returns
The DataMem structure containing the node default value.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 440 of file AbstractProperty.h.

◆ getNodeDefaultStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
std::string tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeDefaultStringValue ( ) const
inlineoverridevirtual

Gets a string representation of the node default value.

Returns
A string representation of the node default value.

Implements tlp::PropertyInterface.

Definition at line 293 of file AbstractProperty.h.

◆ getNodeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
Tnode::RealType tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeDefaultValue
inline

Gets the default node value of the property.

Returns
The default value of nodes.

Definition at line 35 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ getNodesEqualTo()

template<class Tnode , class Tedge , class Tprop >
tlp::Iterator< tlp::node > * tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodesEqualTo ( typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue  v,
const Graph g = nullptr 
) const
virtual

Returns an iterator through all nodes belonging to g whose associated value is equal to val. If g is nullptr, the graph given when creating the property is considered.

Definition at line 60 of file AbstractProperty.cxx.

◆ getNodeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
std::string tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeStringValue ( const node  n) const
inlineoverridevirtual

Gets a string representation of the node value.

Parameters
nThe node to get the value of.
Returns
A string representation of the node value.

Implements tlp::PropertyInterface.

Definition at line 301 of file AbstractProperty.h.

◆ getNodeValue()

template<class Tnode , class Tedge , class Tprop >
tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNodeValue ( const node  n) const
inline

Returns the value associated with the node n in this property. If there is no value, it returns the default node value.

Parameters
nThe node for which we want to get the value of the property.
Returns
:StoredType< Tnode::RealType >::ReturnedConstValue The value of the property for this node.

Definition at line 47 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ getNonDefaultDataMemValue() [1/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNonDefaultDataMemValue ( const edge  e) const
inlineoverridevirtual

Returns the value in a DataMem if it is not default, otherwise returns nullptr.

Parameters
eThe edge to get the value of.
Returns
The value of the edge if it is not default, or nullptr.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 462 of file AbstractProperty.h.

◆ getNonDefaultDataMemValue() [2/2]

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
DataMem* tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNonDefaultDataMemValue ( const node  n) const
inlineoverridevirtual

Returns the value in a DataMem if it is not default, otherwise returns nullptr.

Parameters
nThe node to get the value of.
Returns
The value of the node if it is not default, or nullptr.
Warning
The ownership of this pointer is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 452 of file AbstractProperty.h.

◆ getNonDefaultValuatedEdges()

template<class Tnode , class Tedge , class Tprop >
tlp::Iterator< tlp::edge > * tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNonDefaultValuatedEdges ( const Graph = nullptr) const
overridevirtual

Gets an Iterator on all non-default valuated edges. When given a Graph as parameter, only edges belonging to this graph are iterated over.

Returns
An Iterator over edges whose value is not default.
Warning
The ownership of the iterator is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 449 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ getNonDefaultValuatedNodes()

template<class Tnode , class Tedge , class Tprop >
tlp::Iterator< tlp::node > * tlp::AbstractProperty< Tnode, Tedge, Tprop >::getNonDefaultValuatedNodes ( const Graph = nullptr) const
overridevirtual

Gets an Iterator on all non-default valuated nodes. When given a Graph as parameter, only nodes belonging to this graph are iterated over.

Returns
An Iterator over nodes whose value is not default.
Warning
The ownership of the iterator is given to the caller.

Implements tlp::PropertyInterface.

Definition at line 367 of file AbstractProperty.cxx.

+ Here is the caller graph for this function:

◆ hasNonDefaultValuatedEdges()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::hasNonDefaultValuatedEdges ( const Graph = nullptr) const
overridevirtual

Returns whether the property has edges with a non default value. When given a Graph as parameter, only the edges with a non default value belonging to this graph are taken into account.

Returns
false if all edges has the default value, true if not.

Implements tlp::PropertyInterface.

Definition at line 473 of file AbstractProperty.cxx.

◆ hasNonDefaultValuatedNodes()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::hasNonDefaultValuatedNodes ( const Graph = nullptr) const
overridevirtual

Returns whether the property has nodes with a non default value. When given a Graph as parameter, only the nodes with a non default value belonging to this graph are taken into account.

Returns
false if all nodes has the default value, true if not.

Implements tlp::PropertyInterface.

Definition at line 391 of file AbstractProperty.cxx.

◆ nodeValueSize()

template<class Tnode , class Tedge , class Tprop >
unsigned int tlp::AbstractProperty< Tnode, Tedge, Tprop >::nodeValueSize ( ) const
overridevirtual

Returns the size in bytes of a node's value.

Returns
the size of a node's value (0 means the size is not fixed)

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty, and tlp::StringProperty.

Definition at line 410 of file AbstractProperty.cxx.

◆ numberOfNonDefaultValuatedEdges()

template<class Tnode , class Tedge , class Tprop >
unsigned int tlp::AbstractProperty< Tnode, Tedge, Tprop >::numberOfNonDefaultValuatedEdges ( const Graph = nullptr) const
overridevirtual

Returns the number of edges with a non default value.

Returns
the number of edges with a non default value.

Implements tlp::PropertyInterface.

Definition at line 483 of file AbstractProperty.cxx.

◆ numberOfNonDefaultValuatedNodes()

template<class Tnode , class Tedge , class Tprop >
unsigned int tlp::AbstractProperty< Tnode, Tedge, Tprop >::numberOfNonDefaultValuatedNodes ( const Graph = nullptr) const
overridevirtual

Returns the number of nodes with a non default value. When given a Graph as parameter, only the number of nodes with a non default value belonging to this graph is returned.

Returns
the number of nodes with a non default value.

Implements tlp::PropertyInterface.

Definition at line 401 of file AbstractProperty.cxx.

◆ operator=()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
virtual AbstractProperty<Tnode, Tedge, Tprop>& tlp::AbstractProperty< Tnode, Tedge, Tprop >::operator= ( AbstractProperty< Tnode, Tedge, Tprop > &  prop)
inlinevirtual

This operator overload allows to copy a property using the following syntax :

IntegerProperty* shape = graph->getProperty<IntegerProperty>("viewShape");
IntegerProperty* backup = graph->getProperty<IntegerProperty>("shapeBackup");
*backup = *shape; // all the values from 'shape' will be copied into 'backup'.
Parameters
propThe property to copy the values from.
Returns
This property with the values copied.

Definition at line 256 of file AbstractProperty.h.

◆ readEdgeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::readEdgeDefaultValue ( std::istream &  )
overridevirtual

Reads the edges default value.

Implements tlp::PropertyInterface.

Definition at line 508 of file AbstractProperty.cxx.

◆ readEdgeValue()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::readEdgeValue ( std::istream &  ,
edge   
)
overridevirtual

Reads the value of an edge.

Implements tlp::PropertyInterface.

Definition at line 518 of file AbstractProperty.cxx.

◆ readNodeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::readNodeDefaultValue ( std::istream &  )
overridevirtual

Reads the nodes default value.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 426 of file AbstractProperty.cxx.

◆ readNodeValue()

template<class Tnode , class Tedge , class Tprop >
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::readNodeValue ( std::istream &  ,
node   
)
overridevirtual

Reads the value of a node.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 436 of file AbstractProperty.cxx.

◆ setAllEdgeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllEdgeDataMemValue ( const DataMem *  v)
inlineoverridevirtual

Sets all the edges value to the value contained in the given DataMem structure. All previous values are lost.

Parameters
valueThe value to set on all the edges.

Implements tlp::PropertyInterface.

Definition at line 481 of file AbstractProperty.h.

◆ setAllEdgeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllEdgeStringValue ( const std::string &  value)
inlineoverridevirtual

Sets all the edges value to the value represented by the string. For some types, some parsing will be necessary (e.g. LayoutProperty). All previous values are lost and the represented value is assigned as the default one to the future added edges.

Parameters
valueA string representing the new value to set on all the edges.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 363 of file AbstractProperty.h.

◆ setAllEdgeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllEdgeValue ( typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue  v)
virtual

Sets the value of all edges and notify the observers. All previous values are lost and the given value is assigned as the default one to the future added edges.

Parameters
vThe value to set to all edges.

Definition at line 226 of file AbstractProperty.cxx.

◆ setAllNodeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllNodeDataMemValue ( const DataMem *  value)
inlineoverridevirtual

Sets all the nodes value to the value contained in the given DataMem structure. All previous values are lost.

Parameters
valueThe value to set on all the nodes.

Implements tlp::PropertyInterface.

Definition at line 478 of file AbstractProperty.h.

◆ setAllNodeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllNodeStringValue ( const std::string &  value)
inlineoverridevirtual

Sets all the nodes value to the value represented by the string. For some types, some parsing will be necessary (e.g. LayoutProperty). All previous values are lost and the represented value is assigned as the default one to the future added nodes.

Parameters
valueA string representing the new value to set on all the nodes.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 336 of file AbstractProperty.h.

◆ setAllNodeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setAllNodeValue ( typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue  v)
virtual

Sets the value of all nodes and notify the observers. All previous values are lost and the given value is assigned as the default one to the future added nodes.

Parameters
vThe value to set to all nodes.

Definition at line 114 of file AbstractProperty.cxx.

◆ setEdgeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setEdgeDataMemValue ( const edge  e,
const DataMem *  v 
)
inlineoverridevirtual

Sets the edge value.

Parameters
eThe edge to set the value of.
valueThe value to set to this edge.

Implements tlp::PropertyInterface.

Definition at line 475 of file AbstractProperty.h.

◆ setEdgeDefaultStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setEdgeDefaultStringValue ( const std::string &  value)
inlineoverridevirtual

Sets the value assigned as the default one to the future added edges from a string representation.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on future added edges.
Returns
Whether the given string was a correct representation for this property's type. If not, the default value is not set.

Implements tlp::PropertyInterface.

Definition at line 354 of file AbstractProperty.h.

◆ setEdgeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setEdgeDefaultValue ( typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue  v)
virtual

Sets the value assigned as the default one to the future added edges.

Since
Tulip 5.0
Parameters
valuethe new value to set on future added edges.
Returns
Whether the given string was a correct representation for this property's type. If not, the default value is not set.

Definition at line 185 of file AbstractProperty.cxx.

◆ setEdgeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setEdgeStringValue ( const edge  e,
const std::string &  value 
)
inlineoverridevirtual

Sets a new value on the edge, represented by the string parameter.

Parameters
eThe edge on which to set value on.
valueA string representing the value to set on the edge.
Returns
Whether the string was a correct representation for this property's type. If not, the value is not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 318 of file AbstractProperty.h.

◆ setEdgeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setEdgeValue ( const edge  e,
typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue  v 
)
virtual

Set the value of an edge and notify the observers of a modification.

Parameters
eThe edge to set the value of.
vThe value to affect for this edge.

Definition at line 105 of file AbstractProperty.cxx.

◆ setMetaValueCalculator()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setMetaValueCalculator ( PropertyInterface::MetaValueCalculator calculator)
inlineoverridevirtual

Sets the Calculator for meta nodes and edges.

Parameters
calculatorThe object containing the logic for computing the meta values for the nodes and edges.
Warning
The ownership of the MetaValueCalculator is not taken by the property.

Reimplemented from tlp::PropertyInterface.

Definition at line 502 of file AbstractProperty.h.

◆ setNodeDataMemValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setNodeDataMemValue ( const node  n,
const DataMem *  value 
)
inlineoverridevirtual

Sets the node value.

Parameters
nThe node to set the value of.
valueThe value to set to this node.

Implements tlp::PropertyInterface.

Definition at line 472 of file AbstractProperty.h.

◆ setNodeDefaultStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setNodeDefaultStringValue ( const std::string &  value)
inlineoverridevirtual

Sets the value assigned as the default one to the future added nodes from a string representation.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on future added nodes.
Returns
Whether the given string was a correct representation for this property's type. If not, the default value is not set.

Implements tlp::PropertyInterface.

Definition at line 327 of file AbstractProperty.h.

◆ setNodeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setNodeDefaultValue ( typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue  v)
virtual

Sets the value assigned as the default one to the future added nodes.

Since
Tulip 5.0
Parameters
vthe new value to set on future added nodes.
Returns
Whether the given string was a correct representation for this property's type. If not, the default value is not set.

Definition at line 123 of file AbstractProperty.cxx.

◆ setNodeStringValue()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setNodeStringValue ( const node  n,
const std::string &  value 
)
inlineoverridevirtual

Sets a new value on the node, represented by the string parameter.

Parameters
nThe node on which to set the new value.
valueA string representing the value to set on the node.
Returns
Whether the string was a correct representation for this property's type. If not, the value is not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 309 of file AbstractProperty.h.

◆ setNodeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setNodeValue ( const node  n,
typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue  v 
)
virtual

Sets the value of a node and notify the observers of a modification.

Parameters
nThe node to set the value of.
vThe value to affect for this node.
Examples
graph_display/graph_display.cpp.

Definition at line 96 of file AbstractProperty.cxx.

◆ setStringValueToGraphEdges()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setStringValueToGraphEdges ( const std::string &  value,
const Graph graph 
)
inlineoverridevirtual

Sets all the edges value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty). Only the edges from that graph will have their value modified in the property and the default edge value will not be modified.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on all the edges.
graphA graph that defines the set of edges.
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no edge value will be modified in it.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 372 of file AbstractProperty.h.

◆ setStringValueToGraphNodes()

template<class Tnode , class Tedge , class Tprop = PropertyInterface>
bool tlp::AbstractProperty< Tnode, Tedge, Tprop >::setStringValueToGraphNodes ( const std::string &  value,
const Graph graph 
)
inlineoverridevirtual

Sets all the nodes value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty). Only the nodes from that graph will have their value modified in the property and the default node value will not be modified.

Since
Tulip 5.0
Parameters
valueA string representing the new value to set on all the nodes.
graphA graph that defines the set of nodes.
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no node value will be modified in it.
Returns
Whether the given string was a correct representation for this property's type. If not, the values are not set.

Implements tlp::PropertyInterface.

Reimplemented in tlp::GraphProperty.

Definition at line 345 of file AbstractProperty.h.

◆ setValueToGraphEdges()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setValueToGraphEdges ( typename tlp::StoredType< typename Tedge::RealType >::ReturnedConstValue  v,
const Graph graph 
)
virtual

Sets the value of all edges in a graph and notify the observers. Only the edges from that graph will have their value modified in the property and the default edge value will not be modified.

Since
Tulip 5.0
Parameters
vThe value to set to all edges.
graphA graph on which to modify
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no edge value will be modified.

Definition at line 235 of file AbstractProperty.cxx.

◆ setValueToGraphNodes()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::setValueToGraphNodes ( typename tlp::StoredType< typename Tnode::RealType >::ReturnedConstValue  v,
const Graph graph 
)
virtual

Sets the value of all nodes in a graph and notify the observers. Only the nodes from that graph will have their value modified in the property and the default node value will not be modified.

Since
Tulip 5.0
Parameters
vThe value to set to all nodes.
graphA graph that defines the set of nodes
Warning
If the provided graph is not a descendant of the one associated to that property (including itself), no node value will be modified.

Definition at line 163 of file AbstractProperty.cxx.

◆ writeEdgeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::writeEdgeDefaultValue ( std::ostream &  ) const
overridevirtual

Writes the edges default value.

Implements tlp::PropertyInterface.

Definition at line 497 of file AbstractProperty.cxx.

◆ writeEdgeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::writeEdgeValue ( std::ostream &  ,
edge   
) const
overridevirtual

Writes the value of an edge.

Implements tlp::PropertyInterface.

Definition at line 502 of file AbstractProperty.cxx.

◆ writeNodeDefaultValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::writeNodeDefaultValue ( std::ostream &  ) const
overridevirtual

Writes the nodes default value.

Implements tlp::PropertyInterface.

Definition at line 415 of file AbstractProperty.cxx.

◆ writeNodeValue()

template<class Tnode , class Tedge , class Tprop >
void tlp::AbstractProperty< Tnode, Tedge, Tprop >::writeNodeValue ( std::ostream &  ,
node   
) const
overridevirtual

Writes the value of a node.

Implements tlp::PropertyInterface.

Definition at line 420 of file AbstractProperty.cxx.

tlp::Graph::getProperty
virtual PropertyInterface * getProperty(const std::string &name) const =0
Gets an existing property. In DEBUG mode an assertion checks the existence of the property.