<commit_before>/**
 * @file Picking Controls
 * @author <NAME> <<EMAIL>>
 * @private
 */


function closer( x, a, b ){
    return x.distanceTo( a ) < x.distanceTo( b ) ;
}


/**
 * Picking data object.
 * @typedef {Object} PickingData - picking data
 * @property {Vector2} canvasPosition - mouse x and y position in pixels relative to the canvas
 * @property {Boolean} [altKey] - whether the alt key was pressed
 * @property {Boolean} [ctrlKey] - whether the control key was pressed
 * @property {Boolean} [metaKey] - whether the meta key was pressed
 * @property {Boolean} [shiftKey] - whether the shift key was pressed
 * @property {AtomProxy} [atom] - picked atom
 * @property {BondProxy} [bond] - picked bond
 * @property {Volume} [volume] - picked volume
 * @property {Object} [instance] - instance data
 * @property {Integer} instance.id - instance id
 * @property {String|Integer} instance.name - instance name
 * @property {Matrix4} instance.matrix - transformation matrix of the instance
 * @property {Vector3} [position] - xyz position of the picked object
 * @property {Component} [component] - component holding the picked object
 */


/**
 * Picking proxy class.
 */
class PickingProxy{

    /**
     * [constructor description]
     * @param  {Object} pickingData - picking data
     * @param  {Stage} stage - stage object
     */
    constructor( pickingData, stage ){

        this.pid = pickingData.pid;
        this.picker = pickingData.picker;
        this.instance = pickingData.instance;

        this.controls = stage.viewerControls;
        this.mouse = stage.mouseObserver;
<commit_msg>added missing assignment of this.stage<commit_after>/**
 * @file Picking Controls
 * @author <NAME> <<EMAIL>>
 * @private
 */


function closer( x, a, b ){
    return x.distanceTo( a ) < x.distanceTo( b ) ;
}


/**
 * Picking data object.
 * @typedef {Object} PickingData - picking data
 * @property {Vector2} canvasPosition - mouse x and y position in pixels relative to the canvas
 * @property {Boolean} [altKey] - whether the alt key was pressed
 * @property {Boolean} [ctrlKey] - whether the control key was pressed
 * @property {Boolean} [metaKey] - whether the meta key was pressed
 * @property {Boolean} [shiftKey] - whether the shift key was pressed
 * @property {AtomProxy} [atom] - picked atom
 * @property {BondProxy} [bond] - picked bond
 * @property {Volume} [volume] - picked volume
 * @property {Object} [instance] - instance data
 * @property {Integer} instance.id - instance id
 * @property {String|Integer} instance.name - instance name
 * @property {Matrix4} instance.matrix - transformation matrix of the instance
 * @property {Vector3} [position] - xyz position of the picked object
 * @property {Component} [component] - component holding the picked object
 */


/**
 * Picking proxy class.
 */
class PickingProxy{

    /**
     * [constructor description]
     * @param  {Object} pickingData - picking data
     * @param  {Stage} stage - stage object
     */
    constructor( pickingData, stage ){

        this.pid = pickingData.pid;
        this.picker = pickingData.picker;
        this.instance = pickingData.instance;

        this.stage = stage;
        this.controls = stage.viewerControls;
        this.mouse = stage.mouseObserver;

{'fraction_non_alphanumeric': 0.11732355637030248, 'fraction_numerical': 0.0018331805682859762, 'mean_word_length': 3.3421750663129974, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '1861485', 'n_tokens_mistral': 925, 'n_tokens_neox': 902, 'n_words': 328}