|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef FXSCHEMATICNODE_H
|
|
Toshihiro Shimizu |
890ddd |
#define FXSCHEMATICNODE_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzQt includes
|
|
manongjohn |
d6e3cc |
#include "fxtypes.h"
|
|
manongjohn |
d6e3cc |
|
|
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 |
// FxColumnPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxColumnPainter final : public QObject, public QGraphicsItem {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Shinya Kitaoka |
120a6e |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicColumnNode *m_parent;
|
|
Shinya Kitaoka |
120a6e |
double m_width, m_height;
|
|
Shinya Kitaoka |
120a6e |
QString m_name;
|
|
Shinya Kitaoka |
120a6e |
int m_type;
|
|
shun-iwasawa |
045b61 |
bool m_isReference = false;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxColumnPainter(FxSchematicColumnNode *parent, double width, double height,
|
|
Shinya Kitaoka |
120a6e |
const QString &name);
|
|
Shinya Kitaoka |
120a6e |
virtual ~FxColumnPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
void setName(const QString &name) { m_name = name; }
|
|
shun-iwasawa |
045b61 |
void setIsReference(bool ref = true) { m_isReference = ref; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onIconGenerated();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxPalettePainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
199e29 |
class FxPalettePainter final : public QObject, public QGraphicsItem {
|
|
shun-iwasawa |
199e29 |
Q_OBJECT
|
|
shun-iwasawa |
443318 |
Q_INTERFACES(QGraphicsItem)
|
|
shun-iwasawa |
443318 |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPaletteNode *m_parent;
|
|
Shinya Kitaoka |
120a6e |
double m_width, m_height;
|
|
Shinya Kitaoka |
120a6e |
QString m_name;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxPalettePainter(FxSchematicPaletteNode *parent, double width, double height,
|
|
Shinya Kitaoka |
120a6e |
const QString &name);
|
|
Shinya Kitaoka |
120a6e |
~FxPalettePainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
void setName(const QString &name) { m_name = name; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxPainter final : public QObject, public QGraphicsItem {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Shinya Kitaoka |
120a6e |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicNode *m_parent;
|
|
Shinya Kitaoka |
120a6e |
double m_width, m_height;
|
|
Shinya Kitaoka |
120a6e |
QString m_name, m_label;
|
|
Shinya Kitaoka |
120a6e |
eFxType m_type;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// to obtain the fx icons for zoom out view of the schematic
|
|
Shinya Kitaoka |
120a6e |
std::string m_fxType;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void paint_small(QPainter *painter);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxPainter(FxSchematicNode *parent, double width, double height,
|
|
Shinya Kitaoka |
120a6e |
const QString &name, eFxType type, std::string fxType);
|
|
Shinya Kitaoka |
120a6e |
~FxPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
void setName(const QString &name) { m_name = name; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxXSheetPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxXSheetPainter final : public QObject, public QGraphicsItem {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Shinya Kitaoka |
120a6e |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
double m_width, m_height;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicXSheetNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxXSheetPainter(FxSchematicXSheetNode *parent, double width, double height);
|
|
Shinya Kitaoka |
120a6e |
~FxXSheetPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxOutputPainter
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxOutputPainter final : public QObject, public QGraphicsItem {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Shinya Kitaoka |
120a6e |
Q_INTERFACES(QGraphicsItem)
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
double m_width, m_height;
|
|
Shinya Kitaoka |
120a6e |
bool m_isActive;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicOutputNode *m_parent;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxOutputPainter(FxSchematicOutputNode *parent, double width, double height);
|
|
Shinya Kitaoka |
120a6e |
~FxOutputPainter();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicLink
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicLink final : public SchematicLink {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicLink(QGraphicsItem *parent, QGraphicsScene *scene);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicLink();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicPort
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicPort final : public SchematicPort {
|
|
shun-iwasawa |
199e29 |
Q_OBJECT
|
|
Shinya Kitaoka |
120a6e |
TFx *m_ownerFx;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *m_currentTargetPort;
|
|
Shinya Kitaoka |
120a6e |
QList<schematiclink *=""> m_hiddenLinks;</schematiclink>
|
|
Shinya Kitaoka |
120a6e |
QList<schematiclink *=""> m_ghostLinks;</schematiclink>
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
a8fd67 |
bool m_isPassThrough;
|
|
shun-iwasawa |
a8fd67 |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort(FxSchematicDock *parent, int type);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicPort();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
473e70 |
bool linkTo(SchematicPort *port, bool checkOnly = false) override;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicDock *getDock() const;
|
|
Shinya Kitaoka |
473e70 |
SchematicLink *makeLink(SchematicPort *port) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
a8fd67 |
void setIsPassThrough();
|
|
shun-iwasawa |
a8fd67 |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
Shinya Kitaoka |
473e70 |
void mouseMoveEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Shinya Kitaoka |
473e70 |
void mouseReleaseEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Shinya Kitaoka |
120a6e |
TFx *getOwnerFx() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
void linkEffects(TFx *inputFx, TFx *fx, int inputId);
|
|
Shinya Kitaoka |
473e70 |
SchematicPort *searchPort(const QPointF &scenePos) override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//! Handles hiding of existing link and showing of ghost links for snapping
|
|
Shinya Kitaoka |
120a6e |
//! after creation link only for fx having
|
|
Shinya Kitaoka |
120a6e |
//! dynamic ports.
|
|
Shinya Kitaoka |
120a6e |
//! If \b secondIndex is -1 consider the last port in the groupedPorts of the
|
|
Shinya Kitaoka |
120a6e |
//! node.
|
|
Shinya Kitaoka |
120a6e |
void handleSnappedLinksOnDynamicPortFx(
|
|
Shinya Kitaoka |
120a6e |
const std::vector<tfxport *=""> &groupedPorts, int targetIndex,</tfxport>
|
|
Shinya Kitaoka |
120a6e |
int startIndex = -1);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void resetSnappedLinksOnDynamicPortFx();
|
|
Shinya Kitaoka |
120a6e |
|
|
shun-iwasawa |
21e838 |
void hideSnappedLinks(SchematicPort *) override;
|
|
shun-iwasawa |
21e838 |
void showSnappedLinks(SchematicPort *) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicDock
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicDock final : public QGraphicsItem, public QObject {
|
|
Shinya Kitaoka |
120a6e |
QString m_name;
|
|
Shinya Kitaoka |
120a6e |
double m_width;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *m_port;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicDock(FxSchematicNode *parent, const QString &string, double width,
|
|
Shinya Kitaoka |
120a6e |
eFxSchematicPortType type);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicDock();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicNode *getNode();
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *getPort() { return m_port; }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class FxSchematicNode : public SchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
enum eDropActionMode { eShift, eNone };
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
QString m_name; //!< Node's name (displayed on top, editable)
|
|
Shinya Kitaoka |
120a6e |
TFxP
|
|
Shinya Kitaoka |
120a6e |
m_fx; //!< The node's associated fx (could be a wrapper to the actual fx)
|
|
Shinya Kitaoka |
120a6e |
TFxP m_actualFx; //!< The actual node's associated fx
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicNode *m_linkedNode;
|
|
Shinya Kitaoka |
120a6e |
QList<fxschematicdock *=""> m_inDocks;</fxschematicdock>
|
|
Shinya Kitaoka |
120a6e |
FxSchematicDock *m_outDock;
|
|
Shinya Kitaoka |
120a6e |
FxSchematicDock *m_linkDock;
|
|
Shinya Kitaoka |
120a6e |
SchematicName *m_nameItem;
|
|
Shinya Kitaoka |
120a6e |
eFxType m_type;
|
|
Shinya Kitaoka |
120a6e |
bool m_isCurrentFxLinked;
|
|
Toshihiro Shimizu |
890ddd |
|
|
manongjohn |
d6e3cc |
bool m_isNormalIconView;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
//! If the fx has dynamic port groups, ensures that each group always has at
|
|
Shinya Kitaoka |
120a6e |
//! least one unlinked port
|
|
Shinya Kitaoka |
120a6e |
//! that users can attach to, while keeping the number of unlinked ports to
|
|
Shinya Kitaoka |
120a6e |
//! the minimum allowed by the
|
|
Shinya Kitaoka |
120a6e |
//! group's specifics.
|
|
Shinya Kitaoka |
120a6e |
virtual void checkDynamicInputPortSize() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//! Adds a dynamic group port to the associated fx.
|
|
Shinya Kitaoka |
120a6e |
void addDynamicInputPort(int groupIndex) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//! Removes the port with specified name from the associated fx. Returns false
|
|
Shinya Kitaoka |
120a6e |
//! (ie operation refused)
|
|
Shinya Kitaoka |
120a6e |
//! if the specified port does not exists, is connected, or is not in a
|
|
Shinya Kitaoka |
120a6e |
//! dynamic port group.
|
|
Shinya Kitaoka |
120a6e |
bool removeDynamicInputPort(const std::string &name) const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
//! Moves the port group links to the front ports.
|
|
Shinya Kitaoka |
120a6e |
void shiftLinks() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void updateOutputDockToolTips(const QString &name);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicNode(FxSchematicScene *parent, TFx *fx, qreal width, qreal height,
|
|
Shinya Kitaoka |
120a6e |
eFxType type);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setWidth(const qreal &width) { m_width = width; }
|
|
Shinya Kitaoka |
120a6e |
void setHeight(const qreal &height) { m_height = height; }
|
|
Shinya Kitaoka |
473e70 |
void setSchematicNodePos(const QPointF &pos) const override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
TFx *getFx() const { return m_fx.getPointer(); }
|
|
Shinya Kitaoka |
120a6e |
bool isA(eFxType type) { return m_type == type; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
int getInputPortCount() { return m_inDocks.size(); }
|
|
Shinya Kitaoka |
120a6e |
int getInputDockId(FxSchematicDock *dock);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *getInputPort(int i) {
|
|
Shinya Kitaoka |
120a6e |
return m_inDocks[i] ? m_inDocks[i]->getPort() : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *getOutputPort() {
|
|
Shinya Kitaoka |
120a6e |
return m_outDock ? m_outDock->getPort() : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *getLinkPort() {
|
|
Shinya Kitaoka |
120a6e |
return m_linkDock ? m_linkDock->getPort() : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool isNameEditing() { return m_nameItem->isVisible(); }
|
|
Shinya Kitaoka |
473e70 |
void onClicked() override;
|
|
Shinya Kitaoka |
120a6e |
bool isCurrentFxLinked(SchematicNode *comingNode) {
|
|
Shinya Kitaoka |
120a6e |
return m_isCurrentFxLinked;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
void setIsCurrentFxLinked(bool value, FxSchematicNode *comingNode);
|
|
Shinya Kitaoka |
473e70 |
void setPosition(const QPointF &newPos) override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void updatePortsPosition();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
virtual bool isOpened() { return true; }
|
|
Shinya Kitaoka |
120a6e |
virtual bool isEnabled() const;
|
|
Shinya Kitaoka |
120a6e |
virtual bool isCached() const;
|
|
Shinya Kitaoka |
120a6e |
virtual void resize(bool maximizeNode) {}
|
|
Shinya Kitaoka |
120a6e |
|
|
manongjohn |
d6e3cc |
void toggleNormalIconView() { m_isNormalIconView = !m_isNormalIconView; }
|
|
manongjohn |
d6e3cc |
bool isNormalIconView() { return m_isNormalIconView; }
|
|
shun-iwasawa |
57ba4e |
|
|
Toshihiro Shimizu |
890ddd |
signals:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void switchCurrentFx(TFx *fx);
|
|
Shinya Kitaoka |
120a6e |
void currentColumnChanged(int index);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void fxNodeDoubleClicked();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicOutputNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicOutputNode final : public FxSchematicNode {
|
|
shun-iwasawa |
199e29 |
Q_OBJECT
|
|
shun-iwasawa |
199e29 |
|
|
Shinya Kitaoka |
120a6e |
FxOutputPainter *m_outputPainter;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicOutputNode(FxSchematicScene *scene, TOutputFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicOutputNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicXSheetNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicXSheetNode final : public FxSchematicNode {
|
|
shun-iwasawa |
199e29 |
Q_OBJECT
|
|
shun-iwasawa |
199e29 |
|
|
Shinya Kitaoka |
120a6e |
FxXSheetPainter *m_xsheetPainter;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicXSheetNode(FxSchematicScene *scene, TXsheetFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicXSheetNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicNormalFxNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicNormalFxNode final : public FxSchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxPainter *m_painter;
|
|
Shinya Kitaoka |
120a6e |
SchematicToggle *m_renderToggle;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicNormalFxNode(FxSchematicScene *scene, TFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicNormalFxNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
void resize(bool maximizeNode) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onNameChanged();
|
|
Shinya Kitaoka |
120a6e |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicZeraryNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicZeraryNode final : public FxSchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
FxPainter *m_painter;
|
|
Shinya Kitaoka |
120a6e |
int m_columnIndex;
|
|
Shinya Kitaoka |
120a6e |
SchematicToggle *m_renderToggle, *m_cameraStandToggle;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicZeraryNode(FxSchematicScene *scene, TZeraryColumnFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicZeraryNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
473e70 |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
38fd86 |
QWidget *widget = 0) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
void resize(bool maximizeNode) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
int getColumnIndex() { return m_columnIndex; }
|
|
Shinya Kitaoka |
473e70 |
bool isCached() const override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onRenderToggleClicked(bool);
|
|
manongjohn |
d6e3cc |
void onCameraStandToggleClicked(int);
|
|
Shinya Kitaoka |
120a6e |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicColumnNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicColumnNode final : public FxSchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
SchematicThumbnailToggle *m_resizeItem;
|
|
Shinya Kitaoka |
120a6e |
SchematicToggle *m_renderToggle, *m_cameraStandToggle;
|
|
Shinya Kitaoka |
120a6e |
FxColumnPainter *m_columnPainter;
|
|
Shinya Kitaoka |
120a6e |
int m_columnIndex;
|
|
Shinya Kitaoka |
120a6e |
bool m_isOpened;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicColumnNode(FxSchematicScene *scene, TLevelColumnFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicColumnNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
QPixmap getPixmap();
|
|
Shinya Kitaoka |
473e70 |
bool isOpened() override { return m_isOpened; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void getLevelTypeAndName(int &, QString &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
void resize(bool maximizeNode) override;
|
|
Shinya Kitaoka |
120a6e |
int getColumnIndex() { return m_columnIndex; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
void renameObject(const TStageObjectId &id, std::string name);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onRenderToggleClicked(bool);
|
|
Shinya Kitaoka |
120a6e |
void onCameraStandToggleClicked(int);
|
|
Shinya Kitaoka |
120a6e |
void onChangedSize(bool);
|
|
Shinya Kitaoka |
120a6e |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
// FxSchematicPaletteNode
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxSchematicPaletteNode final : public FxSchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
SchematicToggle *m_renderToggle;
|
|
Shinya Kitaoka |
120a6e |
FxPalettePainter *m_palettePainter;
|
|
Shinya Kitaoka |
120a6e |
int m_columnIndex;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPaletteNode(FxSchematicScene *scene, TPaletteColumnFx *fx);
|
|
Shinya Kitaoka |
120a6e |
~FxSchematicPaletteNode();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
QPixmap getPixmap();
|
|
Shinya Kitaoka |
473e70 |
bool isOpened() override { return false; }
|
|
Shinya Kitaoka |
120a6e |
int getColumnIndex() { return m_columnIndex; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QString getPaletteName();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onRenderToggleClicked(bool);
|
|
Shinya Kitaoka |
120a6e |
void onNameChanged();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
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 |
|
|
Shinya Kitaoka |
d1f6c4 |
class FxGroupNode final : public FxSchematicNode {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QList<tfxp> m_groupedFxs;</tfxp>
|
|
Shinya Kitaoka |
120a6e |
QList<tfxp> m_roots;</tfxp>
|
|
Shinya Kitaoka |
120a6e |
int m_groupId;
|
|
Shinya Kitaoka |
120a6e |
FxPainter *m_painter;
|
|
Shinya Kitaoka |
120a6e |
SchematicToggle *m_renderToggle;
|
|
Shinya Kitaoka |
120a6e |
bool m_isOpened;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
FxGroupNode(FxSchematicScene *scene, const QList<tfxp> &groupedFx,</tfxp>
|
|
Shinya Kitaoka |
120a6e |
const QList<tfxp> &roots, int groupId,</tfxp>
|
|
Shinya Kitaoka |
120a6e |
const std::wstring &groupName);
|
|
Shinya Kitaoka |
120a6e |
~FxGroupNode();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
QRectF boundingRect() const override;
|
|
Shinya Kitaoka |
120a6e |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
Shinya Kitaoka |
473e70 |
QWidget *widget = 0) override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
FxSchematicPort *getOutputPort() const {
|
|
Shinya Kitaoka |
120a6e |
return m_outDock ? m_outDock->getPort() : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
bool isNameEditing() const { return m_nameItem->isVisible(); }
|
|
Shinya Kitaoka |
120a6e |
QList<tfxp> getRootFxs() const { return m_roots; }</tfxp>
|
|
Shinya Kitaoka |
120a6e |
int getRootCount() { return m_roots.size(); }
|
|
Shinya Kitaoka |
120a6e |
int getFxCount() const { return m_groupedFxs.size(); }
|
|
Shinya Kitaoka |
120a6e |
TFx *getFx(int i) const {
|
|
Shinya Kitaoka |
120a6e |
return 0 <= i && i < m_groupedFxs.size() ? m_groupedFxs[i].getPointer() : 0;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
QList<tfxp> getGroupedFxs() const { return m_groupedFxs; }</tfxp>
|
|
Shinya Kitaoka |
120a6e |
void updateFxsDagPosition(const TPointD &pos) const;
|
|
Shinya Kitaoka |
473e70 |
bool isOpened() override { return m_isOpened; }
|
|
Shinya Kitaoka |
473e70 |
void resize(bool maximized) override;
|
|
Shinya Kitaoka |
120a6e |
bool contains(TFxP fx);
|
|
Shinya Kitaoka |
120a6e |
// returns the number of ports that take the group in input... it consider
|
|
Shinya Kitaoka |
120a6e |
// also the node xsheet
|
|
Shinya Kitaoka |
120a6e |
int getOutputConnectionsCount() const;
|
|
Shinya Kitaoka |
473e70 |
bool isEnabled() const override;
|
|
Shinya Kitaoka |
473e70 |
bool isCached() const override;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
473e70 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
manongjohn |
b13816 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
Shinya Kitaoka |
120a6e |
QPointF computePos() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void onNameChanged();
|
|
Shinya Kitaoka |
120a6e |
void onRenderToggleClicked(bool);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
shun-iwasawa |
a8fd67 |
//*****************************************************
|
|
shun-iwasawa |
a8fd67 |
// FxPassThroughPainter
|
|
shun-iwasawa |
a8fd67 |
//*****************************************************
|
|
shun-iwasawa |
a8fd67 |
class FxSchematicPassThroughNode;
|
|
shun-iwasawa |
a8fd67 |
class FxPassThroughPainter final : public QObject, public QGraphicsItem {
|
|
shun-iwasawa |
a8fd67 |
Q_OBJECT
|
|
shun-iwasawa |
a8fd67 |
Q_INTERFACES(QGraphicsItem)
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
double m_width, m_height;
|
|
konero |
b50d23 |
QString m_name;
|
|
konero |
b50d23 |
bool m_showName;
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
FxSchematicPassThroughNode *m_parent;
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
public:
|
|
shun-iwasawa |
a8fd67 |
FxPassThroughPainter(FxSchematicPassThroughNode *parent, double width,
|
|
konero |
b50d23 |
double height, const QString &name, bool showName);
|
|
shun-iwasawa |
a8fd67 |
~FxPassThroughPainter();
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
QRectF boundingRect() const override;
|
|
shun-iwasawa |
a8fd67 |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
shun-iwasawa |
a8fd67 |
QWidget *widget = 0) override;
|
|
konero |
b50d23 |
void setName(const QString &name) { m_name = name; }
|
|
konero |
b50d23 |
void setShowName(bool showName) { m_showName = showName; }
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
protected:
|
|
shun-iwasawa |
a8fd67 |
void contextMenuEvent(QGraphicsSceneContextMenuEvent *cme) override;
|
|
shun-iwasawa |
a8fd67 |
};
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
//*****************************************************
|
|
shun-iwasawa |
a8fd67 |
// FxSchematicPassThroughNode
|
|
shun-iwasawa |
a8fd67 |
//*****************************************************
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
class FxSchematicPassThroughNode final : public FxSchematicNode {
|
|
shun-iwasawa |
a8fd67 |
Q_OBJECT
|
|
shun-iwasawa |
a8fd67 |
|
|
konero |
b50d23 |
bool m_showName;
|
|
konero |
b50d23 |
|
|
shun-iwasawa |
a8fd67 |
FxPassThroughPainter *m_passThroughPainter;
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
public:
|
|
shun-iwasawa |
a8fd67 |
FxSchematicPassThroughNode(FxSchematicScene *scene, TFx *fx);
|
|
shun-iwasawa |
a8fd67 |
~FxSchematicPassThroughNode();
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
QRectF boundingRect() const override;
|
|
shun-iwasawa |
a8fd67 |
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
shun-iwasawa |
a8fd67 |
QWidget *widget = 0) override;
|
|
konero |
b50d23 |
bool isOpened() override { return false; }
|
|
shun-iwasawa |
a8fd67 |
|
|
shun-iwasawa |
a8fd67 |
protected:
|
|
konero |
b50d23 |
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *me) override;
|
|
shun-iwasawa |
a8fd67 |
void mousePressEvent(QGraphicsSceneMouseEvent *me) override;
|
|
konero |
b50d23 |
|
|
konero |
b50d23 |
protected slots:
|
|
konero |
b50d23 |
|
|
konero |
b50d23 |
void onNameChanged();
|
|
shun-iwasawa |
a8fd67 |
};
|
|
shun-iwasawa |
a8fd67 |
|
|
Shinya Kitaoka |
120a6e |
#endif // FXSCHEMATICNODE_H
|