[Opengeoscience-developers] OpenGeoscience branch, enhance_map_api, updated. 597c3cb5db990496edbbf33853d68109b2fd2f48

Aashish Chaudhary aashish.chaudhary at kitware.com
Sat Mar 2 19:30:01 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenGeoscience".

The branch, enhance_map_api has been updated
       via  597c3cb5db990496edbbf33853d68109b2fd2f48 (commit)
       via  4790a51068213c566f1d880e13ba9d3d890b1250 (commit)
      from  3754f834428aa9a448156b1645cdef308effe881 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://public.kitware.com/gitweb?p=OpenGeoscience/opengeoscience.git;a=commitdiff;h=597c3cb5db990496edbbf33853d68109b2fd2f48
commit 597c3cb5db990496edbbf33853d68109b2fd2f48
Author:     Aashish Chaudhary <aashish.chaudhary at kitware.com>
AuthorDate: Sat Mar 2 19:29:33 2013 -0500
Commit:     Aashish Chaudhary <aashish.chaudhary at kitware.com>
CommitDate: Sat Mar 2 19:29:33 2013 -0500

    Fixed code style

diff --git a/web/lib/vgl/renderer.js b/web/lib/vgl/renderer.js
index d8f5706..3c2bf23 100644
--- a/web/lib/vgl/renderer.js
+++ b/web/lib/vgl/renderer.js
@@ -21,7 +21,6 @@
 // renderState class
 //
 //////////////////////////////////////////////////////////////////////////////
-///---------------------------------------------------------------------------
 vglModule.renderState = function() {
   this.m_modelViewMatrix = mat4.create();
   this.m_projectionMatrix = null;
@@ -47,7 +46,7 @@ vglModule.renderer = function() {
 
   vglModule.object.call(this);
 
-  // / Private member variables
+  /** Private member variables */
   var m_width = 1280;
   var m_height = 1024;
   var m_clippingRange = [ 0.1, 1000.0 ];
@@ -56,7 +55,7 @@ vglModule.renderer = function() {
 
   m_camera.addChild(m_sceneRoot);
 
-  // / Public member methods
+  /** Public member methods */
 
   /**
    * Get scene root
@@ -101,16 +100,15 @@ vglModule.renderer = function() {
     gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
 
     perspectiveMatrix = m_camera.computeProjectionMatrix((m_width / m_height),
-    0.1, 10000.0);
+                                                         0.1, 10000.0);
 
     var renSt = new vglModule.renderState();
     renSt.m_projectionMatrix = perspectiveMatrix;
     var children = m_sceneRoot.children();
     for ( var i = 0; i < children.length; ++i) {
-      console.log('actor index ' + i);
       var actor = children[i];
       mat4.multiply(m_camera.computeViewMatrix(), actor.matrix(),
-      renSt.m_modelViewMatrix);
+                    renSt.m_modelViewMatrix);
       renSt.m_material = actor.material();
       renSt.m_mapper = actor.mapper();
 
@@ -171,7 +169,7 @@ vglModule.renderer = function() {
    *
    */
   vglModule.renderer.worldToDisplay = function(worldPt, viewMatrix,
-  projectionMatrix, width, height) {
+                                               projectionMatrix, width, height) {
     var viewProjectionMatrix = mat4.create();
     mat4.multiply(projectionMatrix, viewMatrix, viewProjectionMatrix);
 
@@ -201,7 +199,7 @@ vglModule.renderer = function() {
    *
    */
   vglModule.renderer.displayToWorld = function(displayPt, viewMatrix,
-  projectionMatrix, width, height) {
+                                               projectionMatrix, width, height) {
     var x = (2.0 * displayPt[0] / width) - 1;
     var y = -(2.0 * displayPt[1] / height) + 1;
     var z = displayPt[2];
diff --git a/web/lib/vgl/shaderProgram.js b/web/lib/vgl/shaderProgram.js
index 8fbc3d9..dbdb80f 100644
--- a/web/lib/vgl/shaderProgram.js
+++ b/web/lib/vgl/shaderProgram.js
@@ -202,7 +202,7 @@ vglModule.shaderProgram = function() {
   this.bindUniforms = function() {
     for ( var i = 0; i < m_uniforms.length; ++i) {
       m_uniformNameToLocation[m_uniforms[i].name()] = this
-      .queryUniformLocation(m_uniforms[i].name());
+          .queryUniformLocation(m_uniforms[i].name());
 
       console.log(m_uniforms[i].name());
       console.log(this.queryUniformLocation(m_uniforms[i].name()));
diff --git a/web/lib/vgl/utils.js b/web/lib/vgl/utils.js
index 144e051..38f1d5c 100644
--- a/web/lib/vgl/utils.js
+++ b/web/lib/vgl/utils.js
@@ -21,7 +21,6 @@
 // utils class
 //
 ///////////////////////////////////////////////////////////////////////////////
-
 /**
  * Utility class provides helper functions to create geometry objects
  *
@@ -45,18 +44,17 @@ inherit(vglModule.utils, vglModule.object);
  * @returns {vglModule.shader}
  */
 vglModule.utils.createTextureFragmentShader = function(context) {
- var fragmentShaderSource = [
-   'varying highp vec3 iTextureCoord;',
-   'uniform sampler2D sampler2d;',
-   'uniform mediump float opacity;',
-   'void main(void) {',
-     'gl_FragColor = vec4(texture2D(sampler2d, vec2(iTextureCoord.s, iTextureCoord.t)).xyz, opacity);',
-   '}'
-  ].join('\n');
-
- var shader = new vglModule.shader(gl.FRAGMENT_SHADER);
- shader.setShaderSource(fragmentShaderSource);
- return shader;
+  var fragmentShaderSource = [
+                              'varying highp vec3 iTextureCoord;',
+                              'uniform sampler2D sampler2d;',
+                              'uniform mediump float opacity;',
+                              'void main(void) {',
+                              'gl_FragColor = vec4(texture2D(sampler2d, vec2(iTextureCoord.s, iTextureCoord.t)).xyz, opacity);',
+                              '}' ].join('\n');
+
+  var shader = new vglModule.shader(gl.FRAGMENT_SHADER);
+  shader.setShaderSource(fragmentShaderSource);
+  return shader;
 };
 
 /**
@@ -66,17 +64,15 @@ vglModule.utils.createTextureFragmentShader = function(context) {
  * @returns {vglModule.shader}
  */
 vglModule.utils.createFragmentShader = function(context) {
- var fragmentShaderSource = [
-   'varying mediump vec3 iVertexColor;',
-   'uniform mediump float opacity;',
-   'void main(void) {',
-     'gl_FragColor = vec4(iVertexColor, opacity);',
-   '}'
-  ].join('\n');
-
- var shader = new vglModule.shader(gl.FRAGMENT_SHADER);
- shader.setShaderSource(fragmentShaderSource);
- return shader;
+  var fragmentShaderSource = [ 'varying mediump vec3 iVertexColor;',
+                              'uniform mediump float opacity;',
+                              'void main(void) {',
+                              'gl_FragColor = vec4(iVertexColor, opacity);',
+                              '}' ].join('\n');
+
+  var shader = new vglModule.shader(gl.FRAGMENT_SHADER);
+  shader.setShaderSource(fragmentShaderSource);
+  return shader;
 };
 
 /**
@@ -86,22 +82,20 @@ vglModule.utils.createFragmentShader = function(context) {
  * @returns {vglModule.shader}
  */
 vglModule.utils.createTextureVertexShader = function(context) {
- var vertexShaderSource = [
-   'attribute vec3 vertexPosition;',
-   'attribute vec3 textureCoord;',
-   'uniform mat4 modelViewMatrix;',
-   'uniform mat4 projectionMatrix;',
-   'varying highp vec3 iTextureCoord;',
-   'void main(void)',
-   '{',
-   'gl_Position = projectionMatrix * modelViewMatrix * vec4(vertexPosition, 1.0);',
-   ' iTextureCoord = textureCoord;',
-   '}'
- ].join('\n');
-
- var shader = new vglModule.shader(gl.VERTEX_SHADER);
- shader.setShaderSource(vertexShaderSource);
- return shader;
+  var vertexShaderSource = [
+                            'attribute vec3 vertexPosition;',
+                            'attribute vec3 textureCoord;',
+                            'uniform mat4 modelViewMatrix;',
+                            'uniform mat4 projectionMatrix;',
+                            'varying highp vec3 iTextureCoord;',
+                            'void main(void)',
+                            '{',
+                            'gl_Position = projectionMatrix * modelViewMatrix * vec4(vertexPosition, 1.0);',
+                            ' iTextureCoord = textureCoord;', '}' ].join('\n');
+
+  var shader = new vglModule.shader(gl.VERTEX_SHADER);
+  shader.setShaderSource(vertexShaderSource);
+  return shader;
 };
 
 /**
@@ -111,25 +105,23 @@ vglModule.utils.createTextureVertexShader = function(context) {
  * @returns {vglModule.shader}
  */
 vglModule.utils.createVertexShader = function(context) {
-   var vertexShaderSource = [
-     'attribute vec3 vertexPosition;',
-     'attribute vec3 textureCoord;',
-     'attribute vec3 vertexColor;',
-     'uniform mat4 modelViewMatrix;',
-     'uniform mat4 projectionMatrix;',
-     'varying mediump vec3 iVertexColor;',
-     'varying highp vec3 iTextureCoord;',
-     'void main(void)',
-     '{',
-     'gl_Position = projectionMatrix * modelViewMatrix * vec4(vertexPosition, 1.0);',
-     ' iTextureCoord = textureCoord;',
-     ' iVertexColor = vertexColor;',
-     '}'
-   ].join('\n');
-
-   var shader = new vglModule.shader(gl.VERTEX_SHADER);
-   shader.setShaderSource(vertexShaderSource);
-   return shader;
+  var vertexShaderSource = [
+                            'attribute vec3 vertexPosition;',
+                            'attribute vec3 textureCoord;',
+                            'attribute vec3 vertexColor;',
+                            'uniform mat4 modelViewMatrix;',
+                            'uniform mat4 projectionMatrix;',
+                            'varying mediump vec3 iVertexColor;',
+                            'varying highp vec3 iTextureCoord;',
+                            'void main(void)',
+                            '{',
+                            'gl_Position = projectionMatrix * modelViewMatrix * vec4(vertexPosition, 1.0);',
+                            ' iTextureCoord = textureCoord;',
+                            ' iVertexColor = vertexColor;', '}' ].join('\n');
+
+  var shader = new vglModule.shader(gl.VERTEX_SHADER);
+  shader.setShaderSource(vertexShaderSource);
+  return shader;
 };
 
 /**
@@ -141,9 +133,9 @@ vglModule.utils.createVertexShader = function(context) {
  * @returns actor
  *
  */
-vglModule.utils.createPlane = function(originX, originY, originZ,
-                                        point1X, point1Y, point1Z,
-                                        point2X, point2Y, point2Z) {
+vglModule.utils.createPlane = function(originX, originY, originZ, point1X,
+                                       point1Y, point1Z, point2X, point2Y,
+                                       point2Z) {
   var mapper = new vglModule.mapper();
   var planeSource = new vglModule.planeSource();
   planeSource.setOrigin(originX, originY, originZ);
@@ -164,12 +156,10 @@ vglModule.utils.createPlane = function(originX, originY, originZ,
   var modelViewUniform = new vglModule.modelViewUniform("modelViewMatrix");
   var projectionUniform = new vglModule.projectionUniform("projectionMatrix");
 
-  prog.addVertexAttribute(posVertAttr,
-    vglModule.vertexAttributeKeys.Position);
-  prog.addVertexAttribute(colorVertAttr,
-    vglModule.vertexAttributeKeys.Color);
+  prog.addVertexAttribute(posVertAttr, vglModule.vertexAttributeKeys.Position);
+  prog.addVertexAttribute(colorVertAttr, vglModule.vertexAttributeKeys.Color);
   prog.addVertexAttribute(texCoordVertAttr,
-    vglModule.vertexAttributeKeys.TextureCoordinate);
+                          vglModule.vertexAttributeKeys.TextureCoordinate);
   prog.addUniform(opacityUniform);
   prog.addUniform(modelViewUniform);
   prog.addUniform(projectionUniform);
@@ -179,7 +169,6 @@ vglModule.utils.createPlane = function(originX, originY, originZ,
   mat.addAttribute(blend);
 
   var actor = new vglModule.actor();
-  console.log(actor);
   actor.setMapper(mapper);
   actor.setMaterial(mat);
 
@@ -196,8 +185,8 @@ vglModule.utils.createPlane = function(originX, originY, originZ,
  *
  */
 vglModule.utils.createTexturePlane = function(originX, originY, originZ,
-                                               point1X, point1Y, point1Z,
-                                               point2X, point2Y, point2Z) {
+                                              point1X, point1Y, point1Z,
+                                              point2X, point2Y, point2Z) {
 
   var mapper = new vglModule.mapper();
   var planeSource = new vglModule.planeSource();
@@ -219,10 +208,9 @@ vglModule.utils.createTexturePlane = function(originX, originY, originZ,
   var samplerUniform = new vglModule.uniform(gl.INT, "sampler2d");
   samplerUniform.set(0);
 
-  prog.addVertexAttribute(posVertAttr,
-    vglModule.vertexAttributeKeys.Position);
+  prog.addVertexAttribute(posVertAttr, vglModule.vertexAttributeKeys.Position);
   prog.addVertexAttribute(texCoordVertAttr,
-    vglModule.vertexAttributeKeys.TextureCoordinate);
+                          vglModule.vertexAttributeKeys.TextureCoordinate);
   prog.addUniform(opacityUniform);
   prog.addUniform(modelViewUniform);
   prog.addUniform(projectionUniform);
@@ -234,7 +222,6 @@ vglModule.utils.createTexturePlane = function(originX, originY, originZ,
   mat.addAttribute(blend);
 
   var actor = new vglModule.actor();
-  console.log(actor);
   actor.setMapper(mapper);
   actor.setMaterial(mat);
 

http://public.kitware.com/gitweb?p=OpenGeoscience/opengeoscience.git;a=commitdiff;h=4790a51068213c566f1d880e13ba9d3d890b1250
commit 4790a51068213c566f1d880e13ba9d3d890b1250
Author:     Aashish Chaudhary <aashish.chaudhary at kitware.com>
AuthorDate: Sat Mar 2 19:23:02 2013 -0500
Commit:     Aashish Chaudhary <aashish.chaudhary at kitware.com>
CommitDate: Sat Mar 2 19:23:02 2013 -0500

    Removed debug messages

diff --git a/web/lib/app.js b/web/lib/app.js
index 0b3abb0..76fedd2 100644
--- a/web/lib/app.js
+++ b/web/lib/app.js
@@ -42,7 +42,6 @@ function main() {
 
   $(myMap).on('mapUpdated', function() {
     // For test purposes only
-    console.log("Yohoo.....camera has been moved or something");
   });
 
   // / Listen for slider slidechange event
diff --git a/web/lib/geo/layer.js b/web/lib/geo/layer.js
index 93baa9c..87e8817 100644
--- a/web/lib/geo/layer.js
+++ b/web/lib/geo/layer.js
@@ -170,8 +170,6 @@ geoModule.featureLayer = function(options, feature) {
    *
    */
   this.updateLayerOpacity = function(event) {
-    console.log('updated layer opacity');
-
     var mat = m_actor.material();
     var opacityUniform = mat.shaderProgram().uniform('opacity');
 

-----------------------------------------------------------------------

Summary of changes:
 web/lib/app.js               |    1 -
 web/lib/geo/layer.js         |    2 -
 web/lib/vgl/renderer.js      |   14 ++---
 web/lib/vgl/shaderProgram.js |    2 +-
 web/lib/vgl/utils.js         |  135 +++++++++++++++++++-----------------------
 5 files changed, 68 insertions(+), 86 deletions(-)


hooks/post-receive
-- 
OpenGeoscience



More information about the Opengeoscience-developers mailing list