Skip to content

Commit a722ee8

Browse files
committed
Changes to symbolizer and sytler classes
1 parent f28353e commit a722ee8

File tree

8 files changed

+286
-36
lines changed

8 files changed

+286
-36
lines changed

OpenSensorHubClientLibrary/js/style/geometry.js

+68-5
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,77 @@
1111
*/
1212

1313
/**
14+
* @date May 28, 2015
1415
* @public
1516
*/
1617

1718
var Geometry = function () {
19+
20+
// Privates
21+
var _x = null;
22+
var _y = null;
23+
var _z = null;
24+
var _t = null;
25+
var _propertyName = null;
26+
var _breaks = null;
27+
var _object = null;
28+
29+
this.getPropertyName = function() {
30+
return _propertyName;
31+
}
32+
33+
this.setPropertyName = function(pn) {
34+
_propertyName = pn;
35+
}
36+
37+
this.getT = function() {
38+
return _t;
39+
}
40+
41+
this.setT = function(t) {
42+
_t = t;
43+
}
44+
45+
this.getX = function() {
46+
return _x;
47+
}
48+
49+
this.setX = function(x) {
50+
_x = x;
51+
}
52+
53+
this.getY = function() {
54+
return _y;
55+
}
56+
57+
this.setY = function(y) {
58+
_y = y;
59+
}
60+
61+
this.getZ = function() {
62+
return _z;
63+
}
64+
65+
this.setZ = function(z) {
66+
_z = z;
67+
}
1868

19-
this.x = null;
20-
this.y = null;
21-
this.z = null;
22-
this.t = null;
69+
this.getBreaks = function () {
70+
return _breaks;
71+
}
2372

24-
}
73+
this.setBreaks = function(b) {
74+
_breaks = b;
75+
}
76+
77+
this.getObject = function() {
78+
return _object;
79+
}
80+
81+
this.setObject = function(o) {
82+
_object = o;
83+
}
84+
85+
return this;
86+
87+
} // Geometry
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
*
5+
* Software distributed under the License is distributed on an "AS IS" basis,
6+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7+
* for the specific language governing rights and limitations under the License.
8+
*
9+
* The Initial Developer is Terravolv, Inc. Portions created by the Initial
10+
* Developer are Copyright (C) 2014-2015 the Initial Developer. All Rights Reserved.
11+
*/
12+
13+
/**
14+
* @date May 28, 2015
15+
* @public
16+
*/
17+
18+
var Graphic = function () {
19+
20+
// Privates
21+
var _opacity = null;
22+
var _size = null;
23+
var _rotation = null;
24+
var _spacing = null;
25+
var _glyphs = [];
26+
27+
// Getters & Setters
28+
this.getGlyphs = function () {
29+
return _glyphs;
30+
}
31+
32+
this.setGlyphs = function (images) {
33+
_glyphs = images;
34+
}
35+
36+
this.getOpacity = function() {
37+
return _opacity;
38+
}
39+
40+
41+
this.setOpacity = function(opacity) {
42+
_opacity = opacity;
43+
}
44+
45+
46+
this.getRotation = function () {
47+
return _rotation;
48+
}
49+
50+
51+
this.setRotation = function (rotation) {
52+
_rotation = rotation;
53+
}
54+
55+
56+
this.getSize = function() {
57+
return _size;
58+
}
59+
60+
61+
this.setSize = function(size) {
62+
_size = size;
63+
}
64+
65+
66+
this.getSpacing = function() {
67+
return _spacing;
68+
}
69+
70+
71+
this.setSpacing = function(spacing)
72+
{
73+
_spacing = spacing;
74+
}
75+
76+
return this;
77+
78+
} // Graphic

OpenSensorHubClientLibrary/js/style/pointgraphic.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
/**
14+
* @date May 28, 2015
1415
* @public
1516
*/
1617

@@ -27,6 +28,7 @@ var ShapeType = {
2728

2829
var PointGraphic = function () {
2930

31+
// Public
3032
this.shapetype = ShapeType.UNKNOWN;
3133
this.orientation = null;
3234
this.size = null;
@@ -45,6 +47,7 @@ var PointGraphic = function () {
4547

4648
return this;
4749

48-
};
50+
} // PointGraphic
4951

52+
// Extends PrimitiveGraphic
5053
PointGraphic.prototype = Object.create(PrimitiveGraphic.prototype);

OpenSensorHubClientLibrary/js/style/pointstyler.js

+26-12
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,33 @@
1414
* @public
1515
*/
1616

17-
var PointStyler = function (sym) {
17+
var PointStyler = function () {
1818

19-
this.symbolizer = null;
20-
this.point = null;
19+
// Private
20+
var _symbolizer = null;
21+
var _point = null;
2122

22-
__construct = function (me) {
23-
me.symbolizer = sym;
24-
me.point = new PointGraphic();
25-
} (this);
23+
// Constructor
24+
__construct = function () {
25+
_point = new PointGraphic();
26+
} ();
27+
28+
this.setSymbolizer = function(symbolizer) {
29+
_symbolizer = symbolizer;
30+
}
31+
32+
this.getSymbolizer = function () {
33+
return _symbolizer;
34+
}
2635

27-
point.x = sym.x;
28-
point.y = sym.y;
29-
point.z = sym.z;
36+
this.getPoint = function() {
37+
38+
// Merge data with symbology and return renderer independent point graphic
39+
40+
return _point;
41+
}
3042

31-
return point;
32-
};
43+
return this;
44+
45+
} // PointStyler
46+

OpenSensorHubClientLibrary/js/style/pointsymbolizer.js

+16-5
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,28 @@
1111
*/
1212

1313
/**
14+
* @date May 28, 2015
1415
* @public
1516
*/
1617

1718
var PointSymbolizer = function () {
1819

19-
this.opacity = null;
20-
this.size = null;
21-
this.rotation = null;
22-
this.spacing = null;
23-
this.images = [];
20+
// Privates
21+
var _graphic = null;
22+
23+
// Getters & Setters
24+
25+
this.getGraphic = function() {
26+
return _graphic;
27+
}
28+
29+
this.setGraphic = function(graphic) {
30+
_graphic = graphic;
31+
}
32+
33+
return this;
2434

2535
};
2636

37+
// Extends Symbolizer
2738
PointSymbolizer.prototype = Object.create(Symbolizer.prototype);

OpenSensorHubClientLibrary/js/style/primitivegraphic.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,29 @@
1111
*/
1212

1313
/**
14+
* @date May 28, 2015
1415
* @public
1516
*/
1617

1718
var PrimitiveGraphic = function () {
1819

20+
// Private
21+
var _basename = "PrmitiveGraphic";
22+
23+
// Public
1924
this.x = null;
2025
this.y = null;
2126
this.z = null;
2227
this.r = null;
2328
this.g = null;
2429
this.b = null;
2530
this.t = null;
26-
this.basename = "PrmitiveGraphic";
31+
32+
// Getters & Setters
33+
this.basename = function () {
34+
return _basename;
35+
}
2736

2837
return this;
2938

30-
};
39+
} // PrimitiveGraphic
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
*
5+
* Software distributed under the License is distributed on an "AS IS" basis,
6+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7+
* for the specific language governing rights and limitations under the License.
8+
*
9+
* The Initial Developer is Terravolv, Inc. Portions created by the Initial
10+
* Developer are Copyright (C) 2014-2015 the Initial Developer. All Rights Reserved.
11+
*/
12+
13+
/**
14+
* @date May 28, 2015
15+
* @public
16+
*/
17+
18+
var ScalarParamter = function() {
19+
20+
// Privates
21+
var _propertyName = null;
22+
var _constantValue = null;
23+
var _mappingFunction = null;
24+
var _constant = true;
25+
26+
// Getters and Setters
27+
this.isConstant = function() {
28+
return _constant;
29+
}
30+
31+
this.setConstant = function(c) {
32+
_constant = c;
33+
}
34+
35+
this.getConstantValue = function() {
36+
return _constantValue;
37+
}
38+
39+
this.setConstantValue = function(cv) {
40+
_constantValue = cv;
41+
_constant = false;
42+
}
43+
44+
this.getMappedValue = function() {
45+
return this.getConstantValue();
46+
}
47+
48+
this.getMappingFunction = function() {
49+
return _mappingFunction;
50+
}
51+
52+
this.setMappingFunction = function (mf) {
53+
_mappingFunction = mf;
54+
_constant = false;
55+
}
56+
57+
this.getPropertyName = function () {
58+
return _propertyName;
59+
}
60+
61+
this.setPropertyName = function(pn) {
62+
_propertyName = pn;
63+
_constant = false;
64+
}
65+
66+
return this;
67+
68+
} // ScalarParameter

0 commit comments

Comments
 (0)