/** * Method returns the unit shape of this unit. * <p> * If this unit configuration does not provide any shape information the shape of the unit host will be returned. * In case the unit host even does not provide any shape information and the unit is a device than the shape of the device class will be used. * * @return the shape representing the unit. * * @throws NotAvailableException is thrown if the unit shape is not available or the resolution has been failed. */ default Shape getUnitShape() throws NotAvailableException { try { try { return Registries.getLocationRegistry().getUnitShape(getConfig()); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new FatalImplementationErrorException("getLocationRegistry should not throw InterruptedExceptions anymore!", Unit.class, ex); } } catch (final CouldNotPerformException ex) { throw new NotAvailableException("UnitShape", ex); } }
/** * {@inheritDoc} * * @param config {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ @Override public synchronized UnitConfig applyConfigUpdate(UnitConfig config) throws CouldNotPerformException, InterruptedException { this.config = config; Transform3D unitToRootTransform = Registries.getLocationRegistry(true).getUnitToRootTransform3D(config); AxisAlignedBoundingBox3DFloat aabb = Registries.getLocationRegistry().getUnitShape(config).getBoundingBox(); boundingBox = new BoundingBox(unitToRootTransform, aabb); return this.config; }