• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IdEObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bimserver.emf.IdEObject的典型用法代码示例。如果您正苦于以下问题:Java IdEObject类的具体用法?Java IdEObject怎么用?Java IdEObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IdEObject类属于org.bimserver.emf包,在下文中一共展示了IdEObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processInline

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private Object processInline(EClassifier classifier, String value) throws DeserializeException, MetaDataException {
	if (value.indexOf("(") != -1) {
		String typeName = value.substring(0, value.indexOf("(")).trim();
		String v = value.substring(value.indexOf("(") + 1, value.length() - 1);
		EClassifier eClassifier = getPackageMetaData().getEClassifierCaseInsensitive(typeName);
		if (eClassifier instanceof EClass) {
			Object convert = convert(eClassifier, v);
			try {
				model.add(-1, (IdEObject) convert);
			} catch (IfcModelInterfaceException e) {
				throw new DeserializeException(lineNumber, e);
			}
			return convert;
		} else {
			throw new DeserializeException(lineNumber, typeName + " is not an existing IFC entity");
		}
	} else {
		return IfcParserWriterUtils.convertSimpleValue(getPackageMetaData(), classifier.getInstanceClass(), value, lineNumber);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:21,代码来源:IfcStepDeserializer.java


示例2: writeEClass

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void writeEClass(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object referencedObject = object.eGet(feature);
	if (referencedObject instanceof IdEObject && ((IdEObject)referencedObject).eClass().getEAnnotation("wrapped") != null) {
		writeWrappedValue(object, feature, ((EObject)referencedObject).eClass());
	} else {
		if (referencedObject instanceof EObject && model.contains((IdEObject) referencedObject)) {
			print(DASH);
			print(String.valueOf(getExpressId((IdEObject) referencedObject)));
		} else {
			EntityDefinition entityBN = getPackageMetaData().getSchemaDefinition().getEntityBN(object.eClass().getName());
			if (entityBN != null && entityBN.isDerived(feature.getName())) {
				print(ASTERISK);
			} else if (feature.isMany()) {
				writeList(object, feature);
			} else {
				writeObject(object, feature);
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:21,代码来源:IfcStepSerializer.java


示例3: getAllContentsSet

import org.bimserver.emf.IdEObject; //导入依赖的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;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:20,代码来源:IFCAbstractModelResource.java


示例4: setDoubleAsStringValues

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void setDoubleAsStringValues(IdEObject idEObject) {
	for (EAttribute eAttribute : idEObject.eClass().getEAllAttributes()) {
		if (eAttribute.getEType() == EcorePackage.eINSTANCE.getEDouble()) {
			EStructuralFeature asStringFeature = idEObject.eClass().getEStructuralFeature(eAttribute.getName() + "AsString");
			if (asStringFeature != null) {
				if (eAttribute.isMany()) {
					List list = (List) idEObject.eGet(eAttribute);
					List listAsString = (List) idEObject.eGet(asStringFeature);
					for (int i = 0; i < list.size(); i++) {
						listAsString.set(i, "" + list.get(i));
					}
				} else {
					idEObject.eSet(asStringFeature, "" + idEObject.eGet(eAttribute));
				}
			}
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:20,代码来源:Scaler.java


示例5: processTodoList

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void processTodoList(IfcModelInterface model, TodoList todoList, QueryInterface query) throws BimserverDatabaseException {
	IdEObject idEObject = todoList.poll();
	while (idEObject != null) {
		IdEObject result = get(idEObject, idEObject.getOid(), model, query, todoList);
		if (result == null) {
			throw new BimserverDatabaseException("Object not found: " + query.getPid() + " " + query.getRid() + " " + idEObject.getOid() + " " + idEObject.eClass().getName());
		}
		if (!model.contains(result.getOid())) {
			try {
				model.addAllowMultiModel(result.getOid(), result);
			} catch (IfcModelInterfaceException e) {
				throw new BimserverDatabaseException(e);
			}
		}
		idEObject = todoList.poll();
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:18,代码来源:DatabaseSession.java


示例6: setIfcCraneRailAShapeProfileDef

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void setIfcCraneRailAShapeProfileDef(IdEObject idEObject, float scale) {
	IfcCraneRailAShapeProfileDef ifcCraneRailAShapeProfileDef = (IfcCraneRailAShapeProfileDef) idEObject;
	ifcCraneRailAShapeProfileDef.setBaseDepth1(ifcCraneRailAShapeProfileDef.getBaseDepth1() * scale);
	ifcCraneRailAShapeProfileDef.setBaseDepth2(ifcCraneRailAShapeProfileDef.getBaseDepth2() * scale);
	ifcCraneRailAShapeProfileDef.setBaseDepth3(ifcCraneRailAShapeProfileDef.getBaseDepth3() * scale);
	ifcCraneRailAShapeProfileDef.setBaseWidth2(ifcCraneRailAShapeProfileDef.getBaseWidth2() * scale);
	ifcCraneRailAShapeProfileDef.setBaseWidth4(ifcCraneRailAShapeProfileDef.getBaseWidth4() * scale);
	if (ifcCraneRailAShapeProfileDef.isSetCentreOfGravityInY()) {
		ifcCraneRailAShapeProfileDef.setCentreOfGravityInY(ifcCraneRailAShapeProfileDef.getCentreOfGravityInY() * scale);
	}
	ifcCraneRailAShapeProfileDef.setHeadDepth2(ifcCraneRailAShapeProfileDef.getHeadDepth2() * scale);
	ifcCraneRailAShapeProfileDef.setHeadDepth3(ifcCraneRailAShapeProfileDef.getHeadDepth3() * scale);
	ifcCraneRailAShapeProfileDef.setHeadWidth(ifcCraneRailAShapeProfileDef.getHeadWidth() * scale);
	ifcCraneRailAShapeProfileDef.setOverallHeight(ifcCraneRailAShapeProfileDef.getOverallHeight() * scale);
	if (ifcCraneRailAShapeProfileDef.isSetRadius()) {
		ifcCraneRailAShapeProfileDef.setRadius(ifcCraneRailAShapeProfileDef.getRadius() * scale);
	}
	ifcCraneRailAShapeProfileDef.setWebThickness(ifcCraneRailAShapeProfileDef.getWebThickness() * scale);
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:20,代码来源:Scaler.java


示例7: setIfcCraneRailFShapeProfileDef

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void setIfcCraneRailFShapeProfileDef(IdEObject idEObject, float scale) {
	IfcCraneRailFShapeProfileDef ifcCraneRailFShapeProfileDef = (IfcCraneRailFShapeProfileDef) idEObject;
	ifcCraneRailFShapeProfileDef.setBaseDepth1(ifcCraneRailFShapeProfileDef.getBaseDepth1() * scale);
	ifcCraneRailFShapeProfileDef.setBaseDepth2(ifcCraneRailFShapeProfileDef.getBaseDepth2() * scale);
	if (ifcCraneRailFShapeProfileDef.isSetCentreOfGravityInY()) {
		ifcCraneRailFShapeProfileDef.setCentreOfGravityInY(ifcCraneRailFShapeProfileDef.getCentreOfGravityInY() * scale);
	}
	ifcCraneRailFShapeProfileDef.setHeadDepth2(ifcCraneRailFShapeProfileDef.getHeadDepth2() * scale);
	ifcCraneRailFShapeProfileDef.setHeadDepth3(ifcCraneRailFShapeProfileDef.getHeadDepth3() * scale);
	ifcCraneRailFShapeProfileDef.setHeadWidth(ifcCraneRailFShapeProfileDef.getHeadWidth() * scale);
	ifcCraneRailFShapeProfileDef.setOverallHeight(ifcCraneRailFShapeProfileDef.getOverallHeight() * scale);
	if (ifcCraneRailFShapeProfileDef.isSetRadius()) {
		ifcCraneRailFShapeProfileDef.setRadius(ifcCraneRailFShapeProfileDef.getRadius() * scale);
	}
	ifcCraneRailFShapeProfileDef.setWebThickness(ifcCraneRailFShapeProfileDef.getWebThickness() * scale);
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:17,代码来源:Scaler.java


示例8: setIfcLShapeProfileDef

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void setIfcLShapeProfileDef(IdEObject idEObject, float scale) {
	IfcLShapeProfileDef ifcLShapeProfileDef = (IfcLShapeProfileDef) idEObject;
	if (ifcLShapeProfileDef.isSetCentreOfGravityInX()) {
		ifcLShapeProfileDef.setCentreOfGravityInX(ifcLShapeProfileDef.getCentreOfGravityInX() * scale);
	}
	if (ifcLShapeProfileDef.isSetCentreOfGravityInY()) {
		ifcLShapeProfileDef.setCentreOfGravityInY(ifcLShapeProfileDef.getCentreOfGravityInY() * scale);
	}
	ifcLShapeProfileDef.setDepth(ifcLShapeProfileDef.getDepth() * scale);
	ifcLShapeProfileDef.setEdgeRadius(ifcLShapeProfileDef.getEdgeRadius() * scale);
	if (ifcLShapeProfileDef.isSetFilletRadius()) {
		ifcLShapeProfileDef.setFilletRadius(ifcLShapeProfileDef.getFilletRadius() * scale);
	}
	ifcLShapeProfileDef.setThickness(ifcLShapeProfileDef.getThickness() * scale);
	if (ifcLShapeProfileDef.isSetWidth()) {
		ifcLShapeProfileDef.setWidth(ifcLShapeProfileDef.getWidth() * scale);
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:19,代码来源:Scaler.java


示例9: resetOids

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void resetOids(IdEObject idEObject, Set<IdEObject> done) {
	if (idEObject == null) {
		return;
	}
	if (done.contains(idEObject)) {
		return;
	}
	((IdEObjectImpl) idEObject).setOid(-1);
	done.add(idEObject);
	for (EReference eReference : idEObject.eClass().getEAllReferences()) {
		Object val = idEObject.eGet(eReference);
		if (eReference.isMany()) {
			List list = (List) val;
			for (Object o : list) {
				resetOids((IdEObject) o, done);
			}
		} else {
			resetOids((IdEObject) val, done);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:23,代码来源:IfcModel.java


示例10: fixOids

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private void fixOids(IdEObject idEObject, OidProvider oidProvider, BiMap<Long, IdEObject> temp) {
	if (idEObject == null) {
		return;
	}
	if (temp.containsValue(idEObject)) {
		return;
	}
	((IdEObjectImpl) idEObject).setOid(oidProvider.newOid(idEObject.eClass()));
	if (objects.containsValue(idEObject)) {
		temp.put(idEObject.getOid(), idEObject);
	}
	for (EReference eReference : idEObject.eClass().getEAllReferences()) {
		Object val = idEObject.eGet(eReference);
		if (eReference.isMany()) {
			List list = (List) val;
			for (Object o : list) {
				fixOids((IdEObject) o, oidProvider, temp);
			}
		} else {
			fixOids((IdEObject) val, oidProvider, temp);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:25,代码来源:IfcModel.java


示例11: execute

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@Override
public Set<Project> execute() throws UserException, BimserverLockConflictException, BimserverDatabaseException {
	User user = getUserByUoid(authorization.getUoid());
	IfcModelInterface projectsModel = getDatabaseSession().getAllOfType(StorePackage.eINSTANCE.getProject(), OldQuery.getDefault());
	Set<Project> result = new HashSet<Project>();
	for (IdEObject idEObject : projectsModel.getValues()) {
		if (idEObject instanceof Project) {
			Project project = (Project)idEObject;
			if (!project.getName().equals("INT-Store")) {
				if ((user.getUserType() == UserType.ADMIN || (project.getState() == ObjectState.ACTIVE) && authorization.hasRightsOnProjectOrSuperProjects(user, project))) {
					result.add(project);
				}
			}
		}
	}
	return result;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:18,代码来源:GetAllWritableProjectsDatabaseAction.java


示例12: getReferences

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List<Long> getReferences(Long tid, Long oid, String referenceName) throws ServerException, UserException {
	DatabaseSession session = getBimServer().getDatabase().createSession();
	try {
		LongTransaction transaction = getBimServer().getLongTransactionManager().get(tid);
		EClass eClass = session.getEClassForOid(oid);
		IdEObject object = session.get(eClass, oid, new OldQuery(transaction.getPackageMetaData(), transaction.getPid(), transaction.getRid(), transaction.getRoid(), null, Deep.NO));
		if (object == null) {
			throw new UserException("No object of type " + eClass.getName() + " with oid " + oid + " found");
		}
		List<IdEObject> list = (List<IdEObject>) object.eGet(object.eClass().getEStructuralFeature(referenceName));
		List<Long> oidList = new ArrayList<Long>();
		for (IdEObject idEObject : list) {
			oidList.add(idEObject.getOid());
		}
		return oidList;
	} catch (Exception e) {
		return handleException(e);
	} finally {
		session.close();
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:24,代码来源:LowLevelServiceImpl.java


示例13: create

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends IdEObject> T create(EClass eClass) throws IfcModelInterfaceException, ObjectAlreadyExistsException {
	final IdEObjectImpl idEObject = (IdEObjectImpl) eClass.getEPackage().getEFactoryInstance().create(eClass);
	idEObject.setModel(this);

	if (recordChanges) {
		idEObject.eAdapters().add(adapter);
		try {
			Long oid = bimServerClient.getLowLevelInterface().createObject(tid, eClass.getName(), eClass.getEStructuralFeature("GlobalId") != null);
			idEObject.setOid(oid);
		} catch (Exception e) {
			LOGGER.error("", e);
		}
		add(idEObject.getOid(), idEObject);
	}
	return (T) idEObject;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:19,代码来源:ClientIfcModel.java


示例14: query

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public <T extends IdEObject> List<T> query(EAttribute attribute, Object value) throws BimserverLockConflictException, BimserverDatabaseException {
	List<T> result = new ArrayList<>();
	if (attribute.getEAnnotation("singleindex") != null) {
		String indexTableName = attribute.getEContainingClass().getEPackage().getName() + "_" + attribute.getEContainingClass().getName() + "_" + attribute.getName();
		byte[] queryBytes = null;
		if (value instanceof String) {
			queryBytes = ((String)value).getBytes(Charsets.UTF_8);
		} else if (value instanceof Integer) {
			queryBytes = BinUtils.intToByteArray((Integer)value);
		} else {
			throw new BimserverDatabaseException("Unsupported type " + value);
		}
		List<byte[]> duplicates = database.getKeyValueStore().getDuplicates(indexTableName, queryBytes, this);
		for (byte[] indexValue : duplicates) {
			ByteBuffer buffer = ByteBuffer.wrap(indexValue);
			buffer.getInt(); // pid
			long oid = buffer.getLong();
			result.add((T) get(oid, OldQuery.getDefault()));
		}
	}
	return result;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:24,代码来源:DatabaseSession.java


示例15: storeDeep

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void storeDeep(IdEObject object, Set<IdEObject> done) throws BimserverDatabaseException {
	if (object == null || done.contains(object)) {
		return;
	}
	done.add(object);
	store(object);
	for (EReference eReference : object.eClass().getEAllReferences()) {
		if (eReference.isMany()) {
			List<?> list = (List<?>) object.eGet(eReference);
			for (Object v : list) {
				storeDeep((IdEObject) v, done);
			}
		} else {
			IdEObject reference = (IdEObject) object.eGet(eReference);
			storeDeep(reference, done);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:19,代码来源:DatabaseSession.java


示例16: writeEmbeddedValue

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void writeEmbeddedValue(int pid, int rid, Object value, ByteBuffer buffer, PackageMetaData packageMetaData) throws BimserverDatabaseException {
	IdEObject wrappedValue = (IdEObject) value;

	Short cid = database.getCidOfEClass(wrappedValue.eClass());
	buffer.order(ByteOrder.LITTLE_ENDIAN);
	buffer.putShort((short) -cid);
	buffer.order(ByteOrder.BIG_ENDIAN);
	
	for (EStructuralFeature eStructuralFeature : wrappedValue.eClass().getEAllStructuralFeatures()) {
		if (eStructuralFeature.isMany()) {
			writeList(wrappedValue, buffer, packageMetaData, eStructuralFeature);
		} else {
			writePrimitiveValue(eStructuralFeature, wrappedValue.eGet(eStructuralFeature), buffer);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:17,代码来源:DatabaseSession.java


示例17: writeEDataType

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void writeEDataType(IdEObject object, EntityDefinition entityBN, EStructuralFeature feature) throws SerializerException, IOException {
	if (entityBN != null && entityBN.isDerived(feature.getName())) {
		print(ASTERISK);
	} else if (feature.isMany()) {
		writeList(object, feature);
	} else {
		writeObject(object, feature);
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:10,代码来源:IfcStepSerializer.java


示例18: writeObject

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private void writeObject(IdEObject object, EStructuralFeature feature) throws SerializerException, IOException {
	Object ref = object.eGet(feature);
	if (ref == null || (feature.isUnsettable() && !object.eIsSet(feature))) {
		EClassifier type = feature.getEType();
		if (type instanceof EClass) {
			EStructuralFeature structuralFeature = ((EClass) type).getEStructuralFeature(WRAPPED_VALUE);
			if (structuralFeature != null) {
				String name = structuralFeature.getEType().getName();
				if (name.equals(IFC_BOOLEAN) || name.equals(IFC_LOGICAL) || structuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) {
					print(BOOLEAN_UNDEFINED);
				} else {
					print(DOLLAR);
				}
			} else {
				print(DOLLAR);
			}
		} else {
			if (type == EcorePackage.eINSTANCE.getEBoolean()) {
				print(BOOLEAN_UNDEFINED);
			} else if (feature.isMany()) {
				print("()");
			} else {
				print(DOLLAR);
			}
		}
	} else {
		if (ref instanceof EObject) {
			writeEmbedded((EObject) ref);
		} else if (feature.getEType() == ECORE_PACKAGE_INSTANCE.getEDouble()) {
			writeDoubleValue((Double)ref, object, feature);
		} else {
			IfcParserWriterUtils.writePrimitive(ref, outputStream);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:IfcPlugins,代码行数:36,代码来源:IfcStepSerializer.java


示例19: addToSerializer

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
protected long addToSerializer(final Serializer serializer, long oid, final EObject eo)
		throws IfcModelInterfaceException {
	if (eo.eClass().getEAnnotation("wrapped") != null) {
		// this is a wrapped object: no need to add it explicitly
	} else if (eo instanceof IdEObject) {
		final IdEObject idEObj = (IdEObject) eo;
		serializer.getModel().add(oid, idEObj);
		oid++;
	}
	return oid;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:12,代码来源:IFCExportCommand.java


示例20: createSerializer

import org.bimserver.emf.IdEObject; //导入依赖的package包/类
private Serializer createSerializer(final HawkResourceImpl resource) throws Exception {
	Serializer serializer = null;
	for (TreeIterator<EObject> it = EcoreUtil.getAllContents(resource, false); it.hasNext()
			&& serializer == null;) {
		EObject eo = it.next();
		if (eo instanceof IdEObject) {
			serializer = createSerializer(eo.eClass().getEPackage().getNsURI());
		}
	}
	return serializer;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:12,代码来源:IFCExportCommand.java



注:本文中的org.bimserver.emf.IdEObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BrowserInformationControlInput类代码示例发布时间:2022-05-22
下一篇:
Java SortRowsMeta类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap