<commit_before>/*******************************************************************************
#      ____               __          __  _      _____ _       _               #
#     / __ \              \ \        / / | |    / ____| |     | |              #
#    | |  | |_ __   ___ _ __ \  /\  / /__| |__ | |  __| | ___ | |__   ___      #
#    | |  | | '_ \ / _ \ '_ \ \/  \/ / _ \ '_ \| | |_ | |/ _ \| '_ \ / _ \     #
#    | |__| | |_) |  __/ | | \  /\  /  __/ |_) | |__| | | (_) | |_) |  __/     #
#     \____/| .__/ \___|_| |_|\/  \/ \___|_.__/ \_____|_|\___/|_.__/ \___|     #
#           | |                                                                #
#           |_|                 _____ _____  _  __                             #
#                              / ____|  __ \| |/ /                             #
#                             | (___ | |  | | ' /                              #
#                              \___ \| |  | |  <                               #
#                              ____) | |__| | . \                              #
#                             |_____/|_____/|_|\_\                             #
#                                                                              #
#                              (c) 2010-2011 by                                #
#           University of Applied Sciences Northwestern Switzerland            #
#                     Institute of Geomatics Engineering                       #
#                           <EMAIL>                            #
********************************************************************************
*     Licensed under MIT License. Read the file LICENSE for more information   *
*******************************************************************************/      


goog.provide('owg.ogContext');

goog.require('goog.debug.Logger');
goog.require('owg.ObjectDefs');
goog.require('owg.ogObject');
goog.require('owg.engine3d');

//------------------------------------------------------------------------------
// CALLBACK FUNCTIONS FOR ENGINE
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {engine3d} engine the engine
 */
function _ctx_callback_init(engine)
{ 
   var context = engine.owg;
   
   if (context.cbfInit)
   {
      context.cbfInit(context.id);
   }
   
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} dt time delta (in milliseconds)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_timer(dt, engine)
{
   var context = engine.owg;
   
   if (context.cbfTimer)
   {
      context.cbfTimer(context.id, dt);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {engine3d} engine the engine
 */
function _ctx_callback_render(engine)
{
   var context = engine.owg;
   
   if (context.cbfRender)
   {
      context.cbfRender(context.id);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} button mouse button
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mousedown(button, x, y, engine)
{
      var context = engine.owg;
   
   if (context.cbfMouseDown)
   {
      context.cbfMouseDown(context.id, button, x, y);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} button mouse button
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mouseup(button, x, y, engine)
{
   var context = engine.owg;
   
   if (context.cbfMouseUp)
   {
      context.cbfMouseUp(context.id);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mousemove(x, y, engine)
{
   var context = engine.owg;
   
   if (context.cbfMouseMove)<commit_msg>Bugfix: Mouse-Up callback sends "context, button, x, y" now<commit_after>/*******************************************************************************
#      ____               __          __  _      _____ _       _               #
#     / __ \              \ \        / / | |    / ____| |     | |              #
#    | |  | |_ __   ___ _ __ \  /\  / /__| |__ | |  __| | ___ | |__   ___      #
#    | |  | | '_ \ / _ \ '_ \ \/  \/ / _ \ '_ \| | |_ | |/ _ \| '_ \ / _ \     #
#    | |__| | |_) |  __/ | | \  /\  /  __/ |_) | |__| | | (_) | |_) |  __/     #
#     \____/| .__/ \___|_| |_|\/  \/ \___|_.__/ \_____|_|\___/|_.__/ \___|     #
#           | |                                                                #
#           |_|                 _____ _____  _  __                             #
#                              / ____|  __ \| |/ /                             #
#                             | (___ | |  | | ' /                              #
#                              \___ \| |  | |  <                               #
#                              ____) | |__| | . \                              #
#                             |_____/|_____/|_|\_\                             #
#                                                                              #
#                              (c) 2010-2011 by                                #
#           University of Applied Sciences Northwestern Switzerland            #
#                     Institute of Geomatics Engineering                       #
#                           <EMAIL>                            #
********************************************************************************
*     Licensed under MIT License. Read the file LICENSE for more information   *
*******************************************************************************/      


goog.provide('owg.ogContext');

goog.require('goog.debug.Logger');
goog.require('owg.ObjectDefs');
goog.require('owg.ogObject');
goog.require('owg.engine3d');

//------------------------------------------------------------------------------
// CALLBACK FUNCTIONS FOR ENGINE
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {engine3d} engine the engine
 */
function _ctx_callback_init(engine)
{ 
   var context = engine.owg;
   
   if (context.cbfInit)
   {
      context.cbfInit(context.id);
   }
   
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} dt time delta (in milliseconds)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_timer(dt, engine)
{
   var context = engine.owg;
   
   if (context.cbfTimer)
   {
      context.cbfTimer(context.id, dt);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {engine3d} engine the engine
 */
function _ctx_callback_render(engine)
{
   var context = engine.owg;
   
   if (context.cbfRender)
   {
      context.cbfRender(context.id);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} button mouse button
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mousedown(button, x, y, engine)
{
      var context = engine.owg;
   
   if (context.cbfMouseDown)
   {
      context.cbfMouseDown(context.id, button, x, y);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} button mouse button
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mouseup(button, x, y, engine)
{
   var context = engine.owg;
   
   if (context.cbfMouseUp)
   {
      context.cbfMouseUp(context.id, button, x, y);
   }
}
//------------------------------------------------------------------------------
/**
 * @ignore
 * @param {number} x mouse x-coord (window coord)
 * @param {number} y mouse y-coord (window coord)
 * @param {engine3d} engine the engine
 */
function _ctx_callback_mousemove(x, y, engine)
{
   var context = engine.owg;
   
   if (context.cbfMouseMove)
{'fraction_non_alphanumeric': 0.29843421360130873, 'fraction_numerical': 0.0035054919373685442, 'mean_word_length': 1.028679781938848, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1179062', 'n_tokens_mistral': 2287, 'n_tokens_neox': 2192, 'n_words': 390}