<commit_before>/*
 * 3DCityDB-Web-Map
 * http://www.3dcitydb.org/
 * 
 * Copyright 2015 - 2016
 * Chair of Geoinformatics
 * Technical University of Munich, Germany
 * https://www.gis.bgu.tum.de/
 * 
 * The 3DCityDB-Web-Map is jointly developed with the following
 * cooperation partners:
 * 
 * virtualcitySYSTEMS GmbH, Berlin <http://www.virtualcitysystems.de/>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

(function() {
	function Cesium3DTilesDataLayer(options){	
		
		var proxyUrl;
		if (location.host.indexOf('8000') > -1) {
			proxyUrl = '/proxy/'
		}
		else {
			proxyUrl = location.protocol + '//' + location.host + '/proxy/'
		}
		this._defaultProxy = new Cesium.DefaultProxy(proxyUrl)
		
		this._url = options.url;
		this._name = options.name;
		this._id = Cesium.defaultValue(options.id, Cesium.createGuid());		
		this._region = options.region;
		this._active = Cesium.defaultValue(options.active, true);
		this._highlightedObjects = {};		
		this._hiddenObjects = [];
		this._cameraPosition = {};
		this._thematicDataUrl = Cesium.defaultValue(options.thematicDataUrl, "");
		this._thematicDataProvider = Cesium.defaultValue(options.thematicDataProvider, "");
		this._cesiumViewer = undefined;
		this._tileset = undefined;		
		
		this._highlightColor = new Cesium.Color(0.4, 0.4, 0.0, 1.0);
		this._mouseOverhighlightColor = new Cesium.Color(0.0, 0.3, 0.0, 1.0);
		
		this._configParameters = {
			"id": this.id,
			"name" : this.name,
			"url" : this.url,
			"thematicDataUrl" : this.thematicDataUrl,
			"thematicDataProvider" : this._thematicDataProvider
		}
	
		/**
		 * handles ClickEvents
		 */
		this._clickEvent = new Cesium.Event();
		
		this._ctrlClickEvent = new Cesium.Event();
		
		/**
		 * handles ClickEvents
		 */
		this._mouseInEvent = new Cesium.Event();
		
		/**
		 * handles ClickEvents
		 */
		this._mouseOutEvent = new Cesium.Event();
		
		this._viewChangedEvent = new Cesium.Event();
		
		Cesium.knockout.track(this, ['_highlightedObjects', '_hiddenObjects']);
	}

	Object.defineProperties(Cesium3DTilesDataLayer.prototype, {
	    /**
	     * Gets the active 
	     */
	    active : {
	        get : function(){
	        	return this._active;
	        }
	    },
	    /**
	     * Gets the currently highlighted Objects as an array
	     */
	    highlightedObjects : {
	        get : function(){
	        	return this._highlightedObjects;
	        },
	        set : function(value){
	        	this._highlightedObjects = value;
	        }	    
	    },
	    /**
	     * Gets the currently hidden Objects as an array
	     */
	    hiddenObjects : {
	        get : function(){
	        	return this._hiddenObjects;
	        },
	        set : function(value){
	        	this._hiddenObjects = value;
	        }	
	    },
	    /**
	     * Gets/Sets the CameraPosition.
	     */
	    cameraPosition : {
	        get : function(){
	        	return this._cameraPosition;
	        },
	        set : function(value){
	        	this._cameraPosition = value;
	        }
	    },
	    /**
	     * Gets the url of the datasource
	     */
	    url : {
	        get : function(){
	        	return this._url;
	        },
	        set : function(value){
	        	this._url = value;
	        }
	    },
	    /**
	     * Gets the name of this datasource.
	     */
	    name : {
	        get : function(){
	        	return this._name;
	        },
	        set : function(value){
	        	this._name = value;
	        }
	    },
	    /**
	     * Gets the id of this datasource, the id should be unique.
	     */
	    id : {
	        get : function(){
	        	return this._id;
	        },
	        set : function(value){
	        	this._id = value;
	        }
	    },
	    /**
	     * Gets boundingbox of this layer as an Cesium Rectangle Object with longitude/latitude values in radians. 
	     */
	    region : {
	        get : function(){
	        	return this._region;
	        }
	    },
	    
	    thematicDataUrl : {
	        get : function(){
	        	return this._thematicDataUrl;
	        },
	        set : function(value){
	        	this._thematicDataUrl = value;
	        }
	    },
	    
	    thematicDataProvider : {
	        get : function(){
	        	return this._thematicDataProvider;
	        },
	        set : function(value){
	        	this._thematicDataProvider = value;
	        }
	    },
	    
	    highlightColor : {
	        get : function(){
	        	return this._highlightColor;
	        },
	        set : function(value){
	        	this._highlightColor = value;
	        }
	    },
	    
	    mouseOverhighlightColor : {
	        get : function(){
	        	return this._mouseOverhighlightColor;
	        },
	        set : function(value){
	        	this._mouseOverhighlightColor = value;
	        }
	    },
	    
	    configParameters : {
	        get : function(){
	        	return this._configParameters;
	        }
	    }
	});

	/**<commit_msg>minor fix<commit_after>/*
 * 3DCityDB-Web-Map
 * http://www.3dcitydb.org/
 * 
 * Copyright 2015 - 2016
 * Chair of Geoinformatics
 * Technical University of Munich, Germany
 * https://www.gis.bgu.tum.de/
 * 
 * The 3DCityDB-Web-Map is jointly developed with the following
 * cooperation partners:
 * 
 * virtualcitySYSTEMS GmbH, Berlin <http://www.virtualcitysystems.de/>
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 *     
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

(function() {
	function Cesium3DTilesDataLayer(options){	
		
		var proxyUrl;
		if (location.host.indexOf('8000') > -1) {
			proxyUrl = '/proxy/'
		}
		else {
			proxyUrl = location.protocol + '//' + location.host + '/proxy/'
		}
		this._defaultProxy = new Cesium.DefaultProxy(proxyUrl)
		
		this._url = options.url;
		this._name = options.name;
		this._id = Cesium.defaultValue(options.id, Cesium.createGuid());		
		this._region = options.region;
		this._active = Cesium.defaultValue(options.active, true);
		this._highlightedObjects = {};		
		this._hiddenObjects = [];
		this._cameraPosition = {};
		this._thematicDataUrl = Cesium.defaultValue(options.thematicDataUrl, "");
		this._cityobjectsJsonUrl = options.cityobjectsJsonUrl;
		this._thematicDataProvider = Cesium.defaultValue(options.thematicDataProvider, "");
		this._cesiumViewer = undefined;
		this._tileset = undefined;		
		
		this._highlightColor = new Cesium.Color(0.4, 0.4, 0.0, 1.0);
		this._mouseOverhighlightColor = new Cesium.Color(0.0, 0.3, 0.0, 1.0);
		
		this._configParameters = {
			"id": this.id,
			"name" : this.name,
			"url" : this.url,
			"thematicDataUrl" : this.thematicDataUrl,
			"thematicDataProvider" : this._thematicDataProvider
		}
	
		/**
		 * handles ClickEvents
		 */
		this._clickEvent = new Cesium.Event();
		
		this._ctrlClickEvent = new Cesium.Event();
		
		/**
		 * handles ClickEvents
		 */
		this._mouseInEvent = new Cesium.Event();
		
		/**
		 * handles ClickEvents
		 */
		this._mouseOutEvent = new Cesium.Event();
		
		this._viewChangedEvent = new Cesium.Event();
		
		Cesium.knockout.track(this, ['_highlightedObjects', '_hiddenObjects']);
	}

	Object.defineProperties(Cesium3DTilesDataLayer.prototype, {
	    /**
	     * Gets the active 
	     */
	    active : {
	        get : function(){
	        	return this._active;
	        }
	    },
	    /**
	     * Gets the currently highlighted Objects as an array
	     */
	    highlightedObjects : {
	        get : function(){
	        	return this._highlightedObjects;
	        },
	        set : function(value){
	        	this._highlightedObjects = value;
	        }	    
	    },
	    /**
	     * Gets the currently hidden Objects as an array
	     */
	    hiddenObjects : {
	        get : function(){
	        	return this._hiddenObjects;
	        },
	        set : function(value){
	        	this._hiddenObjects = value;
	        }	
	    },
	    /**
	     * Gets/Sets the CameraPosition.
	     */
	    cameraPosition : {
	        get : function(){
	        	return this._cameraPosition;
	        },
	        set : function(value){
	        	this._cameraPosition = value;
	        }
	    },
	    /**
	     * Gets the url of the datasource
	     */
	    url : {
	        get : function(){
	        	return this._url;
	        },
	        set : function(value){
	        	this._url = value;
	        }
	    },
	    /**
	     * Gets the name of this datasource.
	     */
	    name : {
	        get : function(){
	        	return this._name;
	        },
	        set : function(value){
	        	this._name = value;
	        }
	    },
	    /**
	     * Gets the id of this datasource, the id should be unique.
	     */
	    id : {
	        get : function(){
	        	return this._id;
	        },
	        set : function(value){
	        	this._id = value;
	        }
	    },
	    /**
	     * Gets boundingbox of this layer as an Cesium Rectangle Object with longitude/latitude values in radians. 
	     */
	    region : {
	        get : function(){
	        	return this._region;
	        }
	    },
	    
	    thematicDataUrl : {
	        get : function(){
	        	return this._thematicDataUrl;
	        },
	        set : function(value){
	        	this._thematicDataUrl = value;
	        }
	    },
	    
	    thematicDataProvider : {
	        get : function(){
	        	return this._thematicDataProvider;
	        },
	        set : function(value){
	        	this._thematicDataProvider = value;
	        }
	    },
	    
	    cityobjectsJsonUrl : {
	        get : function(){
	        	return this._cityobjectsJsonUrl;
	        },
	        set : function(value){
	        	this._cityobjectsJsonUrl = value;
	        }
	    },
	    
	    highlightColor : {
	        get : function(){
	        	return this._highlightColor;
	        },
	        set : function(value){
	        	this._highlightColor = value;
	        }
	    },
	    
	    mouseOverhighlightColor : {
	        get : function(){
	        	return this._mouseOverhighlightColor;
	        },
	        set : function(value){
	        	this._mouseOverhighlightColor = value;
	        }
	    },
	    
	    configParameters : {
	        get : function(){
	        	return this._configParameters;
	        }
	    }
	});

	/**
{'fraction_non_alphanumeric': 0.11357890935355724, 'fraction_numerical': 0.006861682918020947, 'mean_word_length': 1.913466596528143, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 8, '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': '491281', 'n_tokens_mistral': 3677, 'n_tokens_neox': 3129, 'n_words': 734}