<commit_before>'use strict';
var ShaderGenerator = require( 'osgShader/ShaderGenerator' );
var ShadowCastShaderGenerator = require( 'osgShadow/ShadowCastShaderGenerator' );
var DisplayNormalVisitor = require( 'osgUtil/DisplayNormalVisitor' );
var DisplayGeometryVisitor = require( 'osgUtil/DisplayGeometryVisitor' );

var ShaderGeneratorProxy = function () {

    // object of shader generators
    this._generators = {};
    this.addShaderGenerator( 'default', new ShaderGenerator() );
    this.addShaderGenerator( 'ShadowCast', new ShadowCastShaderGenerator() );
    this.addShaderGenerator( 'debugNormal', new DisplayNormalVisitor.ShaderGeneratorCompilerOffsetNormal() );
    this.addShaderGenerator( 'debugTangent', new DisplayNormalVisitor.ShaderGeneratorCompilerOffsetTangent() );
    this.addShaderGenerator( 'debugGeometry', new DisplayGeometryVisitor.ShaderGeneratorCompilerColorGeometry() );
    this.addShaderGenerator( 'debugSkinning', new DisplayGeometryVisitor.ShaderGeneratorCompilerColorSkinning() );

    return this;
};

ShaderGeneratorProxy.prototype = {

    getShaderGenerator: function ( name ) {

        if ( !name ) return this._generators.default;

        return this._generators[ name ];
    },

    // user-space facility to provide its own
    addShaderGenerator: function ( name, sg ) {

        this._generators[ name ] = sg;

    }

};

module.exports = ShaderGeneratorProxy;<commit_msg>Prints an error if shader generator require is not present<commit_after>'use strict';
var notify = require( 'osg/notify' );
var ShaderGenerator = require( 'osgShader/ShaderGenerator' );
var ShadowCastShaderGenerator = require( 'osgShadow/ShadowCastShaderGenerator' );
var DisplayNormalVisitor = require( 'osgUtil/DisplayNormalVisitor' );
var DisplayGeometryVisitor = require( 'osgUtil/DisplayGeometryVisitor' );

var ShaderGeneratorProxy = function () {

    // object of shader generators
    this._generators = {};
    this.addShaderGenerator( 'default', new ShaderGenerator() );
    this.addShaderGenerator( 'ShadowCast', new ShadowCastShaderGenerator() );
    this.addShaderGenerator( 'debugNormal', new DisplayNormalVisitor.ShaderGeneratorCompilerOffsetNormal() );
    this.addShaderGenerator( 'debugTangent', new DisplayNormalVisitor.ShaderGeneratorCompilerOffsetTangent() );
    this.addShaderGenerator( 'debugGeometry', new DisplayGeometryVisitor.ShaderGeneratorCompilerColorGeometry() );
    this.addShaderGenerator( 'debugSkinning', new DisplayGeometryVisitor.ShaderGeneratorCompilerColorSkinning() );

    return this;
};

ShaderGeneratorProxy.prototype = {

    getShaderGenerator: function ( name ) {

        if ( !name ) return this._generators.default;

        var shaderGenerator = this._generators[ name ];

        if ( !shaderGenerator ) {
            notify.error( 'ShaderGenerator ' + name + ' does not exist in ShaderGeneratorProxy' );
            return this._generators.default;
        }

        return shaderGenerator;
    },

    // user-space facility to provide its own
    addShaderGenerator: function ( name, sg ) {

        this._generators[ name ] = sg;

    }

};

module.exports = ShaderGeneratorProxy;
{'fraction_non_alphanumeric': 0.09968354430379747, 'fraction_numerical': 0.0, 'mean_word_length': 4.614564831261101, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4811663', 'n_tokens_mistral': 824, 'n_tokens_neox': 794, 'n_words': 183}