本文整理汇总了Java中org.bimserver.emf.IdEObject类的典型用法代码示例。如果您正苦于以下问题:Java IdEObject类的具体用法?Java IdEObject怎么用?Java IdEObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdEObject类属于org.bimserver.emf包,在下文中一共展示了IdEObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
}
}
示例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;
}
示例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));
}
}
}
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
}