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


C++ TIStream::matchTag方法代码示例

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


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

示例1: loadData

void TScannerParameters::loadData(TIStream &is) {
  std::string tagName;
  while (is.matchTag(tagName)) {
    if (tagName == "dpi") {
      std::string s                  = is.getTagAttribute("value");
      if (isDouble(s)) m_dpi.m_value = std::stof(s);
    } else if (tagName == "brightness") {
      std::string s                         = is.getTagAttribute("value");
      if (isDouble(s)) m_brightness.m_value = std::stof(s);
    } else if (tagName == "threshold") {
      std::string s                        = is.getTagAttribute("value");
      if (isDouble(s)) m_threshold.m_value = std::stof(s);
    } else if (tagName == "contrast") {
      std::string s                       = is.getTagAttribute("value");
      if (isDouble(s)) m_contrast.m_value = std::stof(s);
    } else if (tagName == "autoFeeder") {
      m_paperFeeder.m_value = 1.0;
    } else if (tagName == "reverseOrder") {
      m_reverseOrder = true;
    } else if (tagName == "mode") {
      std::string scanTypeString = is.getTagAttribute("value");
      m_scanType                 = None;
      if (scanTypeString == BlackAndWhite)
        m_scanType = BW;
      else if (scanTypeString == Graytones)
        m_scanType = GR8;
      else if (scanTypeString == Rgbcolors)
        m_scanType = RGB24;
    } else if (tagName == "paper") {
      std::string paperFormat = is.getTagAttribute("fmt");
      if (paperFormat != "") setPaperFormat(paperFormat);
    }
  }
  m_validatedByCurrentScanner = false;
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:35,代码来源:tscanner.cpp

示例2: loadData

void TFarmTask::loadData(TIStream &is)
{
	string tagName;
	while (is.matchTag(tagName)) {
		if (tagName == "taskId") {
			is >> m_id;
		} else if (tagName == "parentId") {
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:7,代码来源:tfarmtask.cpp

示例3: loadData

void TPinnedRangeSet::loadData(TIStream &is) {
  m_ranges.clear();
  int prevFrame = 0;
  int i         = 0;
  std::string tagName;
  int count = 0;
  while (is.matchTag(tagName) && count < 3) {
    if (tagName == "permanent") {
      while (!is.matchEndTag()) {
        i++;
        int frame = 0;
        is >> frame;
        if (i % 2 == 0) m_ranges.push_back(Range(prevFrame, frame));
        prevFrame = frame;
      }
      count++;
    } else if (tagName == "temp") {
      assert(0);
      // OBSOLETO
      while (!is.matchEndTag()) {
        int frame = 0;
        is >> frame;
        // m_tempPinned.push_back(frame);
      }
      count++;
    } else if (tagName == "lockedAngle") {
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:26,代码来源:tpinnedrangeset.cpp

示例4: loadData

void TXshZeraryFxColumn::loadData(TIStream &is)
{
	TPersist *p = 0;
	is >> p;
	if (!p)
		return;

	TZeraryColumnFx *fx = dynamic_cast<TZeraryColumnFx *>(p);
	fx->addRef();
	if (m_zeraryColumnFx) {
		m_zeraryColumnFx->setColumn(0);
		m_zeraryColumnFx->release();
	}
	m_zeraryColumnFx = fx;
	m_zeraryColumnFx->setColumn(this);

	int r0, r1;
	bool touched = false;
	const TXshCell cell(m_zeraryFxLevel, TFrameId(1));
	string tagName;
	while (is.matchTag(tagName)) {
		if (tagName == "status") {
			int status;
			is >> status;
			setStatusWord(status);
		} else if (tagName == "cells") {
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:26,代码来源:txshzeraryfxcolumn.cpp

示例5: loadData

/*! Set all scene properties elements, to information contained in \b TIStream \b is.
		\sa saveData()
*/
void TSceneProperties::loadData(TIStream &is, bool isLoadingProject)
{
	TSceneProperties defaultProperties;
	assign(&defaultProperties);

	int globFrom = -1, globTo = 0, globStep = 1;
	double globFrameRate = -1;
	std::string tagName;
	*m_outputProp = *m_previewProp = TOutputProperties();
	while (is.matchTag(tagName)) {
		if (tagName == "projectPath") {
			TFilePath projectPath;
			is >> projectPath;
		} else if (tagName == "range") {
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:17,代码来源:sceneproperties.cpp

示例6: loadData

void SkVD::loadData(TIStream &is)
{
	string tagName;

	while (is.matchTag(tagName)) {
		int p;
		for (p = 0; p < PARAMS_COUNT; ++p) {
			if (tagName == parNames[p]) {
				is >> *m_params[p], is.matchEndTag();
				break;
			}
		}

		if (p >= PARAMS_COUNT)
			is.skipCurrentTag();
	}
开发者ID:natowi,项目名称:opentoonz,代码行数:16,代码来源:plasticskeletondeformation.cpp

示例7: loadFolder

void TLevelSet::loadFolder(TIStream &is, TFilePath folder) {
  std::string s;
  is.getTagParam("type", s);
  if (s == "default") setDefaultFolder(folder);
  while (!is.eos()) {
    std::string tagName;
    is.matchTag(tagName);
    if (tagName == "levels") {
      while (!is.eos()) {
        TPersist *p = 0;
        is >> p;
        TXshLevel *xshLevel = dynamic_cast<TXshLevel *>(p);
        if (xshLevel && !xshLevel->getChildLevel())
          moveLevelToFolder(folder, xshLevel);
      }
    } else if (tagName == "folder") {
      is.getTagParam("name", s);
      TFilePath child = createFolder(folder, ::to_wstring(s));
      loadFolder(is, child);
    } else
      throw TException("expected <levels> or <folder>");
    is.closeChild();
  }
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:23,代码来源:levelset.cpp

示例8: loadData

void CleanupParameters::loadData(TIStream &is, bool globalParams)
{
	if (globalParams) {
		CleanupParameters cp;
		assign(&cp);
	}

	std::string tagName;
	m_lineProcessingMode = lpNone;
	m_noAntialias = false;
	m_postAntialias = false;

	while (is.matchTag(tagName)) {
		if (tagName == "cleanupPalette") {
			m_cleanupPalette->loadData(is);
			m_cleanupPalette->setIsCleanupPalette(true);
			is.closeChild();
		} else if (tagName == "cleanupCamera") {
			m_camera.loadData(is);
			is.closeChild();
		} else if (tagName == "autoCenter") {
			m_autocenterType = AUTOCENTER_FDG;
			std::string s = is.getTagAttribute("type");
			if (s != "" && isInt(s))
				m_autocenterType = (AUTOCENTER_TYPE)toInt(s);
			s = is.getTagAttribute("pegHoles");
			if (s != "" && isInt(s))
				m_pegSide = (PEGS_SIDE)toInt(s);
		} else if (tagName == "transform") {
			std::string s = is.getTagAttribute("flip");
			m_flipx = (s.find("x") != std::string::npos);
			m_flipy = (s.find("y") != std::string::npos);
			s = is.getTagAttribute("rotate");
			if (s != "" && isInt(s))
				m_rotate = toInt(s);
			s = is.getTagAttribute("xoff");
			if (s != "" && isDouble(s))
				m_offx = toDouble(s);
			s = is.getTagAttribute("yoff");
			if (s != "" && isDouble(s))
				m_offy = toDouble(s);
		} else if (tagName == "lineProcessing") {
			m_lineProcessingMode = lpGrey;
			std::string s = is.getTagAttribute("sharpness");
			if (s != "" && isDouble(s))
				m_sharpness = toDouble(s);
			s = is.getTagAttribute("autoAdjust");
			if (s != "" && isDouble(s))
				m_autoAdjustMode = (CleanupTypes::AUTO_ADJ_MODE)toInt(s);
			s = is.getTagAttribute("mode");
			if (s != "" && s == "color")
				m_lineProcessingMode = lpColor;
		} else if (tagName == "despeckling") {
			std::string s = is.getTagAttribute("value");
			if (s != "" && isInt(s))
				m_despeckling = toInt(s);
		} else if (tagName == "aaValue") {
			std::string s = is.getTagAttribute("value");
			if (s != "" && isInt(s))
				m_aaValue = toInt(s);
		} else if (tagName == "noAntialias")
			m_noAntialias = true;
		else if (tagName == "MLAA")
			m_postAntialias = true;
		else if (tagName == "closestField") {
			std::string s = is.getTagAttribute("value");
			if (s != "" && isDouble(s))
				m_closestField = toDouble(s);
		} else if (tagName == "fdg") {
			std::string s = is.getTagAttribute("name");
			if (s != "")
				setFdgByName(s);
		} else if (tagName == "path") {
			is >> m_path;
			is.closeChild();
		} else
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:76,代码来源:cleanupparameters.cpp


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