/** * GUI component * @param apiComponent * @constructor */ R3.GUI = function( apiComponent ) { __RUNTIME_COMPONENT__; __UPGRADE_TO_RUNTIME__; }; R3.GUI.prototype = Object.create(R3.Component.prototype); R3.GUI.prototype.constructor = R3.GUI; /** * Creates a helper instance */ R3.GUI.prototype.createInstance = function() { this.instance = new this.guiRuntime.instance( { autoPlace: false } ); __CREATE_INSTANCE__; }; /** * Updates the instance with the current state */ R3.GUI.prototype.updateInstance = function(property) { if (property === 'domElement') { console.warn('todo: update domElement for gui'); return; } __UPDATE_INSTANCE__; }; /** * Removes empty folders from instance */ R3.GUI.prototype.removeEmtpyFolders = function() { this.instance.removeEmptyFolders(); }; /** * Remove all folders from instance */ R3.GUI.prototype.removeAllFolders = function() { this.instance.removeAllFolders(); }; /** * Adds a folder to instance * @param folderName * @returns {*} */ R3.GUI.prototype.addFolder = function(folderName) { try { return this.instance.addFolder(folderName); } catch (e) { try { folderName += ' duplicate (' + R3.Utils.RandomId() + ')'; return this.instance.addFolder(folderName); } catch (e) { console.log(e.message); return null; } } };