Ejemplo n.º 1
0
void TMacroFx::loadData(TIStream &is)
{
	VersionNumber tnzVersion = is.getVersion();
	string tagName;
	while (is.openChild(tagName)) {
		if (tagName == "root") {
			TPersist *p = 0;
			is >> p;
			m_root = dynamic_cast<TFx *>(p);
		} else if (tagName == "nodes") {
void TXshSoundTextColumn::loadData(TIStream &is)
{
	string tagName;
	while (is.openChild(tagName)) {
		if (tagName == "cells") {
			while (is.openChild(tagName)) {
				if (tagName == "cell") {
					TPersist *p = 0;
					int row = 1;
					int fidNumber = 1;
					TFilePath path;
					is >> row >> fidNumber >> p;
					TXshLevel *xshLevel = dynamic_cast<TXshLevel *>(p);
					TXshCell cell(xshLevel, TFrameId(fidNumber));
					setCell(row, cell);
				} else
					throw TException("TXshLevelColumn, unknown tag(2): " + tagName);
				is.closeChild();
			}
		} else
Ejemplo n.º 3
0
void ColumnLevel::loadData(TIStream &is)
{
	std::string tagName;
	is.openChild(tagName);
	if (tagName == "SoundCells") {
		TPersist *p = 0;
		is >> m_startOffset >> m_endOffset >> m_startFrame >> p;
		TXshSoundLevel *xshLevel = dynamic_cast<TXshSoundLevel *>(p);
		if (xshLevel)
			m_soundLevel = xshLevel;
	}
Ejemplo n.º 4
0
void TToneCurveParam::loadData(TIStream &is) {
  std::string tagName;
  is.openChild(tagName);
  assert(tagName == "tonecurve");
  m_rgbaParamSet->removeAllParam();
  m_rgbaParamSet->loadData(is);
  m_rgbParamSet->removeAllParam();
  m_rgbParamSet->loadData(is);
  m_rParamSet->removeAllParam();
  m_rParamSet->loadData(is);
  m_gParamSet->removeAllParam();
  m_gParamSet->loadData(is);
  m_bParamSet->removeAllParam();
  m_bParamSet->loadData(is);
  m_aParamSet->removeAllParam();
  m_aParamSet->loadData(is);
  is.openChild(tagName);
  m_isLinear->loadData(is);
  is.closeChild();
  is.closeChild();
}
Ejemplo n.º 5
0
void TRangeParam::loadData(TIStream &is)
{
	std::string childName;
	while (is.openChild(childName)) {
		if (childName == "min")
			m_data->m_min->loadData(is);
		else if (childName == "max")
			m_data->m_max->loadData(is);
		else
			throw TException("unknown tag");
		is.closeChild();
	}
}
Ejemplo n.º 6
0
void ShaderInterface::loadData(TIStream &is) {
  struct locals {
    inline static TFilePath getAbsolutePath(const TFilePath &file,
                                            const TFilePath &relTo) {
      QDir relToDir(
          QString::fromStdWString(relTo.getParentDir().getWideString()));
      QString absFileStr(relToDir.absoluteFilePath(
          QString::fromStdWString(file.getWideString())));
      return TFilePath(absFileStr.toStdWString());
    }

    static bool nameMatch(const QString &name, const Parameter &param) {
      return (name == param.m_name);
    }
  };

  std::string tagName;

  try {
    while (is.openChild(tagName)) {
      if (tagName == l_names[MAIN_PROGRAM]) {
        is >> m_mainShader;
        m_mainShader.m_type = QGLShader::Fragment;
        is.closeChild();
      } else if (tagName == l_names[INPUT_PORTS]) {
        while (is.openChild(tagName)) {
          if (tagName == l_names[INPUT_PORT]) {
            QString portName;
            is >> portName;

            m_ports.push_back(portName);

            is.closeChild();
          } else if (tagName == l_names[PORTS_PROGRAM]) {
            is >> m_portsShader;
            m_portsShader.m_type = QGLShader::Vertex;
            is.closeChild();
          } else
Ejemplo n.º 7
0
void TXshMeshColumn::loadData(TIStream &is) {
  std::string tagName;
  while (is.openChild(tagName)) {
    if (tagName == "status") {
      int status;
      is >> status;
      setStatusWord(status);
      if (status & eCamstandTransparent43) {
        setOpacity(128);
        status = status & ~eCamstandTransparent43;
      }

      is.closeChild();
    } else if (tagName == "camerastand_opacity") {
Ejemplo n.º 8
0
void TXsheet::loadData(TIStream &is) {
  clearAll();
  TStageObjectId cameraId   = TStageObjectId::CameraId(0);
  TStageObject *firstCamera = getStageObject(cameraId);
  m_imp->m_pegTree->removeStageObject(cameraId);

  int col = 0;
  string tagName;
  while (is.openChild(tagName)) {
    if (tagName == "columns") {
      while (!is.eos()) {
        TPersist *p = 0;
        is >> p;
        TXshColumn *column = dynamic_cast<TXshColumn *>(p);
        if (!column) throw TException("expected xsheet column");
        m_imp->m_columnSet.insertColumn(col++, column);
        column->setXsheet(this);
        if (TXshZeraryFxColumn *zc =
                dynamic_cast<TXshZeraryFxColumn *>(column)) {
          TFx *fx         = zc->getZeraryColumnFx()->getZeraryFx();
          int fxTypeCount = m_imp->m_fxDag->getFxTypeCount(fx);
          int maxFxTypeId = std::max(fxTypeCount, fx->getAttributes()->getId());
          m_imp->m_fxDag->updateFxTypeTable(fx, maxFxTypeId);
          m_imp->m_fxDag->updateFxIdTable(fx);
          for (int j = 0; j < fx->getParams()->getParamCount(); j++) {
            TParam *param = fx->getParams()->getParam(j);
            if (TDoubleParam *dp = dynamic_cast<TDoubleParam *>(param))
              getStageObjectTree()->setGrammar(dp);
            else if (dynamic_cast<TPointParam *>(param) ||
                     dynamic_cast<TRangeParam *>(param) ||
                     dynamic_cast<TPixelParam *>(param)) {
              TParamSet *paramSet = dynamic_cast<TParamSet *>(param);
              assert(paramSet);
              int f;
              for (f = 0; f < paramSet->getParamCount(); f++) {
                TDoubleParam *dp = dynamic_cast<TDoubleParam *>(
                    paramSet->getParam(f).getPointer());
                if (!dp) continue;
                getStageObjectTree()->setGrammar(dp);
              }
            }
          }
        }
      }
    } else if (tagName == "pegbars") {
      TPersist *p = m_imp->m_pegTree;
      is >> *p;
    } else if (tagName == "fxnodes") {
Ejemplo n.º 9
0
void TTextureMesh::loadData(TIStream &is) {
  typedef tcg::Mesh<vertex_type, edge_type, face_type> mesh_type;

  std::string str;
  int i, size;

  while (is.openChild(str)) {
    if (str == "V") {
      is >> size;

      m_vertices.reserve(size);
      TTextureMesh::vertex_type v;

      for (i = 0; i < size; ++i) {
        is >> v.P().x >> v.P().y;
        mesh_type::addVertex(v);
      }

      is.closeChild();
    } else if (str == "E") {
Ejemplo n.º 10
0
void TExternalProgramFx::loadData(TIStream &is) {
  std::string tagName;
  while (is.openChild(tagName)) {
    if (tagName == "path") {
      is >> m_executablePath;
    } else if (tagName == "args") {