forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the CSG Viewer visualization plugin
based on conversations here: galaxyproject#1191 (comment)
- Loading branch information
1 parent
01a919c
commit e505a4f
Showing
8 changed files
with
2,382 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE visualization SYSTEM "../../visualization.dtd"> | ||
<visualization name="CSG Viewer"> | ||
<data_sources> | ||
<data_source> | ||
<model_class>HistoryDatasetAssociation</model_class> | ||
<test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.PlyAscii</test> | ||
<test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.PlyBinary</test> | ||
<test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.VtkAscii</test> | ||
<test type="isinstance" test_attr="datatype" result_type="datatype">constructive_solid_geometry.VtkBinary</test> | ||
<to_param param_attr="id">dataset_id</to_param> | ||
</data_source> | ||
</data_sources> | ||
<params> | ||
<param type="dataset" var_name_in_template="hda" required="true">dataset_id</param> | ||
</params> | ||
<template>csg.mako</template> | ||
</visualization> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/** | ||
* Origin: https://raw.githubusercontent.com/mrdoob/three.js/af21991fc7c4e1d35d6a93031707273d937af0f9/examples/js/Detector.js | ||
* @author alteredq / http://alteredqualia.com/ | ||
* @author mr.doob / http://mrdoob.com/ | ||
*/ | ||
|
||
var Detector = { | ||
|
||
canvas: !! window.CanvasRenderingContext2D, | ||
webgl: ( function () { | ||
|
||
try { | ||
|
||
var canvas = document.createElement( 'canvas' ); return !! ( window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ) ); | ||
|
||
} catch ( e ) { | ||
|
||
return false; | ||
|
||
} | ||
|
||
} )(), | ||
workers: !! window.Worker, | ||
fileapi: window.File && window.FileReader && window.FileList && window.Blob, | ||
|
||
getWebGLErrorMessage: function () { | ||
|
||
var element = document.createElement( 'div' ); | ||
element.id = 'webgl-error-message'; | ||
element.style.fontFamily = 'monospace'; | ||
element.style.fontSize = '13px'; | ||
element.style.fontWeight = 'normal'; | ||
element.style.textAlign = 'center'; | ||
element.style.background = '#fff'; | ||
element.style.color = '#000'; | ||
element.style.padding = '1.5em'; | ||
element.style.width = '400px'; | ||
element.style.margin = '5em auto 0'; | ||
|
||
if ( ! this.webgl ) { | ||
|
||
element.innerHTML = window.WebGLRenderingContext ? [ | ||
'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />', | ||
'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.' | ||
].join( '\n' ) : [ | ||
'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>', | ||
'Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.' | ||
].join( '\n' ); | ||
|
||
} | ||
|
||
return element; | ||
|
||
}, | ||
|
||
addGetWebGLMessage: function ( parameters ) { | ||
|
||
var parent, id, element; | ||
|
||
parameters = parameters || {}; | ||
|
||
parent = parameters.parent !== undefined ? parameters.parent : document.body; | ||
id = parameters.id !== undefined ? parameters.id : 'oldie'; | ||
|
||
element = Detector.getWebGLErrorMessage(); | ||
element.id = id; | ||
|
||
parent.appendChild( element ); | ||
|
||
} | ||
|
||
}; | ||
|
||
// browserify support | ||
if ( typeof module === 'object' ) { | ||
|
||
module.exports = Detector; | ||
|
||
} |
Oops, something went wrong.