diva.sketch.recognition
Class SceneWriter

java.lang.Object
  extended by diva.sketch.recognition.SceneWriter

public class SceneWriter
extends Object

SceneWriter writes a single interpretation of a scene to an output stream. This interpretation can then be read in by a SceneParser for testing purposes. It currently has the limitation that it can only write interpretations that have "SimpleData" interpretations of the scene, because it doesn't know how to handle complex data.

Version:
$Revision: 1.10 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)
See Also:
SceneParser

Constructor Summary
SceneWriter()
          Build a scene writer using the system-specified composite builder for
SceneWriter(CompositeBuilder builder)
          Build a scene writer using the given composite builder for mapping types to builders.
 
Method Summary
 void write(Scene db, SceneElement root, Writer out)
          Write the single interpretation of the scene given rooted by the given root to the character-output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneWriter

public SceneWriter()
            throws Exception
Build a scene writer using the system-specified composite builder for

Throws:
Exception

SceneWriter

public SceneWriter(CompositeBuilder builder)
Build a scene writer using the given composite builder for mapping types to builders.

Method Detail

write

public void write(Scene db,
                  SceneElement root,
                  Writer out)
           throws Exception
Write the single interpretation of the scene given rooted by the given root to the character-output stream. The caller is responsible for closing the stream. Throw a runtime exception if it encounters typed data that is not of the type SimpleData.

Throws:
Exception


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.