|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef FXSCHEMATICNODE_H
|
|
Toshihiro Shimizu |
890ddd |
#define FXSCHEMATICNODE_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzQt includes
|
|
Toshihiro Shimizu |
890ddd |
#include "schematicnode.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Qt includes
|
|
Toshihiro Shimizu |
890ddd |
#include <qgraphicsitem></qgraphicsitem>
|
|
Toshihiro Shimizu |
890ddd |
#include <qlist></qlist>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//==============================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Forward declarations
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TFx;
|
|
Toshihiro Shimizu |
890ddd |
class TOutputFx;
|
|
Toshihiro Shimizu |
890ddd |
class TXsheetFx;
|
|
Toshihiro Shimizu |
890ddd |
class TZeraryColumnFx;
|
|
Toshihiro Shimizu |
890ddd |
class TPaletteColumnFx;
|
|
Toshihiro Shimizu |
890ddd |
class TLevelColumnFx;
|
|
Toshihiro Shimizu |
890ddd |
class TStageObjectId;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicNode;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicScene;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicDock;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicColumnNode;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicPaletteNode;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicNormalFxNode;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicXSheetNode;
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicOutputNode;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//==============================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
enum eFxSchematicPortType {
|
|
Toshihiro Shimizu |
890ddd |
eFxOutputPort = 200,
|
|
Toshihiro Shimizu |
890ddd |
eFxInputPort = 201,
|
|
Toshihiro Shimizu |
890ddd |
eFxLinkPort = 202,
|
|
Toshihiro Shimizu |
890ddd |
eFxGroupedInPort = 203,
|
|
Toshihiro Shimizu |
890ddd |
eFxGroupedOutPort = 204
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
enum eFxType {
|
|
Toshihiro Shimizu |
890ddd |
eNormalFx = 100,
|
|
Toshihiro Shimizu |
890ddd |
eZeraryFx = 101,
|
|
Toshihiro Shimizu |
890ddd |
eMacroFx = 102,
|
|
Toshihiro Shimizu |
890ddd |
eColumnFx = 103,
|
|
Toshihiro Shimizu |
890ddd |
eOutpuFx = 104,
|
|
Toshihiro Shimizu |
890ddd |
eXSheetFx = 106,
|
|
Toshihiro Shimizu |
890ddd |
eGroupedFx = 107,
|
|
Toshihiro Shimizu |
890ddd |
eNormalImageAdjustFx = 108,
|
|
Toshihiro Shimizu |
890ddd |
eNormalLayerBlendingFx = 109,
|
|
Toshihiro Shimizu |
890ddd |
eNormalMatteFx = 110
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxColumnPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxColumnPainter : public QObject, public QGraphicsItem
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicColumnNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
QString m_name;
|
|
Toshihiro Shimizu |
890ddd |
int m_type;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxColumnPainter(FxSchematicColumnNode *parent, double width, double height, const QString &name);
|
|
Toshihiro Shimizu |
890ddd |
virtual ~FxColumnPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
void setName(const QString &name) { m_name = name; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QLinearGradient getGradientByLevelType(int type);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onIconGenerated();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxPalettePainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxPalettePainter : public QGraphicsItem, public QObject
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPaletteNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
QString m_name;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxPalettePainter(FxSchematicPaletteNode *parent, double width, double height, const QString &name);
|
|
Toshihiro Shimizu |
890ddd |
~FxPalettePainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
void setName(const QString &name) { m_name = name; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxPainter : public QObject, public QGraphicsItem
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
QString m_name, m_label;
|
|
Toshihiro Shimizu |
890ddd |
eFxType m_type;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//to obtain the fx icons for zoom out view of the schematic
|
|
Shinya Kitaoka |
3bfa54 |
std::string m_fxType;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QLinearGradient getGradientByLevelType(eFxType);
|
|
Toshihiro Shimizu |
890ddd |
void paint_small(QPainter *painter);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
3bfa54 |
FxPainter(FxSchematicNode *parent, double width, double height, const QString &name, eFxType type, std::string fxType);
|
|
Toshihiro Shimizu |
890ddd |
~FxPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
void setName(const QString &name) { m_name = name; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxXSheetPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxXSheetPainter : public QObject, public QGraphicsItem
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicXSheetNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxXSheetPainter(FxSchematicXSheetNode *parent, double width, double height);
|
|
Toshihiro Shimizu |
890ddd |
~FxXSheetPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxOutputPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxOutputPainter : public QObject, public QGraphicsItem
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
bool m_isActive;
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicOutputNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxOutputPainter(FxSchematicOutputNode *parent, double width, double height);
|
|
Toshihiro Shimizu |
890ddd |
~FxOutputPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicLink
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicLink : public SchematicLink
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicLink(QGraphicsItem *parent, QGraphicsScene *scene);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicLink();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicPort
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicPort : public SchematicPort
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TFx *m_ownerFx;
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *m_currentTargetPort;
|
|
Toshihiro Shimizu |
890ddd |
QList<schematiclink *=""> m_hiddenLinks;</schematiclink>
|
|
Toshihiro Shimizu |
890ddd |
QList<schematiclink *=""> m_ghostLinks;</schematiclink>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort(FxSchematicDock *parent, int type);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicPort();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
bool linkTo(SchematicPort *port, bool checkOnly = false);
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicDock *getDock() const;
|
|
Toshihiro Shimizu |
890ddd |
SchematicLink *makeLink(SchematicPort *port);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme);
|
|
Toshihiro Shimizu |
890ddd |
void mouseMoveEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
void mouseReleaseEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
TFx *getOwnerFx() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
void linkEffects(TFx *inputFx, TFx *fx, int inputId);
|
|
Toshihiro Shimizu |
890ddd |
SchematicPort *searchPort(const QPointF &scenePos);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//!Handles hiding of existing link and showing of ghost links for snapping after creation link only for fx having
|
|
Toshihiro Shimizu |
890ddd |
//!dynamic ports.
|
|
Toshihiro Shimizu |
890ddd |
//!If \b secondIndex is -1 consider the last port in the groupedPorts of the node.
|
|
Shinya Kitaoka |
3bfa54 |
void handleSnappedLinksOnDynamicPortFx(const std::vector<tfxport *=""> &groupedPorts, int targetIndex, int startIndex = -1);</tfxport>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void resetSnappedLinksOnDynamicPortFx();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void hideSnappedLinks();
|
|
Toshihiro Shimizu |
890ddd |
void showSnappedLinks();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicDock
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicDock : public QGraphicsItem, public QObject
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
QString m_name;
|
|
Toshihiro Shimizu |
890ddd |
double m_width;
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *m_port;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicDock(FxSchematicNode *parent, const QString &string, double width, eFxSchematicPortType type);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicDock();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicNode *getNode();
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *getPort() { return m_port; }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicNode : public SchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
enum eDropActionMode {
|
|
Toshihiro Shimizu |
890ddd |
eShift,
|
|
Toshihiro Shimizu |
890ddd |
eNone
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
QString m_name; //!< Node's name (displayed on top, editable)
|
|
Toshihiro Shimizu |
890ddd |
TFxP m_fx; //!< The node's associated fx (could be a wrapper to the actual fx)
|
|
Toshihiro Shimizu |
890ddd |
TFxP m_actualFx; //!< The actual node's associated fx
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicNode *m_linkedNode;
|
|
Toshihiro Shimizu |
890ddd |
QList<fxschematicdock *=""> m_inDocks;</fxschematicdock>
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicDock *m_outDock;
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicDock *m_linkDock;
|
|
Toshihiro Shimizu |
890ddd |
SchematicName *m_nameItem;
|
|
Toshihiro Shimizu |
890ddd |
eFxType m_type;
|
|
Toshihiro Shimizu |
890ddd |
bool m_isCurrentFxLinked;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool m_isLargeScaled;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
//! If the fx has dynamic port groups, ensures that each group always has at least one unlinked port
|
|
Toshihiro Shimizu |
890ddd |
//! that users can attach to, while keeping the number of unlinked ports to the minimum allowed by the
|
|
Toshihiro Shimizu |
890ddd |
//! group's specifics.
|
|
Toshihiro Shimizu |
890ddd |
virtual void checkDynamicInputPortSize() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Adds a dynamic group port to the associated fx.
|
|
Toshihiro Shimizu |
890ddd |
void addDynamicInputPort(int groupIndex) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Removes the port with specified name from the associated fx. Returns false (ie operation refused)
|
|
Toshihiro Shimizu |
890ddd |
//! if the specified port does not exists, is connected, or is not in a dynamic port group.
|
|
Toshihiro Shimizu |
890ddd |
bool removeDynamicInputPort(const std::string &name) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! Moves the port group links to the front ports.
|
|
Toshihiro Shimizu |
890ddd |
void shiftLinks() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void updateOutputDockToolTips(const QString &name);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicNode(FxSchematicScene *parent, TFx *fx, qreal width, qreal height, eFxType type);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void setWidth(const qreal &width) { m_width = width; }
|
|
Toshihiro Shimizu |
890ddd |
void setHeight(const qreal &height) { m_height = height; }
|
|
Toshihiro Shimizu |
890ddd |
void setSchematicNodePos(const QPointF &pos) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TFx *getFx() const { return m_fx.getPointer(); }
|
|
Toshihiro Shimizu |
890ddd |
bool isA(eFxType type) { return m_type == type; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getInputPortCount() { return m_inDocks.size(); }
|
|
Toshihiro Shimizu |
890ddd |
int getInputDockId(FxSchematicDock *dock);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *getInputPort(int i) { return m_inDocks[i] ? m_inDocks[i]->getPort() : 0; }
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *getOutputPort() { return m_outDock ? m_outDock->getPort() : 0; }
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *getLinkPort() { return m_linkDock ? m_linkDock->getPort() : 0; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool isNameEditing() { return m_nameItem->isVisible(); }
|
|
Toshihiro Shimizu |
890ddd |
void onClicked();
|
|
Toshihiro Shimizu |
890ddd |
bool isCurrentFxLinked(SchematicNode *comingNode) { return m_isCurrentFxLinked; }
|
|
Toshihiro Shimizu |
890ddd |
void setIsCurrentFxLinked(bool value, FxSchematicNode *comingNode);
|
|
Toshihiro Shimizu |
890ddd |
void setPosition(const QPointF &newPos);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void updatePortsPosition();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isOpened() { return true; }
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isEnabled() const;
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isCached() const;
|
|
Toshihiro Shimizu |
890ddd |
virtual void resize(bool maximizeNode) {}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool isLargeScaled() { return m_isLargeScaled; }
|
|
Toshihiro Shimizu |
890ddd |
signals:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void switchCurrentFx(TFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
void currentColumnChanged(int index);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void fxNodeDoubleClicked();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicOutputNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicOutputNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
FxOutputPainter *m_outputPainter;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicOutputNode(FxSchematicScene *scene, TOutputFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicOutputNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicXSheetNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicXSheetNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
FxXSheetPainter *m_xsheetPainter;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicXSheetNode(FxSchematicScene *scene, TXsheetFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicXSheetNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicNormalFxNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicNormalFxNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxPainter *m_painter;
|
|
Toshihiro Shimizu |
890ddd |
SchematicToggle *m_renderToggle;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicNormalFxNode(FxSchematicScene *scene, TFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicNormalFxNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void resize(bool maximizeNode);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicZeraryNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicZeraryNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxPainter *m_painter;
|
|
Toshihiro Shimizu |
890ddd |
int m_columnIndex;
|
|
Toshihiro Shimizu |
890ddd |
SchematicToggle *m_renderToggle, *m_cameraStandToggle;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicZeraryNode(FxSchematicScene *scene, TZeraryColumnFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicZeraryNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void resize(bool maximizeNode);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int getColumnIndex() { return m_columnIndex; }
|
|
Toshihiro Shimizu |
890ddd |
bool isCached() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicColumnNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicColumnNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
SchematicThumbnailToggle *m_resizeItem;
|
|
Toshihiro Shimizu |
890ddd |
SchematicToggle *m_renderToggle, *m_cameraStandToggle;
|
|
Toshihiro Shimizu |
890ddd |
FxColumnPainter *m_columnPainter;
|
|
Toshihiro Shimizu |
890ddd |
int m_columnIndex;
|
|
Toshihiro Shimizu |
890ddd |
bool m_isOpened;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicColumnNode(FxSchematicScene *scene, TLevelColumnFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicColumnNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
QPixmap getPixmap();
|
|
Toshihiro Shimizu |
890ddd |
bool isOpened() { return m_isOpened; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void getLevelTypeAndName(int &, QString &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void resize(bool maximizeNode);
|
|
Toshihiro Shimizu |
890ddd |
int getColumnIndex() { return m_columnIndex; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
void renameObject(const TStageObjectId &id, std::string name);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
void onCameraStandToggleClicked(int);
|
|
Toshihiro Shimizu |
890ddd |
void onChangedSize(bool);
|
|
Toshihiro Shimizu |
890ddd |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicPaletteNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxSchematicPaletteNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
SchematicToggle *m_renderToggle;
|
|
Toshihiro Shimizu |
890ddd |
FxPalettePainter *m_palettePainter;
|
|
Toshihiro Shimizu |
890ddd |
int m_columnIndex;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPaletteNode(FxSchematicScene *scene, TPaletteColumnFx *fx);
|
|
Toshihiro Shimizu |
890ddd |
~FxSchematicPaletteNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
QPixmap getPixmap();
|
|
Toshihiro Shimizu |
890ddd |
bool isOpened() { return false; }
|
|
Toshihiro Shimizu |
890ddd |
int getColumnIndex() { return m_columnIndex; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QString getPaletteName();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Toshihiro Shimizu |
890ddd |
void renameObject(const TStageObjectId &id, std::string name);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxGroupNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class FxGroupNode : public FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QList<tfxp> m_groupedFxs;</tfxp>
|
|
Toshihiro Shimizu |
890ddd |
QList<tfxp> m_roots;</tfxp>
|
|
Toshihiro Shimizu |
890ddd |
int m_groupId;
|
|
Toshihiro Shimizu |
890ddd |
FxPainter *m_painter;
|
|
Toshihiro Shimizu |
890ddd |
SchematicToggle *m_renderToggle;
|
|
Toshihiro Shimizu |
890ddd |
bool m_isOpened;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
FxGroupNode(FxSchematicScene *scene, const QList<tfxp> &groupedFx, const QList<tfxp> &roots,</tfxp></tfxp>
|
|
Shinya Kitaoka |
3bfa54 |
int groupId, const std::wstring &groupName);
|
|
Toshihiro Shimizu |
890ddd |
~FxGroupNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QRectF boundingRect() const;
|
|
Toshihiro Shimizu |
890ddd |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxSchematicPort *getOutputPort() const { return m_outDock ? m_outDock->getPort() : 0; }
|
|
Toshihiro Shimizu |
890ddd |
bool isNameEditing() const { return m_nameItem->isVisible(); }
|
|
Toshihiro Shimizu |
890ddd |
QList<tfxp> getRootFxs() const { return m_roots; }</tfxp>
|
|
Toshihiro Shimizu |
890ddd |
int getRootCount() { return m_roots.size(); }
|
|
Toshihiro Shimizu |
890ddd |
int getFxCount() const { return m_groupedFxs.size(); }
|
|
Toshihiro Shimizu |
890ddd |
TFx *getFx(int i) const { return 0 <= i && i < m_groupedFxs.size() ? m_groupedFxs[i].getPointer() : 0; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QList<tfxp> getGroupedFxs() const { return m_groupedFxs; }</tfxp>
|
|
Toshihiro Shimizu |
890ddd |
void updateFxsDagPosition(const TPointD &pos) const;
|
|
Toshihiro Shimizu |
890ddd |
bool isOpened() { return m_isOpened; }
|
|
Toshihiro Shimizu |
890ddd |
void resize(bool maximized);
|
|
Toshihiro Shimizu |
890ddd |
bool contains(TFxP fx);
|
|
Toshihiro Shimizu |
890ddd |
//returns the number of ports that take the group in input... it consider also the node xsheet
|
|
Toshihiro Shimizu |
890ddd |
int getOutputConnectionsCount() const;
|
|
Toshihiro Shimizu |
890ddd |
bool isEnabled() const;
|
|
Toshihiro Shimizu |
890ddd |
virtual bool isCached() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Toshihiro Shimizu |
890ddd |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me);
|
|
Toshihiro Shimizu |
890ddd |
QPointF computePos() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif // FXSCHEMATICNODE_H
|