//>>built
define("dojox/dgauges/CircularRangeIndicator",["dojo/_base/declare","./ScaleIndicatorBase","./_circularUtils","dojo/_base/event"],function(o,p,n,r){return o("dojox.dgauges.CircularRangeIndicator",p,{start:0,radius:NaN,startThickness:6,endThickness:6,fill:null,stroke:null,constructor:function(){this.indicatorShapeFunc=null;this.fill=[255,120,0];this.stroke={color:"black",width:0.2};this.interactionMode="none";this.addInvalidatingProperties("start,radius,startThickness,endThickness,fill,stroke".split(","))},
_interpolateColor:function(d,c,e){return((1-e)*(d>>16&255)+e*(c>>16&255)&255)<<16|((1-e)*(d>>8&255)+e*(c>>8&255)&255)<<8|(1-e)*(d&255)+e*(c&255)&255},_colorsInterpolation:function(d,c,e){for(var b=[],a=0,f=0;f<d.length-1;f++)a=(c[f+1]-c[f])*e,a=Math.round(a),b=b.concat(_colorInterpolation(d[f],d[f+1],a));return b},_alphasInterpolation:function(d,c,e){for(var b=[],a=0,f=0;f<d.length-1;f++)a=(c[f+1]-c[f])*e,a=Math.round(a),b=b.concat(_alphaInterpolation(d[f],d[f+1],a));return b},_alphaInterpolation:function(d,
c,e){for(var c=(c-d)/(e-1),b=[],a=0;a<e;a++)b.push(d+a*c);return b},_colorInterpolation:function(d,c,e){for(var b=[],a=0;a<e;a++)b.push(_interpolateColor(d,c,a/(e-1)));return b},_getEntriesFor:function(d,c){for(var e=[],b,a=0;a<d.length;a++)b=d[a],b=null==b[c]||isNaN(b[c])?a/(d.length-1):b[c],e.push(b);return e},_drawColorTrack:function(d,c,e,b,a,f,g,i,h,o,p,j){var k=0.05,g=6.28318530718-n.computeAngle(f,g,a);isNaN(j)||(j=n.computeAngle(f,j,a),h*=j/g,g=j);var j=Math.max(2,Math.floor(g/k)),k=g/j,q=
0,g=-i,q=(i-h)/j,l;"clockwise"==a&&(k=-k);var m=[],a=c+Math.cos(f)*(b+g),i=e-Math.sin(f)*(b+g);m.push(a,i);for(h=0;h<j;h++)l=f+h*k,a=c+Math.cos(l+k)*(b+g+h*q),i=e-Math.sin(l+k)*(b+g+h*q),m.push(a,i);isNaN(l)&&(l=f);a=c+Math.cos(l+k)*(b+0+0*(j-1));i=e-Math.sin(l+k)*(b+0+0*(j-1));m.push(a,i);for(h=j-1;0<=h;h--)l=f+h*k,a=c+Math.cos(l+k)*(b+0+0*h),i=e-Math.sin(l+k)*(b+0+0*h),m.push(a,i);a=c+Math.cos(f)*(b+0);i=e-Math.sin(f)*(b+0);m.push(a,i);a=c+Math.cos(f)*(b+g);i=e-Math.sin(f)*(b+g);m.push(a,i);d.createPolyline(m).setFill(o).setStroke(p)},
refreshRendering:function(){this.inherited(arguments);var d=this._gfxGroup;d.clear();var c=this.scale.originX,e=this.scale.originY,b=isNaN(this.radius)?this.scale.radius:this.radius,a=this.scale.orientation,f=n.toRadians(360-this.scale.positionForValue(this.start)),g=isNaN(this._transitionValue)?this.value:this._transitionValue,g=n.toRadians(360-this.scale.positionForValue(g));this._drawColorTrack(d,c,e,b,a,f,g,this.startThickness,this.endThickness,this.fill,this.stroke,NaN)},_onMouseDown:function(d){this.inherited(arguments);
var c=this.scale._gauge._gaugeToPage(this.scale.originX,this.scale.originY);this.set("value",this.scale.valueForPosition(180*Math.atan2(d.pageY-c.y,d.pageX-c.x)/Math.PI));r.stop(d)},_onMouseMove:function(d){this.inherited(arguments);var c=this.scale._gauge._gaugeToPage(this.scale.originX,this.scale.originY);this.set("value",this.scale.valueForPosition(180*Math.atan2(d.pageY-c.y,d.pageX-c.x)/Math.PI))}})});