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;
55 const std::string& getTypename()
const {
56 return propertyTypename;
68 Coord getMax(
const Graph *subgraph=NULL);
75 Coord getMin(
const Graph *subgraph=NULL);
87 void translate(
const Vec3f &move,
const Graph *subgraph=NULL);
99 void translate(
const Vec3f &move, Iterator<node> *itNodes, Iterator<edge> *itEdges);
107 void scale(
const Vec3f &scaleFactors,
const Graph *subgraph=NULL);
119 void scale(
const Vec3f &scaleFactors, Iterator<node> *itNodes, Iterator<edge> *itEdges);
127 void rotateX(
const double &alpha,
const Graph *subgraph=NULL);
135 void rotateY(
const double &alpha,
const Graph *subgraph=NULL);
143 void rotateZ(
const double &alpha,
const 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(
const Graph *subgraph=NULL);
196 void center(
const Vec3f &newCenter,
const Graph *subgraph=NULL);
203 void normalize(
const 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);
287 virtual void setNodeValue(
const node,
const Coord &v);
288 virtual void setEdgeValue(
const edge,
const std::vector<Coord> &v);
289 virtual void setAllNodeValue(
const Coord &v,
const Graph *graph = NULL);
290 virtual void setAllEdgeValue(
const std::vector<Coord> &v,
const Graph *graph = NULL);
296 void resetBoundingBox();
297 void rotate(
const double& alpha,
int rot, Iterator<node> *, Iterator<edge> *);
299 void treatEvent(
const Event&);
303 unsigned int nbBendedEdges;
312 CoordVectorProperty(
Graph *g,
const std::string& n=
""):AbstractVectorProperty<CoordVectorType, tlp::PointType>(g, n) {}
315 static const std::string propertyTypename;
316 const std::string& getTypename()
const {
317 return propertyTypename;
This class extends upon PropertyInterface, and adds type-safe methods to get and set the node and edg...
Abstracts the computation of minimal and maximal values on node and edge values of properties...
A graph property that maps a std::vector<tlp::Coord> value to graph elements.
PropertyInterface describes the interface of a graph property.
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
Event is the base class for all events used in the Observation mechanism.
void updateEdgeValue(tlp::edge e, typename edgeType::RealType newValue)
Updates the value on an edge, and updates the minimal/maximal cached values if necessary. Should be called by subclasses in order to keep the cache up to date.
A graph property that maps a tlp::Coord value to graph nodes and std::vector<tlp::Coord> for edges...