forked from ahmidou/SpliceMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FabricSpliceEditorWidget.h
88 lines (70 loc) · 3.17 KB
/
FabricSpliceEditorWidget.h
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
#ifndef _CREATIONSPLICEEDITORWIDGET_H_
#define _CREATIONSPLICEEDITORWIDGET_H_
#include <QtGui/QTabWidget>
#include <QtGui/QTextEdit>
#include <QtCore/QEvent>
#include <map>
#include "FabricSpliceComboWidget.h"
#include "FabricSpliceButtonWidget.h"
#include "FabricSpliceListWidget.h"
#include "FabricSpliceKLSourceCodeWidget.h"
#include "FabricSpliceBaseInterface.h"
#include <maya/MStatus.h>
class FabricSpliceEditorWidget : public QTabWidget {
public:
FabricSpliceEditorWidget(QWidget * parent, const QString & name);
~FabricSpliceEditorWidget();
void update(MStatus * status = NULL);
void updateNodeDropDown(MStatus * status = NULL);
void updateOperatorDropDown(MStatus * status = NULL);
void setOperatorName(const std::string & opName, MStatus * status = NULL);
void setNodeDropDown(std::string nodeName, MStatus * status = NULL);
void reportCompilerError(unsigned int row, unsigned int col, const char * file, const char * level, const char * desc, MStatus * status = NULL);
static QWidget * creator(QWidget * parent, const QString & name);
static FabricSpliceEditorWidget * getFirst();
static FabricSpliceEditorWidget * getFirstOrOpen(bool onIdle = true);
static void postUpdateAll(MStatus * status = NULL);
static void updateAll(MStatus * status = NULL);
static void updateAllNodeDropDowns(MStatus * status = NULL);
static void updateAllOperatorDropDowns(MStatus * status = NULL);
static void setAllNodeDropDowns(std::string nodeName, bool onIdle = true, MStatus * status = NULL);
static void setAllOperatorNames(std::string opName, bool onIdle = true, MStatus * status = NULL);
static void reportAllCompilerError(unsigned int row, unsigned int col, const char * file, const char * level, const char * desc, MStatus * status = NULL);
// callbacks
static void onNodeChanged(void * userData);
static void onOperatorChanged(void * userData);
static void compilePressed(void * userData);
static void addAttrPressed(void * userData);
static void removeAttrPressed(void * userData);
static void addOpPressed(void * userData);
static void editOpPressed(void * userData);
static void removeOpPressed(void * userData);
private:
typedef std::map<std::string, FabricSpliceEditorWidget*> widgetMap;
typedef widgetMap::iterator widgetIt;
typedef std::pair<std::string, FabricSpliceEditorWidget*> widgetPair;
std::string mName;
std::string mOpName;
static widgetMap gWidgets;
static bool gUpdatePosted;
FabricSpliceComboWidget * mNodeCombo;
FabricSpliceListWidget * mAttrList;
FabricSpliceListWidget * mOperatorList;
FabricSpliceKLLineNumberWidget * mLineNumbers;
FabricSpliceKLSourceCodeWidget * mSourceCode;
FabricSpliceButtonWidget * mAddAttrButton;
FabricSpliceButtonWidget * mRemoveAttrButton;
FabricSpliceButtonWidget * mAddOpButton;
FabricSpliceButtonWidget * mEditOpButton;
FabricSpliceButtonWidget * mRemoveOpButton;
FabricSpliceButtonWidget * mCompileButton;
QTextEdit * mErrorLog;
QTextEdit * mPortText;
std::string getCurrentNodeName();
FabricSpliceBaseInterface * getCurrentBaseInterface();
protected:
virtual bool event ( QEvent * event );
virtual QSize sizeHint () const;
virtual void bringToFront();
};
#endif