本文整理汇总了C++中Mapping::get方法的典型用法代码示例。如果您正苦于以下问题:C++ Mapping::get方法的具体用法?C++ Mapping::get怎么用?C++ Mapping::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mapping
的用法示例。
在下文中一共展示了Mapping::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreProperties
void EditableSceneBodyImpl::restoreProperties(const Archive& archive)
{
Listing& states = *archive["editableSceneBodies"].toListing();
for(int i=0; i < states.size(); ++i){
Mapping* state = states[i].toMapping();
BodyItem* bodyItem = archive.findItem<BodyItem>(state->find("bodyItem"));
if(bodyItem){
EditableSceneBodyImpl* impl = bodyItem->sceneBody()->impl;
impl->showCenterOfMass(state->get("showCenterOfMass", impl->isCmVisible));
impl->showZmp(state->get("showZmp", impl->isZmpVisible));
}
}
}
示例2: restore
bool PoseSeq::restore(const Mapping& archive, const BodyPtr body)
{
setTargetBodyName(archive.get("targetBody", body->name()));
const Listing& refs = *archive.findListing("refs");
if(!refs.isValid()){
return false;
}
PoseSeq::iterator current = begin();
for(int i=0; i < refs.size(); ++i){
const Mapping& ref = *refs[i].toMapping();
bool isInserted = false;
double time = ref["time"].toDouble();
const ValueNode& referred = ref["refer"];
if(referred.isScalar()){
const string& name = referred;
if(!name.empty()){
current = insert(current, time, name);
isInserted = true;
}
} else if(referred.isMapping()){
const Mapping& mReferred = *referred.toMapping();
const string& type = mReferred["type"];
PoseUnitPtr poseUnit;
if(type == "Pose"){
poseUnit = new Pose();
} else if(type == "PronunSymbol"){
poseUnit = new PronunSymbol();
}
/*
else if(type == "PoseSeq"){
poseUnit = createLocalPoseSeq();
}
*/
if(poseUnit && poseUnit->restore(mReferred, body)){
poseUnit->name_ = mReferred["name"];
current = insert(current, time, poseUnit);
isInserted = true;
}
}
if(isInserted){
current->setMaxTransitionTime(ref.get("maxTransitionTime", 0.0));
}
}
return true;
}
示例3: readOverrides
void Archive::readOverrides() {
// Iterate over all files in the directory and override the table of contents
// if there is a free SEENXXXX.TXT file.
fs::path seen_dir = fs::path(name).branch_path();
fs::directory_iterator end;
for (fs::directory_iterator it(seen_dir); it != end; ++it) {
string filename = it->leaf();
if (filename.size() == 12 &&
istarts_with(filename, "seen") &&
iends_with(filename, ".txt") &&
isdigit(filename[4]) &&
isdigit(filename[5]) &&
isdigit(filename[6]) &&
isdigit(filename[7])) {
Mapping* mapping = new Mapping((seen_dir / filename).string(), Read);
maps_to_delete_.push_back(mapping);
int index = lexical_cast<int>(filename.substr(4, 4));
scenarios[index] = FilePos(mapping->get(), mapping->size());
}
}
}
示例4: restore
void ConfigDialog::restore(const Mapping& archive)
{
viewMarkerCheck.setChecked(archive.get("showViewMarker", viewMarkerCheck.isChecked()));
directoryEntry.setText(archive.get("directory", directoryEntry.string()));
basenameEntry.setText(archive.get("basename", basenameEntry.string()));
startTimeCheck.setChecked(archive.get("checkStartTime", startTimeCheck.isChecked()));
startTimeSpin.setValue(archive.get("startTime", startTimeSpin.value()));
finishTimeCheck.setChecked(archive.get("checkFinishTime", finishTimeCheck.isChecked()));
finishTimeSpin.setValue(archive.get("finishTime", finishTimeSpin.value()));
fpsSpin.setValue(archive.get("fps", fpsSpin.value()));
imageSizeCheck.setChecked(archive.get("setSize", imageSizeCheck.isChecked()));
imageWidthSpin.setValue(archive.get("width", imageWidthSpin.value()));
imageHeightSpin.setValue(archive.get("height", imageHeightSpin.value()));
mouseCursorCheck.setChecked(archive.get("mouseCursor", mouseCursorCheck.isChecked()));
}
示例5: restoreState
bool Task::restoreState(AbstractTaskSequencer* sequencer, const Mapping& archive)
{
sequencer->setCurrentPhase(archive.get("phaseIndex", 0));
return true;
}