当前位置: 首页>>代码示例>>Java>>正文


Java IdEObject.eSet方法代码示例

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


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

示例1: 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

示例2: returnCachedData

import org.bimserver.emf.IdEObject; //导入方法依赖的package包/类
private void returnCachedData(IfcModelInterface model, GeometryCache geometryCache, DatabaseSession databaseSession, int pid, int rid) throws BimserverDatabaseException {
	EClass productClass = model.getPackageMetaData().getEClass("IfcProduct");
	List<IdEObject> products = model.getAllWithSubTypes(productClass);
	for (IdEObject ifcProduct : products) {
		GeometryCacheEntry geometryCacheEntry = geometryCache.get(ifcProduct.getExpressId());
		if (geometryCacheEntry != null) {
			GeometryData geometryData = databaseSession.create(GeometryPackage.eINSTANCE.getGeometryData(), pid, rid);
			geometryData.setVertices(geometryCacheEntry.getVertices().array());
			geometryData.setNormals(geometryCacheEntry.getNormals().array());
			GeometryInfo geometryInfo = databaseSession.create(GeometryPackage.eINSTANCE.getGeometryInfo(), pid, rid);
			Vector3f min = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid);
			min.setX(geometryCacheEntry.getGeometryInfo().getMinBounds().getX());
			min.setY(geometryCacheEntry.getGeometryInfo().getMinBounds().getY());
			min.setZ(geometryCacheEntry.getGeometryInfo().getMinBounds().getZ());
			Vector3f max = databaseSession.create(GeometryPackage.eINSTANCE.getVector3f(), pid, rid);
			max.setX(geometryCacheEntry.getGeometryInfo().getMaxBounds().getX());
			max.setY(geometryCacheEntry.getGeometryInfo().getMaxBounds().getY());
			max.setZ(geometryCacheEntry.getGeometryInfo().getMaxBounds().getZ());
			geometryInfo.setMinBounds(min);
			geometryInfo.setMaxBounds(max);
			geometryInfo.setData(geometryData);
			ifcProduct.eSet(ifcProduct.eClass().getEStructuralFeature("geometry"), geometryInfo);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:26,代码来源:GeometryGenerator.java

示例3: readWrappedValue

import org.bimserver.emf.IdEObject; //导入方法依赖的package包/类
private IdEObject readWrappedValue(EStructuralFeature feature, ByteBuffer buffer, EClass eClass, QueryInterface query) {
	EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature("wrappedValue");
	Object primitiveValue = readPrimitiveValue(eStructuralFeature.getEType(), buffer, query);
	IdEObject eObject = createInternal(eClass, query);
	((IdEObjectImpl) eObject).setLoaded(); // We don't want to go lazy load
											// this
	eObject.eSet(eStructuralFeature, primitiveValue);
	if (eStructuralFeature.getEType() == EcorePackage.eINSTANCE.getEDouble() || eStructuralFeature.getEType() == EcorePackage.eINSTANCE.getEDoubleObject()) {
		EStructuralFeature strFeature = eClass.getEStructuralFeature("wrappedValueAsString");
		Object stringVal = readPrimitiveValue(EcorePackage.eINSTANCE.getEString(), buffer, query);
		eObject.eSet(strFeature, stringVal);
	}
	return eObject;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:15,代码来源:DatabaseSession.java

示例4: readEmbeddedValue

import org.bimserver.emf.IdEObject; //导入方法依赖的package包/类
private IdEObject readEmbeddedValue(EStructuralFeature feature, ByteBuffer buffer, EClass eClass, QueryInterface query) {
	IdEObject eObject = createInternal(eClass, query);
	for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
		if (eStructuralFeature.isMany()) {
			// Not implemented
		} else {
			Object primitiveValue = readPrimitiveValue(eStructuralFeature.getEType(), buffer, query);
			((IdEObjectImpl) eObject).setLoaded();
			eObject.eSet(eStructuralFeature, primitiveValue);
		}
	}
	return eObject;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:14,代码来源:DatabaseSession.java

示例5: copy

import org.bimserver.emf.IdEObject; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private IdEObject copy(IfcModel target, IdEObject idEObject, boolean limitToNonGuids) throws IfcModelInterfaceException {
	if (target.contains(idEObject.getOid())) {
		return target.get(idEObject.getOid());
	}
	IdEObject newObject = (IdEObject) idEObject.eClass().getEPackage().getEFactoryInstance().create(idEObject.eClass());
	((IdEObjectImpl)newObject).setOid(idEObject.getOid());
	if (newObject.getOid() != -1) {
		target.add(newObject.getOid(), newObject);
	}
	for (EAttribute eAttribute : newObject.eClass().getEAllAttributes()) {
		newObject.eSet(eAttribute, idEObject.eGet(eAttribute));
	}
	for (EReference eReference : newObject.eClass().getEAllReferences()) {
		Object referencedObject = idEObject.eGet(eReference);
		if (referencedObject instanceof IdEObject) {
			IdEObject refEObject = (IdEObject)referencedObject;
			if (!limitToNonGuids || !(referencedObject instanceof IfcRoot) && !(referencedObject instanceof IfcGloballyUniqueId)) {
				newObject.eSet(eReference, copy(target, refEObject, limitToNonGuids));
			}
		} else if (referencedObject instanceof List) {
			List list = (List)referencedObject;
			List newList = (List)newObject.eGet(eReference);
			for (Object o : list) {
				if (!limitToNonGuids || !(o instanceof IfcRoot) && !(o instanceof IfcGloballyUniqueId)) {
					IdEObject listObject = (IdEObject)o;
					IdEObject smartCopy = copy(target, listObject, limitToNonGuids);
					if (!newList.contains(smartCopy)) {
						newList.add(smartCopy);
					}
				}
			}
		}
	}
	return newObject;
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:37,代码来源:RevisionMerger.java

示例6: copyDecomposes

import org.bimserver.emf.IdEObject; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void copyDecomposes(IdEObject ifcObjectDefinition, IdEObject ownerHistory) throws IfcModelInterfaceException, ObjectAlreadyExistsException {
	IdEObject newObjectDefinition = copy(ifcObjectDefinition, false, skipRepresentation);
	EStructuralFeature decomposesFeature = newObjectDefinition.eClass().getEStructuralFeature("Decomposes");
	for (IdEObject ifcRelDecomposes : (List<IdEObject>)ifcObjectDefinition.eGet(decomposesFeature)) {
		copy(ifcRelDecomposes, false, skipRepresentation);
		EStructuralFeature relatingObjectFeature = ifcRelDecomposes.eClass().getEStructuralFeature("RelatingObject");
		IdEObject relatingObject = (IdEObject) ifcRelDecomposes.eGet(relatingObjectFeature);
		if (relatingObject != null) {
			copyDecomposes(relatingObject, ownerHistory);
		}
	}
	if (ifcObjectDefinition.eClass().getEPackage().getEClassifier("IfcElement").isInstance(ifcObjectDefinition)) {
		EStructuralFeature containedInStructureFeature = ifcObjectDefinition.eClass().getEStructuralFeature("ContainedInStructure");
		for (IdEObject containedInStructure : (List<IdEObject>)ifcObjectDefinition.eGet(containedInStructureFeature)) {
			IdEObject newContainedInSpatialStructure = getTargetModel().create(containedInStructure.eClass());
			newContainedInSpatialStructure.eSet(newContainedInSpatialStructure.eClass().getEStructuralFeature("GlobalId"), GuidCompressor.getNewIfcGloballyUniqueId());
			newContainedInSpatialStructure.eSet(newContainedInSpatialStructure.eClass().getEStructuralFeature("OwnerHistory"), ownerHistory);
			EStructuralFeature relatedElementsFeature = newContainedInSpatialStructure.eClass().getEStructuralFeature("RelatedElements");
			((List<IdEObject>)newContainedInSpatialStructure.eGet(relatedElementsFeature)).add(newObjectDefinition);
			EStructuralFeature relatingStructureFeature = containedInStructure.eClass().getEStructuralFeature("RelatingStructure");
			IdEObject newRelatingStructre = copy(((IdEObject)containedInStructure.eGet(relatingStructureFeature)), false, skipRepresentation);
			newContainedInSpatialStructure.eSet(relatingStructureFeature, newRelatingStructre);
			getTargetModel().add(oidProvider.newOid(newContainedInSpatialStructure.eClass()), newContainedInSpatialStructure);
			copyDecomposes((IdEObject)containedInStructure.eGet(relatingStructureFeature), ownerHistory);
		}
	}
}
 
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:29,代码来源:ModelHelper.java


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