|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TCELLSELECTION_H
|
|
Toshihiro Shimizu |
890ddd |
#define TCELLSELECTION_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/selection.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tgeometry.h"
|
|
Toshihiro Shimizu |
890ddd |
#include <set></set>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TimeStretchPopup;
|
|
shun-iwasawa |
aa65b8 |
class ReframePopup;
|
|
shun-iwasawa |
5e2a8f |
class TXshCell;
|
|
Jeremy Bullock |
3f573c |
class TXshSimpleLevel;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//=============================================================================
|
|
Toshihiro Shimizu |
890ddd |
// TCellSelection
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class TCellSelection final : public TSelection {
|
|
Shinya Kitaoka |
120a6e |
TimeStretchPopup *m_timeStretchPopup;
|
|
shun-iwasawa |
aa65b8 |
ReframePopup *m_reframePopup;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
class Range {
|
|
Shinya Kitaoka |
120a6e |
public:
|
|
Shinya Kitaoka |
120a6e |
int m_c0, m_r0, m_c1, m_r1;
|
|
Shinya Kitaoka |
120a6e |
Range();
|
|
Shinya Kitaoka |
120a6e |
bool isEmpty() const;
|
|
Shinya Kitaoka |
120a6e |
bool contains(int r, int c) const;
|
|
Shinya Kitaoka |
120a6e |
int getRowCount() const;
|
|
Shinya Kitaoka |
120a6e |
int getColCount() const;
|
|
Shinya Kitaoka |
120a6e |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
Range m_range;
|
|
shun-iwasawa |
6e950f |
int m_resizePivotRow; // pivot frame when resizing the selection with
|
|
shun-iwasawa |
6e950f |
// ctrl+arrow keys
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
TCellSelection();
|
|
Shinya Kitaoka |
120a6e |
TCellSelection(Range range) : m_range(range) {}
|
|
Shinya Kitaoka |
120a6e |
~TCellSelection();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
void enableCommands() override;
|
|
shun-iwasawa |
afe084 |
void setAlternativeCommandNames();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
473e70 |
bool isEmpty() const override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void copyCells();
|
|
Shinya Kitaoka |
120a6e |
void pasteCells();
|
|
shun-iwasawa |
559266 |
void doPaste(); // choose pasting behavior by preference option
|
|
Jeremy Bullock |
af94bc |
void pasteDuplicateCells();
|
|
Shinya Kitaoka |
120a6e |
void deleteCells();
|
|
shun-iwasawa |
da26e7 |
void deleteCells(bool withShift);
|
|
Shinya Kitaoka |
120a6e |
void cutCells();
|
|
Shinya Kitaoka |
120a6e |
void cutCells(bool withoutCopy);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
/*- セルの上書きペースト -*/
|
|
Shinya Kitaoka |
120a6e |
void overWritePasteCells();
|
|
shun-iwasawa |
fd55f6 |
// paste cell numbers only
|
|
shun-iwasawa |
fd55f6 |
void overwritePasteNumbers();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
//! \note: puo' anche essere r0>r1 o c0>c1
|
|
Shinya Kitaoka |
120a6e |
void selectCells(int r0, int c0, int r1, int c1);
|
|
Shinya Kitaoka |
120a6e |
void selectCell(int row, int col);
|
|
Shinya Kitaoka |
473e70 |
void selectNone() override;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void getSelectedCells(int &r0, int &c0, int &r1, int &c1) const;
|
|
Shinya Kitaoka |
120a6e |
Range getSelectedCells() const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool isCellSelected(int r, int c) const;
|
|
Shinya Kitaoka |
120a6e |
bool isRowSelected(int row) const;
|
|
Shinya Kitaoka |
120a6e |
bool isColSelected(int col) const;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
bool areAllColSelectedLocked() const;
|
|
Jeremy Bullock |
3f573c |
bool areOnlyVectorCellsSelected();
|
|
Jeremy Bullock |
3f573c |
TXshSimpleLevel *getNewToonzRasterLevel(TXshSimpleLevel *sl);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// commands
|
|
Shinya Kitaoka |
120a6e |
void reverseCells();
|
|
Shinya Kitaoka |
120a6e |
void swingCells();
|
|
Shinya Kitaoka |
120a6e |
void incrementCells();
|
|
Shinya Kitaoka |
120a6e |
void randomCells();
|
|
Shinya Kitaoka |
120a6e |
void stepCells(int count);
|
|
Shinya Kitaoka |
120a6e |
void eachCells(int count);
|
|
Shinya Kitaoka |
120a6e |
void resetStepCells();
|
|
Shinya Kitaoka |
120a6e |
void increaseStepCells();
|
|
Shinya Kitaoka |
120a6e |
void decreaseStepCells();
|
|
Shinya Kitaoka |
120a6e |
void step2Cells() { stepCells(2); }
|
|
Shinya Kitaoka |
120a6e |
void step3Cells() { stepCells(3); }
|
|
Shinya Kitaoka |
120a6e |
void step4Cells() { stepCells(4); }
|
|
Shinya Kitaoka |
120a6e |
void each2Cells() { eachCells(2); }
|
|
Shinya Kitaoka |
120a6e |
void each3Cells() { eachCells(3); }
|
|
Shinya Kitaoka |
120a6e |
void each4Cells() { eachCells(4); }
|
|
Shinya Kitaoka |
120a6e |
void rollupCells();
|
|
Shinya Kitaoka |
120a6e |
void rolldownCells();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void setKeyframes();
|
|
Shinya Kitaoka |
120a6e |
void pasteKeyframesInto();
|
|
Shinya Kitaoka |
120a6e |
|
|
manongjohn |
b248d8 |
void shiftKeyframes(int direction);
|
|
manongjohn |
b248d8 |
void shiftKeyframesUp() { shiftKeyframes(-1); }
|
|
manongjohn |
b248d8 |
void shiftKeyframesDown() { shiftKeyframes(1); }
|
|
manongjohn |
b248d8 |
|
|
Shinya Kitaoka |
120a6e |
void cloneLevel();
|
|
Shinya Kitaoka |
120a6e |
void insertCells();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void openTimeStretchPopup();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void dRenumberCells();
|
|
Shinya Kitaoka |
120a6e |
void dPasteCells();
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
void reframeCells(int count);
|
|
Shinya Kitaoka |
120a6e |
void reframe1Cells() { reframeCells(1); }
|
|
Shinya Kitaoka |
120a6e |
void reframe2Cells() { reframeCells(2); }
|
|
Shinya Kitaoka |
120a6e |
void reframe3Cells() { reframeCells(3); }
|
|
Shinya Kitaoka |
120a6e |
void reframe4Cells() { reframeCells(4); }
|
|
Jeremy Bullock |
3f573c |
void convertToToonzRaster();
|
|
Jeremy Bullock |
3f573c |
void convertVectortoVector();
|
|
shun-iwasawa |
5e2a8f |
|
|
shun-iwasawa |
aa65b8 |
void reframeWithEmptyInbetweens();
|
|
manongjohn |
136caa |
void duplicateFrame(int row, int col, bool multiple);
|
|
manongjohn |
136caa |
void duplicateFrames();
|
|
shun-iwasawa |
aa65b8 |
|
|
shun-iwasawa |
5e2a8f |
void renameCells(TXshCell &cell);
|
|
shun_iwasawa |
3639da |
// rename cells for each columns with correspondent item in the list
|
|
shun_iwasawa |
3639da |
void renameMultiCells(QList<txshcell> &cells);</txshcell>
|
|
shun_iwasawa |
3639da |
|
|
shun_iwasawa |
3639da |
static bool isEnabledCommand(std::string commandId);
|
|
manongjohn |
9f5dc2 |
|
|
manongjohn |
0ec114 |
void createBlankDrawing(int row, int col, bool inRange);
|
|
manongjohn |
0ec114 |
void createBlankDrawings();
|
|
manongjohn |
9f5dc2 |
void fillEmptyCell();
|
|
shun-iwasawa |
6e950f |
int getResizePivotRow() const { return m_resizePivotRow; }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#endif // TCELLSELECTION_H
|