当前位置: 首页>>代码示例>>C++>>正文


C++ TApp::getCurrentLevel方法代码示例

本文整理汇总了C++中TApp::getCurrentLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::getCurrentLevel方法的具体用法?C++ TApp::getCurrentLevel怎么用?C++ TApp::getCurrentLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TApp的用法示例。


在下文中一共展示了TApp::getCurrentLevel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:28,代码来源:fxparameditorpopup.cpp

示例2: enterEvent

void SceneViewer::enterEvent(QEvent *) {
  if (m_isMouseEntered) return;

  m_isMouseEntered = true;

  TApp *app        = TApp::instance();
  modifiers        = 0;
  TTool *tool      = app->getCurrentTool()->getTool();
  TXshLevel *level = app->getCurrentLevel()->getLevel();
  if (level && level->getSimpleLevel())
    m_dpiScale =
        getCurrentDpiScale(level->getSimpleLevel(), tool->getCurrentFid());
  else
    m_dpiScale = TPointD(1, 1);

  if (m_freezedStatus != NO_FREEZED) return;

  invalidateToolStatus();
  if (tool && tool->isEnabled()) {
    tool->setViewer(this);
    tool->updateMatrix();
    tool->onEnter();
  }

  setFocus();
  updateGL();
}
开发者ID:hvfrancesco,项目名称:opentoonz,代码行数:27,代码来源:sceneviewerevents.cpp

示例3: showEvent

void FilmstripFrames::showEvent(QShowEvent *) {
  TApp *app = TApp::instance();

  // cambiamenti al livello
  TXshLevelHandle *levelHandle = app->getCurrentLevel();
  connect(levelHandle, SIGNAL(xshLevelSwitched(TXshLevel *)), this,
          SLOT(onLevelSwitched(TXshLevel *)));
  connect(levelHandle, SIGNAL(xshLevelChanged()), this, SLOT(onLevelChanged()));
  connect(levelHandle, SIGNAL(xshLevelViewChanged()), this,
          SLOT(onLevelChanged()));

  // al frame corrente
  connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this,
          SLOT(onFrameSwitched()));
  connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this,
          SLOT(update()));

  // iconcine
  connect(IconGenerator::instance(), SIGNAL(iconGenerated()), this,
          SLOT(update()));

  // onion skin
  connect(app->getCurrentOnionSkin(), SIGNAL(onionSkinMaskChanged()), this,
          SLOT(update()));

  // enable navigator link with the Viewer in the InknPaint page
  ComboViewerPanel *inknPaintViewerPanel = app->getInknPaintViewerPanel();
  if (inknPaintViewerPanel) {
    SceneViewer *viewer = inknPaintViewerPanel->getSceneViewer();
    if (viewer) {
      connect(viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
      connect(viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
    }
  }
}
开发者ID:jcome,项目名称:opentoonz,代码行数:35,代码来源:filmstrip.cpp

示例4: 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();
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:26,代码来源:tpanels.cpp

示例5: 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();
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:30,代码来源:tpanels.cpp

示例6: 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()));
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:25,代码来源:tpanels.cpp

示例7: hideEvent

void FilmstripFrames::hideEvent(QHideEvent *) {
  TApp *app = TApp::instance();

  // cambiamenti al livello
  disconnect(app->getCurrentLevel());

  // al frame corrente
  disconnect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this,
             SLOT(onFrameSwitched()));
  disconnect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this,
             SLOT(update()));

  // iconcine
  disconnect(IconGenerator::instance(), SIGNAL(iconGenerated()), this,
             SLOT(update()));

  // onion skin
  disconnect(app->getCurrentOnionSkin(), SIGNAL(onionSkinMaskChanged()), this,
             SLOT(update()));

  ComboViewerPanel *inknPaintViewerPanel = app->getInknPaintViewerPanel();
  if (inknPaintViewerPanel) {
    SceneViewer *viewer = inknPaintViewerPanel->getSceneViewer();
    if (viewer) {
      disconnect(viewer, SIGNAL(onZoomChanged()), this, SLOT(update()));
      disconnect(viewer, SIGNAL(refreshNavi()), this, SLOT(update()));
    }
  }
}
开发者ID:jcome,项目名称:opentoonz,代码行数:29,代码来源:filmstrip.cpp

示例8: hideEvent

void BinarizePopup::hideEvent(QHideEvent *e)
{
	TApp *app = TApp::instance();
	bool ret = true;
	ret = ret && disconnect(app->getCurrentFrame(), 0, this, 0);
	ret = ret && disconnect(app->getCurrentColumn(), 0, this, 0);
	ret = ret && disconnect(app->getCurrentLevel(), 0, this, 0);
	assert(ret);
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:9,代码来源:binarizepopup.cpp

示例9: 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);
}
开发者ID:luc--,项目名称:opentoonz,代码行数:11,代码来源:comboviewerpane.cpp

示例10: onCurrentButtonToggled

void PaletteViewerPanel::onCurrentButtonToggled(bool isCurrent) {
  if (isActive() == isCurrent) return;

  TApp *app          = TApp::instance();
  TPaletteHandle *ph = app->getPaletteController()->getCurrentLevelPalette();
  // Se sono sulla palette del livello corrente e le palette e' vuota non
  // consento di bloccare il pannello.
  if (isActive() && !ph->getPalette()) {
    m_isCurrentButton->setPressed(true);
    return;
  }

  setActive(isCurrent);
  m_paletteViewer->enableSaveAction(isCurrent);

  // Cambio il livello corrente
  if (isCurrent) {
    std::set<TXshSimpleLevel *> levels;
    TXsheet *xsheet = app->getCurrentXsheet()->getXsheet();
    int row, column;
    findPaletteLevels(levels, row, column, m_paletteHandle->getPalette(),
                      xsheet);
    // Se non trovo livelli riferiti alla palette setto il palette viewer alla
    // palette del livello corrente.
    if (levels.empty()) {
      m_paletteViewer->setPaletteHandle(ph);
      update();
      return;
    }
    TXshSimpleLevel *level = *levels.begin();
    // Se sto editando l'xsheet devo settare come corrente anche la colonna e il
    // frame.
    if (app->getCurrentFrame()->isEditingScene()) {
      int currentColumn = app->getCurrentColumn()->getColumnIndex();
      if (currentColumn != column)
        app->getCurrentColumn()->setColumnIndex(column);
      int currentRow = app->getCurrentFrame()->getFrameIndex();
      TXshCell cell  = xsheet->getCell(currentRow, column);
      if (cell.isEmpty() || cell.getSimpleLevel() != level)
        app->getCurrentFrame()->setFrameIndex(row);

      TCellSelection *selection = dynamic_cast<TCellSelection *>(
          app->getCurrentSelection()->getSelection());
      if (selection) selection->selectNone();
    }
    app->getCurrentLevel()->setLevel(level);
    m_paletteViewer->setPaletteHandle(ph);
  } else {
    m_paletteHandle->setPalette(ph->getPalette());
    m_paletteViewer->setPaletteHandle(m_paletteHandle);
  }
  update();
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:53,代码来源:tpanels.cpp

示例11: onChooseLevelComboChanged

/*! switch the current level when the current index of m_chooseLevelCombo is
 * changed
*/
void Filmstrip::onChooseLevelComboChanged(int index) {
  TApp *tapp = TApp::instance();
  // empty level
  if (index == m_chooseLevelCombo->findText(tr("- No Current Level -")))
    tapp->getCurrentLevel()->setLevel(0);
  else {
    std::vector<TFrameId> fids;
    m_levels[index]->getFids(fids);
    tapp->getCurrentFrame()->setFrameIds(fids);

    // retrieve to the current working frame of the level
    TFrameId WF;
    std::map<TXshSimpleLevel *, TFrameId>::iterator WFit;
    WFit = m_workingFrames.find(m_levels[index]);
    if (WFit != m_workingFrames.end())
      WF = WFit->second;
    else
      WF = fids[0];

    // this function emits xshLevelSwitched() signal and eventually calls
    // FlipConsole::UpdateRange
    // it may move the current frame so we need to keep the current frameId
    // before calling setLevel.
    tapp->getCurrentLevel()->setLevel(m_levels[index]);

    if (tapp->getCurrentSelection()->getSelection())
      tapp->getCurrentSelection()->getSelection()->selectNone();

    // move to the current working frame
    tapp->getCurrentFrame()->setFid(WF);

    QApplication::setOverrideCursor(Qt::WaitCursor);

    invalidateIcons(m_levels[index], fids);

    QApplication::restoreOverrideCursor();
  }
}
开发者ID:jcome,项目名称:opentoonz,代码行数:41,代码来源:filmstrip.cpp

示例12: 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);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:14,代码来源:comboviewerpane.cpp

示例13: TPanel

StudioPaletteViewerPanel::StudioPaletteViewerPanel(QWidget *parent)
    : TPanel(parent) {
  m_studioPaletteHandle = new TPaletteHandle();
  connect(m_studioPaletteHandle, SIGNAL(colorStyleSwitched()),
          SLOT(onColorStyleSwitched()));
  connect(m_studioPaletteHandle, SIGNAL(paletteSwitched()),
          SLOT(onPaletteSwitched()));

  connect(m_studioPaletteHandle, SIGNAL(paletteLockChanged()),
          SLOT(onPaletteSwitched()));

  TApp *app             = TApp::instance();
  m_studioPaletteViewer = new StudioPaletteViewer(
      this, m_studioPaletteHandle,
      app->getPaletteController()->getCurrentLevelPalette(),
      app->getCurrentFrame(), app->getCurrentXsheet(), app->getCurrentLevel());
  setWidget(m_studioPaletteViewer);
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:18,代码来源:tpanels.cpp

示例14: showEvent

void BinarizePopup::showEvent(QShowEvent *e)
{
	TApp *app = TApp::instance();

	TPixel32 col1, col2;
	Preferences::instance()->getChessboardColors(col1, col2);
	m_viewer->setBgColor(col1, col2);

	bool ret = true;
	ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameTypeChanged()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentFrame(), SIGNAL(frameSwitched()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentColumn(), SIGNAL(columnIndexSwitched()), this, SLOT(fetchSample()));
	ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelSwitched(TXshLevel *)), this, SLOT(onLevelSwitched(TXshLevel *)));
	ret = ret && connect(app->getCurrentLevel(), SIGNAL(xshLevelChanged()), this, SLOT(fetchSample()));
	assert(ret);
	m_previewChk->setChecked(false);
	fetchSample();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:18,代码来源:binarizepopup.cpp

示例15: setCurrentSampleRaster

void AntialiasPopup::setCurrentSampleRaster()
{
	TRasterP sampleRas;

	m_startRas = TRasterP();
	TSelection *selection = TApp::instance()->getCurrentSelection()->getSelection();
	TCellSelection *cellSelection = dynamic_cast<TCellSelection *>(selection);
	TFilmstripSelection *filmstripSelection = dynamic_cast<TFilmstripSelection *>(selection);
	TImageP image;
	if (cellSelection) {
		TApp *app = TApp::instance();
		TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
		TXshCell cell = xsh->getCell(app->getCurrentFrame()->getFrameIndex(), app->getCurrentColumn()->getColumnIndex());
		TImageP aux = cell.getImage(true);
		if (aux)
			image = aux->cloneImage();
	} else if (filmstripSelection) {
		TApp *app = TApp::instance();
		TXshSimpleLevel *simpleLevel = app->getCurrentLevel()->getSimpleLevel();
		if (simpleLevel) {
			TImageP imageAux = simpleLevel->getFrame(app->getCurrentFrame()->getFid(), true);
			if (imageAux)
				image = imageAux->cloneImage();
		}
	}

	if (!image || !(sampleRas = image->raster())) {
		m_viewer->setImage(TImageP());
		m_viewer->update();
		m_okBtn->setEnabled(false);
		return;
	}

	m_okBtn->setEnabled(true);
	m_startRas = sampleRas->clone();
	onChange(m_startRas, sampleRas, m_thresholdField->getValue(), m_softnessField->getValue());

	m_viewer->setImage(image);
	m_viewer->update();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:40,代码来源:antialiaspopup.cpp


注:本文中的TApp::getCurrentLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。