Tulip  5.1.0
Large graphs analysis and drawing
tlp::LayoutProperty Class Reference

#include <LayoutProperty.h>

+ Inheritance diagram for tlp::LayoutProperty:
+ Collaboration diagram for tlp::LayoutProperty:

Public Member Functions

 LayoutProperty (Graph *graph, const std::string &name="")
 
std::vector< double > angularResolutions (const node n, const Graph *subgraph=NULL) const
 
double averageAngularResolution (const Graph *subgraph=NULL) const
 
double averageAngularResolution (const node n, const Graph *subgraph=NULL) const
 
double averageEdgeLength (const Graph *subgraph=NULL) const
 
void center (const Graph *subgraph=NULL)
 
void center (const Vec3f &newCenter, const Graph *subgraph=NULL)
 
PropertyInterfaceclonePrototype (Graph *, const std::string &) const
 
void computeEmbedding (Graph *subgraph=NULL)
 
void computeEmbedding (const node n, Graph *subgraph=NULL)
 
double edgeLength (const edge e) const
 
Coord getMax (const Graph *subgraph=NULL)
 
Coord getMin (const Graph *subgraph=NULL)
 
const std::string & getTypename () const
 
void normalize (const Graph *subgraph=NULL)
 
void perfectAspectRatio (const Graph *subgraph=NULL)
 
void rotateX (const double &alpha, const Graph *subgraph=NULL)
 
void rotateX (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
 
void rotateY (const double &alpha, const Graph *subgraph=NULL)
 
void rotateY (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
 
void rotateZ (const double &alpha, const Graph *subgraph=NULL)
 
void rotateZ (const double &alpha, Iterator< node > *itNodes, Iterator< edge > *itEdges)
 
void scale (const Vec3f &scaleFactors, const Graph *subgraph=NULL)
 
void scale (const Vec3f &scaleFactors, Iterator< node > *itNodes, Iterator< edge > *itEdges)
 
virtual void setAllEdgeValue (tlp::StoredType< std::vector< Coord > >::ReturnedConstValue v)
 
virtual void setAllEdgeValue (tlp::StoredType< std::vector< Coord > >::ReturnedConstValue v, const Graph *graph)
 
virtual void setAllNodeValue (tlp::StoredType< Coord >::ReturnedConstValue v)
 
virtual void setAllNodeValue (tlp::StoredType< Coord >::ReturnedConstValue v, const Graph *graph)
 
virtual void setEdgeValue (const edge, tlp::StoredType< std::vector< Coord > >::ReturnedConstValue v)
 
virtual void setNodeValue (const node, tlp::StoredType< Coord >::ReturnedConstValue v)
 
virtual void setValueToGraphEdges (tlp::StoredType< std::vector< Coord > >::ReturnedConstValue v, const Graph *graph)
 
virtual void setValueToGraphNodes (tlp::StoredType< Coord >::ReturnedConstValue v, const Graph *graph)
 
void translate (const Vec3f &move, const Graph *subgraph=NULL)
 
void translate (const Vec3f &move, Iterator< node > *itNodes, Iterator< edge > *itEdges)
 
- Public Member Functions inherited from tlp::MinMaxProperty< nodeType, edgeType, propType >
 MinMaxProperty (tlp::Graph *graph, const std::string &name, typename nodeType::RealType NodeMin, typename nodeType::RealType NodeMax, typename edgeType::RealType EdgeMin, typename edgeType::RealType EdgeMax)
 
edgeType::RealType getEdgeMax (const Graph *graph=NULL)
 
edgeType::RealType getEdgeMin (const Graph *graph=NULL)
 
nodeType::RealType getNodeMax (const Graph *graph=NULL)
 
nodeType::RealType getNodeMin (const Graph *graph=NULL)
 
void updateAllEdgesValues (typename edgeType::RealType newValue)
 
void updateAllNodesValues (typename nodeType::RealType newValue)
 
template<>
void updateEdgeValue (tlp::edge e, tlp::LineType::RealType newValue)
 
void updateEdgeValue (tlp::edge e, typename edgeType::RealType newValue)
 
void updateNodeValue (tlp::node n, typename nodeType::RealType newValue)
 
- Public Member Functions inherited from tlp::AbstractProperty< nodeType, edgeType, propType >
 AbstractProperty (Graph *, const std::string &n="")
 
int compare (const node n1, const node n2) const
 
int compare (const edge e1, const edge e2) const
 
virtual void computeMetaValue (node n, Graph *sg, Graph *mg)
 
virtual void computeMetaValue (edge e, tlp::Iterator< edge > *itE, Graph *mg)
 
virtual bool copy (const node destination, const node source, PropertyInterface *property, bool ifNotDefault=false)
 
virtual bool copy (const edge destination, const edge source, PropertyInterface *property, bool ifNotDefault=false)
 
virtual void copy (PropertyInterface *property)
 
virtual unsigned int edgeValueSize () const
 
void erase (const node n)
 
void erase (const edge e)
 
virtual DataMem * getEdgeDataMemValue (const edge e) const
 
virtual DataMem * getEdgeDefaultDataMemValue () const
 
virtual std::string getEdgeDefaultStringValue () const
 
edgeType::RealType getEdgeDefaultValue () const
 
virtual tlp::Iterator< edge > * getEdgesEqualTo (typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v, const Graph *g=NULL) const
 
virtual std::string getEdgeStringValue (const edge e) const
 
tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue getEdgeValue (const edge e) const
 
virtual DataMem * getNodeDataMemValue (const node n) const
 
virtual DataMem * getNodeDefaultDataMemValue () const
 
virtual std::string getNodeDefaultStringValue () const
 
nodeType::RealType getNodeDefaultValue () const
 
virtual tlp::Iterator< node > * getNodesEqualTo (typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v, const Graph *g=NULL) const
 
virtual std::string getNodeStringValue (const node n) const
 
tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue getNodeValue (const node n) const
 
virtual DataMem * getNonDefaultDataMemValue (const node n) const
 
virtual DataMem * getNonDefaultDataMemValue (const edge e) const
 
virtual tlp::Iterator< edge > * getNonDefaultValuatedEdges (const Graph *g=NULL) const
 
virtual tlp::Iterator< node > * getNonDefaultValuatedNodes (const Graph *g=NULL) const
 
virtual unsigned int nodeValueSize () const
 
virtual unsigned int numberOfNonDefaultValuatedEdges (const Graph *=NULL) const
 
virtual unsigned int numberOfNonDefaultValuatedNodes (const Graph *g=NULL) const
 
virtual AbstractProperty< nodeType, edgeType, propType > & operator= (AbstractProperty< nodeType, edgeType, propType > &prop)
 
virtual bool readEdgeDefaultValue (std::istream &)
 
virtual bool readEdgeValue (std::istream &, edge)
 
virtual bool readNodeDefaultValue (std::istream &)
 
virtual bool readNodeValue (std::istream &, node)
 
virtual void setAllEdgeDataMemValue (const DataMem *v)
 
virtual bool setAllEdgeStringValue (const std::string &inV)
 
virtual bool setAllEdgeStringValue (const std::string &inV, const Graph *graph)
 
virtual void setAllEdgeValue (typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v)
 
virtual void setAllEdgeValue (typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v, const Graph *graph)
 
virtual void setAllNodeDataMemValue (const DataMem *v)
 
virtual bool setAllNodeStringValue (const std::string &inV)
 
virtual bool setAllNodeStringValue (const std::string &inV, const Graph *graph)
 
virtual void setAllNodeValue (typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v)
 
virtual void setAllNodeValue (typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v, const Graph *graph)
 
virtual void setEdgeDataMemValue (const edge e, const DataMem *v)
 
virtual bool setEdgeDefaultStringValue (const std::string &inV)
 
virtual void setEdgeDefaultValue (typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v)
 
virtual bool setEdgeStringValue (const edge inE, const std::string &inV)
 
virtual void setEdgeValue (const edge e, typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v)
 
virtual void setMetaValueCalculator (PropertyInterface::MetaValueCalculator *mvCalc)
 
virtual void setNodeDataMemValue (const node n, const DataMem *v)
 
virtual bool setNodeDefaultStringValue (const std::string &inV)
 
virtual void setNodeDefaultValue (typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v)
 
virtual bool setNodeStringValue (const node inN, const std::string &inV)
 
virtual void setNodeValue (const node n, typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v)
 
virtual bool setStringValueToGraphEdges (const std::string &inV, const Graph *graph)
 
virtual bool setStringValueToGraphNodes (const std::string &inV, const Graph *graph)
 
virtual void setValueToGraphEdges (typename tlp::StoredType< typename edgeType::RealType >::ReturnedConstValue v, const Graph *graph)
 
virtual void setValueToGraphNodes (typename tlp::StoredType< typename nodeType::RealType >::ReturnedConstValue v, const Graph *graph)
 
virtual void writeEdgeDefaultValue (std::ostream &) const
 
virtual void writeEdgeValue (std::ostream &, edge) const
 
virtual void writeNodeDefaultValue (std::ostream &) const
 
virtual void writeNodeValue (std::ostream &, node) const
 

Public Attributes

unsigned int nbBendedEdges
 

Static Public Attributes

static const std::string propertyTypename
 

Protected Member Functions

virtual void clone_handler (AbstractProperty< tlp::PointType, tlp::LineType > &)
 
- Protected Member Functions inherited from tlp::MinMaxProperty< nodeType, edgeType, propType >
 MINMAX_MAP (nodeType) minMaxNode
 
 MINMAX_MAP (edgeType) minMaxEdge
 
 MINMAX_PAIR (nodeType) computeMinMaxNode(const Graph *graph)
 
 MINMAX_PAIR (edgeType) computeMinMaxEdge(const Graph *graph)
 
void removeListenersAndClearEdgeMap ()
 
void removeListenersAndClearNodeMap ()
 
- Protected Member Functions inherited from tlp::AbstractProperty< nodeType, edgeType, propType >
virtual void clone_handler (AbstractProperty< nodeType, edgeType, propType > &)
 

Additional Inherited Members

- Protected Attributes inherited from tlp::MinMaxProperty< nodeType, edgeType, propType >
edgeType::RealType _edgeMax
 
edgeType::RealType _edgeMin
 
nodeType::RealType _nodeMax
 
nodeType::RealType _nodeMin
 
bool needGraphListener
 
- Protected Attributes inherited from tlp::AbstractProperty< nodeType, edgeType, propType >
edgeType::RealType edgeDefaultValue
 
MutableContainer< typename edgeType::RealType > edgeProperties
 
nodeType::RealType nodeDefaultValue
 
MutableContainer< typename nodeType::RealType > nodeProperties
 

Detailed Description

A graph property that maps a tlp::Coord value to graph nodes and std::vector<tlp::Coord> for edges.

Examples:
clique_import/cliqueimport.cpp, and graph_display/graph_display.cpp.

Definition at line 48 of file LayoutProperty.h.

Member Function Documentation

std::vector<double> tlp::LayoutProperty::angularResolutions ( const node  n,
const Graph subgraph = NULL 
) const

Returns a vector of all angular resolution of a node. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
nthe graph node on which to compute the angular resolution
subgraphIf not null, only computes the average angular resolution for the node in that sub-graph
double tlp::LayoutProperty::averageAngularResolution ( const Graph subgraph = NULL) const

Returns the average angular resolution of the layout. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
subgraphIt not null, only computes the average angular resolution for that sub-graph
double tlp::LayoutProperty::averageAngularResolution ( const node  n,
const Graph subgraph = NULL 
) const

Returns the average angular resolution of a node. It is only defined for 2D drawing, meaning the third coordinate is omitted

Parameters
nthe graph node on which to compute the angular resolution
subgraphIf not null, only computes the average angular resolution for the node in that sub-graph
double tlp::LayoutProperty::averageEdgeLength ( const Graph subgraph = NULL) const

Returns the average edge length of the layout, the bends are taken into account

Parameters
subgraphIf not null, only compute the average edge length for that sub-graph
void tlp::LayoutProperty::center ( const Graph subgraph = NULL)

Centers the layout, meaning translating it in order that the center of its bounding box is (0,0,0)

Parameters
subgraphIf not null, only centers the layout of that sub-graph
void tlp::LayoutProperty::center ( const Vec3f &  newCenter,
const Graph subgraph = NULL 
)

Centers the layout to newCenter, meaning translating it in order that the center of its bounding box is equal to newCenter

Parameters
newCenterthe coordinate of the new layout center
subgraphIf not null, only centers the layout of that sub-graph
void tlp::LayoutProperty::computeEmbedding ( Graph subgraph = NULL)

Fixes embedding of the graph according to the layout ie. sort edges around nodes according to their neighbors/bends position in the layout/ Only works in 2D, the third coordinate is not taken into account.

Parameters
subgraphIt not null, only fixes embedding in that sub-graph
void tlp::LayoutProperty::computeEmbedding ( const node  n,
Graph subgraph = NULL 
)

Fixes embedding of the node according to the layout ie. sort edges around the node according to its neighbors/bends position in the layout/ Only work in 2D, the third coordinate is not taken into account.

Parameters
nthe graph node on which to fix embedding
subgraphIf not null, only fixes the embedding of the node in that sub-graph
double tlp::LayoutProperty::edgeLength ( const edge  e) const

Returns the length of an edge, the bends are taken into account. Thus, it measure the length of a polyline.

Parameters
ethe graph edge on which to compute its length
Warning
this function only measure the length of the polyline between bends, when using curves like B├ęzier etc... the result will not be the length of the curve.
Coord tlp::LayoutProperty::getMax ( const Graph subgraph = NULL)

Returns the maximum coordinate of the layout, i.e. the top-right corner of the induced bounding box

Parameters
subgraphIf not null, returns the maximum coordinate for a sub-graph layout
Coord tlp::LayoutProperty::getMin ( const Graph subgraph = NULL)

Returns the minimum coordinate of the layout, i.e. the bottom-left corner of the induced bounding box

Parameters
subgraphIf not null, returns the minimum coordinate for a sub-graph layout
void tlp::LayoutProperty::normalize ( const Graph subgraph = NULL)

Normalizes the layout, meaning dividing each nodes and edges coordinate by the maximum magnitude of the whole coordinates set

Parameters
subgraphIf not null, only normalizes the layout of that sub-graph
void tlp::LayoutProperty::perfectAspectRatio ( const Graph subgraph = NULL)

Scales the layout in order to approach an aspect ratio (width / height) of 1.0 .

Parameters
subgraphIf not null, only scales the layout of that sub-graph
void tlp::LayoutProperty::rotateX ( const double &  alpha,
const Graph subgraph = NULL 
)

Rotates the layout around the X-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateX ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the X-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::rotateY ( const double &  alpha,
const Graph subgraph = NULL 
)

Rotates the layout around the Y-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateY ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the Y-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::rotateZ ( const double &  alpha,
const Graph subgraph = NULL 
)

Rotates the layout around the Z-axis according to an angle in degrees.

Parameters
alphaan angle in degrees
subgraphIf not null, only rotates the layout of that sub-graph
void tlp::LayoutProperty::rotateZ ( const double &  alpha,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Rotates the layout around the Z-axis of the nodes and edges provided through iterators according to an angle in degrees.

Parameters
alphaan angle in degrees
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
void tlp::LayoutProperty::scale ( const Vec3f &  scaleFactors,
const Graph subgraph = NULL 
)

Scales the current layout according to a vector of scale factors (sx, sy, sz).

Parameters
scaleFactorsa vector of scale factors
subgraphIf not null, only scales the layout of that sub-graph
void tlp::LayoutProperty::scale ( const Vec3f &  scaleFactors,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Scales the layout of a set of nodes and edges provided through iterators according to a vector of scale factors (sx, sy, sz).

Parameters
scaleFactorsa vector of scale factors
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted
virtual void tlp::LayoutProperty::setNodeValue ( const node  ,
tlp::StoredType< Coord >::ReturnedConstValue  v 
)
virtual

Returns the number of crossings in the layout

void tlp::LayoutProperty::translate ( const Vec3f &  move,
const Graph subgraph = NULL 
)

Translates the current layout according to a movement vector

Parameters
movea movement vector
subgraphIf not null, only translates the layout of that sub-graph
void tlp::LayoutProperty::translate ( const Vec3f &  move,
Iterator< node > *  itNodes,
Iterator< edge > *  itEdges 
)

Translates the layout of a set of nodes and edges provided through iterators according to a movement vector

Parameters
movea movement vector
itNodesan iterator on graph nodes
itEdgesan iterator on graph edges
Warning
The iterators are not deleted