Tulip  5.3.0
Large graphs analysis and drawing
CachedPropertyAnimation.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 CACHEDPROPERTYANIMATION_H_
22 #define CACHEDPROPERTYANIMATION_H_
23 
24 #include <tulip/PropertyAnimation.h>
25 
26 #include <map>
27 
28 namespace tlp {
29 
30 class BooleanProperty;
31 
32 template <typename PropType, typename NodeType, typename EdgeType>
33 class CachedPropertyAnimation : public PropertyAnimation<PropType, NodeType, EdgeType> {
34 public:
35  CachedPropertyAnimation(tlp::Graph *graph, PropType *start, PropType *end, PropType *out,
36  tlp::BooleanProperty *selection = nullptr, int frameCount = 1,
37  bool computeNodes = true, bool computeEdges = true,
38  QObject *parent = nullptr);
39  ~CachedPropertyAnimation() override;
40 
41  void frameChanged(int frame) override;
42 
43 protected:
44  std::map<std::pair<NodeType, NodeType>, NodeType> computedNodeSteps;
45  std::map<std::pair<EdgeType, EdgeType>, EdgeType> computedEdgeSteps;
46 };
47 
48 #include "cxx/CachedPropertyAnimation.cxx"
49 } // namespace tlp
50 
51 #endif /* CACHEDPROPERTYANIMATION_H_ */
52 ///@endcond
A graph property that maps a boolean value to graph elements.