|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef STAGEOBJECTSELECTION_H
|
|
Toshihiro Shimizu |
890ddd |
#define STAGEOBJECTSELECTION_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/selection.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz/tstageobjectid.h"
|
|
shun-iwasawa |
60079f |
#include "toonz/txshcolumn.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tgeometry.h"
|
|
Toshihiro Shimizu |
890ddd |
#include <qlist></qlist>
|
|
Toshihiro Shimizu |
890ddd |
#include <qpair></qpair>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// forward declaration
|
|
Toshihiro Shimizu |
890ddd |
class TXsheetHandle;
|
|
Toshihiro Shimizu |
890ddd |
class TObjectHandle;
|
|
Toshihiro Shimizu |
890ddd |
class TColumnHandle;
|
|
Toshihiro Shimizu |
890ddd |
class TFxHandle;
|
|
Toshihiro Shimizu |
890ddd |
class SchematicLink;
|
|
Toshihiro Shimizu |
890ddd |
class SchematicPort;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//=========================================================
|
|
Toshihiro Shimizu |
890ddd |
//
|
|
Toshihiro Shimizu |
890ddd |
// FxSelection
|
|
Toshihiro Shimizu |
890ddd |
//
|
|
Toshihiro Shimizu |
890ddd |
//---------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class StageObjectSelection final : public QObject, public TSelection {
|
|
Shinya Kitaoka |
120a6e |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QList<qpair<tstageobjectid, tstageobjectid="">> m_selectedLinks;</qpair<tstageobjectid,>
|
|
Shinya Kitaoka |
120a6e |
QList<tstageobjectid> m_selectedObjects;</tstageobjectid>
|
|
Shinya Kitaoka |
120a6e |
QList<int> m_selectedSplines;</int>
|
|
Shinya Kitaoka |
120a6e |
TXsheetHandle *m_xshHandle;
|
|
Shinya Kitaoka |
120a6e |
TObjectHandle *m_objHandle;
|
|
Shinya Kitaoka |
120a6e |
TColumnHandle *m_colHandle;
|
|
Shinya Kitaoka |
120a6e |
TFxHandle *m_fxHandle;
|
|
Shinya Kitaoka |
120a6e |
TPointD m_pastePosition;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
StageObjectSelection();
|
|
Shinya Kitaoka |
120a6e |
StageObjectSelection(const StageObjectSelection &src);
|
|
Shinya Kitaoka |
120a6e |
~StageObjectSelection();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
void enableCommands() override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
bool isEmpty() const override {
|
|
Shinya Kitaoka |
120a6e |
return m_selectedObjects.empty() && m_selectedLinks.empty() &&
|
|
Shinya Kitaoka |
120a6e |
m_selectedSplines.empty();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
void setPastePosition(const TPointD &pos) { m_pastePosition = pos; };
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
void selectNone() override {
|
|
Shinya Kitaoka |
120a6e |
m_selectedObjects.clear();
|
|
Shinya Kitaoka |
120a6e |
m_selectedLinks.clear();
|
|
Shinya Kitaoka |
120a6e |
m_selectedSplines.clear();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
void deleteSelection();
|
|
Shinya Kitaoka |
120a6e |
void groupSelection();
|
|
Shinya Kitaoka |
120a6e |
void ungroupSelection();
|
|
Shinya Kitaoka |
120a6e |
void collapseSelection();
|
|
Shinya Kitaoka |
120a6e |
void explodeChild();
|
|
Shinya Kitaoka |
120a6e |
void copySelection();
|
|
Shinya Kitaoka |
120a6e |
void pasteSelection();
|
|
Shinya Kitaoka |
120a6e |
void cutSelection();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void select(const TStageObjectId &id);
|
|
Shinya Kitaoka |
120a6e |
void unselect(const TStageObjectId &id);
|
|
Shinya Kitaoka |
120a6e |
void select(int id);
|
|
Shinya Kitaoka |
120a6e |
void unselect(int id);
|
|
Shinya Kitaoka |
120a6e |
void select(SchematicLink *link);
|
|
Shinya Kitaoka |
120a6e |
void unselect(SchematicLink *link);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool isSelected(const TStageObjectId &id) const;
|
|
Shinya Kitaoka |
120a6e |
bool isSelected(SchematicLink *link);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
const QList<tstageobjectid> &getObjects() const { return m_selectedObjects; }</tstageobjectid>
|
|
Shinya Kitaoka |
120a6e |
const QList<qpair<tstageobjectid, tstageobjectid="">> &getLinks() const {</qpair<tstageobjectid,>
|
|
Shinya Kitaoka |
120a6e |
return m_selectedLinks;
|
|
Shinya Kitaoka |
120a6e |
}
|
|
shun-iwasawa |
4a3868 |
const QList<int> &getSplines() const { return m_selectedSplines; }</int>
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setXsheetHandle(TXsheetHandle *xshHandle) { m_xshHandle = xshHandle; }
|
|
Shinya Kitaoka |
120a6e |
void setObjectHandle(TObjectHandle *objHandle) { m_objHandle = objHandle; }
|
|
Shinya Kitaoka |
120a6e |
void setColumnHandle(TColumnHandle *colHandle) { m_colHandle = colHandle; }
|
|
Shinya Kitaoka |
120a6e |
void setFxHandle(TFxHandle *fxHandle) { m_fxHandle = fxHandle; }
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// return true if objects in m_selectedObjects makes a connected graph;
|
|
Shinya Kitaoka |
120a6e |
bool isConnected() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
// not implemented
|
|
Shinya Kitaoka |
120a6e |
StageObjectSelection &operator=(const StageObjectSelection &);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
QPair<tstageobjectid, tstageobjectid=""> getBoundingObjects(SchematicLink *link);</tstageobjectid,>
|
|
Shinya Kitaoka |
120a6e |
QPair<tstageobjectid, tstageobjectid=""> getBoundingObjects(</tstageobjectid,>
|
|
Shinya Kitaoka |
120a6e |
SchematicPort *inputPort, SchematicPort *outputPort);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
signals:
|
|
Shinya Kitaoka |
120a6e |
void doCollapse(QList<tstageobjectid>);</tstageobjectid>
|
|
Shinya Kitaoka |
120a6e |
void doExplodeChild(QList<tstageobjectid>);</tstageobjectid>
|
|
shun-iwasawa |
4a3868 |
void doDelete();
|
|
shun-iwasawa |
60079f |
void columnPasted(const QList<txshcolumnp> &);</txshcolumnp>
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
3bfa54 |
#endif
|