Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize meshes #817

Merged
merged 10 commits into from
Jun 29, 2018
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