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


C++ XmlSerializer::getDocumentPath方法代码示例

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


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

示例1: serialize

void OpenCLSource::serialize(XmlSerializer& s) const {
    s.serialize("programModified", programModified_);
    std::string relPath = tgt::FileSystem::relativePath(tgt::FileSystem::dirName(programFilename_),
        tgt::FileSystem::dirName(s.getDocumentPath()));
    std::string relProgramFilename = relPath + "/" + tgt::FileSystem::fileName(programFilename_);
    s.serialize("programFilename", relProgramFilename);
    if (programModified_)
        s.serialize("programSource", programSource_);
}
开发者ID:151706061,项目名称:Voreen,代码行数:9,代码来源:openclproperty.cpp

示例2: serialize

void VolumeURLProperty::serialize(XmlSerializer& s) const {
    Property::serialize(s);

    std::string relativeURL;
    if (!value_.empty()) {
        std::string basePath = tgt::FileSystem::dirName(s.getDocumentPath());
        relativeURL = VolumeURL::convertURLToRelativePath(value_, basePath);
    }
    s.serialize("url", relativeURL);
}
开发者ID:151706061,项目名称:Voreen,代码行数:10,代码来源:volumeurlproperty.cpp

示例3: serialize

void FileDialogProperty::serialize(XmlSerializer& s) const {
    Property::serialize(s);

    // convert path to an relative one with respect to the document's path
    std::string path = value_;
    if (path.empty())
        s.serialize("noPathSet", true);
    else
        s.serialize("noPathSet", false);

    if (!path.empty() && !s.getDocumentPath().empty())
        path = tgt::FileSystem::relativePath(path, tgt::FileSystem::dirName(s.getDocumentPath()));

    // cleanup path: replace backslashes
    std::string::size_type pos = path.find("\\");
    while (pos != std::string::npos) {
        path[pos] = '/';
        pos = path.find("\\");
    }

    s.serialize("value", path);
}
开发者ID:MKLab-ITI,项目名称:gnorasi,代码行数:22,代码来源:filedialogproperty.cpp

示例4: serialize

void PlotEntitySettings::serialize(XmlSerializer& s) const {
    s.serialize("entity", static_cast<int>(entity_));
    s.serialize("colorMap", colorMap_);
    s.serialize("mainColumnIndex", mainColumnIndex_);
    s.serialize("candleTopColumnIndex", candleTopColumnIndex_);
    s.serialize("candleBottomColumnIndex", candleBottomColumnIndex_);
    s.serialize("stickTopColumnIndex", stickTopColumnIndex_);
    s.serialize("stickBottomColumnIndex", stickBottomColumnIndex_);
    s.serialize("optionalCI", optionalColumnIndex_);
    s.serialize("secondOptionalCI", secondOptionalColumnIndex_);
    s.serialize("firstColor", firstColor_);
    s.serialize("secondColor", secondColor_);
    s.serialize("lineStyle", static_cast<int>(lineStyle_));
    s.serialize("splineFlag", splineFlag_);
    s.serialize("errorbarFlag", errorbarFlag_);
    s.serialize("wireOnlyFlag", wireOnlyFlag_);
    s.serialize("heightmapFlag", heightmapFlag_);
    s.serialize("candleStickFlag", candleStickFlag_);
    s.serialize("minGlyphSize", minGlyphSize_);
    s.serialize("maxGlyphSize", maxGlyphSize_);
    s.serialize("glyphStyle", static_cast<int>(glyphStyle_));

    //see FileDialogProperty
    // convert path to an relative one with respect to the document's path
    std::string path = texturePath_;
    if (!path.empty() && !s.getDocumentPath().empty())
        path = tgt::FileSystem::relativePath(path, tgt::FileSystem::dirName(s.getDocumentPath()));

    // cleanup path: replace backslashes
    std::string::size_type pos = path.find("\\");
    while (pos != std::string::npos) {
        path[pos] = '/';
        pos = path.find("\\");
    }
    s.serialize("texturePath", path);
    s.serialize("useTextureFlag", useTextureFlag_);
}
开发者ID:bsmr-opengl,项目名称:voreen,代码行数:37,代码来源:plotentitysettings.cpp

示例5: serialize

void VolumeURLListProperty::serialize(XmlSerializer& s) const {
    Property::serialize(s);

    std::vector<std::string> urlList = value_;
    std::map<std::string, bool> selectMap = selectionMap_;

    // convert URLs to relative path
    std::string basePath = tgt::FileSystem::dirName(s.getDocumentPath());
    for (size_t i=0; i<urlList.size(); i++) {
        std::string url = urlList[i];
        std::string urlConv = VolumeURL::convertURLToRelativePath(url, basePath);
        urlList[i] = urlConv;
        if (selectMap.find(url) != selectMap.end()) {
            bool selected = selectMap[url];
            selectMap.erase(url);
            selectMap.insert(std::pair<std::string, bool>(urlConv, selected));
        }
    }

    s.serialize("VolumeURLs", urlList, "url");
    s.serialize("Selection", selectMap, "entry", "url");
}
开发者ID:151706061,项目名称:Voreen,代码行数:22,代码来源:volumeurllistproperty.cpp


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