wwobjloader2
Version:
New OBJLoader utilizing web worker for three.js
1,183 lines (363 loc) • 14.5 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Documentation Class: WorkerDirector</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">Documentation</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="topNavigation">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
<ul class="dropdown-menu ">
<li><a href="THREE.LoaderSupport.Builder.html">THREE.LoaderSupport.Builder</a></li><li><a href="THREE.LoaderSupport.Callbacks.html">THREE.LoaderSupport.Callbacks</a></li><li><a href="THREE.LoaderSupport.ConsoleLogger.html">THREE.LoaderSupport.ConsoleLogger</a></li><li><a href="THREE.LoaderSupport.LoadedMeshUserOverride.html">THREE.LoaderSupport.LoadedMeshUserOverride</a></li><li><a href="THREE.LoaderSupport.LoaderBase.html">THREE.LoaderSupport.LoaderBase</a></li><li><a href="THREE.LoaderSupport.PrepData.html">THREE.LoaderSupport.PrepData</a></li><li><a href="THREE.LoaderSupport.ResourceDescriptor.html">THREE.LoaderSupport.ResourceDescriptor</a></li><li><a href="THREE.LoaderSupport.Validator.html">THREE.LoaderSupport.Validator</a></li><li><a href="THREE.LoaderSupport.WorkerDirector.html">THREE.LoaderSupport.WorkerDirector</a></li><li><a href="THREE.LoaderSupport.WorkerRunnerRefImpl.html">THREE.LoaderSupport.WorkerRunnerRefImpl</a></li><li><a href="THREE.LoaderSupport.WorkerSupport.html">THREE.LoaderSupport.WorkerSupport</a></li><li><a href="THREE.OBJLoader2.html">THREE.OBJLoader2</a></li>
</ul>
</li>
</ul>
<div class="col-sm-3 col-md-3">
<form class="navbar-form" role="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
<div class="input-group-btn">
<button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="container" id="toc-content">
<div class="row">
<div class="col-md-8">
<div id="main">
<h1 class="page-title">Class: WorkerDirector</h1>
<section>
<header>
<h2>
WorkerDirector
</h2>
</header>
<article>
<div class="container-overview">
<hr>
<dt>
<h4 class="name" id="WorkerDirector"><span class="type-signature"></span>new WorkerDirector(classDef, logger)</h4>
</dt>
<dd>
<div class="description">
<p>Orchestrate loading of multiple OBJ files/data from an instruction queue with a configurable amount of workers (1-16).
Workflow:
prepareWorkers
enqueueForRun
processQueue
deregister</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>classDef</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Class definition to be used for construction</p></td>
</tr>
<tr>
<td class="name"><code>logger</code></td>
<td class="type">
<span class="param-type"><a href="THREE.LoaderSupport.ConsoleLogger.html">THREE.LoaderSupport.ConsoleLogger</a></span>
</td>
<td class="description last"><p>logger to be used</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<hr>
<dt>
<h4 class="name" id="deregister"><span class="type-signature"><static> </span>WorkerDirector#deregister()</h4>
</dt>
<dd>
<div class="description">
<p>Terminate all workers.</p>
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="enqueueForRun"><span class="type-signature"><static> </span>WorkerDirector#enqueueForRun(prepData)</h4>
</dt>
<dd>
<div class="description">
<p>Store run instructions in internal instructionQueue.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>prepData</code></td>
<td class="type">
<span class="param-type"><a href="THREE.LoaderSupport.PrepData.html">THREE.LoaderSupport.PrepData</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getMaxQueueSize"><span class="type-signature"><static> </span>WorkerDirector#getMaxQueueSize()</h4>
</dt>
<dd>
<div class="description">
<p>Returns the maximum length of the instruction queue.</p>
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="getMaxWebWorkers"><span class="type-signature"><static> </span>WorkerDirector#getMaxWebWorkers()</h4>
</dt>
<dd>
<div class="description">
<p>Returns the maximum number of workers.</p>
</div>
<dl class="details">
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">number</span>
</dd>
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="prepareWorkers"><span class="type-signature"><static> </span>WorkerDirector#prepareWorkers(globalCallbacks, maxQueueSize, maxWebWorkers)</h4>
</dt>
<dd>
<div class="description">
<p>Create or destroy workers according limits. Set the name and register callbacks for dynamically created web workers.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>globalCallbacks</code></td>
<td class="type">
<span class="param-type">THREE.OBJLoader2.WWOBJLoader2.PrepDataCallbacks</span>
</td>
<td class="description last"><p>Register global callbacks used by all web workers</p></td>
</tr>
<tr>
<td class="name"><code>maxQueueSize</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Set the maximum size of the instruction queue (1-1024)</p></td>
</tr>
<tr>
<td class="name"><code>maxWebWorkers</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last"><p>Set the maximum amount of workers (1-16)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="processQueue"><span class="type-signature"><static> </span>WorkerDirector#processQueue()</h4>
</dt>
<dd>
<div class="description">
<p>Process the instructionQueue until it is depleted.</p>
</div>
<dl class="details">
</dl>
</dd>
<hr>
<dt>
<h4 class="name" id="setCrossOrigin"><span class="type-signature"><static> </span>WorkerDirector#setCrossOrigin(crossOrigin)</h4>
</dt>
<dd>
<div class="description">
<p>Sets the CORS string to be used.</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>crossOrigin</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>CORS value</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
</div>
</div>
<div class="clearfix"></div>
<div class="col-md-3">
<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
</div>
</div>
</div>
<div class="modal fade" id="searchResults">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Search results</h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<footer>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
on October 24th 2017, 10:38:01 pm
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>
<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
<script>
$( function () {
$( "[id*='$']" ).each( function () {
var $this = $( this );
$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
} );
$( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
var $this = $( this );
var example = $this.find( "code" );
exampleText = example.html();
var lang = /{@lang (.*?)}/.exec( exampleText );
if ( lang && lang[1] ) {
exampleText = exampleText.replace( lang[0], "" );
example.html( exampleText );
lang = lang[1];
} else {
var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
lang = langClassMatch ? langClassMatch[1] : "javascript";
}
if ( lang ) {
$this
.addClass( "sunlight-highlight-" + lang )
.addClass( "linenums" )
.html( example.html() );
}
} );
Sunlight.highlightAll( {
lineNumbers : true,
showMenu : true,
enableDoclinks : true
} );
$.catchAnchorLinks( {
navbarOffset: 10
} );
$( "#toc" ).toc( {
anchorName : function ( i, heading, prefix ) {
return $( heading ).attr( "id" ) || ( prefix + i );
},
selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
showAndHide : false,
smoothScrolling: true
} );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
$( '.dropdown-toggle' ).dropdown();
$( "table" ).each( function () {
var $this = $( this );
$this.addClass('table');
} );
} );
</script>
<!--Navigation and Symbol Display-->
<!--Google Analytics-->
<script type="text/javascript">
$(document).ready(function() {
SearcherDisplay.init();
});
</script>
</body>
</html>