tlp Namespace Reference
Detailed Description
Author: David Auber Email : auber@labri.fr Last modification : 01/09/2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Classes
Typedefs
Enumerations
Functions
- template<typename Obj, unsigned int SIZE> std::ostream & operator<< (std::ostream &os, const Array< Obj, SIZE > &)
- template<typename Obj, unsigned int SIZE> std::istream & operator>> (std::istream &is, Array< Obj, SIZE > &)
- template<typename Obj> Circle< Obj > enclosingCircle (const Circle< Obj > &, const Circle< Obj > &)
- template<typename Obj> Circle< Obj > enclosingCircle (const std::vector< Circle< Obj > > &circles)
- template<typename Obj> Circle< Obj > lazyEnclosingCircle (const std::vector< Circle< Obj > > &circles)
- template<typename Obj> std::ostream & operator<< (std::ostream &os, const Circle< Obj > &)
- std::ostream & operator<< (std::ostream &os, const tlp::Color &)
- std::istream & operator>> (std::istream &is, tlp::Color &)
- *void convexHull (const std::vector< Coord > &points, std::vector< unsigned int > &convexHull)
- function for convex hull manipulation
- void mergeHulls (const std::vector< Coord > &points, const std::vector< unsigned int > &hull1, const std::vector< unsigned int > &hull2, std::vector< unsigned int > &mergedConvexHull)
- void intersectHulls (std::vector< Coord > &points, const std::vector< unsigned int > &hull1, const std::vector< unsigned int > &hull2, std::vector< unsigned int > &intersection)
- double areaOfHull (const std::vector< Coord > &points, const std::vector< unsigned int > &hull)
- bool insideHull (const std::vector< Coord > &points, const std::vector< unsigned int > &hull, const Coord &point)
- Coord operator * (const Coord &, const Vector< float, 3 > &)
- Coord operator * (const Coord &, const float &)
- *TLP_SCOPE void delaunayTriangulation (const std::vector< Coord > &points, std::vector< std::pair< unsigned int, unsigned int > > &edges)
- functions for Delaunay Triangulations
- void delaunayTriangulation (const std::vector< Coord > &points, std::vector< tlp::Array< unsigned int, 3 > > &triangles)
- void delaunayTriangulation (const std::vector< Coord > &points, std::vector< std::pair< unsigned int, unsigned int > > &edges, std::vector< tlp::Array< unsigned int, 3 > > &triangles)
- void voronoiDiagram (const std::vector< Coord > &points, VoronoiDiagram &voronoiDiagram, bool returnVoronoiEdgeList=false)
- TLP_SCOPE std::pair< Coord,
Coord > computeBoundingBox (Graph *graph, LayoutProperty *layout, SizeProperty *size, DoubleProperty *rotation, BooleanProperty *selection=0)
- TLP_SCOPE std::pair< Coord,
Coord > computeBoundingRadius (Graph *graph, LayoutProperty *layout, SizeProperty *size, DoubleProperty *rotation, BooleanProperty *selection=0)
- TLP_SCOPE void openMetaNode (Graph *graph, node metaNode, Graph *groupUnderSubGraph, GraphProperty *metaGraphProperty)
- TLP_SCOPE void openMetaNode (Graph *graph, node n)
- TLP_SCOPE node createMetaNode (Graph *graph, std::set< node > &subGraph, Graph *groupUnderSubGraph, GraphProperty *metaInfo)
- TLP_SCOPE node createMetaNode (Graph *graph, std::set< node > &subGraph)
- TLP_SCOPE Graph * inducedSubGraph (Graph *, const std::set< node > &, std::string name="induced subgraph")
- TLP_SCOPE void updateGroupLayout (Graph *graph, Graph *cluster, node metanode)
- TLP_SCOPE Graph * loadGraph (const std::string &filename)
- TLP_SCOPE bool saveGraph (Graph *, const std::string &filename)
- TLP_SCOPE Graph * importGraph (const std::string &alg, DataSet &dataSet, PluginProgress *plugProgress=0, Graph *newGraph=0)
- TLP_SCOPE bool exportGraph (Graph *graph, std::ostream &os, const std::string &alg, DataSet &dataSet, PluginProgress *plugProgress=0)
- TLP_SCOPE bool applyAlgorithm (Graph *graph, std::string &errorMsg, DataSet *dataSet=0, const std::string &alg="hierarchical", PluginProgress *plugProgress=0)
- TLP_SCOPE Graph * newGraph ()
- TLP_SCOPE Graph * newSubGraph (Graph *, std::string name="unnamed")
- TLP_SCOPE Graph * newCloneSubGraph (Graph *, std::string name="unnamed")
- TLP_SCOPE bool getSource (Graph *, node &n)
- TLP_SCOPE void copyToGraph (Graph *outG, Graph *inG, BooleanProperty *inSelection=0, BooleanProperty *outSelection=0)
- TLP_SCOPE void removeFromGraph (Graph *ioG, BooleanProperty *inSelection=0)
- TLP_SCOPE bool averagePathLength (Graph *, double &, PluginProgress *=0)
- TLP_SCOPE bool averageCluster (Graph *, double &, PluginProgress *=0)
- TLP_SCOPE bool computeClusterMetric (Graph *graph, DoubleProperty *prop, unsigned int depth, PluginProgress *=0)
- TLP_SCOPE bool computeDagLevelMetric (Graph *graph, DoubleProperty *prop, PluginProgress *=0)
- TLP_SCOPE unsigned int maxDegree (Graph *)
- TLP_SCOPE unsigned int minDegree (Graph *)
- TLP_SCOPE unsigned int maxDistance (Graph *graph, node n, MutableContainer< unsigned int > &distance, int direction=2)
- TLP_SCOPE std::vector< std::vector<
node > > computeCanonicalOrdering (PlanarConMap *, std::vector< edge > *dummyEdges=0, PluginProgress *pluginProgress=0)
- TLP_SCOPE std::vector< node > computeGraphCenters (Graph *graph)
- TLP_SCOPE node graphCenterHeuristic (Graph *graph)
- TLP_SCOPE node makeSimpleSource (Graph *graph)
- TLP_SCOPE void makeProperDag (Graph *graph, std::list< node > &addedNodes, stdext::hash_map< edge, edge > &replacedEdges, IntegerProperty *edgeLength=0)
- TLP_SCOPE void selectSpanningForest (Graph *graph, BooleanProperty *selectionProperty, PluginProgress *pluginProgress=0)
- TLP_SCOPE void selectMinimumSpanningTree (Graph *graph, BooleanProperty *selectionProperty, DoubleProperty *weight=0, PluginProgress *pluginProgress=0)
- TLP_SCOPE Graph * computeTree (Graph *graph, Graph *rootGraph=0, bool isConnected=false, PluginProgress *pluginProgress=0)
- TLP_SCOPE void cleanComputedTree (Graph *graph, Graph *tree)
- template<typename Obj, unsigned int SIZE> MATRIX operator * (const MATRIX &mat, const Obj &obj)
- template<typename Obj, unsigned int SIZE> MATRIX operator * (const MATRIX &mat1, const MATRIX &mat2)
- template<typename Obj, unsigned int SIZE> Vector< Obj, SIZE > operator * (const Vector< Obj, SIZE > &vec, const tlp::Matrix< Obj, SIZE > &)
- template<typename Obj, unsigned int SIZE> Vector< Obj, SIZE > operator * (const Matrix< Obj, SIZE > &, const Vector< Obj, SIZE > &vec)
- TLP_SCOPE void initTulipLib (char *appDirPath=0)
- TLP_SCOPE void loadPlugins (PluginLoader *plug=0)
- TLP_SCOPE bool loadPlugin (const std::string &filename, PluginLoader *plug=0)
- TLP_SCOPE void loadPluginsFromDir (std::string dir, std::string type, PluginLoader *loader=0)
- TLP_SCOPE char * demangleTlpClassName (const char *className)
- TLP_SCOPE std::istream * getIgzstream (const char *name, int open_mode=std::ios::in)
- TLP_SCOPE std::ostream * getOgzstream (const char *name, int open_mode=std::ios::out)
- TLP_SCOPE std::string getMajor (const std::string &release)
- TLP_SCOPE std::string getMinor (const std::string &release)
- *bool stringToColor (std::string &str, Color &col)
- bool stringToSize (std::string &str, Size &siz)
- bool stringToCoord (std::string &str, Coord &coo)
- bool stringToLCoord (std::string &str, std::list< Coord > &lcoo)
- bool stringToNodeProperty (PropertyInterface *propertyName, node n, std::string &str)
- bool stringToEdgeProperty (PropertyInterface *propertyName, edge e, std::string &str)
- bool stringToAllNodeProperty (PropertyInterface *propertyName, std::string &str)
- bool stringToAllEdgeProperty (PropertyInterface *propertyName, std::string &str)
- std::string nodePropertyToString (PropertyInterface *propertyName, node n)
- std::string edgePropertyToString (PropertyInterface *propertyName, edge e)
- std::string propertyType (PropertyInterface *propertyName)
- std::string propertyNodeDefaultValue (PropertyInterface *propertyName)
- std::string propertyEdgeDefaultValue (PropertyInterface *propertyName)
- TEMPLATEVECTOR VECTOR operator * (const VECTOR &, const VECTOR &)
- TEMPLATEVECTOR VECTOR operator * (const VECTOR &, const Obj &)
Variables
Typedef Documentation
Enumeration Type Documentation
|
- Enumeration values:
-
TLP_CONTINUE |
|
TLP_CANCEL |
|
TLP_STOP |
|
|
Function Documentation
TLP_SCOPE bool tlp::applyAlgorithm |
( |
Graph * |
graph, |
|
|
std::string & |
errorMsg, |
|
|
DataSet * |
dataSet = 0 , |
|
|
const std::string & |
alg = "hierarchical" , |
|
|
PluginProgress * |
plugProgress = 0 |
|
) |
|
|
TLP_SCOPE bool tlp::averageCluster |
( |
Graph * |
, |
|
|
double & |
, |
|
|
PluginProgress * |
= 0 |
|
) |
|
|
TLP_SCOPE bool tlp::averagePathLength |
( |
Graph * |
, |
|
|
double & |
, |
|
|
PluginProgress * |
= 0 |
|
) |
|
|
TLP_SCOPE void tlp::cleanComputedTree |
( |
Graph * |
graph, |
|
|
Graph * |
tree |
|
) |
|
|
|
Clean the graph from a tree previously computed with the computTree function |
TLP_SCOPE std::pair<Coord, Coord> tlp::computeBoundingBox |
( |
Graph * |
graph, |
|
|
LayoutProperty * |
layout, |
|
|
SizeProperty * |
size, |
|
|
DoubleProperty * |
rotation, |
|
|
BooleanProperty * |
selection = 0 |
|
) |
|
|
TLP_SCOPE std::pair<Coord, Coord> tlp::computeBoundingRadius |
( |
Graph * |
graph, |
|
|
LayoutProperty * |
layout, |
|
|
SizeProperty * |
size, |
|
|
DoubleProperty * |
rotation, |
|
|
BooleanProperty * |
selection = 0 |
|
) |
|
|
TLP_SCOPE std::vector<std::vector<node> > tlp::computeCanonicalOrdering |
( |
PlanarConMap * |
, |
|
|
std::vector< edge > * |
dummyEdges = 0 , |
|
|
PluginProgress * |
pluginProgress = 0 |
|
) |
|
|
|
This ordering was first introduced by C. Gutwenger and P. Mutzel in
"Grid embeddings of biconnected planar graphs",
"Extended Abstract, Max-Planck-Institut für Informatik,"
"Saarbrücken, Germany, 1997"
Let n be the number of nodes, the original algorithm complexity is in O(n).
But the implementation of the canonical ordering has not been made in O(n).
|
TLP_SCOPE bool tlp::computeClusterMetric |
( |
Graph * |
graph, |
|
|
DoubleProperty * |
prop, |
|
|
unsigned int |
depth, |
|
|
PluginProgress * |
= 0 |
|
) |
|
|
TLP_SCOPE bool tlp::computeDagLevelMetric |
( |
Graph * |
graph, |
|
|
DoubleProperty * |
prop, |
|
|
PluginProgress * |
= 0 |
|
) |
|
|
TLP_SCOPE std::vector<node> tlp::computeGraphCenters |
( |
Graph * |
graph |
) |
|
|
|
Find all the graph centers, that version does not manage edge weight. complexity O(n * m). Only works on connected graphs. |
TLP_SCOPE Graph* tlp::computeTree |
( |
Graph * |
graph, |
|
|
Graph * |
rootGraph = 0 , |
|
|
bool |
isConnected = false , |
|
|
PluginProgress * |
pluginProgress = 0 |
|
) |
|
|
|
Compute a directed tree from the graph. The algorithm is the following
- if the graph is a directed tree, return the graph
- if the graph is a free tree, return a directed copy
- if the graph is connected, make a copy return a directed spanning tree of that copy
- if the graph is not connected, make a copy, compute a tree for each of its connected components, add a simple source and return the copy.
|
TLP_SCOPE void tlp::copyToGraph |
( |
Graph * |
outG, |
|
|
Graph * |
inG, |
|
|
BooleanProperty * |
inSelection = 0 , |
|
|
BooleanProperty * |
outSelection = 0 |
|
) |
|
|
|
Append the selected part of the graph inG (properties, nodes & edges) into the graph outG. If no selection is done (inSel=NULL), the whole inG graph is appended. The output selection is used to select the appended nodes & edges - Warning:
- The input selection is extended to all selected edge ends.
|
TLP_SCOPE node tlp::createMetaNode |
( |
Graph * |
graph, |
|
|
std::set< node > & |
subGraph |
|
) |
|
|
|
Function to close a subgraph into a metanode. Edges from nodes in the subgraph to nodes outside the subgraph are replaced with edges from the metanode to the nodes outside the subgraph. Version for backwards compatibility with groupUnderSubGraph set to graph->getSuperGraph(), multiEdges set to true, metaInfo set to viewMetaGraph, and delAllEdge set to true. |
TLP_SCOPE node tlp::createMetaNode |
( |
Graph * |
graph, |
|
|
std::set< node > & |
subGraph, |
|
|
Graph * |
groupUnderSubGraph, |
|
|
GraphProperty * |
metaInfo |
|
) |
|
|
|
Function to close a subgraph into a metanode. Edges from nodes in the subgraph to nodes outside the subgraph are replaced with edges from the metanode to the nodes outside the subgraph.
- Parameters:
-
| graph | The graph where the meta node will be placed. |
| subGraph | The set of nodes to be contracted into a metanode. |
| groupUnderSubgraph | The subgraph where the groups are placed. |
| metaGraphProperty | The metagraph property used to associate the subgraph to the new metanode. |
|
TLP_SCOPE char* tlp::demangleTlpClassName |
( |
const char * |
className |
) |
|
|
|
returns the demangled name of a C++ class defines in the tlp namespace. The tlp:: prefix is omitted and the returned pointer do not have to be deallocated. |
TLP_SCOPE bool tlp::exportGraph |
( |
Graph * |
graph, |
|
|
std::ostream & |
os, |
|
|
const std::string & |
alg, |
|
|
DataSet & |
dataSet, |
|
|
PluginProgress * |
plugProgress = 0 |
|
) |
|
|
TLP_SCOPE std::istream* tlp::getIgzstream |
( |
const char * |
name, |
|
|
int |
open_mode = std::ios::in |
|
) |
|
|
TLP_SCOPE std::string tlp::getMajor |
( |
const std::string & |
release |
) |
|
|
|
Extracts Major number from a release number |
TLP_SCOPE std::string tlp::getMinor |
( |
const std::string & |
release |
) |
|
|
|
Extracts Minor number from a release number |
TLP_SCOPE std::ostream* tlp::getOgzstream |
( |
const char * |
name, |
|
|
int |
open_mode = std::ios::out |
|
) |
|
|
|
Returns an ostream to write to a gzipped file (uses gzstream lib) the stream has to be deleted after use. - Warning:
- Don't forget to check the stream with ios::bad()!
|
TLP_SCOPE bool tlp::getSource |
( |
Graph * |
, |
|
|
node & |
n |
|
) |
|
|
|
find the first node of degree 0, if no node exist return false else true |
TLP_SCOPE node tlp::graphCenterHeuristic |
( |
Graph * |
graph |
) |
|
|
|
return a node that can be considered as the graph center. It is an heuristic, thus it is not absolutely sure that this node is a graph center. Only works on connected graphs. |
TLP_SCOPE Graph* tlp::importGraph |
( |
const std::string & |
alg, |
|
|
DataSet & |
dataSet, |
|
|
PluginProgress * |
plugProgress = 0 , |
|
|
Graph * |
newGraph = 0 |
|
) |
|
|
TLP_SCOPE Graph* tlp::inducedSubGraph |
( |
Graph * |
, |
|
|
const std::set< node > & |
, |
|
|
std::string |
name = "induced subgraph" |
|
) |
|
|
|
Return a subgraph induced by a set of nodes |
TLP_SCOPE void tlp::initTulipLib |
( |
char * |
appDirPath = 0 |
) |
|
|
TLP_SCOPE Graph* tlp::loadGraph |
( |
const std::string & |
filename |
) |
|
|
|
Load a graph in the tlp format Warning : this function use "tlp" import plugin (must be laoded) |
TLP_SCOPE bool tlp::loadPlugin |
( |
const std::string & |
filename, |
|
|
PluginLoader * |
plug = 0 |
|
) |
|
|
TLP_SCOPE void tlp::loadPlugins |
( |
PluginLoader * |
plug = 0 |
) |
|
|
TLP_SCOPE void tlp::loadPluginsFromDir |
( |
std::string |
dir, |
|
|
std::string |
type, |
|
|
PluginLoader * |
loader = 0 |
|
) |
|
|
TLP_SCOPE void tlp::makeProperDag |
( |
Graph * |
graph, |
|
|
std::list< node > & |
addedNodes, |
|
|
stdext::hash_map< edge, edge > & |
replacedEdges, |
|
|
IntegerProperty * |
edgeLength = 0 |
|
) |
|
|
TLP_SCOPE node tlp::makeSimpleSource |
( |
Graph * |
graph |
) |
|
|
|
return a new node connected to all previously existing nodes which had a null indegree |
TLP_SCOPE unsigned int tlp::maxDegree |
( |
Graph * |
|
) |
|
|
TLP_SCOPE unsigned int tlp::maxDistance |
( |
Graph * |
graph, |
|
|
node |
n, |
|
|
MutableContainer< unsigned int > & |
distance, |
|
|
int |
direction = 2 |
|
) |
|
|
TLP_SCOPE unsigned int tlp::minDegree |
( |
Graph * |
|
) |
|
|
TLP_SCOPE Graph* tlp::newCloneSubGraph |
( |
Graph * |
, |
|
|
std::string |
name = "unnamed" |
|
) |
|
|
|
Return a subgraph equal to the graph given in parameter (a clone subgraph) |
TLP_SCOPE Graph* tlp::newGraph |
( |
|
) |
|
|
TLP_SCOPE Graph* tlp::newSubGraph |
( |
Graph * |
, |
|
|
std::string |
name = "unnamed" |
|
) |
|
|
TLP_SCOPE void tlp::openMetaNode |
( |
Graph * |
graph, |
|
|
node |
n |
|
) |
|
|
|
Function to open a metanode and replace all edges between that meta node and other nodes in the graph. Provided for backwards compatability with groupUnderSubGraph set to graph->getSuperGraph(), and metaGraphs set to viewMetaGraph. |
TLP_SCOPE void tlp::openMetaNode |
( |
Graph * |
graph, |
|
|
node |
metaNode, |
|
|
Graph * |
groupUnderSubGraph, |
|
|
GraphProperty * |
metaGraphProperty |
|
) |
|
|
|
Function to open a metanode and replace all edges between that meta node and other nodes in the graph.
- Parameters:
-
| graph | The graph where the metanode is contained and where the subgraph will be replaced. |
| n | The meta node to open. |
| groupUnderSubgraph | The subgraph where the groups are placed |
| metaGraphProperty | The metagraph property used to associate the subgraph to metanodes |
|
Coord tlp::operator * |
( |
const Coord & |
, |
|
|
const float & |
|
|
) |
[inline] |
|
Coord tlp::operator * |
( |
const Coord & |
, |
|
|
const Vector< float, 3 > & |
|
|
) |
[inline] |
|
std::ostream& tlp::operator<< |
( |
std::ostream & |
os, |
|
|
const tlp::Color & |
|
|
) |
|
|
std::istream& tlp::operator>> |
( |
std::istream & |
is, |
|
|
tlp::Color & |
|
|
) |
|
|
TLP_SCOPE void tlp::removeFromGraph |
( |
Graph * |
ioG, |
|
|
BooleanProperty * |
inSelection = 0 |
|
) |
|
|
|
Remove the selected part of the graph ioG (properties, nodes & edges). If no selection is done (inSel=NULL), the whole graph is reseted to default value. - Warning:
- The selection is extended to all selected edge ends.
|
TLP_SCOPE bool tlp::saveGraph |
( |
Graph * |
, |
|
|
const std::string & |
filename |
|
) |
|
|
|
Save a graph in tlp format Warning : this function use "tlp" export plugin (must be laoded) |
TLP_SCOPE void tlp::selectMinimumSpanningTree |
( |
Graph * |
graph, |
|
|
BooleanProperty * |
selectionProperty, |
|
|
DoubleProperty * |
weight = 0 , |
|
|
PluginProgress * |
pluginProgress = 0 |
|
) |
|
|
|
Select the minimum spanning tree (Kruskal algorithm) of a weighted graph, i.e for all graph elements (nodes or edges) belonging to that tree the selectionProperty associated value is true. The value is false for the other elements |
TLP_SCOPE void tlp::selectSpanningForest |
( |
Graph * |
graph, |
|
|
BooleanProperty * |
selectionProperty, |
|
|
PluginProgress * |
pluginProgress = 0 |
|
) |
|
|
|
Select a spanning forest of the graph, i.e for all graph elements (nodes or edges) belonging to that forest the selectionProperty associated value is true. The value is false for the other elements |
TLP_SCOPE void tlp::updateGroupLayout |
( |
Graph * |
graph, |
|
|
Graph * |
cluster, |
|
|
node |
metanode |
|
) |
|
|
|
Update the layout of metanode in cluster according to the layout of underlying nodes in graph |
Variable Documentation
|