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> 34 tlp::edge e, tlp::LineType::RealType newValue);
37 std::pair<tlp::Coord, tlp::Coord>
40 class PropertyContext;
43 typedef AbstractProperty<tlp::PointType, tlp::LineType> AbstractLayoutProperty;
44 typedef MinMaxProperty<tlp::PointType, tlp::LineType> LayoutMinMaxProperty;
57 static const std::string propertyTypename;
58 const std::string &getTypename()
const override {
59 return propertyTypename;
72 Coord getMax(
const Graph *subgraph =
nullptr);
80 Coord getMin(
const Graph *subgraph =
nullptr);
92 void translate(
const Vec3f &move,
const Graph *subgraph =
nullptr);
112 void scale(
const Vec3f &scaleFactors,
const Graph *subgraph =
nullptr);
132 void rotateX(
const double &alpha,
const Graph *subgraph =
nullptr);
140 void rotateY(
const double &alpha,
const Graph *subgraph =
nullptr);
148 void rotateZ(
const double &alpha,
const Graph *subgraph =
nullptr);
192 void center(
const Graph *subgraph =
nullptr);
201 void center(
const Vec3f &newCenter,
const Graph *subgraph =
nullptr);
209 void normalize(
const Graph *subgraph =
nullptr);
215 void perfectAspectRatio(
const Graph *subgraph =
nullptr);
230 double edgeLength(
const edge e)
const;
237 double averageEdgeLength(
const Graph *subgraph =
nullptr)
const;
246 double averageAngularResolution(
const Graph *subgraph =
nullptr)
const;
257 double averageAngularResolution(
const node n,
const Graph *subgraph =
nullptr)
const;
268 std::vector<double> angularResolutions(
const node n,
const Graph *subgraph =
nullptr)
const;
277 void computeEmbedding(
Graph *subgraph =
nullptr);
287 void computeEmbedding(
const node n,
Graph *subgraph =
nullptr);
296 void setNodeValue(
const node, tlp::StoredType<Coord>::ReturnedConstValue v)
override;
297 void setEdgeValue(
const edge, tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v)
override;
298 void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v)
override;
299 void setValueToGraphNodes(tlp::StoredType<Coord>::ReturnedConstValue v,
300 const Graph *graph)
override;
301 void setAllEdgeValue(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v)
override;
302 void setValueToGraphEdges(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v,
303 const Graph *graph)
override;
305 _DEPRECATED
void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v,
306 const Graph *graph)
override;
307 _DEPRECATED
void setAllEdgeValue(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v,
308 const Graph *graph)
override;
314 void resetBoundingBox();
317 void treatEvent(
const Event &)
override;
321 unsigned int nbBendedEdges;
329 :
public AbstractVectorProperty<tlp::CoordVectorType, tlp::PointType> {
332 : AbstractVectorProperty<CoordVectorType, tlp::PointType>(g, n) {}
335 static const std::string propertyTypename;
336 const std::string &getTypename()
const override {
337 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.
Interface for Tulip iterators. Allows basic iteration operations only.
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...