20 #ifndef TULIP_LAYOUT_H
21 #define TULIP_LAYOUT_H
23 #include <tulip/tuliphash.h>
24 #include <tulip/PropertyTypes.h>
25 #include <tulip/Observable.h>
26 #include <tulip/AbstractProperty.h>
27 #include <tulip/PropertyAlgorithm.h>
28 #include <tulip/minmaxproperty.h>
38 class PropertyContext;
41 typedef AbstractProperty<tlp::PointType, tlp::LineType> AbstractLayoutProperty;
42 typedef MinMaxProperty<tlp::PointType, tlp::LineType> LayoutMinMaxProperty;
54 static const std::string propertyTypename;
56 return propertyTypename;
68 Coord getMax(
Graph *subgraph=NULL);
75 Coord getMin(
Graph *subgraph=NULL);
87 void translate(
const Vec3f &move,
Graph *subgraph=NULL);
99 void translate(
const Vec3f &move, Iterator<node> *itNodes, Iterator<edge> *itEdges);
107 void scale(
const Vec3f &scaleFactors,
Graph *subgraph=NULL);
119 void scale(
const Vec3f &scaleFactors, Iterator<node> *itNodes, Iterator<edge> *itEdges);
127 void rotateX(
const double &alpha,
Graph *subgraph=NULL);
135 void rotateY(
const double &alpha,
Graph *subgraph=NULL);
143 void rotateZ(
const double &alpha,
Graph *subgraph=NULL);
155 void rotateX(
const double &alpha, Iterator<node> *itNodes, Iterator<edge> *itEdges);
167 void rotateY(
const double &alpha, Iterator<node> *itNodes, Iterator<edge> *itEdges);
179 void rotateZ(
const double &alpha, Iterator<node> *itNodes, Iterator<edge> *itEdges);
187 void center(
Graph *subgraph=NULL);
196 void center(
const Vec3f &newCenter,
Graph *subgraph=NULL);
203 void normalize(
Graph *subgraph=NULL);
208 void perfectAspectRatio();
223 double edgeLength(
const edge e)
const;
230 double averageEdgeLength(
const Graph *subgraph=NULL)
const;
239 double averageAngularResolution(
const Graph *subgraph=NULL)
const;
249 double averageAngularResolution(
const node n,
const Graph *subgraph=NULL)
const;
259 std::vector<double> angularResolutions(
const node n,
const Graph *subgraph=NULL)
const;
268 void computeEmbedding(
Graph *subgraph=NULL);
278 void computeEmbedding(
const node n,
Graph *subgraph=NULL);
283 unsigned int crossingNumber()
const;
286 virtual void setNodeValue(
const node,
const Coord &v);
287 virtual void setEdgeValue(
const edge,
const std::vector<Coord> &v);
288 virtual void setAllNodeValue(
const Coord &v);
289 virtual void setAllEdgeValue(
const std::vector<Coord> &v);
296 void resetBoundingBox();
297 void rotate(
const double& alpha,
int rot, Iterator<node> *, Iterator<edge> *);
299 void treatEvent(
const Event&);
311 static const std::string propertyTypename;
313 return propertyTypename;
318 typedef CoordVectorProperty LayoutVectorProperty;