20 #ifndef TULIP_LAYOUT_H 21 #define TULIP_LAYOUT_H 23 #include <tulip/PropertyTypes.h> 24 #include <tulip/Observable.h> 25 #include <tulip/AbstractProperty.h> 26 #include <tulip/PropertyAlgorithm.h> 27 #include <tulip/minmaxproperty.h> 33 tlp::edge e, tlp::LineType::RealType newValue);
36 std::pair<tlp::Coord, tlp::Coord>
39 class PropertyContext;
42 typedef AbstractProperty<tlp::PointType, tlp::LineType> AbstractLayoutProperty;
43 typedef MinMaxProperty<tlp::PointType, tlp::LineType> LayoutMinMaxProperty;
56 static const std::string propertyTypename;
57 const std::string &getTypename()
const override {
58 return propertyTypename;
71 Coord getMax(
const Graph *subgraph =
nullptr);
79 Coord getMin(
const Graph *subgraph =
nullptr);
91 void translate(
const Vec3f &move,
const Graph *subgraph =
nullptr);
111 void scale(
const Vec3f &scaleFactors,
const Graph *subgraph =
nullptr);
131 void rotateX(
const double &alpha,
const Graph *subgraph =
nullptr);
139 void rotateY(
const double &alpha,
const Graph *subgraph =
nullptr);
147 void rotateZ(
const double &alpha,
const Graph *subgraph =
nullptr);
191 void center(
const Graph *subgraph =
nullptr);
200 void center(
const Vec3f &newCenter,
const Graph *subgraph =
nullptr);
208 void normalize(
const Graph *subgraph =
nullptr);
214 void perfectAspectRatio(
const Graph *subgraph =
nullptr);
229 double edgeLength(
const edge e)
const;
236 double averageEdgeLength(
const Graph *subgraph =
nullptr)
const;
245 double averageAngularResolution(
const Graph *subgraph =
nullptr)
const;
256 double averageAngularResolution(
const node n,
const Graph *subgraph =
nullptr)
const;
267 std::vector<double> angularResolutions(
const node n,
const Graph *subgraph =
nullptr)
const;
276 void computeEmbedding(
Graph *subgraph =
nullptr);
286 void computeEmbedding(
const node n,
Graph *subgraph =
nullptr);
295 void setNodeValue(
const node, tlp::StoredType<Coord>::ReturnedConstValue v)
override;
296 void setEdgeValue(
const edge, tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v)
override;
297 void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v)
override;
298 void setValueToGraphNodes(tlp::StoredType<Coord>::ReturnedConstValue v,
299 const Graph *graph)
override;
300 void setAllEdgeValue(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v)
override;
301 void setValueToGraphEdges(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v,
302 const Graph *graph)
override;
304 _DEPRECATED
void setAllNodeValue(tlp::StoredType<Coord>::ReturnedConstValue v,
305 const Graph *graph)
override;
306 _DEPRECATED
void setAllEdgeValue(tlp::StoredType<std::vector<Coord>>::ReturnedConstValue v,
307 const Graph *graph)
override;
313 void resetBoundingBox();
316 void treatEvent(
const Event &)
override;
320 unsigned int nbBendedEdges;
328 :
public AbstractVectorProperty<tlp::CoordVectorType, tlp::PointType> {
331 : AbstractVectorProperty<CoordVectorType, tlp::PointType>(g, n) {}
334 static const std::string propertyTypename;
335 const std::string &getTypename()
const override {
336 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...