示例#1
0
void DrawTool::parseGroup(xercesc::DOMElement * parentNode, crispr::xml::parser& xmlParser)
{

    
    // create a new graph object
    char * c_gid = tc(parentNode->getAttribute(xmlParser.attr_Gid()));
    crispr::graph * current_graph = new crispr::graph(c_gid);
    xr(&c_gid);
    // change the max and min coverages back to their original values
    resetInitialLimits();
    
    DT_Graphs.push_back(current_graph);
    for (xercesc::DOMElement * currentElement = parentNode->getFirstElementChild(); 
         currentElement != NULL; 
         currentElement = currentElement->getNextElementSibling()) {
        
        if (xercesc::XMLString::equals(currentElement->getTagName(), xmlParser.tag_Data())) {
            parseData(currentElement, xmlParser, current_graph);
            setColours();
        } else if (xercesc::XMLString::equals(currentElement->getTagName(), xmlParser.tag_Assembly())) {
            parseAssembly(currentElement, xmlParser, current_graph);
        }
        
    }
    
    char * c_file_prefix = tc(parentNode->getAttribute(xmlParser.attr_Gid()));
    std::string file_prefix = c_file_prefix;
    std::string file_name = file_prefix + "." + DT_OutputFormat;
    xr(&c_file_prefix);
    char * file_name_c = strdup(file_name.c_str());

    layoutGraph(current_graph->getGraph(), DT_RenderingAlgorithm);
    renderGraphToFile(current_graph->getGraph(), DT_OutputFormat, file_name_c);
    freeLayout(current_graph->getGraph());
    // free the duplicated string
    try {
        delete file_name_c;
    } catch (std::exception& e) {
        std::cerr<<e.what()<<std::endl;
    }
}
示例#2
0
文件: Trace.cpp 项目: nealey/vera
void Trace::layoutGraph(wxString infile)
{
	layoutGraph(infile.ToAscii(), (const char *) outputfile);
}
示例#3
0
文件: Trace.cpp 项目: nealey/vera
void Trace::layoutGraph(const char *infile)
{
	layoutGraph(infile, (const char *) outputfile);
}