use of org.bimserver.interfaces.objects.SBounds in project BIMserver by opensourceBIM.
the class ServiceImpl method getModelBoundsForConcreteRevision.
@Override
public SBounds getModelBoundsForConcreteRevision(Long croid) throws ServerException, UserException {
DatabaseSession session = getBimServer().getDatabase().createSession(OperationType.READ_ONLY);
try {
ConcreteRevision concreteRevision = session.get(croid, OldQuery.getDefault());
Bounds bounds = concreteRevision.getBounds();
Vector3f min = bounds.getMin();
Vector3f max = bounds.getMax();
if (concreteRevision.getMultiplierToMm() != 1f) {
min.setX(min.getX() * concreteRevision.getMultiplierToMm());
min.setY(min.getY() * concreteRevision.getMultiplierToMm());
min.setZ(min.getZ() * concreteRevision.getMultiplierToMm());
max.setX(max.getX() * concreteRevision.getMultiplierToMm());
max.setY(max.getY() * concreteRevision.getMultiplierToMm());
max.setZ(max.getZ() * concreteRevision.getMultiplierToMm());
}
return getBimServer().getSConverter().convertToSObject(bounds);
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations