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


C++ TXshLevel::getName方法代码示例

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


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

示例1: getLevel

QScriptValue getLevel(QScriptContext *ctx, QScriptEngine *eng)
{
	QString levelName = ctx->argument(0).toString();

	ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
	TXshLevel *level = scene->getLevelSet()->getLevel(levelName.toStdWString());
	if (!level) {
		level = scene->createNewLevel(PLI_XSHLEVEL, levelName.toStdWString());
		levelName = QString::fromStdWString(level->getName());
	}
	if (level->getSimpleLevel())
		return eng->newQObject(new ScriptWrapper::Level(level->getSimpleLevel()), QScriptEngine::ScriptOwnership);
	else
		return QScriptValue();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:15,代码来源:scriptengine.cpp

示例2: dropEvent

void CastTreeViewer::dropEvent(QDropEvent *event)
{
	m_dropTargetItem = 0;
	if (m_dropFilePath != TFilePath()) {
		IoCmd::loadScene(m_dropFilePath);
		m_dropFilePath = TFilePath();
		m_dropTargetItem = 0;
		update();
		return;
	}

	if (!event->mimeData()->hasFormat("application/vnd.toonz.levels"))
		return;
	m_dropTargetItem = itemAt(event->pos());
	if (!m_dropTargetItem)
		return;
	TFilePath folderPath(m_dropTargetItem->data(1, Qt::DisplayRole).toString().toStdWString());
	m_dropTargetItem = 0;
	update();

	if (folderPath.getName() == AudioFolderName) {
		event->ignore();
		return;
	}
	event->acceptProposedAction();

	TLevelSet *levelSet = getLevelSet();

	const CastItems *castItems = dynamic_cast<const CastItems *>(event->mimeData());
	assert(castItems);
	if (!castItems)
		return;
	int i;
	TUndoManager::manager()->beginBlock();
	for (i = 0; i < castItems->getItemCount(); i++) {
		CastItem *item = castItems->getItem(i);
		if (LevelCastItem *li = dynamic_cast<LevelCastItem *>(item)) {
			TXshLevel *level = li->getLevel();
			wstring levelName = level->getName();
			MoveLevelToFolderUndo *undo = new MoveLevelToFolderUndo(levelSet, levelName, folderPath);
			levelSet->moveLevelToFolder(folderPath, level);
			TUndoManager::manager()->add(undo);
		} else if (SoundCastItem *si = dynamic_cast<SoundCastItem *>(item)) {
		}
	}
	TUndoManager::manager()->endBlock();
	emit itemMovedToFolder();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:48,代码来源:castviewer.cpp

示例3: onNameChanged

void LevelSettingsPopup::onNameChanged() {
  QString text     = m_nameFld->text();
  TXshLevel *level = 0;
  if (m_sl)
    level = m_sl.getPointer();
  else if (m_cl)
    level = m_cl.getPointer();
  else
    return;

  if (text.length() == 0) {
    error("The name " + text +
          " you entered for the level is not valid.\n Please enter a different "
          "name.");
    m_nameFld->setFocus();
    return;
  }

  /*-- Level名に変更がない場合 --*/
  if (level->getName() == text.toStdWString()) {
    // warning("Level name unchanged.");
    return;
  }

  TLevelSet *levelSet =
      TApp::instance()->getCurrentScene()->getScene()->getLevelSet();

  if (!levelSet->renameLevel(level, text.toStdWString())) {
    error("The name " + text +
          " you entered for the level is already used.\nPlease enter a "
          "different name.");
    m_nameFld->setFocus();
    return;
  }

  TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
  TApp::instance()->getCurrentScene()->notifyCastChange();
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:38,代码来源:levelsettingspopup.cpp

示例4: changeWindowTitle

void ComboViewerPanel::changeWindowTitle() {
  TApp *app         = TApp::instance();
  ToonzScene *scene = app->getCurrentScene()->getScene();
  if (!scene) return;
  int frame = app->getCurrentFrame()->getFrame();

  // put the titlebar texts in this string
  QString name;

  // if the frame type is "scene editing"
  if (app->getCurrentFrame()->isEditingScene()) {
    QString sceneName = QString::fromStdWString(scene->getSceneName());
    if (sceneName.isEmpty()) sceneName = tr("Untitled");

    if (app->getCurrentScene()->getDirtyFlag()) sceneName += QString(" *");
    name = tr("Scene: ") + sceneName;
    if (frame >= 0)
      name =
          name + tr("   ::   Frame: ") + tr(std::to_string(frame + 1).c_str());
    int col = app->getCurrentColumn()->getColumnIndex();
    if (col < 0) {
      setWindowTitle(name);
      return;
    }
    TXsheet *xsh  = app->getCurrentXsheet()->getXsheet();
    TXshCell cell = xsh->getCell(frame, col);
    if (cell.isEmpty()) {
      setWindowTitle(name);
      return;
    }
    assert(cell.m_level.getPointer());
    TFilePath fp(cell.m_level->getName());
    QString imageName =
        QString::fromStdWString(fp.withFrame(cell.m_frameId).getWideString());
    name = name + tr("   ::   Level: ") + imageName;

    if (m_sceneViewer->isPreviewEnabled()) {
      name = name + "  ::  Zoom : " +
             QString::number((int)(100.0 *
                                   sqrt(m_sceneViewer->getViewMatrix().det()) *
                                   m_sceneViewer->getDpiFactor())) +
             "%";
    }

    // If the current level exists and some option is set in the preference,
    // set the zoom value to the current level's dpi
    else if (Preferences::instance()
                 ->isActualPixelViewOnSceneEditingModeEnabled() &&
             TApp::instance()->getCurrentLevel()->getSimpleLevel() &&
             !CleanupPreviewCheck::instance()
                  ->isEnabled()  // cleanup preview must be OFF
             &&
             !CameraTestCheck::instance()
                  ->isEnabled())  // camera test mode must be OFF neither
    {
      name = name + "  ::  Zoom : " +
             QString::number((int)(100.0 *
                                   sqrt(m_sceneViewer->getViewMatrix().det()) *
                                   m_sceneViewer->getDpiFactor())) +
             "%";
    }

  }
  // if the frame type is "level editing"
  else {
    TXshLevel *level = app->getCurrentLevel()->getLevel();
    if (level) {
      TFilePath fp(level->getName());
      QString imageName = QString::fromStdWString(
          fp.withFrame(app->getCurrentFrame()->getFid()).getWideString());

      name = name + tr("Level: ") + imageName;

      name = name + "  ::  Zoom : " +
             QString::number((int)(100.0 *
                                   sqrt(m_sceneViewer->getViewMatrix().det()) *
                                   m_sceneViewer->getDpiFactor())) +
             "%";
    }
  }
  setWindowTitle(name);
}
开发者ID:luc--,项目名称:opentoonz,代码行数:82,代码来源:comboviewerpane.cpp


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