<commit_before>/*(function () {
    // Create Composite data type view assembly

    cinema.viewFactory.registerView('composite-image-stack-light', 'view', function (rootSelector, viewType, model) {
        var container = $(rootSelector),
            dataType = model.getDataType(),
            compositeModel = new cinema.decorators.Composite(model),
            controlModel = new cinema.models.ControlModel({ info: model }),
            viewpointModel = new cinema.models.ViewPointModel({ controlModel: controlModel }),
            layers = new cinema.models.LayerModel(compositeModel.getDefaultPipelineSetup(),
                { info: model }),
            renderingModel = new cinema.models.RenderingModel({ url: '/rendering/rendering.json',
                                                                visModel: model }),
            renderer = new cinema.views.VisualizationCanvasWidgetLight({
                el: $('.body-content', container),
                model: compositeModel,
                layers: layers,
                controlModel: controlModel,
                viewpoint: viewpointModel,
                renderingModel: renderingModel
            }),
            mouseInteractor = new cinema.utilities.RenderViewMouseInteractor({
                renderView: renderer,
                camera: viewpointModel
            }).enableMouseWheelZoom({
                maxZoomLevel: 10,
                zoomIncrement: 0.05,
                invertControl: false
            }).enableDragPan({
                keyModifiers: cinema.keyModifiers.SHIFT
            }).enableDragRotation({
                keyModifiers: null
            }),
            compositeTools = new cinema.views.CompositeToolsWidget({
                el: $('.c-tools-panel', container),
                model: compositeModel,
                controlModel: controlModel,
                viewpoint: viewpointModel,
                layers: layers,
                toolbarSelector: '.c-panel-toolbar'
            }),
            renderingView = new cinema.views.RenderingWidget({
                el: $('.c-rendering-panel', container),
                model: compositeModel,
                toolbarSelector: '.c-panel-toolbar',
                viewport: renderer,
                renderingModel: renderingModel
            }),
            controlList = [
                { position: 'right', key: 'tools',     icon: 'icon-tools', title: 'Tools' },
                { position: 'left',  key: 'rendering', icon: 'icon-picture',   title: 'Rendering'}
            ];

            function render () {
                var root = $(rootSelector);
                renderer.setElement($('.c-body-container', root)).render();
                compositeTools.setElement($('.c-tools-panel', root)).render();
                renderingView.setElement($('.c-rendering-panel', root)).render();
                renderer.forceRedraw();
            }

            function refreshCamera () {
                renderer.showViewpoint();
            }

            function resetCamera () {
                renderer.showViewpoint();
                renderer.resetCamera();
            }

            controlModel.on('change', refreshCamera);
            viewpointModel.on('change', refreshCamera);
            renderingView.on('change', refreshCamera);
            cinema.events.on('c:resetCamera', resetCamera);

        return {
            controlList: controlList,
            render: render
        };
    });
}());*/<commit_msg>Convert composite w/ light view<commit_after>cinema.views.CompositeLightView = Backbone.View.extend({
    initialize: function () {
        this.compositeModel = new cinema.decorators.Composite(this.model),
        this.controlModel = new cinema.models.ControlModel({ info: this.model }),
        this.viewpointModel = new cinema.models.ViewPointModel({ controlModel: this.controlModel }),
        this.layers = new cinema.models.LayerModel(this.compositeModel.getDefaultPipelineSetup(),
            { info: this.model }),
        this.renderingModel = new cinema.models.RenderingModel({
            // TODO absolute path...
            url: '/rendering/rendering.json',
            visModel: this.model
        });

        this.controlModel.on('change', this.refreshCamera, this);
        this.viewpointModel.on('change', this.refreshCamera, this);
        this.listenTo(cinema.events, 'c:resetCamera', this.resetCamera);
    },

    render: function () {
        if (this.renderView) {
            this.renderView.remove();
        }

        this.renderView = new cinema.views.VisualizationCanvasWidgetLight({
            el: this.$('.c-body-container'),
            model: this.compositeModel,
            layers: this.layers,
            controlModel: this.controlModel,
            viewpoint: this.viewpointModel,
            renderingModel: this.renderingModel
        });

        new cinema.utilities.RenderViewMouseInteractor({
            renderView: this.renderView,
            camera: this.viewpointModel
        }).enableMouseWheelZoom({
            maxZoomLevel: 10,
            zoomIncrement: 0.05,
            invertControl: false
        }).enableDragPan({
            keyModifiers: cinema.keyModifiers.SHIFT
        }).enableDragRotation({
            keyModifiers: null
        });
        this.renderView.render();

        if (this.toolsWidget) {
            this.toolsWidget.remove();
        }
        if (this.renderingWidget) {
            this.renderingWidget.remove();
        }
        this.toolsWidget = new cinema.views.CompositeToolsWidget({
            el: this.$('.c-tools-panel'),
            model: this.compositeModel,
            controlModel: this.controlModel,
            viewpoint: this.viewpointModel,
            layers: this.layers,
            toolbarSelector: '.c-panel-toolbar'
        });
        this.renderingWidget = new cinema.views.RenderingWidget({
            el: this.$('.c-rendering-panel'),
            model: this.compositeModel,
            toolbarSelector: '.c-panel-toolbar',
            viewport: this.renderView,
            renderingModel: this.renderingModel
        });
        this.toolsWidget.render();
        this.renderingWidget.render();

        return this;
    },

    refreshCamera: function () {
        if (this.renderView) {
            this.renderView.showViewpoint();
        }
    },

    resetCamera: function () {
        if (this.renderView) {
            this.renderView.showViewpoint();
            this.renderView.resetCamera();
        }
    }
});

cinema.viewMapper.registerView('composite-image-stack-light', 'view', cinema.views.CompositeLightView, {
    controls: [
        { position: 'right', key: 'tools', icon: 'icon-tools', title: 'Tools' },
        { position: 'left', key: 'rendering', icon: 'icon-picture', title: 'Rendering'}
    ]
});
{'fraction_non_alphanumeric': 0.11662276851038923, 'fraction_numerical': 0.0014632718759145448, 'mean_word_length': 1.8514810179390906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5649135', 'n_tokens_mistral': 1715, 'n_tokens_neox': 1676, 'n_words': 312}