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") {
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 TStageObjectSpline::loadData(TIStream &is) { std::vector<TThickPoint> points; VersionNumber tnzVersion = is.getVersion(); if (tnzVersion < VersionNumber(1, 16)) { while (!is.eos()) { TThickPoint p; is >> p.x >> p.y >> p.thick; points.push_back(p); } } else {
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(); } }
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") {
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") {
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") {
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(); }
void TFarmTask::loadData(TIStream &is) { string tagName; while (is.matchTag(tagName)) { if (tagName == "taskId") { is >> m_id; } else if (tagName == "parentId") {
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; }
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
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") {
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; }
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(); }
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 ¶m) { 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
void TIntParam::loadData(TIStream &is) { int def, value; is >> def; if (is.eos()) { def += 1; setDefaultValue(def); setValue(def, false); return; } setDefaultValue(def); is >> value; setValue(value, false); }
/*! 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") {
void MessageGeneric::load(TIStream& in) { util::T_UI4 val; in >> val; m_commandType = val; unsigned int count = 0; in >> count; for (int i = 1; i <= count; i++){ unsigned int len = 0; in >> len; util::ScopedArray<char> buf(new char[len + 1]); memset(buf.get(), 0, len + 1); in.read(reinterpret_cast<unsigned char*>(buf.get()), len); m_params.push_back(buf.get()); } }
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(); }
void TExternalProgramFx::loadData(TIStream &is) { std::string tagName; while (is.openChild(tagName)) { if (tagName == "path") { is >> m_executablePath; } else if (tagName == "args") {
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