Example #1
0
/**
 * Load Road Network Data
 */
void loadData(char *path)
{
	readBuffer = (char *)malloc(nowSize);
	LoadNode(path);
	LoadEdge(path);
	LoadNet(path);
}
Example #2
0
void JSONGraphReader::LoadEdges( Graph * graph, QScriptValue value ){
    QScriptValueIterator verIt(value.property("vers"));
    QListIterator<Ver*> i(graph->vers());
    while (verIt.hasNext()) {
        verIt.next();
        Ver * v = i.next();
        if( ! verIt.value().isObject() )
            continue;

        QString id = verIt.value().property("id").toString();
        QScriptValueIterator edgeIt(verIt.value().property("edges"));
        while(edgeIt.hasNext()){
            edgeIt.next();
            if( !edgeIt.value().isObject() )
                continue;
//            try{
                Edge * edge = LoadEdge( graph, edgeIt.value(),v);
                graph->AddEdge(edge);
//            }catch(ReaderError & e){
//                qDebug()<<e.message();
//            }
        }
    }
}