@SuppressWarnings("unchecked") public double[] placement3DToMatrix(AbstractHashMapVirtualObject ifcAxis2Placement3D) { EReference refDirectionFeature = packageMetaData.getEReference("IfcAxis2Placement3D", "RefDirection"); AbstractHashMapVirtualObject location = ifcAxis2Placement3D.getDirectFeature(packageMetaData.getEReference("IfcPlacement", "Location")); if (ifcAxis2Placement3D.getDirectFeature(packageMetaData.getEReference("IfcAxis2Placement3D", "Axis")) != null && ifcAxis2Placement3D.getDirectFeature(refDirectionFeature) != null) { AbstractHashMapVirtualObject axis = ifcAxis2Placement3D.getDirectFeature(packageMetaData.getEReference("IfcAxis2Placement3D", "Axis")); AbstractHashMapVirtualObject direction = ifcAxis2Placement3D.getDirectFeature(refDirectionFeature); List<Double> axisDirectionRatios = (List<Double>) axis.get("DirectionRatios"); List<Double> directionDirectionRatios = (List<Double>) direction.get("DirectionRatios"); List<Double> locationCoordinates = (List<Double>) location.get("Coordinates"); double[] cross = Vector.crossProduct(new double[]{axisDirectionRatios.get(0), axisDirectionRatios.get(1), axisDirectionRatios.get(2), 1}, new double[]{directionDirectionRatios.get(0), directionDirectionRatios.get(1), directionDirectionRatios.get(2), 1}); return new double[]{ directionDirectionRatios.get(0), directionDirectionRatios.get(1), directionDirectionRatios.get(2), 0, cross[0], cross[1], cross[2], 0, axisDirectionRatios.get(0), axisDirectionRatios.get(1), axisDirectionRatios.get(2), 0, locationCoordinates.get(0), locationCoordinates.get(1), locationCoordinates.get(2), 1 }; } else if (location != null) { List<Double> locationCoordinates = (List<Double>) location.get("Coordinates"); return new double[]{ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, locationCoordinates.get(0), locationCoordinates.get(1), locationCoordinates.get(2), 1 }; } return Matrix.identity(); }
private double[] placementToMatrix(AbstractHashMapVirtualObject placement) { AbstractHashMapVirtualObject placementRelTo = placement.getDirectFeature(packageMetaData.getEReference("IfcLocalPlacement", "PlacementRelTo")); double[] matrix = Matrix.identity(); if (placement.eClass().getName().equals("IfcLocalPlacement")) { AbstractHashMapVirtualObject relativePlacement = placement.getDirectFeature(packageMetaData.getEReference("IfcLocalPlacement", "RelativePlacement")); if (relativePlacement != null && relativePlacement.eClass().getName().equals("IfcAxis2Placement3D")) { matrix = placement3DToMatrix(relativePlacement); } } if (placementRelTo != null) { double[] baseMatrix = placementToMatrix(placementRelTo); double[] rhs = matrix; matrix = Matrix.identity(); Matrix.multiplyMM(matrix, 0, baseMatrix, 0, rhs, 0); } return matrix; }
HashMapVirtualObject next = queryObjectProvider.next(); while (next != null) { AbstractHashMapVirtualObject geometry = next.getDirectFeature(packageMetaData.getEReference("IfcProduct", "geometry")); if (geometry != null) { Long dataId = (Long) geometry.get("data");
throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId()); EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName); if (eReference == null) { throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + eClass.getName() + "\"");
EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName); if (eReference == null) { throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + eClass.getName() + "\"");
throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId()); EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName); if (eReference == null) { throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + eClass.getName() + "\"");
throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId()); EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName); if (eReference == null) { throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + eClass.getName() + "\"");
AbstractHashMapVirtualObject mappingTarget = item.getDirectFeature(packageMetaData.getEReference("IfcMappedItem", "MappingTarget")); AbstractHashMapVirtualObject mappingSourceOfMappedItem = item.getDirectFeature(packageMetaData.getEReference("IfcMappedItem", "MappingSource")); if (mappingSourceOfMappedItem == null) { LOGGER.info("No mapping source"); continue; AbstractHashMapVirtualObject mappedRepresentation = mappingSourceOfMappedItem.getDirectFeature(packageMetaData.getEReference("IfcRepresentationMap", "MappedRepresentation")); double[] productMatrix = Matrix.identity(); if (mappingTarget != null) { AbstractHashMapVirtualObject axis1 = mappingTarget.getDirectFeature(packageMetaData.getEReference("IfcCartesianTransformationOperator", "Axis1")); AbstractHashMapVirtualObject axis2 = mappingTarget.getDirectFeature(packageMetaData.getEReference("IfcCartesianTransformationOperator", "Axis2")); AbstractHashMapVirtualObject axis3 = mappingTarget.getDirectFeature(packageMetaData.getEReference("IfcCartesianTransformationOperator", "Axis3")); AbstractHashMapVirtualObject localOrigin = mappingTarget.getDirectFeature(packageMetaData.getEReference("IfcCartesianTransformationOperator", "LocalOrigin")); AbstractHashMapVirtualObject placement = next.getDirectFeature(packageMetaData.getEReference("IfcProduct", "ObjectPlacement")); if (placement != null) { productMatrix = placementToMatrix(placement); AbstractHashMapVirtualObject representation = next.getDirectFeature(representationFeature); if (representation != null) { Set<HashMapVirtualObject> list = representation.getDirectListFeature(packageMetaData.getEReference("IfcProductRepresentation", "Representations")); boolean goForIt = goForIt(list); if (goForIt) { representation = next.getDirectFeature(representationFeature); if (representation != null) { list = representation.getDirectListFeature(packageMetaData.getEReference("IfcProductRepresentation", "Representations")); boolean goForIt2 = goForIt(list);
throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId()); EReference eReference = packageMetaData.getEReference(eClass.getName(), attributeName); if (eReference == null) { throw new UserException("No reference with the name \"" + attributeName + "\" found in class \"" + eClass.getName() + "\"");
HashMapVirtualObject next = queryObjectProvider.next(); while (next != null) { AbstractHashMapVirtualObject geometry = next.getDirectFeature(packageMetaData.getEReference("IfcProduct", "geometry")); if (geometry != null) { float density = (float) geometry.get("density");