本文整理汇总了C++中XmlDeserializer::getDocumentPath方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlDeserializer::getDocumentPath方法的具体用法?C++ XmlDeserializer::getDocumentPath怎么用?C++ XmlDeserializer::getDocumentPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlDeserializer
的用法示例。
在下文中一共展示了XmlDeserializer::getDocumentPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
void FileDialogProperty::deserialize(XmlDeserializer& s) {
Property::deserialize(s);
// An empty serialized value does not necessarily mean that it wasn't set, but could also mean that it was the
// same path as the document path passed during serialization, which makes the relative path empty. We need an
// extra bool to remember if this was the case.
try {
bool noPathSet;
s.deserialize("noPathSet", noPathSet);
if(noPathSet) {
set("");
return;
}
}
catch (XmlSerializationNoSuchDataException) {
s.removeLastError();
}
std::string value;
s.deserialize("value", value);
// convert path relative to the document's path to an absolute one
if (!s.getDocumentPath().empty())
value = tgt::FileSystem::absolutePath(tgt::FileSystem::dirName(s.getDocumentPath()) + "/" + value);
try {
set(value);
}
catch (Condition::ValidationFailed& e) {
s.addError(e);
}
}
示例2: deserialize
void PlotEntitySettings::deserialize(XmlDeserializer& s) {
int value;
s.deserialize("entity", value);
entity_ = static_cast<Entity>(value);
s.deserialize("colorMap", colorMap_);
s.deserialize("mainColumnIndex", mainColumnIndex_);
s.deserialize("candleTopColumnIndex", candleTopColumnIndex_);
s.deserialize("candleBottomColumnIndex", candleBottomColumnIndex_);
s.deserialize("stickTopColumnIndex", stickTopColumnIndex_);
s.deserialize("stickBottomColumnIndex", stickBottomColumnIndex_);
s.deserialize("optionalCI", optionalColumnIndex_);
s.deserialize("secondOptionalCI", secondOptionalColumnIndex_);
s.deserialize("firstColor", firstColor_);
s.deserialize("secondColor", secondColor_);
s.deserialize("lineStyle", value);
lineStyle_ = static_cast<LineStyle>(value);
s.deserialize("splineFlag", splineFlag_);
s.deserialize("errorbarFlag", errorbarFlag_);
s.deserialize("wireOnlyFlag", wireOnlyFlag_);
s.deserialize("heightmapFlag", heightmapFlag_);
s.deserialize("candleStickFlag", candleStickFlag_);
s.deserialize("minGlyphSize", minGlyphSize_);
s.deserialize("maxGlyphSize", maxGlyphSize_);
s.deserialize("glyphStyle", value);
glyphStyle_ = static_cast<GlyphStyle>(value);
//see FileDialogProperty
s.deserialize("texturePath", texturePath_);
// convert path relative to the document's path to an absolute one
if (!texturePath_.empty() && !s.getDocumentPath().empty())
texturePath_ = tgt::FileSystem::absolutePath(
tgt::FileSystem::dirName(s.getDocumentPath()) + "/" + texturePath_);
s.deserialize("useTextureFlag", useTextureFlag_);
}
示例3: deserialize
void VolumeURLListProperty::deserialize(XmlDeserializer& s) {
Property::deserialize(s);
std::vector<std::string> urlList = value_;
std::map<std::string, bool> selectMap = selectionMap_;
s.deserialize("VolumeURLs", urlList, "url");
try {
s.deserialize("Selection", selectMap, "entry", "url");
}
catch (SerializationException& e) {
s.removeLastError();
LWARNING("Failed to deserialize selection map: " << e.what());
}
// convert URLs to absolute 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::convertURLToAbsolutePath(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));
}
}
value_ = urlList;
selectionMap_ = selectMap;
invalidate();
}
示例4: deserialize
void OpenCLSource::deserialize(XmlDeserializer& s) {
//current format:
s.deserialize("programModified", programModified_);
s.deserialize("programFilename", programFilename_);
programFilename_ = tgt::FileSystem::absolutePath(
tgt::FileSystem::dirName(s.getDocumentPath())) + "/" + programFilename_;
if (programModified_)
s.deserialize("programSource", programSource_);
}
示例5: deserialize
void VolumeURLProperty::deserialize(XmlDeserializer& s) {
std::string relativeURL;
s.deserialize("url", relativeURL);
if (relativeURL.empty())
value_ = "";
else {
std::string basePath = tgt::FileSystem::dirName(s.getDocumentPath());
value_ = VolumeURL::convertURLToAbsolutePath(relativeURL, basePath);
}
Property::deserialize(s);
}