本文整理汇总了Java中org.bimserver.plugins.deserializers.Deserializer类的典型用法代码示例。如果您正苦于以下问题:Java Deserializer类的具体用法?Java Deserializer怎么用?Java Deserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Deserializer类属于org.bimserver.plugins.deserializers包,在下文中一共展示了Deserializer类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllContentsSet
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Set<IHawkObject> getAllContentsSet() {
if (allElements == null) {
allElements = new HashSet<IHawkObject>();
try {
Deserializer d = createDeserializer();
IfcModelInterface s = readModel(d);
for (IdEObject eo : s.getValues()) {
allElements.add(new IFCObject(eo));
addFloating(allElements, eo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
return allElements;
}
示例2: start
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
private void start() {
Path src = TestFile.RIOLERING_TEST.getFile();
PluginManager pluginManager;
try {
pluginManager = LocalDevPluginLoader.createPluginManager(Paths.get("home"));
DeserializerPlugin deserializerPlugin = pluginManager.getFirstDeserializer("ifc", Schema.IFC2X3TC1, true);
Deserializer deserializer = deserializerPlugin.createDeserializer(new PluginConfiguration());
deserializer.init(pluginManager.getMetaDataManager().getPackageMetaData("ifc2x3tc1"));
try {
model = DeserializerUtils.readFromFile(deserializer, src);
} catch (Exception e) {
e.printStackTrace();
}
step1();
} catch (PluginException e1) {
e1.printStackTrace();
}
}
示例3: readModel
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public IfcModelInterface readModel(Path file) {
PluginManager pluginManager;
try {
pluginManager = LocalDevPluginLoader.createPluginManager(Paths.get("home"));
DeserializerPlugin deserializerPlugin = pluginManager.getFirstDeserializer("ifc", Schema.IFC2X3TC1, true);
Deserializer deserializer = deserializerPlugin.createDeserializer(new PluginConfiguration());
deserializer.init(pluginManager.getMetaDataManager().getPackageMetaData("ifc2x3tc1"));
try {
IfcModelInterface model = DeserializerUtils.readFromFile(deserializer, file);
return model;
} catch (Exception e) {
e.printStackTrace();
}
} catch (PluginException e1) {
e1.printStackTrace();
}
return null;
}
示例4: readModel
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
protected IfcModelInterface readModel(Deserializer d) throws DeserializeException, IOException {
// The factory only reports a non-unknown type if the zip has at least
// one .ifc* file, so this should be safe.
final ZipEntry first = ifcEntries.get(0);
return d.read(zipFile.getInputStream(first), first.getName(), first.getSize());
}
示例5: createDeserializer
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
private Deserializer createDeserializer() throws Exception {
Deserializer d;
String packageLowerCaseName;
switch (ifcModelType) {
case IFC2X3_STEP:
d = new Ifc2x3tc1StepDeserializer(Schema.IFC2X3TC1);
packageLowerCaseName = Ifc2x3tc1Package.eINSTANCE.getName().toLowerCase();
break;
case IFC2X3_XML:
d = new Ifc2x3tc1XmlDeserializer();
packageLowerCaseName = Ifc2x3tc1Package.eINSTANCE.getName().toLowerCase();
break;
case IFC4_STEP:
d = new Ifc4StepDeserializer(Schema.IFC4);
packageLowerCaseName = Ifc4Package.eINSTANCE.getName().toLowerCase();
break;
case IFC4_XML:
d = new Ifc4XmlDeserializer();
packageLowerCaseName = Ifc4Package.eINSTANCE.getName().toLowerCase();
break;
default:
throw new IllegalArgumentException("Unsupported IFC model type " + ifcModelType);
}
PluginManager bimPluginManager = createPluginManager();
MetaDataManager bimMetaDataManager = new MetaDataManager(bimPluginManager);
bimMetaDataManager.init();
final PackageMetaData packageMetaData = bimMetaDataManager.getPackageMetaData(packageLowerCaseName);
d.init(packageMetaData);
return d;
}
示例6: createDeserializer
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
return new Ifc4StepDeserializer(Schema.IFC4);
}
示例7: createDeserializer
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
return new Ifc2x3tc1StepDeserializer();
}
示例8: createDeserializer
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
public Deserializer createDeserializer(PluginConfiguration pluginConfiguration) {
return new JsonDeserializer();
}
示例9: readModel
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
protected abstract IfcModelInterface readModel(Deserializer d)
throws DeserializeException, IOException;
示例10: readModel
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
@Override
protected IfcModelInterface readModel(Deserializer d) throws DeserializeException {
return d.read(ifc);
}
示例11: readFromBytes
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public static IfcModelInterface readFromBytes(Deserializer deserializer, byte[] bytes, String filename) throws DeserializeException {
return deserializer.read(new ByteArrayInputStream(bytes), filename, bytes.length, null);
}
示例12: readFromFile
import org.bimserver.plugins.deserializers.Deserializer; //导入依赖的package包/类
public static IfcModelInterface readFromFile(Deserializer deserializer, Path path) throws DeserializeException, IOException {
try (InputStream fis = Files.newInputStream(path)) {
return deserializer.read(fis, path.getFileName().toString(), Files.size(path), null);
}
}