Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/PropertyAnimation.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef PROPERTYANIMATION_H_
00022 #define PROPERTYANIMATION_H_
00023 
00024 #include <tulip/Animation.h>
00025 #include <tulip/BooleanProperty.h>
00026 
00027 
00028 namespace tlp {
00029 
00030 template<typename PropType, typename NodeType, typename EdgeType>
00031 class PropertyAnimation: public Animation {
00032 public:
00033   PropertyAnimation(tlp::Graph *graph, PropType *start, PropType *end, PropType *out,
00034                     tlp::BooleanProperty *selection = NULL, int frameCount = 1, bool computeNodes = true, bool computeEdges = true, QObject* parent=NULL);
00035 
00036   virtual ~PropertyAnimation();
00037   virtual void frameChanged(int f);
00038 
00039 protected:
00040   tlp::Graph *_graph;
00041   PropType *_start;
00042   PropType *_end;
00043   PropType *_out;
00044   tlp::BooleanProperty *_selection;
00045   bool _computeNodes;
00046   bool _computeEdges;
00047 
00048   virtual NodeType getNodeFrameValue(const NodeType &startValue, const NodeType &endValue, int frame)=0;
00049   virtual EdgeType getEdgeFrameValue(const EdgeType &startValue, const EdgeType &endValue, int frame)=0;
00050 
00051   virtual bool equalNodes(const NodeType &v1, const NodeType &v2) {
00052     return v1 == v2;
00053   }
00054 
00055   virtual bool equalEdges(const EdgeType &v1, const EdgeType &v2) {
00056     return v1 == v2;
00057   }
00058 };
00059 
00060 #include "cxx/PropertyAnimation.cxx"
00061 
00062 }
00063 
00064 #endif /* PROPERTYANIMATION_H_ */
00065 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties