<commit_before>/**
 * A Web-Map3DCityDB class to visualize Layer3DCityDB with Cesium.
 * 
 * @alias Web-Map3DCityDB
 * @constructor
 * 
 * @param {CesiumViewer} cesiumViewer
 */
function WebMap3DCityDB(cesiumViewer){
	this._cesiumViewerInstance = cesiumViewer;
	this._layers = [];	
	this._mouseMoveEvents = false;
	this._mouseClickEvents = false;
	this._eventHandler = new Cesium.ScreenSpaceEventHandler(cesiumViewer.scene.canvas);
	this._cameraEventAggregator = new Cesium.CameraEventAggregator(cesiumViewer.scene.canvas);
}



/**
 * adds a 3DCityDBLayer to the cesiumViewer
 * @param {3DCityDBLayer} layer
 */
WebMap3DCityDB.prototype.addLayer = function(layer){
	for(var i = 0; i < this._layers.length; i++){
		if(layer.id == this._layers[i].id){
			return;
		}
	}
	layer.addToCesium(this._cesiumViewerInstance);
	this._layers.push(layer);
	return;
}


/**
 * removes a 3DCityDBLayer from the cesiumViewer
 * @param {String} id
 */
WebMap3DCityDB.prototype.removeLayer = function(id){	
	for(var i = 0; i < this._layers.length; i++){
		var layer = this._layers[i]; 
		if(id == layer.id){
			layer.removeFromCesium(this._cesiumViewerInstance);
			this._layers.splice(i, 1);
			return;
		}
	}
	return;
}

/** 
 * activates mouseClick Events over objects 
 * @param {Boolean} active
 */
WebMap3DCityDB.prototype.activateMouseClickEvents = function(active){	
	if(active){
		var that = this;
		this._eventHandler.setInputAction(function(event){
			var object = that._cesiumViewerInstance.scene.pick(event.position);
			if(object){
				if(object.id.layerId){
					var layerid = object.id.layerId;
					for(var i = 0; i < that._layers.length; i++){
						if(that._layers[i].id == layerid){
							that._layers[i].triggerEvent("CLICK", object);
						}
					}
				}
			}
		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);		
	}else{
		this._eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
	}
	this._mouseClickEvents = active;	
}<commit_msg>new CtrlClickEvent in 3dcitydb-web-map<commit_after>/**
 * A Web-Map3DCityDB class to visualize Layer3DCityDB with Cesium.
 * 
 * @alias Web-Map3DCityDB
 * @constructor
 * 
 * @param {CesiumViewer} cesiumViewer
 */
function WebMap3DCityDB(cesiumViewer){
	this._cesiumViewerInstance = cesiumViewer;
	this._layers = [];	
	this._mouseMoveEvents = false;
	this._mouseClickEvents = false;
	this._eventHandler = new Cesium.ScreenSpaceEventHandler(cesiumViewer.scene.canvas);
	this._cameraEventAggregator = new Cesium.CameraEventAggregator(cesiumViewer.scene.canvas);
}



/**
 * adds a 3DCityDBLayer to the cesiumViewer
 * @param {3DCityDBLayer} layer
 */
WebMap3DCityDB.prototype.addLayer = function(layer){
	for(var i = 0; i < this._layers.length; i++){
		if(layer.id == this._layers[i].id){
			return;
		}
	}
	layer.addToCesium(this._cesiumViewerInstance);
	this._layers.push(layer);
	return;
}


/**
 * removes a 3DCityDBLayer from the cesiumViewer
 * @param {String} id
 */
WebMap3DCityDB.prototype.removeLayer = function(id){	
	for(var i = 0; i < this._layers.length; i++){
		var layer = this._layers[i]; 
		if(id == layer.id){
			layer.removeFromCesium(this._cesiumViewerInstance);
			this._layers.splice(i, 1);
			return;
		}
	}
	return;
}

/** 
 * activates mouseClick Events over objects 
 * @param {Boolean} active
 */
WebMap3DCityDB.prototype.activateMouseClickEvents = function(active){	
	if(active){
		var that = this;
		this._eventHandler.setInputAction(function(event){
			var object = that._cesiumViewerInstance.scene.pick(event.position);
			if(object){
				if(object.id.layerId){
					var layerid = object.id.layerId;
					for(var i = 0; i < that._layers.length; i++){
						if(that._layers[i].id == layerid){
							that._layers[i].triggerEvent("CLICK", object);
						}
					}
				}
			}
		}, Cesium.ScreenSpaceEventType.LEFT_CLICK);	
		
		this._eventHandler.setInputAction(function(event){
			var object = that._cesiumViewerInstance.scene.pick(event.position);
			if(object){
				if(object.id.layerId){
					var layerid = object.id.layerId;
					for(var i = 0; i < that._layers.length; i++){
						if(that._layers[i].id == layerid){
							that._layers[i].triggerEvent("CTRLCLICK", object);
						}
					}
				}
			}
		}, Cesium.ScreenSpaceEventType.LEFT_CLICK, Cesium.KeyboardEventModifier.CTRL);		
	}else{
		this._eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
		this._eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK, Cesium.KeyboardEventModifier.CTRL);
	}
	this._mouseClickEvents = active;	
}

{'fraction_non_alphanumeric': 0.13453014184397163, 'fraction_numerical': 0.006648936170212766, 'mean_word_length': 4.145952109464082, 'pattern_counts': {'":': 0, '<': 10, '<?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': '2934833', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1574, 'n_words': 262}