コード例 #1
0
void Detector::addSpatialEntityTypeToPropertyTree(SpatialEntityPseudo3D &spatialEntity,
                                                  pt::ptree &propertyTree) {
    pt::ptree attributeTree;

    attributeTree.put<std::string>(LABEL_SPATIAL_ENTITY_SPATIAL_TYPE, spatialEntity.typeAsString());

    propertyTree.add_child(LABEL_ATTRIBUTE, attributeTree);
}
コード例 #2
0
void Detector::addNumericStateVariableToPropertyTree(pt::ptree &propertyTree,
                                                     const std::string &name, double value) {
    pt::ptree numericStateVariablePropertyTree;

    numericStateVariablePropertyTree.put<std::string>(LABEL_EXPERIMENT_TIMEPOINT_NUMERIC_STATE_VARIABLE_NAME, name);
    numericStateVariablePropertyTree.put<double>(LABEL_EXPERIMENT_TIMEPOINT_NUMERIC_STATE_VARIABLE_VALUE, value);

    propertyTree.add_child(LABEL_EXPERIMENT_TIMEPOINT_NUMERIC_STATE_VARIABLE, numericStateVariablePropertyTree);
}
コード例 #3
0
void Detector::addSpatialEntitiesToPropertyTree(pt::ptree &propertyTree) {
    std::vector<std::shared_ptr<SpatialEntityPseudo3D>> spatialEntities = getCollectionOfSpatialEntityPseudo3D();

    for (std::shared_ptr<SpatialEntityPseudo3D> &spatialEntityPointer : spatialEntities) {
        pt::ptree spatialEntityPropertyTree = constructSpatialEntityPropertyTree(*spatialEntityPointer);

        propertyTree.add_child(LABEL_EXPERIMENT_TIMEPOINT_SPATIAL_ENTITY, spatialEntityPropertyTree);
    }
}