本文整理汇总了C++中TApp::getCurrentScene方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::getCurrentScene方法的具体用法?C++ TApp::getCurrentScene怎么用?C++ TApp::getCurrentScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApp
的用法示例。
在下文中一共展示了TApp::getCurrentScene方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void execute()
{
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
TLevelSet *levelSet = scene->getLevelSet();
std::set<TXshLevel *> usedLevels;
scene->getTopXsheet()->getUsedLevels(usedLevels);
std::vector<TXshLevel *> unused;
for (int i = 0; i < levelSet->getLevelCount(); i++) {
TXshLevel *xl = levelSet->getLevel(i);
if (usedLevels.count(xl) == 0)
unused.push_back(xl);
}
if (unused.empty()) {
DVGui::error(QObject::tr("No unused levels"));
return;
} else {
TUndoManager *um = TUndoManager::manager();
um->beginBlock();
for (int i = 0; i < (int)unused.size(); i++) {
TXshLevel *xl = unused[i];
um->add(new DeleteLevelUndo(xl));
scene->getLevelSet()->removeLevel(xl);
}
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
TApp::instance()->getCurrentScene()->notifyCastChange();
um->endBlock();
}
}
示例2: CurrentStyleChangeCommand
PaletteViewerPanel::PaletteViewerPanel(QWidget *parent) : TPanel(parent) {
m_paletteHandle = new TPaletteHandle();
connect(m_paletteHandle, SIGNAL(colorStyleSwitched()),
SLOT(onColorStyleSwitched()));
connect(m_paletteHandle, SIGNAL(paletteSwitched()),
SLOT(onPaletteSwitched()));
TApp *app = TApp::instance();
m_paletteViewer = new PaletteViewer(this, PaletteViewerGUI::LEVEL_PALETTE);
m_paletteViewer->setPaletteHandle(
app->getPaletteController()->getCurrentLevelPalette());
m_paletteViewer->setFrameHandle(app->getCurrentFrame());
m_paletteViewer->setXsheetHandle(app->getCurrentXsheet());
// for clearing cache when paste style command called from the StyleSelection
m_paletteViewer->setLevelHandle(app->getCurrentLevel());
TSceneHandle *sceneHandle = app->getCurrentScene();
connect(sceneHandle, SIGNAL(sceneSwitched()), SLOT(onSceneSwitched()));
CurrentStyleChangeCommand *currentStyleChangeCommand =
new CurrentStyleChangeCommand();
m_paletteViewer->setChangeStyleCommand(currentStyleChangeCommand);
setWidget(m_paletteViewer);
initializeTitleBar();
}
示例3: hideEvent
void SchematicScenePanel::hideEvent(QHideEvent *e) {
TApp *app = TApp::instance();
disconnect(m_schematicViewer, SIGNAL(showPreview(TFxP)), this,
SLOT(onShowPreview(TFxP)));
disconnect(m_schematicViewer, SIGNAL(doCollapse(const QList<TFxP> &)), this,
SLOT(onCollapse(const QList<TFxP> &)));
disconnect(m_schematicViewer, SIGNAL(doCollapse(QList<TStageObjectId>)), this,
SLOT(onCollapse(QList<TStageObjectId>)));
disconnect(m_schematicViewer, SIGNAL(doExplodeChild(const QList<TFxP> &)),
this, SLOT(onExplodeChild(const QList<TFxP> &)));
disconnect(m_schematicViewer, SIGNAL(doExplodeChild(QList<TStageObjectId>)),
this, SLOT(onExplodeChild(QList<TStageObjectId>)));
disconnect(m_schematicViewer, SIGNAL(editObject()), this,
SLOT(onEditObject()));
disconnect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()),
m_schematicViewer, SLOT(updateScenes()));
disconnect(app->getCurrentObject(), SIGNAL(objectSwitched()),
m_schematicViewer, SLOT(updateScenes()));
disconnect(app->getCurrentXsheet(), SIGNAL(xsheetSwitched()),
m_schematicViewer, SLOT(updateSchematic()));
disconnect(app->getCurrentXsheet(), SIGNAL(xsheetChanged()),
m_schematicViewer, SLOT(updateSchematic()));
disconnect(app->getCurrentScene(), SIGNAL(sceneSwitched()), m_schematicViewer,
SLOT(onSceneSwitched()));
}
示例4: showEvent
void SchematicScenePanel::showEvent(QShowEvent *e) {
if (m_schematicViewer->isStageSchematicViewed())
setWindowTitle("Stage Schematic");
else
setWindowTitle("Fx Schematic");
TApp *app = TApp::instance();
connect(m_schematicViewer, SIGNAL(showPreview(TFxP)), this,
SLOT(onShowPreview(TFxP)));
connect(m_schematicViewer, SIGNAL(doCollapse(const QList<TFxP> &)), this,
SLOT(onCollapse(const QList<TFxP> &)));
connect(m_schematicViewer, SIGNAL(doCollapse(QList<TStageObjectId>)), this,
SLOT(onCollapse(QList<TStageObjectId>)));
connect(m_schematicViewer, SIGNAL(doExplodeChild(const QList<TFxP> &)), this,
SLOT(onExplodeChild(const QList<TFxP> &)));
connect(m_schematicViewer, SIGNAL(doExplodeChild(QList<TStageObjectId>)),
this, SLOT(onExplodeChild(QList<TStageObjectId>)));
connect(m_schematicViewer, SIGNAL(editObject()), this, SLOT(onEditObject()));
connect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()), m_schematicViewer,
SLOT(updateScenes()));
connect(app->getCurrentObject(), SIGNAL(objectSwitched()), m_schematicViewer,
SLOT(updateScenes()));
connect(app->getCurrentXsheet(), SIGNAL(xsheetSwitched()), m_schematicViewer,
SLOT(updateSchematic()));
connect(app->getCurrentXsheet(), SIGNAL(xsheetChanged()), m_schematicViewer,
SLOT(updateSchematic()));
connect(app->getCurrentScene(), SIGNAL(sceneSwitched()), m_schematicViewer,
SLOT(onSceneSwitched()));
m_schematicViewer->updateSchematic();
}
示例5: QDialog
FxParamEditorPopup::FxParamEditorPopup()
: QDialog(TApp::instance()->getMainWindow()) {
setWindowTitle(tr("Fx Settings"));
setMinimumSize(20, 20);
TApp *app = TApp::instance();
TSceneHandle *hScene = app->getCurrentScene();
TPixel32 col1, col2;
Preferences::instance()->getChessboardColors(col1, col2);
FxSettings *fxSettings = new FxSettings(this, col1, col2);
fxSettings->setSceneHandle(hScene);
fxSettings->setFxHandle(app->getCurrentFx());
fxSettings->setFrameHandle(app->getCurrentFrame());
fxSettings->setXsheetHandle(app->getCurrentXsheet());
fxSettings->setLevelHandle(app->getCurrentLevel());
fxSettings->setObjectHandle(app->getCurrentObject());
fxSettings->setCurrentFx();
QVBoxLayout *mainLayout = new QVBoxLayout();
mainLayout->setMargin(0);
mainLayout->setSpacing(10);
{ mainLayout->addWidget(fxSettings); }
setLayout(mainLayout);
move(parentWidget()->geometry().center() - rect().bottomRight() / 2.0);
}
示例6: TFilePath
TFx *InsertFxPopup::createFx()
{
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
TXsheet *xsh = scene->getXsheet();
QTreeWidgetItem *item = m_fxTree->currentItem();
QString text = item->data(0, Qt::UserRole).toString();
if (text.isEmpty())
return 0;
TFx *fx;
TFilePath path = TFilePath(text.toStdWString());
if (TFileStatus(path).doesExist() && TFileStatus(path.getParentDir()).isDirectory()) {
std::string folder = path.getParentDir().getName();
if (folder == "macroFx") //Devo caricare una macro
fx = createMacroFxByPath(path);
else //Verifico se devo caricare un preset
{
folder = path.getParentDir().getParentDir().getName();
if (folder == "presets") //Devo caricare un preset
fx = createPresetFxByName(path);
}
} else
fx = createFxByName(text.toStdString());
if (fx)
return fx;
else
return 0;
}
示例7: mouseReleaseEvent
void LayerHeaderPanel::mouseReleaseEvent(QMouseEvent *event) {
TApp *app = TApp::instance();
TXsheet *xsh = m_viewer->getXsheet();
int col, totcols = xsh->getColumnCount();
bool sound_changed = false;
if (m_doOnRelease != 0 && totcols > 0) {
for (col = 0; col < totcols; col++) {
if (!xsh->isColumnEmpty(col)) {
TXshColumn *column = xsh->getColumn(col);
if (m_doOnRelease == ToggleAllPreviewVisible) {
column->setPreviewVisible(!column->isPreviewVisible());
} else if (m_doOnRelease == ToggleAllTransparency) {
column->setCamstandVisible(!column->isCamstandVisible());
if (column->getSoundColumn()) sound_changed = true;
} else if (m_doOnRelease == ToggleAllLock) {
column->lock(!column->isLocked());
}
}
}
if (sound_changed) {
app->getCurrentXsheet()->notifyXsheetSoundChanged();
}
app->getCurrentScene()->notifySceneChanged();
app->getCurrentXsheet()->notifyXsheetChanged();
}
m_viewer->updateColumnArea();
update();
m_doOnRelease = 0;
}
示例8: mousePressEvent
void RowArea::mousePressEvent(QMouseEvent *event)
{
m_viewer->setQtModifiers(event->modifiers());
if (event->button() == Qt::LeftButton) {
bool playRangeModifierisClicked = false;
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentScene()->getScene()->getXsheet();
TPoint pos(event->pos().x(), event->pos().y());
int row = m_viewer->yToRow(pos.y);
QRect visibleRect = visibleRegion().boundingRect();
int playR0, playR1, step;
XsheetGUI::getPlayRange(playR0, playR1, step);
bool playRangeEnabled = playR0 <= playR1;
if (!playRangeEnabled) {
TXsheet *xsh = m_viewer->getXsheet();
playR1 = xsh->getFrameCount() - 1;
playR0 = 0;
}
if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
} else if (m_xa <= pos.x && pos.x <= m_xa + 10 && (row == playR0 || row == playR1)) {
if (!playRangeEnabled)
XsheetGUI::setPlayRange(playR0, playR1, step);
setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer));
playRangeModifierisClicked = true;
} else
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
//when shift+click the row area, select a single row region in the cell area
if (!playRangeModifierisClicked && 0 != (event->modifiers() & Qt::ShiftModifier)) {
int filledCol;
for (filledCol = xsh->getColumnCount() - 1; filledCol >= 0; filledCol--) {
TXshColumn *currentColumn = xsh->getColumn(filledCol);
if (!currentColumn)
continue;
if (!currentColumn->isEmpty())
break;
}
m_viewer->getCellSelection()->selectNone();
m_viewer->getCellSelection()->selectCells(row, 0, row, tmax(0, filledCol));
m_viewer->updateCellRowAree();
}
m_viewer->dragToolClick(event);
event->accept();
} // left-click
// pan by middle-drag
else if (event->button() == Qt::MidButton) {
m_pos = event->pos();
m_isPanning = true;
}
}
示例9: attachHandles
void FunctionViewerPanel::attachHandles() {
TApp *app = TApp::instance();
m_functionViewer->setXsheetHandle(app->getCurrentXsheet());
m_functionViewer->setFrameHandle(app->getCurrentFrame());
m_functionViewer->setObjectHandle(app->getCurrentObject());
m_functionViewer->setFxHandle(app->getCurrentFx());
m_functionViewer->setColumnHandle(app->getCurrentColumn());
m_functionViewer->setSceneHandle(app->getCurrentScene());
}
示例10: onDeliver
void onDeliver()
{
if (m_error) {
m_error = false;
MsgBox(DVGui::CRITICAL, QObject::tr("There was an error saving frames for the %1 level.").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString())));
}
bool isPreview = (m_fp.getType() == "noext");
TImageCache::instance()->remove(toString(m_fp.getWideString() + L".0"));
TNotifier::instance()->notify(TSceneNameChange());
if (Preferences::instance()->isGeneratedMovieViewEnabled()) {
if (!isPreview && (Preferences::instance()->isDefaultViewerEnabled()) &&
(m_fp.getType() == "mov" || m_fp.getType() == "avi" || m_fp.getType() == "3gp")) {
QString name = QString::fromStdString(m_fp.getName());
int index;
if ((index = name.indexOf("#RENDERID")) != -1) //!quite ugly I know....
m_fp = m_fp.withName(name.left(index).toStdWString());
if (!TSystem::showDocument(m_fp)) {
QString msg(QObject::tr("It is not possible to display the file %1: no player associated with its format").arg(QString::fromStdWString(m_fp.withoutParentDir().getWideString())));
MsgBox(WARNING, msg);
}
}
else {
int r0, r1, step;
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
TOutputProperties &outputSettings = isPreview ? *scene->getProperties()->getPreviewProperties() : *scene->getProperties()->getOutputProperties();
outputSettings.getRange(r0, r1, step);
const TRenderSettings rs = outputSettings.getRenderSettings();
if (r0 == 0 && r1 == -1)
r0 = 0, r1 = scene->getFrameCount() - 1;
double timeStretchFactor = isPreview ? 1.0 : (double)outputSettings.getRenderSettings().m_timeStretchTo /
outputSettings.getRenderSettings().m_timeStretchFrom;
r0 = tfloor(r0 * timeStretchFactor);
r1 = tceil((r1 + 1) * timeStretchFactor) - 1;
TXsheet::SoundProperties *prop = new TXsheet::SoundProperties();
prop->m_frameRate = outputSettings.getFrameRate();
TSoundTrack *snd = app->getCurrentXsheet()->getXsheet()->makeSound(prop);
if (outputSettings.getRenderSettings().m_stereoscopic) {
assert(!isPreview);
::viewFile(m_fp.withName(m_fp.getName() + "_l"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
::viewFile(m_fp.withName(m_fp.getName() + "_r"), r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
} else
::viewFile(m_fp, r0 + 1, r1 + 1, step, isPreview ? rs.m_shrinkX : 1, snd, 0, false, true);
}
}
}
示例11: hideEvent
void ComboViewerPanel::hideEvent(QHideEvent *) {
TApp *app = TApp::instance();
disconnect(app->getCurrentScene());
disconnect(app->getCurrentLevel());
disconnect(app->getCurrentFrame());
disconnect(app->getCurrentObject());
disconnect(app->getCurrentXsheet());
disconnect(app->getCurrentTool());
m_flipConsole->setActive(false);
}
示例12: hideColumns
void TColumnSelection::hideColumns() {
TApp *app = TApp::instance();
ColumnFan *columnFan = app->getCurrentXsheet()->getXsheet()->getColumnFan();
std::set<int>::iterator it = m_indices.begin();
for (; it != m_indices.end(); ++it) columnFan->deactivate(*it);
m_indices.clear();
app->getCurrentXsheet()->notifyXsheetChanged();
// DA FARE (non c'e una notica per il solo cambiamento della testa delle
// colonne)
// TApp::instance()->->notify(TColumnHeadChange());
app->getCurrentScene()->setDirtyFlag(true);
}
示例13: undo
void InsertEmptyColumnsUndo::undo() const {
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
std::vector<std::pair<int, int>>::const_iterator bt,
bEnd = m_columnBlocks.end();
for (bt = m_columnBlocks.begin(); bt != bEnd; ++bt)
for (int n = 0; n != bt->second; ++n) xsh->removeColumn(bt->first);
app->getCurrentScene()->setDirtyFlag(true);
app->getCurrentXsheet()->notifyXsheetChanged();
app->getCurrentObject()->notifyObjectIdSwitched();
}
示例14: removeLevel
bool removeLevel(TXshLevel *level)
{
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
if (scene->getChildStack()->getTopXsheet()->isLevelUsed(level))
DVGui::error(QObject::tr("It is not possible to delete the used level %1.").arg(QString::fromStdWString(level->getName()))); //"E_CantDeleteUsedLevel_%1"
else {
TUndoManager *um = TUndoManager::manager();
um->add(new DeleteLevelUndo(level));
scene->getLevelSet()->removeLevel(level);
}
return true;
}
示例15: hideEvent
void ComboViewerPanel::hideEvent(QHideEvent *event) {
StyleShortcutSwitchablePanel::hideEvent(event);
TApp *app = TApp::instance();
disconnect(app->getCurrentFrame(), 0, this, 0);
disconnect(app->getCurrentScene(), 0, this, 0);
disconnect(app->getCurrentLevel(), 0, this, 0);
disconnect(app->getCurrentObject(), 0, this, 0);
disconnect(app->getCurrentXsheet(), 0, this, 0);
disconnect(app->getCurrentTool(), SIGNAL(toolSwitched()), m_sceneViewer,
SLOT(onToolSwitched()));
m_flipConsole->setActive(false);
}