/usr/include/tulip/MainController.h is in libtulip-qt4-dev 3.1.2-2.3ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | //-*-c++-*-
/**
Authors: David Auber, Patrick Mary, Morgan Mathiaut
from the LaBRI Visualization Team
Email : auber@tulip-software.org
Last modification : 13/03/2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
/**
Author: Morgan Mathiaut
Email : mathiaut@labri.fr
Last modification : 14/05/2008
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
#ifndef Tulip_MAINCONTROLLER_H
#define Tulip_MAINCONTROLLER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if (__GNUC__ < 3)
#include <hash_map>
#else
#include <ext/hash_map>
#endif
#include <tulip/Reflect.h>
#include <tulip/Observable.h>
#include <tulip/Graph.h>
#include "tulip/Controller.h"
class QAction;
class QMenu;
namespace tlp {
class Graph;
class View;
class SGHierarchyWidget;
class PropertyDialog;
class ElementPropertiesWidget;
#ifdef STATS_UI
class TulipStats;
#endif
class Morphing;
/** \brief Default controller of Tulip
*
* This Controller create a GUI like the old Tulip
* On left : Property, and hierarchical view
* In view menu you have access to all view plugins
*/
class TLP_QT_SCOPE MainController : public Controller, public Observer, public GraphObserver {
Q_OBJECT;
public:
/**
* Default constructor
*/
MainController();
/**
* Default destructor
*/
virtual ~MainController();
/**
* Attach the QMainWindow to the controller
*/
void attachMainWindow(MainWindowFacade facade);
/**
* Set graph and dataSet to the controller
*/
void setData(Graph *graph=0,DataSet dataSet=DataSet());
/**
* Return the graph and the dataSet of the controller
*/
void getData(Graph **graph,DataSet *dataSet);
/**
* Return the Graph visualized by the controller
*/
Graph *getGraph();
protected :
/**
* Set the default initialization of the graph
*/
void initializeGraph(Graph *graph);
/**
* Load the GUI
*/
void loadGUI();
/**
* Construct main menu
*/
void buildMenu();
/**
* Create and init the main view (NodeLinkDiagramComponent)
*/
View* initMainView(DataSet dataSet);
/**
* Create a view with name : name
*/
View* createView(const std::string &name,Graph *graph,DataSet dataSet,const QRect &rect=QRect(0,0,0,0));
/**
* Put interactors of the given view in graphToolBar
*/
void installInteractors(View *view);
typedef std::set< tlp::Observable * >::iterator ObserverIterator;
/**
* Redraw all views
*/
void redrawViews(bool init=false);
/**
* This function is call when an observable is destroyed
*/
void observableDestroyed(Observable *);
/**
* This function is call when an observable is update
*/
void update ( ObserverIterator begin, ObserverIterator end);
/**
* Init all observers (graph and properties)
*/
void initObservers();
/**
* Clear all observers
*/
void clearObservers();
/**
* Call when a subgraph is add
*/
void addSubGraph(Graph*, Graph *);
/**
* Call when a subgraph is remove
*/
void delSubGraph(Graph*, Graph*);
/**
* Call when a node is add
*/
void addNode(Graph *graph, const node);
/**
* Call when an edge is add
*/
void addEdge(Graph *graph, const edge);
/**
* Call when a node is delete
*/
void delNode(Graph *graph, const node);
/**
* Call when an edge is delete
*/
void delEdge(Graph *graph, const edge);
/**
* Call when a local property is add
*/
void addLocalProperty(Graph*, const std::string&);
/**
* Call when a local property is delete
*/
void delLocalProperty(Graph*, const std::string&);
/**
* Call to update number of nodes/edges
*/
void updateCurrentGraphInfos();
/**
* Change a property
*/
template<typename PROPERTY> bool changeProperty(std::string, std::string, bool = true, bool = false , bool = true);
Graph *currentGraph;
View *currentView;
Graph * copyCutPasteGraph;
std::map<View *,std::string> viewNames;
std::map<QWidget *,View*> viewWidget;
std::map<View *, QAction *> lastInteractorOnView;
std::map<View *,Graph* > viewGraph;
unsigned int currentGraphNbNodes;
unsigned int currentGraphNbEdges;
Graph *graphToReload;
Morphing *morph;
QDockWidget *tabWidgetDock;
SGHierarchyWidget *clusterTreeWidget;
PropertyDialog *propertiesWidget;
ElementPropertiesWidget *eltProperties;
#ifdef STATS_UI
TulipStats *statsWidget;
#endif
QMenu *editMenu;
QMenu *algorithmMenu;
QMenu *viewMenu;
QMenu *optionsMenu;
QMenu *graphMenu;
QAction *forceRatioAction;
QAction *mapMetricAction;
QAction *morphingAction;
QAction *undoAction;
QAction *redoAction;
QAction *editUndoAction;
QAction *editRedoAction;
QMenu *intMenu;
QMenu *stringMenu;
QMenu *sizesMenu;
QMenu *colorsMenu;
QMenu *layoutMenu;
QMenu *metricMenu;
QMenu *selectMenu;
QMenu *generalMenu;
protected slots:
/*
* Change the graph and load it in left part of the GUI
*/
void changeGraph(Graph *graph);
/*
* Clear observers when a graph is about to be remove
*/
void graphAboutToBeRemove(Graph *graph);
/**
* Change GUI when a QWidget is activated
*/
void windowActivated(QWidget *w);
/**
* Load the interactor (referenced by the given QAction) in current View
*/
void changeInteractor(QAction* action);
/**
* Add a new view to the controller
*/
void addView(QAction *action);
/**
* This slot is call when a view emit elementSelected
* Show the element in left part of the GUI
*/
void showElementProperties(unsigned int eltId, bool isNode);
/**
* This slot is call when a view want to change its graph
*/
void viewRequestChangeGraph(View *view, Graph *graph);
/**
* This slot is call went a view will be closed
*/
void widgetWillBeClosed(QObject *object);
void isAcyclic();
void isSimple();
void isConnected();
void isBiconnected();
void isTriconnected();
void isTree();
void isFreeTree();
void isPlanar();
void isOuterPlanar();
void makeAcyclic();
void makeBiconnected();
void makeSimple();
void makeConnected();
void makeDirected();
void reverseSelectedEdgeDirection();
void changeMetric(QAction*);
void changeString(QAction*);
void changeSizes(QAction*);
void changeColors(QAction*);
void changeInt(QAction*);
void changeSelection(QAction*);
void changeLayout(QAction*);
void applyAlgorithm(QAction*);
void updateUndoRedoInfos();
void undo();
void redo();
public slots :
void editCut();
void editCopy();
void editPaste();
void editFind();
void editCreateGroup();
void editCreateSubgraph();
void editDelSelection();
void editReverseSelection();
void editSelectAll();
void editDeselectAll();
public :
View *getView(QWidget *);
};
}
#endif
|