Search in sources :

Example 1 with SerializerInputstream

use of org.bimserver.plugins.serializers.SerializerInputstream in project BIMserver by opensourceBIM.

the class ClientIfcModel method checkin.

public void checkin(long poid, String comment) throws ServerException, UserException, PublicInterfaceNotFoundException {
    this.fixOids(new OidProvider() {

        private long c = 1;

        @Override
        public long newOid(EClass eClass) {
            return c++;
        }
    });
    SharedJsonSerializer sharedJsonSerializer = new SharedJsonSerializer(this, false);
    SDeserializerPluginConfiguration deserializer = bimServerClient.getServiceInterface().getSuggestedDeserializerForExtension("json", poid);
    bimServerClient.checkin(poid, comment, deserializer.getOid(), false, Flow.SYNC, -1, "test", new SerializerInputstream(sharedJsonSerializer));
}
Also used : SharedJsonSerializer(org.bimserver.emf.SharedJsonSerializer) EClass(org.eclipse.emf.ecore.EClass) SDeserializerPluginConfiguration(org.bimserver.interfaces.objects.SDeserializerPluginConfiguration) OidProvider(org.bimserver.emf.OidProvider) SerializerInputstream(org.bimserver.plugins.serializers.SerializerInputstream)

Example 2 with SerializerInputstream

use of org.bimserver.plugins.serializers.SerializerInputstream in project BIMserver by opensourceBIM.

the class OfflineGeometryGenerator method generateForAllElements.

public void generateForAllElements() {
    try {
        serializer.init(model, null, true);
        InputStream in = new SerializerInputstream(serializer);
        renderEngineModel = renderEngine.openModel(in);
        final RenderEngineSettings settings = new RenderEngineSettings();
        settings.setPrecision(Precision.SINGLE);
        settings.setIndexFormat(IndexFormat.AUTO_DETECT);
        settings.setGenerateNormals(true);
        settings.setGenerateTriangles(true);
        settings.setGenerateWireFrame(false);
        final RenderEngineFilter renderEngineFilter = new RenderEngineFilter();
        renderEngineModel.setSettings(settings);
        renderEngineModel.setFilter(renderEngineFilter);
        renderEngineModel.generateGeneralGeometry();
        for (IfcProduct ifcProduct : model.getAllWithSubTypes(IfcProduct.class)) {
            generateGeometry(ifcProduct);
        }
    } catch (SerializerException e) {
        e.printStackTrace();
    } catch (RenderEngineException e) {
        e.printStackTrace();
    }
}
Also used : RenderEngineFilter(org.bimserver.plugins.renderengine.RenderEngineFilter) InputStream(java.io.InputStream) IfcProduct(org.bimserver.models.ifc2x3tc1.IfcProduct) SerializerInputstream(org.bimserver.plugins.serializers.SerializerInputstream) RenderEngineSettings(org.bimserver.plugins.renderengine.RenderEngineSettings) SerializerException(org.bimserver.plugins.serializers.SerializerException) RenderEngineException(org.bimserver.plugins.renderengine.RenderEngineException)

Aggregations

SerializerInputstream (org.bimserver.plugins.serializers.SerializerInputstream)2 InputStream (java.io.InputStream)1 OidProvider (org.bimserver.emf.OidProvider)1 SharedJsonSerializer (org.bimserver.emf.SharedJsonSerializer)1 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)1 IfcProduct (org.bimserver.models.ifc2x3tc1.IfcProduct)1 RenderEngineException (org.bimserver.plugins.renderengine.RenderEngineException)1 RenderEngineFilter (org.bimserver.plugins.renderengine.RenderEngineFilter)1 RenderEngineSettings (org.bimserver.plugins.renderengine.RenderEngineSettings)1 SerializerException (org.bimserver.plugins.serializers.SerializerException)1 EClass (org.eclipse.emf.ecore.EClass)1