Ejemplo n.º 1
0
/*!
 * Writes entire VTK file (headers and data).
 */
void VTK::write( ){

    getMissingMetaData() ;

    calcAppendedOffsets() ;

    writeMetaData() ;
    writeData() ;

    if( nr_procs > 1  && my_proc == 0)  writeCollection() ;

    fh.incrementCounter() ;

    return ;
};
Ejemplo n.º 2
0
void writeDocument(Document* doc) {
	int n;
	startSBOLDocument();

	// write collections
	Collection* col;
	for (n=0; n<getNumCollections(doc); n++) {
		col = getNthCollection(doc, n);
		if (!alreadyProcessed((void *)col))
			writeCollection(col);
	}

	// write components
	DNAComponent* com;
	for (n=0; n<getNumDNAComponents(doc); n++) {
		com = getNthDNAComponent(doc, n);
		if (!alreadyProcessed((void *)com))
			writeDNAComponent(com);
	}

	// At this point there shouldn't be anything left.
	// But in case there are orphaned DNASequences or
	// SequenceAnnotations, SBOL will write them out anyway
	// and fail the schema validation.
	
	// write orphaned sequences
	DNASequence* seq;
	for (n=0; n<getNumDNASequences(doc); n++) {
		seq = getNthDNASequence(doc, n);
		if (!alreadyProcessed((void *)seq))
			writeDNASequence(seq);
	}
	
	// write orphaned sequence annotations
	SequenceAnnotation* ann;
	for (n=0; n<getNumSequenceAnnotations(doc); n++) {
		ann = getNthSequenceAnnotation(doc, n);
		if (!alreadyProcessed((void *)ann))
			writeSequenceAnnotation(ann);
	}

	endSBOLDocument();
}