[Dda-cvs] ntdda/src geometrydata.c,1.20,1.21 joint.c,1.4,1.5
Status: Beta
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2006-08-01 06:16:32
|
Update of /cvsroot/dda/ntdda/src In directory sc8-pr-cvs12.sourceforge.net:/tmp/cvs-serv5641/src Modified Files: geometrydata.c joint.c Log Message: Added some dialog files. Added some code to clean up xml output. Index: joint.c =================================================================== RCS file: /cvsroot/dda/ntdda/src/joint.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** joint.c 1 Aug 2006 05:26:10 -0000 1.4 --- joint.c 1 Aug 2006 06:16:28 -0000 1.5 *************** *** 15,19 **** // Some indentation. #ifndef I2 ! #define I2 " " #endif --- 15,19 ---- // Some indentation. #ifndef I2 ! #define I2 " " #endif Index: geometrydata.c =================================================================== RCS file: /cvsroot/dda/ntdda/src/geometrydata.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** geometrydata.c 17 Dec 2003 23:36:36 -0000 1.20 --- geometrydata.c 1 Aug 2006 06:16:28 -0000 1.21 *************** *** 55,61 **** /* FIXME: Completely rewrite point handling code, * for the entire project. */ ! static void ! emitPoints(Geometrydata * gd, PrintFunc printer, void * stream) { --- 55,63 ---- /* FIXME: Completely rewrite point handling code, * for the entire project. + * + * NOTE: This has been done in the modec code. */ ! void ! gdata_emit_points(Geometrydata * gd, PrintFunc printer, void * stream) { *************** *** 125,130 **** ! static void ! emitBolts(Geometrydata * gd, PrintFunc printer, void * stream) { --- 127,132 ---- ! void ! gdata_emit_bolts(Geometrydata * gd, PrintFunc printer, void * stream) { *************** *** 168,213 **** ! void ! gdata_write_ddaml(Geometrydata * gd, PrintFunc printer, char * outfilename) { ! ! ! FILE * outfile; - /* FIXME: Return an error if this fails. */ - outfile = fopen(outfilename,"w"); ! /* xml header */ printer(outfile,"<?xml version=\"1.0\" standalone=\"no\"?>\n"); printer(outfile,"<!DOCTYPE DDA SYSTEM \"geometry.dtd\">\n"); ! printer(outfile,"<Berkeley:DDA xmlns:Berkeley=\"http://www.tsoft.com/~bdoolin/dda\">\n"); /* FIXME: This is a bogosity. The parser code is broken * because it requires a comment before the <Geometry> * or <Analysis> tags. ! */ printer(outfile,"<!-- Bogus comment to keep ddaml tree-stripping\n"); printer(outfile,"from seg faulting on bad child node. -->\n\n"); printer(outfile,"<Geometry>\n"); ! printer(outfile,I1"<Edgenodedist distance=\"%f\"/>\n",gd->e00); emitJoints(gd, printer, outfile); ! emitPoints(gd, printer, outfile); ! if (gd->nBolts > 0) ! emitBolts(gd, printer, outfile); ! if (gd->nMatLines > 0) ! emitMatlines(gd, printer, outfile); printer(outfile,"</Geometry>\n"); printer(outfile,"</Berkeley:DDA>\n"); fclose(outfile); ! } /* close dumpDDAMLGeometryFile() */ --- 170,250 ---- ! void ! gdata_write_ddaml_header(double edgenode, PrintFunc printer, void * outfile) { ! ! ! /* xml header */ ! printer(outfile,"<?xml version=\"1.0\" standalone=\"no\"?>\n"); ! printer(outfile,"<!DOCTYPE DDA SYSTEM \"geometry.dtd\">\n"); ! printer(outfile,"<Berkeley:DDA xmlns:Berkeley=\"http://www.tsoft.com/~doolin/dda\">\n"); ! ! /* FIXME: This is a bogosity. The parser code is broken ! * because it requires a comment before the <Geometry> ! * or <Analysis> tags. ! */ ! /** Check on the status of this problem. */ ! printer(outfile,"<!-- Bogus comment to keep ddaml tree-stripping\n"); ! printer(outfile,"from seg faulting on bad child node. -->\n\n"); ! printer(outfile,"<Geometry>\n"); ! printer(outfile,I1"<Edgenodedist distance=\"%f\"/>\n",edgenode); ! } ! ! void ! gdata_write_ddaml_trailer(PrintFunc printer, void * outfile) { ! ! printer(outfile,"</Geometry>\n"); ! printer(outfile,"</Berkeley:DDA>\n"); ! } ! ! // FIXME: This should take a FILE * instead of a file name. ! // Makes it much more flexible. Also, the function pointer ! // in the geometry struct calls for a file pointer instead ! // of a char *. The Windows compiler just isn't smart enough ! // to catch that, because it should result in a compile error. void ! gdata_write_ddaml(Geometrydata * gd, PrintFunc printer, void * outfile) { ! gdata_write_ddaml_header(gd->e00, printer, outfile); + #if 0 /* xml header */ printer(outfile,"<?xml version=\"1.0\" standalone=\"no\"?>\n"); printer(outfile,"<!DOCTYPE DDA SYSTEM \"geometry.dtd\">\n"); ! printer(outfile,"<Berkeley:DDA xmlns:Berkeley=\"http://www.tsoft.com/~doolin/dda\">\n"); /* FIXME: This is a bogosity. The parser code is broken * because it requires a comment before the <Geometry> * or <Analysis> tags. ! */ ! /** Check on the status of this problem. */ printer(outfile,"<!-- Bogus comment to keep ddaml tree-stripping\n"); printer(outfile,"from seg faulting on bad child node. -->\n\n"); printer(outfile,"<Geometry>\n"); ! printer(outfile,I1"<Edgenodedist distance=\"%f\"/>\n",gd->e00); ! #endif ! emitJoints(gd, printer, outfile); ! gdata_emit_points(gd, printer, outfile); ! if (gd->nBolts > 0) { ! gdata_emit_bolts(gd, printer, outfile); ! } + if (gd->nMatLines > 0) { + emitMatlines(gd, printer, outfile); + } + gdata_write_ddaml_trailer(printer, outfile); + #if 0 printer(outfile,"</Geometry>\n"); printer(outfile,"</Berkeley:DDA>\n"); + #endif fclose(outfile); ! } |