        if (shape.isSelected()) {
            this.removeSelectedItem(shape);
        }

        shape.deleteConstraiedViews.getViews().forEach(v => this.remove(v));

        this.idGenerator.unregisterExistingIdForPrefix(shape.viewType, shape.id);
        this.idMap.delete(shape.id);
        if (shape.getObj()) {
            this.byObjIdMap.delete(shape.getObj().id);
        }