Skip to content

Commit 8eae86f

Browse files
committed
Cleanup following review
1 parent 4edeb85 commit 8eae86f

File tree

7 files changed

+20
-49
lines changed

7 files changed

+20
-49
lines changed

js/scripts/generate-enums.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ var jsEnumTemplate = compileTemplate('js_enums');
5151
var pyEnumTemplate = compileTemplate('py_enums');
5252

5353

54-
55-
54+
//
55+
// Helper functions
56+
//
5657

5758
function checkUnused() {
5859
return new Promise(function(resolve, reject) {
@@ -78,6 +79,11 @@ function checkUnused() {
7879
});
7980
}
8081

82+
83+
//
84+
// Generator functions
85+
//
86+
8187
function writeJavascriptFile() {
8288
// Here we generate a code to enum string LUT
8389

js/src/core/Renderer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ var RendererView = RenderableView.extend({
8383
acquireRenderer: function() {
8484
RenderableView.prototype.acquireRenderer.call(this);
8585

86-
var background = ThreeModel.prototype.convertColorModelToThree( this.model.get('background') );
87-
var background_opacity = ThreeModel.prototype.convertFloatModelToThree( this.model.get('background_opacity') );
88-
this.renderer.setClearColor( background, background_opacity );
86+
var background = ThreeModel.prototype.convertColorModelToThree(this.model.get('background'));
87+
var background_opacity = ThreeModel.prototype.convertFloatModelToThree(this.model.get('background_opacity'));
88+
this.renderer.setClearColor(background, background_opacity);
8989
}
9090

9191
});

js/src/geometries/PlainGeometry.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
//
2-
// This file auto-generated with generate-wrappers.js
3-
// Date: Thu Jun 01 2017 10:45:06 GMT+0200 (W. Europe Daylight Time)
4-
//
5-
61
var AutogenPlainGeometryModel = require('../geometries/PlainGeometry').PlainGeometryModel;
72

83

js/src/objects/CloneArray.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ function ThreeCloneArray(original, positions, merge) {
1313
}
1414

1515

16-
17-
ThreeCloneArray.prototype = Object.assign( Object.create( THREE.Object3D.prototype ), {
16+
ThreeCloneArray.prototype = Object.assign(Object.create(THREE.Object3D.prototype), {
1817

1918
constructor: ThreeCloneArray,
2019

@@ -51,14 +50,14 @@ ThreeCloneArray.prototype = Object.assign( Object.create( THREE.Object3D.prototy
5150
// Attribute count per
5251
var merged = new THREE.BufferGeometry();
5352
var attributes = geom.attributes;
54-
for ( var key in attributes ) {
53+
for (var key in attributes) {
5554
var attribute = attributes[ key ];
5655
var attributeArray = attribute.array;
5756
// Allocate new buffer:
58-
var mergedAttributeArray = new attributeArray.constructor( attributeArray.length * N );
59-
var mergedAttribute = new attribute.constructor( mergedAttributeArray, attribute.itemSize, attribute.normalized );
57+
var mergedAttributeArray = new attributeArray.constructor(attributeArray.length * N);
58+
var mergedAttribute = new attribute.constructor(mergedAttributeArray, attribute.itemSize, attribute.normalized);
6059
mergedAttribute.dynamic = attribute.dynamic;
61-
merged.addAttribute( key, mergedAttribute );
60+
merged.addAttribute(key, mergedAttribute);
6261
}
6362

6463
var oldIndex = geom.getIndex();

pythreejs/_base/Three.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""
2-
"""
31
from ipywidgets import DOMWidget, Widget, widget_serialization
42
from traitlets import Unicode, CInt, Bool, Instance
53
from .._package import npm_pkg_name

pythreejs/pythreejs.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,25 +143,6 @@ class ShaderMaterial(Material):
143143
wireframeLinewidth = CFloat(1.0).tag(sync=True)
144144

145145

146-
# class SpriteMaterial(Material):
147-
# _view_name = Unicode('SpriteMaterialView').tag(sync=True)
148-
# _model_name = Unicode('SpriteMaterialModel').tag(sync=True)
149-
150-
# uvScale = List(CFloat).tag(sync=True)
151-
# sizeAttenuation = Bool().tag(sync=True)
152-
# uvOffset = List(CFloat).tag(sync=True)
153-
# useScreenCoordinates = Bool().tag(sync=True)
154-
# scaleByViewport = Bool().tag(sync=True)
155-
# alignment = List(CFloat).tag(sync=True)
156-
157-
158-
# class Sprite(Object3D):
159-
# _view_name = Unicode('SpriteView').tag(sync=True)
160-
# _model_name = Unicode('SpriteModel').tag(sync=True)
161-
162-
# material = Instance(Material, allow_none=True).tag(sync=True, **widget_serialization)
163-
# scaleToTexture = Bool().tag(sync=True)
164-
165146

166147
class PlotMesh(Mesh):
167148
plot = Instance('sage.plot.plot3d.base.Graphics3d')
@@ -237,14 +218,6 @@ class AnaglyphEffect(Effect):
237218
_model_name = Unicode('AnaglyphEffectModel').tag(sync=True)
238219

239220

240-
# class SpotLight(PointLight):
241-
# _view_name = Unicode('SpotLight').tag(sync=True)
242-
# _model_name = Unicode('SpotLightModel').tag(sync=True)
243-
244-
# angle = CFloat(10).tag(sync=True)
245-
# exponent = CFloat(0.5).tag(sync=True)
246-
247-
248221
# Some helper classes and functions
249222
def lights_color():
250223
return [

pythreejs/sage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def json_texture(t):
5555
polygonOffsetUnits=1)
5656

5757
def json_box(t):
58-
return BoxGeometry(width=t['size'][0],
59-
height=t['size'][1],
58+
return BoxGeometry(width=t['size'][0],
59+
height=t['size'][1],
6060
depth=t['size'][2])
6161

6262
def json_index_face_set(t):
@@ -94,7 +94,7 @@ def json_line(t):
9494
mesh.append(c)
9595
if (tree_geometry['arrowhead']):
9696
height = .03*tree_geometry['thickness']
97-
c = Mesh(material=m,
97+
c = Mesh(material=m,
9898
geometry=CylinderGeometry(radiusTop=0,
9999
radiusBottom=.02*tree_geometry['thickness'],
100100
height=height,
@@ -135,7 +135,7 @@ def json_text(t):
135135
tree_geometry = t['geometry']
136136
tree_texture = t['texture']
137137
tt = TextTexture(string=tree_geometry['string'])
138-
sm = SpriteMaterial(map=tt, opacity=tree_texture['opacity'], transparent = tree_texture['opacity'] < 1 )
138+
sm = SpriteMaterial(map=tt, opacity=tree_texture['opacity'], transparent = tree_texture['opacity'] < 1)
139139
return Sprite(material=sm, scaleToTexture=True)
140140

141141
def json_point(t):

0 commit comments

Comments
 (0)