Skip to content

Commit

Permalink
Merge pull request #817 from OpenGeoscience/generalize-mesh
Browse files Browse the repository at this point in the history
Generalize meshes
  • Loading branch information
manthey authored Jun 29, 2018
2 parents e8b5062 + 8499dcc commit e1b835b
Show file tree
Hide file tree
Showing 9 changed files with 900 additions and 495 deletions.
485 changes: 111 additions & 374 deletions src/contourFeature.js

Large diffs are not rendered by default.

33 changes: 19 additions & 14 deletions src/gl/contourFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ var registerFeature = require('../registry').registerFeature;
var contourFeature = require('../contourFeature');

/**
* Create a new instance of contourFeature
* Create a new instance of contourFeature.
*
* @class
* @alias geo.gl.contourFeature
* @extends geo.contourFeature
* @param {geo.contourFeature.spec} arg
* @returns {geo.gl.contourFeature}
*/
var gl_contourFeature = function (arg) {
Expand Down Expand Up @@ -117,17 +118,23 @@ var gl_contourFeature = function (arg) {
* into the various gl uniforms and buffers.
*/
function createGLContours() {
var contour = m_this.createContours(),
var contour = m_this._createContours(),
numPts = contour.elements.length,
colorTable = [],
i, i3, j, j3,
posBuf, opacityBuf, valueBuf, indicesBuf,
geom = m_mapper.geometryData();

m_minColorUniform.set([contour.minColor.r, contour.minColor.g,
contour.minColor.b, contour.minColor.a]);
m_maxColorUniform.set([contour.maxColor.r, contour.maxColor.g,
contour.maxColor.b, contour.maxColor.a]);
m_minColorUniform.set([
contour.minColor.r,
contour.minColor.g,
contour.minColor.b,
contour.minColor.a]);
m_maxColorUniform.set([
contour.maxColor.r,
contour.maxColor.g,
contour.maxColor.b,
contour.maxColor.a]);
m_stepsUniform.set(contour.colorMap.length);
m_steppedUniform.set(contour.stepped);
for (i = 0; i < contour.colorMap.length; i += 1) {
Expand Down Expand Up @@ -162,7 +169,9 @@ var gl_contourFeature = function (arg) {
}

/**
* Initialize
* Initialize.
*
* @param {geo.contourFeature.spec} arg The contour feature specification.
*/
this._init = function (arg) {
var blend = vgl.blend(),
Expand Down Expand Up @@ -230,9 +239,7 @@ var gl_contourFeature = function (arg) {
};

/**
* Build
*
* @override
* Build.
*/
this._build = function () {
if (m_actor) {
Expand All @@ -246,9 +253,7 @@ var gl_contourFeature = function (arg) {
};

/**
* Update
*
* @override
* Update.
*/
this._update = function () {
s_update.call(m_this);
Expand All @@ -264,7 +269,7 @@ var gl_contourFeature = function (arg) {
};

/**
* Destroy
* Destroy.
*/
this._exit = function () {
m_this.renderer().contextRenderer().removeActor(m_actor);
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = $.extend({
lineFeature: require('./lineFeature'),
map: require('./map'),
mapInteractor: require('./mapInteractor'),
meshFeature: require('./meshFeature'),
object: require('./object'),
osmLayer: require('./osmLayer'),
pathFeature: require('./pathFeature'),
Expand Down
Loading

0 comments on commit e1b835b

Please sign in to comment.