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


C++ Mapping::get方法代码示例

本文整理汇总了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));
        }
    }
}
开发者ID:orikuma,项目名称:choreonoid,代码行数:13,代码来源:EditableSceneBody.cpp

示例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;
}
开发者ID:kayusawa,项目名称:choreonoid,代码行数:55,代码来源:PoseSeq.cpp

示例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());
    }
  }

}
开发者ID:KitsuneFox89,项目名称:rlvm,代码行数:23,代码来源:archive.cpp

示例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()));
}
开发者ID:kayusawa,项目名称:choreonoid,代码行数:15,代码来源:MovieRecorder.cpp

示例5: restoreState

bool Task::restoreState(AbstractTaskSequencer* sequencer, const Mapping& archive)
{
    sequencer->setCurrentPhase(archive.get("phaseIndex", 0));
    return true;
}
开发者ID:arntanguy,项目名称:choreonoid,代码行数:5,代码来源:Task.cpp


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