org.osm2world.core
Class ConversionFacade

Object
  extended by ConversionFacade

public class ConversionFacade
extends Object

provides an easy way to call all steps of the conversion process in the correct order


Nested Class Summary
static class ConversionFacade.BoundingBoxSizeException
          exception to be thrown if the OSM input data covers an area larger than the maxBoundingBoxDegrees config property
static class ConversionFacade.Phase
           
static interface ConversionFacade.ProgressListener
          implemented by classes that want to be informed about a conversion run's progress
static class ConversionFacade.Results
          all results of a conversion run
 
Constructor Summary
ConversionFacade()
           
 
Method Summary
 void addProgressListener(ConversionFacade.ProgressListener listener)
           
 ConversionFacade.Results createRepresentations(File osmFile, List<WorldModule> worldModules, Configuration config, List<Target<?>> targets)
          performs all necessary steps to go from an OSM file to the renderable WorldObjects.
 ConversionFacade.Results createRepresentations(OSMData osmData, List<WorldModule> worldModules, Configuration config, List<Target<?>> targets)
          variant of createRepresentations(File, List, Configuration, List) that accepts OSMData instead of a file.
 void setElevationCalculator(ElevationCalculator elevationCalculator)
          sets the ElevationCalculator that is used during subsequent calls to createRepresentations(OSMData, List, Configuration, List)
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversionFacade

public ConversionFacade()
Method Detail

setElevationCalculator

public void setElevationCalculator(ElevationCalculator elevationCalculator)
sets the ElevationCalculator that is used during subsequent calls to createRepresentations(OSMData, List, Configuration, List)


createRepresentations

public ConversionFacade.Results createRepresentations(File osmFile,
                                                      List<WorldModule> worldModules,
                                                      Configuration config,
                                                      List<Target<?>> targets)
                                               throws IOException
performs all necessary steps to go from an OSM file to the renderable WorldObjects. Sends updates to ConversionFacade.ProgressListeners.

Parameters:
osmFile - file to read OSM data from; != null
worldModules - modules that will create the WorldObjects in the result; null to use a default module list
config - set of parameters that controls various aspects of the modules' behavior; null to use defaults
targets - receivers of the conversion results; can be null if you want to handle the returned results yourself
Throws:
IOException

createRepresentations

public ConversionFacade.Results createRepresentations(OSMData osmData,
                                                      List<WorldModule> worldModules,
                                                      Configuration config,
                                                      List<Target<?>> targets)
                                               throws IOException,
                                                      ConversionFacade.BoundingBoxSizeException
variant of createRepresentations(File, List, Configuration, List) that accepts OSMData instead of a file. Use this when all data is already in memory, for example with editor applications.

Parameters:
osmData - input data; != null
worldModules - modules that will create the WorldObjects in the result; null to use a default module list
config - set of parameters that controls various aspects of the modules' behavior; null to use defaults
targets - receivers of the conversion results; can be null if you want to handle the returned results yourself
Throws:
ConversionFacade.BoundingBoxSizeException - for oversized bounding boxes
IOException

addProgressListener

public void addProgressListener(ConversionFacade.ProgressListener listener)