Skip to content

Commit

Permalink
Fixed rendering depth option.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsherif committed Dec 19, 2013
1 parent e492b79 commit fe58b81
Show file tree
Hide file tree
Showing 27 changed files with 66 additions and 56 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/*
* BrainBrowser v1.3.7
* BrainBrowser v1.3.8
* https://brainbrowser.cbrain.mcgill.ca/
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/*
* BrainBrowser v1.3.7
* BrainBrowser v1.3.8
* https://brainbrowser.cbrain.mcgill.ca/
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

/*
* BrainBrowser v1.3.7
* BrainBrowser v1.3.8
* https://brainbrowser.cbrain.mcgill.ca/
*
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
Expand Down
24 changes: 12 additions & 12 deletions docs/docular/documentation/docs-metadata.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/docular/documentation/groups-metadata.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h2 id="Parameters">Parameters</h2>
<ul>
<li><strong>format</strong> The format of input file. Should be one of the filetypes described in
BrainBrowser.config.</li>
<li><strong>render_depth</strong> Force rendering at the given depth (can help with transparency).</li>
<li><strong>parse</strong> Parsing options to pass to the worker that will be used to parse the
input file.</li>
<li><strong>before</strong> A callback to be called before loading starts.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h2 id="Parameters">Parameters</h2>
<ul>
<li><strong>format</strong> The format of input file. Should be one of the filetypes described in
BrainBrowser.config.</li>
<li><strong>render_depth</strong> Force rendering at the given depth (can help with transparency).</li>
<li><strong>parse</strong> Parsing options to pass to the worker that will be used to parse the
input file.</li>
<li><strong>before</strong> A callback to be called before loading starts.</li>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BrainBrowser",
"version": "1.3.7",
"version": "1.3.8",
"private": true,
"scripts": {
"start": "node app.js"
Expand Down
Binary file removed public/common/release/brainbrowser-1.3.7.tar.gz
Binary file not shown.
Binary file added public/common/release/brainbrowser-1.3.8.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
*
* * **format** The format of input file. Should be one of the filetypes described in
* BrainBrowser.config.
* * **render_depth** Force rendering at the given depth (can help with transparency).
* * **parse** Parsing options to pass to the worker that will be used to parse the
* input file.
* * **before** A callback to be called before loading starts.
Expand All @@ -57,6 +58,7 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
*
* * **format** The format of input file. Should be one of the filetypes described in
* BrainBrowser.config.
* * **render_depth** Force rendering at the given depth (can help with transparency).
* * **parse** Parsing options to pass to the worker that will be used to parse the
* input file.
* * **before** A callback to be called before loading starts.
Expand Down Expand Up @@ -431,18 +433,18 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
// displays in on the viewer.
function displayModel(model_data, filename, options) {
options = options || {};
var renderDepth = options.renderDepth;
var render_depth = options.render_depth;
var complete = options.complete;

addObject(model_data, filename, renderDepth);
addObject(model_data, filename, render_depth);

viewer.triggerEvent("displaymodel", viewer.model);

if (complete) complete();
}

// Add a polygon object to the scene.
function addObject(model_data, filename, renderDepth){
function addObject(model_data, filename, render_depth){
var model = viewer.model;
var shape, shape_data;
var i, count;
Expand All @@ -464,8 +466,8 @@ BrainBrowser.SurfaceViewer.modules.loading = function(viewer) {
colors: model_data.colors
};

if (renderDepth) {
shape.renderDepth = renderDepth;
if (render_depth) {
shape.renderDepth = render_depth;
}
model.add(shape);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ BrainBrowser.SurfaceViewer.modules.views = function(viewer) {
viewer.setTransparency = function(shape_name, alpha) {
var shape = viewer.model.getObjectByName(shape_name);
var material, wireframe;

if (shape) {
material = shape.material;
material.opacity = alpha;

if (alpha === 1) {
material.transparent = false;
} else {
material.transparent = true;
}

wireframe = shape.getObjectByName("__wireframe__");
if (wireframe) {
wireframe.material.opacity = material.opacity;
Expand Down
Loading

0 comments on commit fe58b81

Please sign in to comment.