use of org.bimserver.plugins.PluginManagerInterface in project BIMserver by opensourceBIM.
the class TestGen method start.
private void start(String[] args) {
try {
PluginManagerInterface pluginManager = LocalDevSetup.setupPluginManager(args);
DeserializerPlugin deserializerPlugin = pluginManager.getFirstDeserializer("ifc", Schema.IFC2X3TC1, true);
Deserializer deserializer = deserializerPlugin.createDeserializer(null);
deserializer.init(pluginManager.getMetaDataManager().getPackageMetaData("ifc2x3tc1"));
RenderEnginePlugin renderEnginePlugin = pluginManager.getRenderEnginePlugin("org.bimserver.ifcengine.JvmRenderEnginePlugin", true);
RenderEngine renderEngine = renderEnginePlugin.createRenderEngine(null, "ifc2x3tc1");
renderEngine.init();
Path path = Paths.get("../TestData/data/AC11-Institute-Var-2-IFC.ifc");
RenderEngineModel renderEngineModel = renderEngine.openModel(new FileInputStream(path.toFile()), Files.size(path));
RenderEngineSettings settings = new RenderEngineSettings();
settings.setPrecision(Precision.SINGLE);
settings.setIndexFormat(IndexFormat.AUTO_DETECT);
settings.setGenerateNormals(true);
settings.setGenerateTriangles(true);
settings.setGenerateWireFrame(false);
renderEngineModel.setSettings(settings);
renderEngineModel.generateGeneralGeometry();
renderEngineModel.close();
renderEngine.close();
long start = System.nanoTime();
long end = System.nanoTime();
System.out.println(((end - start) / 1000000) + " ms");
} catch (PluginException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations