コード例 #1
0
static void loadGrid(const SerializationNode& grid, std::vector< std::vector< std::vector<double> > >& gridVector) {

    const std::vector<SerializationNode>& gridSerializationRows  = grid.getChildren();
    gridVector.resize(gridSerializationRows.size());

    for (unsigned int ii = 0; ii < gridSerializationRows.size(); ii++) {
        const std::vector<SerializationNode>& gridSerializationColumns  = gridSerializationRows[ii].getChildren();
        gridVector[ii].resize(gridSerializationColumns.size());
        for (unsigned int jj = 0; jj < gridSerializationColumns.size(); jj++) {
            const SerializationNode& gridSerializationColumnNode = gridSerializationColumns[jj];
            gridVector[ii][jj].resize(6);
            gridVector[ii][jj][0] = gridSerializationColumnNode.getDoubleProperty("x");
            gridVector[ii][jj][1] = gridSerializationColumnNode.getDoubleProperty("y");
            gridVector[ii][jj][2] = gridSerializationColumnNode.getDoubleProperty("f");
            gridVector[ii][jj][3] = gridSerializationColumnNode.getDoubleProperty("fx");
            gridVector[ii][jj][4] = gridSerializationColumnNode.getDoubleProperty("fy");
            gridVector[ii][jj][5] = gridSerializationColumnNode.getDoubleProperty("fxy");
        }
    }
}
コード例 #2
0
void loadCovalentMap(const SerializationNode& map, std::vector< int >& covalentMap) {
    for (unsigned int ii = 0; ii < map.getChildren().size(); ii++) {
        covalentMap.push_back(map.getChildren()[ii].getIntProperty("v"));
    }
}