[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Project.java, 1.160, 1.161
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2009-02-17 11:08:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6352/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Project.java 17 Feb 2009 10:50:22 -0000 1.160 --- Project.java 17 Feb 2009 11:08:33 -0000 1.161 *************** *** 49,52 **** --- 49,53 ---- import dk.au.perpos.spatialsupport.routefinding.Opening; import dk.au.perpos.spatialsupport.routefinding.Segment; + import dk.au.perpos.spatialsupport.routefinding.io.PPLMPrinter; /** *************** *** 1400,1501 **** } - - private class PPLMPrinter { - private PrintStream out; - private int indent; - - public PPLMPrinter(PrintStream out) { - this.out = out; - this.indent = 0; - } - - public void println(Object object) { - for (int i = 0; i < indent; i++) { - out.print(" "); - } - out.println(object); - } - - public void printPoint(dk.au.perpos.spatialsupport.routefinding.Point point) { - println("<Point X=\"" + point.getX() + "\" Y=\"" + point.getY() + "\" />"); - } - - public void printLocationAttributes(Location location) { - StringBuffer buffer = new StringBuffer(); - buffer.append("<Location "); - buffer.append("LocationID=\"" + location.getId() + "\" "); - buffer.append("Floor=\"" + location.getFloor() + "\" "); - buffer.append("Height=\"" + location.getHeight() + "\" "); - buffer.append("Description=\"" + location.getDescription() + "\""); - buffer.append(">"); - println(buffer); - } - - public void printOpening(Opening opening) { - StringBuffer buffer = new StringBuffer(); - buffer.append("<Opening "); - buffer.append("OpeningID=\"" + opening.getId() + "\" "); - buffer.append("ConnectionID=\"" + opening.getConnection().getId() + "\" "); - buffer.append("Distance=\"" + opening.getDistance() + "\" "); - buffer.append("OpeningDiameter=\"" + opening.getWidth() + "\""); - buffer.append("/>"); - println(buffer); - } - - public void printConnection(dk.au.perpos.spatialsupport.routefinding.Connection connection) { - StringBuffer buffer = new StringBuffer(); - buffer.append("<Connection "); - buffer.append("ConnectionID=\"" + connection.getId() + "\" "); - buffer.append("OpeningID1=\"" + connection.getFrom().getId() + "\" "); - buffer.append("OpeningID2=\"" + connection.getTo().getId() + "\" "); - buffer.append("/>"); - println(buffer); - } - - public void printLocationModel(Location root) { - HashSet<dk.au.perpos.spatialsupport.routefinding.Connection> connections - = new HashSet(); - println("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"); - println("<LocationModel>"); - indent++; - println("<Location LocationID=\"bygning\">"); - indent++; - for (Location node : root.getChildren()) { - printLocationAttributes(node); - indent++; - println("<Boundary>"); - indent++; - for (Segment current : node.getExternalBoundary().getSegments()) { - println("<Segment>"); - indent++; - printPoint(current.getFrom()); - printPoint(current.getTo()); - for (Opening opening : node.getOpenings()) { - if (opening.getSegment() == current) { - printOpening(opening); - } - } - indent--; - println("</Segment>"); - } - indent--; - println("</Boundary>"); - indent--; - for (Opening current : node.getOpenings()) { - connections.add(current.getConnection()); - } - println("</Location>"); - - } - indent--; - println("</Location>"); - for (dk.au.perpos.spatialsupport.routefinding.Connection current : connections) { - printConnection(current); - } - indent--; - println("</LocationModel>"); - } - } - /** * --- 1401,1404 ---- |