Tulip  5.3.0
Large graphs analysis and drawing
LayoutPropertyAnimation.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef LAYOUTPROPERTYANIMATION_H_
22 #define LAYOUTPROPERTYANIMATION_H_
23 
24 #include <tulip/Coord.h>
25 #include <tulip/CachedPropertyAnimation.h>
26 
27 #include <vector>
28 
29 namespace tlp {
30 class LayoutProperty;
31 class Graph;
32 class BooleanProperty;
33 
34 class TLP_QT_SCOPE LayoutPropertyAnimation
35  : public CachedPropertyAnimation<tlp::LayoutProperty, tlp::Coord, std::vector<tlp::Coord>> {
36 public:
37  LayoutPropertyAnimation(tlp::Graph *g, tlp::LayoutProperty *start, tlp::LayoutProperty *end,
38  tlp::LayoutProperty *out, tlp::BooleanProperty *selection = nullptr,
39  int frameCount = 1, bool computeNodes = true, bool computeEdges = true,
40  QObject *parent = nullptr);
41 
42  ~LayoutPropertyAnimation() override {}
43 
44 protected:
45  tlp::Coord getNodeFrameValue(const tlp::Coord &startValue, const tlp::Coord &endValue,
46  int frame) override;
47  std::vector<tlp::Coord> getEdgeFrameValue(const std::vector<tlp::Coord> &startValue,
48  const std::vector<tlp::Coord> &endValue,
49  int frame) override;
50  bool equalEdges(const std::vector<tlp::Coord> &v1, const std::vector<tlp::Coord> &v2) override;
51 
52 private:
53  std::map<std::pair<tlp::Coord, tlp::Coord>, tlp::Vector<double, 3>> steps;
54 };
55 } // namespace tlp
56 
57 #endif /* LAYOUTPROPERTYANIMATION_H_ */
58 ///@endcond
A graph property that maps a boolean value to graph elements.
A graph property that maps a tlp::Coord value to graph nodes and std::vector<tlp::Coord> for edges...