1 #ifndef _SX_SXEDITOR_H_
2 #define _SX_SXEDITOR_H_
8 #include <export/Export.h>
12 #include <QToolButton>
14 #include <QStackedWidget>
16 #include <sx/SXWidget.h>
19 #include <QGraphicsScene>
22 #include <boost/unordered_map.hpp>
23 using namespace boost;
28 enum LayoutExpansion {
37 QList<QLayoutItem *> items;
38 LayoutExpansion expansion;
49 void setMargin(
int margin_bottom,
int margin_top,
int margin_left,
int margin_right);
50 void setMargin(
int margin);
52 void addItem(QLayoutItem *);
54 QLayoutItem *itemAt(
int index)
const;
55 QLayoutItem *takeAt(
int index);
56 void setGeometry(
const QRect &);
57 QSize sizeHint()
const;
58 QSize minimumSize()
const;
59 bool hasHeightForWidth()
const;
60 int heightForWidth(
int)
const;
69 void mousePressEvent(QMouseEvent *ev);
72 ClickableLabel(
const QString & text, QWidget * parent = 0, Qt::WindowFlags f = 0);
80 void initGui(
const QString &msg);
85 Warning(
const QString &title,
const QString &text, QWidget *w);
90 unordered_map<int,unordered_map<int,int> > guiParts;
98 static unordered_map<int,int> nextIDs;
100 static unordered_map<string,SXLogicObject *> objects;
101 static unordered_map<string,unordered_map<int,int> > effects;
102 static unordered_map<string,SXLogicPass *> passes;
103 static unordered_map<string,unordered_map<int,int> > renderobjects;
104 static unordered_map<string,unordered_map<int,int> > meshes;
105 static unordered_map<string,unordered_map<int,int> > shaders;
106 static unordered_map<string,unordered_map<int,int> > rendertargets;
107 static unordered_map<string,unordered_map<int,int> > textures;
108 static unordered_map<string,unordered_map<int,int> > matrices;
109 static unordered_map<string,unordered_map<int,int> > vectors;
110 static unordered_map<string,unordered_map<int,int> > floats;
112 static bool checkAddPass(
const string &ID);
113 static void addPass(
const string &ID,
int diagramID,
int guiID);
114 static void changePass(
const string &oldID,
const string &newID,
int diagramID,
int guiID);
115 static void removePass(
const string &ID,
int diagramID,
int guiID);
117 static void updateNextID(
int diagramID,
int existingID);
118 static int getNextID(
int diagramID);
128 QToolButton *closeDetailButton;
129 QWidget *detailEditPane;
146 QCompleter *completer;
156 const QString getID()
const;
165 QDialog *inputWidget;
167 QCompleter *completer;
181 void setID(
const QString &ID);
182 const QString getID()
const;
196 QDialog *inputWidget;
198 QLabel *assignmentLabel;
199 QLineEdit *valueInput;
200 QToolButton *addValueButton;
201 QToolButton *removeValueButton;
202 QCompleter *completer;
203 QCompleter *valueCompleter;
217 void setID(
const QString &ID);
218 const QString getID()
const;
239 virtual void setID(
const QString &ID) = 0;
240 virtual const QString getID()
const = 0;
241 int getGuiID()
const;
244 virtual void removeDiagramItem() = 0;
258 void setID(
const QString &ID);
259 const QString getID()
const;
261 void paintEvent(QPaintEvent *);
263 void removeDiagramItem();
270 unordered_map<int,GraphicWidget *> nodes;
271 QWidget *parentWidget;
280 GraphEditPane(
int diagramID,
const QSize &size,QWidget *parent = 0);
281 int getDiagramID()
const;
282 void setNextID(
const QString &ID);
283 void setEditMode(EditMode mode);
284 void addPass(
const QPointF &point,
const QString &ID,
int guiID);
286 void removeNode(
int guiID);
287 void setGraphicsView(QGraphicsView *view);
288 QGraphicsView *getGraphicsView();
290 void mousePressEvent(QGraphicsSceneMouseEvent *event);
291 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
292 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
293 void keyPressEvent(QKeyEvent *keyEvent);
295 void removeDiagramItems();
297 void removingDiagramItems();
303 QStackedWidget *mainGuis;
309 QTabWidget *configurations;
310 QVector<ConfigParts> configParts;
311 QAction *addPassAction;
324 void addConfiguration(
const QString &path =
"",
bool load =
false);
325 QSize sizeHint()
const;
328 void removeConfiguration(
int index);
343 const QString getText()
const;
Definition: SXEditor.h:300
Definition: SXEditor.h:33
Definition: SXEditor.h:141
Definition: SXEditor.h:266
Definition: SXEditor.h:331
Definition: SXEditor.h:77
Definition: SXEditor.h:96
Definition: SXEditor.h:63
Definition: SXEditor.h:123
Definition: SXEditor.h:88
Definition: SXEditor.h:93
Definition: Exception.h:13