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);
209 void perfectAspectRatio(
const Graph* subgraph=NULL);
224 double edgeLength(
const edge e)
const;
231 double averageEdgeLength(
const Graph *subgraph=NULL)
const;
240 double averageAngularResolution(
const Graph *subgraph=NULL)
const;
250 double averageAngularResolution(
const node n,
const Graph *subgraph=NULL)
const;
260 std::vector<double> angularResolutions(
const node n,
const Graph *subgraph=NULL)
const;
269 void computeEmbedding(
Graph *subgraph=NULL);
279 void computeEmbedding(
const node n,
Graph *subgraph=NULL);
288 virtual void setNodeValue(
const node, tlp::StoredType<Coord>::ReturnedConstValue v);
289 virtual void setEdgeValue(
const edge, tlp::StoredType<std::vector<Coord> >::ReturnedConstValue v);
290 virtual void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v);
291 virtual void setValueToGraphNodes(tlp::StoredType<Coord>::ReturnedConstValue v,
const Graph *graph );
292 virtual void setAllEdgeValue(tlp::StoredType<std::vector<Coord> >::ReturnedConstValue v);
293 virtual void setValueToGraphEdges(tlp::StoredType<std::vector<Coord> >::ReturnedConstValue v,
const Graph *graph );
295 _DEPRECATED
virtual void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v,
const Graph *graph );
296 _DEPRECATED
virtual void setAllEdgeValue(tlp::StoredType<std::vector<Coord> >::ReturnedConstValue v,
const Graph *graph );
302 void resetBoundingBox();
303 void rotate(
const double& alpha,
int rot, Iterator<node> *, Iterator<edge> *);
305 void treatEvent(
const Event&);
309 unsigned int nbBendedEdges;
318 CoordVectorProperty(
Graph *g,
const std::string& n=
""):AbstractVectorProperty<CoordVectorType, tlp::PointType>(g, n) {}
321 static const std::string propertyTypename;
322 const std::string& getTypename()
const {
323 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...