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


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

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


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

示例1: onLevelColorStyleSwitched

void TApp::onLevelColorStyleSwitched() {
  TPaletteHandle *ph = m_paletteController->getCurrentLevelPalette();
  assert(ph);

  if (ToonzCheck::instance()->setColorIndex(ph->getStyleIndex())) {
    ToonzCheck *tc = ToonzCheck::instance();
    int mask       = tc->getChecks();

    if (mask & ToonzCheck::eInk || mask & ToonzCheck::ePaint) {
      IconGenerator::Settings s;
      s.m_blackBgCheck      = mask & ToonzCheck::eBlackBg;
      s.m_transparencyCheck = mask & ToonzCheck::eTransparency;
      s.m_inksOnly          = mask & ToonzCheck::eInksOnly;
      s.m_inkIndex   = mask & ToonzCheck::eInk ? tc->getColorIndex() : -1;
      s.m_paintIndex = mask & ToonzCheck::ePaint ? tc->getColorIndex() : -1;

      IconGenerator::instance()->setSettings(s);

      TXshLevel *sl = m_currentLevel->getLevel();
      if (!sl) return;

      std::vector<TFrameId> fids;
      sl->getFids(fids);

      for (int i = 0; i < (int)fids.size(); i++)
        IconGenerator::instance()->invalidate(sl, fids[i]);

      m_currentLevel->notifyLevelViewChange();
    }

    /*-- 表示オプションが切り替わっただけなので、DirtyFlagを立てない --*/
    m_currentScene->notifySceneChanged(false);
  }
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:34,代码来源:tapp.cpp

示例2: undo

 void undo() const override {
   TXshLevel *level = m_levelHandle->getLevel();
   if (level) {
     std::vector<TFrameId> fids;
     level->getFids(fids);
     invalidateIcons(level, fids);
   }
 }
开发者ID:jcome,项目名称:opentoonz,代码行数:8,代码来源:studiopaletteviewer.cpp

示例3: onXshLevelChanged

void TApp::onXshLevelChanged() {
  TXshLevel *level = m_currentLevel->getLevel();
  std::vector<TFrameId> fids;
  if (level != 0) level->getFids(fids);
  m_currentFrame->setFrameIds(fids);
  // update current tool
  m_currentTool->onImageChanged((TImage::Type)getCurrentImageType());
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:8,代码来源:tapp.cpp

示例4: onLevelSwitched

void Filmstrip::onLevelSwitched(TXshLevel *oldLevel) {
  updateWindowTitle();

  int tc = ToonzCheck::instance()->getChecks();
  if (tc & (ToonzCheck::eInk | ToonzCheck::ePaint)) {
    TXshLevel *sl = TApp::instance()->getCurrentLevel()->getLevel();
    if (!sl) return;
    std::vector<TFrameId> fids;
    sl->getFids(fids);
    removeIcons(sl, fids, true);
  }
  update();
}
开发者ID:jcome,项目名称:opentoonz,代码行数:13,代码来源:filmstrip.cpp

示例5: loadInCurrentPalette

void StudioPaletteTreeViewer::loadInCurrentPalette() {
  QList<QTreeWidgetItem *> items = selectedItems();
  int count                      = items.size();
  if (count == 0) return;

  TPalette *palette = m_levelPaletteHandle->getPalette();
  if (!palette) return;

  if (palette->isLocked()) {
    DVGui::warning("Palette is Locked!");
    return;
  }

  TPalette *newPalette =
      StudioPalette::instance()->getPalette(getItemPath(items[0]), false);
  if (!newPalette) return;
  if (m_xsheetHandle) {
    int ret = DVGui::eraseStylesInDemand(palette, m_xsheetHandle, newPalette);
    if (ret == 0) return;
  }

  StudioPaletteCmd::loadIntoCurrentPalette(m_levelPaletteHandle, newPalette);
  m_currentLevelHandle->notifyLevelChange();

  TXshLevel *level = m_currentLevelHandle->getLevel();
  if (level) {
    std::vector<TFrameId> fids;
    level->getFids(fids);
    invalidateIcons(level, fids);
  }

  int i;
  for (i = 1; i < count; i++) {
    TFilePath path = getItemPath(items[i]);
    StudioPaletteCmd::mergeIntoCurrentPalette(m_levelPaletteHandle, path);
  }
  // in order to update the title bar of palette viewer
  m_levelPaletteHandle->getPalette()->setDirtyFlag(true);
  m_levelPaletteHandle->notifyPaletteChanged();
}
开发者ID:jcome,项目名称:opentoonz,代码行数:40,代码来源:studiopaletteviewer.cpp

示例6: mergeColumns


//.........这里部分代码省略.........
	std::map<TFrameId, QString> images;

	for (int i = 0; i < (int)cell.size(); i++) {
		if (cell[i].isEmpty() || mCell[i].isEmpty())
			continue;
		if (!level) {
			level = cell[i].getSimpleLevel();
			xl = cell[i].m_level;
		}

		else if (level != cell[i].getSimpleLevel()) {
			MsgBox(WARNING, QObject::tr("It is not possible to perform a merging involving more than one level per column."));
			return;
		}

		if (!mLevel)
			mLevel = mCell[i].getSimpleLevel();
		else if (mLevel != mCell[i].getSimpleLevel()) {
			MsgBox(WARNING, QObject::tr("It is not possible to perform a merging involving more than one level per column."));
			return;
		}
		TImageP img = cell[i].getImage(true);
		TImageP match = mCell[i].getImage(false);
		TFrameId fid = cell[i].m_frameId;
		TFrameId mFid = mCell[i].m_frameId;

		if (!img || !match)
			continue;

		if (alreadyDoneSet.find(fid) == alreadyDoneSet.end()) {
			TRasterImageP timg = (TRasterImageP)img;
			TRasterImageP tmatch = (TRasterImageP)match;
			TVectorImageP vimg = (TVectorImageP)img;
			TVectorImageP vmatch = (TVectorImageP)match;

			if (timg) {
				if (!tmatch) {
					MsgBox(WARNING, QObject::tr("Only raster levels can be merged to a raster level."));
					return;
				}
				areRasters = true;
			} else if (vimg) {
				if (!vmatch) {
					MsgBox(WARNING, QObject::tr("Only vector levels can be merged to a vector level."));
					return;
				}
			} else {
				MsgBox(WARNING, QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels."));
				return;
			}

			QString id = "MergeColumnsUndo" + QString::number(MergeColumnsSessionId) + "-" + QString::number(fid.getNumber());
			TImageCache::instance()->add(id, (timg) ? timg->cloneImage() : vimg->cloneImage());
			images[fid] = id;
			TAffine imgAff, matchAff;
			getColumnPlacement(imgAff, xsh, start + i, column, false);
			getColumnPlacement(matchAff, xsh, start + i, mColumn, false);
			TAffine dpiAff = getDpiAffine(level, fid);
			TAffine mdpiAff = getDpiAffine(mLevel, mFid);
			matchingLevels.push_back(MatchlinePair(cell[i], imgAff * dpiAff, mCell[i], matchAff * mdpiAff));
			alreadyDoneSet.insert(fid);
		}
	}

	if (matchingLevels.empty()) {
		MsgBox(WARNING, QObject::tr("It is possible to merge only Toonz vector levels or standard raster levels."));
		return;
	}

	ToonzScene *sc = TApp::instance()->getCurrentScene()->getScene();
	TXshSimpleLevel *simpleLevel = sc->getLevelSet()->getLevel(column)->getSimpleLevel();

	if (!isRedo)
		TUndoManager::manager()->add(new MergeColumnsUndo(xl, MergeColumnsSessionId,
														  column, level, images,
														  mColumn, level->getPalette()));

	if (areRasters) {
		mergeRasterColumns(matchingLevels);
		for (int i = 0; i < (int)cell.size(); i++) //the saveboxes must be updated
		{
			if (cell[i].isEmpty() || mCell[i].isEmpty())
				continue;

			if (!cell[i].getImage(false) || !mCell[i].getImage(false))
				continue;

			ToolUtils::updateSaveBox(cell[i].getSimpleLevel(), cell[i].m_frameId);
		}
	} else
		mergeVectorColumns(matchingLevels);

	TXshLevel *sl = TApp::instance()->getCurrentScene()->getScene()->getLevelSet()->getLevel(column);
	vector<TFrameId> fidsss;
	sl->getFids(fidsss);
	invalidateIcons(sl, fidsss);
	sl->setDirtyFlag(true);
	level->setDirtyFlag(true);
	TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
开发者ID:guozanhua,项目名称:opentoonz,代码行数:101,代码来源:mergecolumns.cpp

示例7: mousePressEvent

void FilmstripFrames::mousePressEvent(QMouseEvent *event) {
  m_selecting  = false;
  int index    = y2index(event->pos().y());
  TFrameId fid = index2fid(index);

  TXshSimpleLevel *sl = getLevel();
  int i0              = y2index(0);
  int frameHeight = m_iconSize.height() + fs_frameSpacing + fs_iconMarginTop +
                    fs_iconMarginBottom;
  QPoint clickedPos = event->pos() - QPoint(0, (index - i0) * frameHeight);

  if (event->button() == Qt::LeftButton) {
    if (fid == TFrameId()) return;

    ComboViewerPanel *inknPaintViewerPanel =
        TApp::instance()->getInknPaintViewerPanel();

    // navigator pan
    if (fid == TApp::instance()->getCurrentFrame()->getFid() &&
        sl->getType() == TZP_XSHLEVEL && inknPaintViewerPanel &&
        inknPaintViewerPanel->isVisible() &&
        QRect(QPoint(fs_leftMargin + fs_iconMarginLR,
                     fs_frameSpacing / 2 +
                         fs_iconMarginTop)  //<- top-left position of the icon
              ,
              m_iconSize)
            .contains(clickedPos)) {
      m_isNavigatorPanning = true;
      execNavigatorPan(event->pos());
      QApplication::setOverrideCursor(Qt::ClosedHandCursor);
    } else
      m_isNavigatorPanning = false;

    if (event->modifiers() & Qt::ShiftModifier) {
      select(index, SHIFT_SELECT);
      if (m_selection->isSelected(fid)) {
        // click su di un frame gia' selezionato. Puo' essere l'inizio di un
        // drag'n'drop
        m_dragDropArmed = true;
        m_pos           = event->pos();
      }
    } else if (event->modifiers() & Qt::ControlModifier)
      select(index, CTRL_SELECT);
    // inbetween
    else if (sl->getType() == PLI_XSHLEVEL &&
             m_selection->isInInbetweenRange(fid) &&
             event->pos().x() > width() - 20 - fs_rightMargin) {
      inbetween();
    } else {
      // move current frame when clicked without modifier
      TApp *tapp = TApp::instance();
      std::vector<TFrameId> fids;
      TXshLevel *level = tapp->getCurrentLevel()->getLevel();
      level->getFids(fids);

      tapp->getCurrentFrame()->setFrameIds(fids);
      tapp->getCurrentFrame()->setFid(fid);

      if (!m_selection->isSelected(fid))  // selezione semplice
      {
        // click su un frame non selezionato
        m_selecting = true;  // posso estendere la selezione con il drag
        select(index, START_DRAG_SELECT);
      } else if (m_selection->isSelected(fid)) {
        // click su di un frame gia' selezionato. Puo' essere l'inizio di un
        // drag'n'drop
        m_dragDropArmed = true;
        m_pos           = event->pos();
      }
    }
    update();
  } else if (event->button() == Qt::MidButton) {
    m_pos = event->globalPos();
    return;
  } else if (event->button() == Qt::RightButton) {
    select(index);
  }
}
开发者ID:jcome,项目名称:opentoonz,代码行数:78,代码来源:filmstrip.cpp


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