File: jsxgraphcurve.inc

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (371 lines) | stat: -rw-r--r-- 17,855 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
!distribute item $wims_read_parm into input_type,jsx_reply,jsx_xsize,jsx_ysize,jsx_imgurl,jsx_nb
!default showinfobox=false

!set wims_bound=200
!set name_alert=La taille des requetes sur le serveur ne peut exceder $wims_bound points. Realiser le tracé plus rapidement pour que la requete soit plus petite.
!set script$jsx_nb=$(script$jsx_nb)\
JXG.Options.point.showInfobox = $showinfobox;\
var img$jsx_nb;\
var brd$jsx_nb = init_jsx_brd$jsx_nb();\
function init_jsx_brd$jsx_nb() {\
  var jsx_brd = JXG.JSXGraph.initBoard('jsxbox$jsx_nb',\
    {axis:false,\
    boundingbox: [0, 0, $jsx_xsize, $jsx_ysize],\
    showNavigation: false,\
    showCopyright:  false,\
    grid: false });\
    img$jsx_nb=jsx_brd.create('image',['$jsx_imgurl', [0,$jsx_ysize], [$jsx_xsize,-$jsx_ysize]], {fixed: true, highlight: false,frozen:true});\
  return jsx_brd;\
}\
/** UNCOMMENT THIS TO ENABLE DEBUG PRINT. ** var debug_field = document.getElementById("jsx_debug");\
function print_debug(chaine){debug_field.insertAdjacentHTML('beforeEnd', chaine+"\n");}*/\
var jsxbox_free$jsx_nb=[];\
var p$jsx_nb=[];\
// Niveau de zoom\
var zoom_level$jsx_nb = 1.0;\
// Agrandit la zone de travail\
function zoom_in_jsx$jsx_nb() {\
  img$jsx_nb.setAttribute({frozen:false});\
  zoom_level$jsx_nb = Math.min(zoom_level$jsx_nb + 0.1, 3.0);\
  var new_width = $jsx_xsize * zoom_level$jsx_nb;\
  var new_height = $jsx_ysize * zoom_level$jsx_nb;\
  brd$jsx_nb.resizeContainer(new_width, new_height);\
  img$jsx_nb.setAttribute({frozen:true});\
}\
// Réduit la zone de travail\
function zoom_out_jsx$jsx_nb() {\
  img$jsx_nb.setAttribute({frozen:false});\
  zoom_level$jsx_nb = Math.max(zoom_level$jsx_nb - 0.1, 0.5);\
  var new_width = $jsx_xsize * zoom_level$jsx_nb;\
  var new_height = $jsx_ysize * zoom_level$jsx_nb;\
  brd$jsx_nb.resizeContainer(new_width, new_height);\
  img$jsx_nb.setAttribute({frozen:true});\
}\
// Réinitialise la taille de la zone de travail\
function zoom_reset_jsx$jsx_nb() {\
  img$jsx_nb.setAttribute({frozen:false});\
  zoom_level$jsx_nb = 1.0;\
  brd$jsx_nb.resizeContainer($jsx_xsize,$jsx_ysize);\
  img$jsx_nb.setAttribute({frozen:true});\
}

!if $input_type iswordof points bound
  !set script$jsx_nb=$(script$jsx_nb)\
    var getMouseCoords$jsx_nb = function(e, i) {\
      var cPos =  brd$jsx_nb.getCoordsTopLeftCorner(e, i);\
      var absPos = JXG.getPosition(e, i);\
      var dx = absPos[0]-cPos[0];\
      var dy = absPos[1]-cPos[1];\
    return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], brd$jsx_nb);};\
    brd$jsx_nb.on('down', function(e) {\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      for (el in  brd$jsx_nb.objects) {\
        if(JXG.isPoint( brd$jsx_nb.objects[el]) &&  brd$jsx_nb.objects[el].hasPoint(coords.scrCoords[1], coords.scrCoords[2])) {\
          canCreate = false;\
          break;}\
      }\
      if (canCreate) {p$jsx_nb.push(brd$jsx_nb.create('point', [coords.usrCoords[1], coords.usrCoords[2]],{face:'+', size:'8',name:'',strokeColor:'black'}));}\
    });\
    function efface$jsx_nb() {\
      brd$jsx_nb.suspendUpdate();\
      brd$jsx_nb.removeObject(p$jsx_nb[p$jsx_nb.length-1]);\
      p$jsx_nb.pop();\
      brd$jsx_nb.unsuspendUpdate();\
    }
!endif

!if $input_type iswordof line sline segment vector circle
  !if $input_type iswordof line sline segment vector
    !set trace='line'
    !default ooo={straightFirst:true}
    !if $input_type issametext sline
      !set ooo={straightFirst:false}
    !endif
    !if $input_type issametext segment
      !set ooo={straightFirst:false, straightLast:false}
    !endif
    !if $input_type issametext vector
      !set ooo={straightFirst:false, straightLast:false,lastArrow:true}
    !endif
  !endif
  !if $input_type issametext circle
    !set trace='circle'
    !set ooo={}
  !endif
  !set script$jsx_nb=$(script$jsx_nb)\
    var re$jsx_nb=0;\
    var getMouseCoords$jsx_nb = function(e, i) {\
      var cPos =  brd$jsx_nb.getCoordsTopLeftCorner(e, i);\
      var absPos = JXG.getPosition(e, i);\
      var dx = absPos[0]-cPos[0];\
      var dy = absPos[1]-cPos[1];\
    return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], brd$jsx_nb);};\
    brd$jsx_nb.on('down', function(e) {\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      for (el in  brd$jsx_nb.objects) {\
        if(JXG.isPoint(( brd$jsx_nb.objects[el]) &&  brd$jsx_nb.objects[el].hasPoint(coords.scrCoords[1], coords.scrCoords[2]))) {\
          canCreate = false;\
          break;}\
      }\
      if (canCreate) {if(re$jsx_nb==0){p$jsx_nb[re$jsx_nb] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});}\
        re$jsx_nb=re$jsx_nb+1;}\
    });\
    brd$jsx_nb.on('move', function(e) {\
      var i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      if(re$jsx_nb==1){p$jsx_nb[1] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
      louis$jsx_nb = brd$jsx_nb.create($trace,[p$jsx_nb[0],p$jsx_nb[1]], $ooo);\
      re$jsx_nb=re$jsx_nb+1;}\
      if(re$jsx_nb==2){p$jsx_nb[1].moveTo(coords.usrCoords.slice(1));}});\
    function efface$jsx_nb() {\
      brd$jsx_nb.removeObject(p$jsx_nb[0]);\
      brd$jsx_nb.removeObject(p$jsx_nb[1]);\
      brd$jsx_nb.removeObject(louis$jsx_nb);\
      return re$jsx_nb=0;\
    }
!endif

!if $input_type = rectangle
  !set ooo={straightFirst:false, straightLast:false}
  !set trace='line'
  !set script$jsx_nb=$(script$jsx_nb)\
    var re$jsx_nb=0;\
    var getMouseCoords$jsx_nb= function(e, i) {\
      var cPos =  brd$jsx_nb.getCoordsTopLeftCorner(e, i);\
      var absPos = JXG.getPosition(e, i);\
      var dx = absPos[0]-cPos[0];\
      var dy = absPos[1]-cPos[1];\
    return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], brd$jsx_nb);};\
    brd$jsx_nb.on('down',function(e) {\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
        if(re$jsx_nb==0){p$jsx_nb[0] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'b    lack'});\
        p$jsx_nb[1] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
        li1 = brd$jsx_nb.create('line',[[function(){ return p$jsx_nb[0].X();},function(){ return p$jsx_nb[0].Y();}],[function(){ return p$jsx_nb[0    ].X();},function(){ return p$jsx_nb[1].Y();}]], $ooo );\
        li2 = brd$jsx_nb.create('line',[[function(){ return p$jsx_nb[0].X();},function(){ return p$jsx_nb[1].Y();}],[function(){ return p$jsx_nb[1    ].X();},function(){ return p$jsx_nb[1].Y();}]],$ooo);\
      li3 = brd$jsx_nb.create('line',[[function(){ return p$jsx_nb[1].X();},function(){ return p$jsx_nb[1].Y();}],[function(){ return p$jsx_nb[1    ].X();},function(){ return p$jsx_nb[0].Y();}]],$ooo);\
      li4 = brd$jsx_nb.create('line',[[function(){ return p$jsx_nb[1].X();},function(){ return p$jsx_nb[0].Y();}],[function(){ return p$jsx_nb[0    ].X();},function(){ return p$jsx_nb[0].Y();}]],$ooo );}\
    re$jsx_nb=re$jsx_nb+1;\
    });\
    brd$jsx_nb.on('move',function(e){\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      if(re$jsx_nb==1){p$jsx_nb[1].moveTo(coords.usrCoords.slice(1));}\
    });\
    function efface$jsx_nb() {\
      brd$jsx_nb.removeObject(p$jsx_nb);\
      brd$jsx_nb.removeObject(li1);\
      brd$jsx_nb.removeObject(li2);\
      brd$jsx_nb.removeObject(li3);\
      brd$jsx_nb.removeObject(li4);\
    return re$jsx_nb=0;}
!endif

!if $input_type = polygon
  !set script$jsx_nb=$(script$jsx_nb)\
    var re$jsx_nb=0;\
    var jsxbox$jsx_nb = document.getElementById('jsxbox$jsx_nb');\
    var point_tmp$jsx_nb;\
    var seg_tmp$jsx_nb;\
    var segg_tmp$jsx_nb;\
    var getMouseCoords$jsx_nb = function(e, i) {\
      var cPos =  brd$jsx_nb.getCoordsTopLeftCorner(e, i);\
      var absPos = JXG.getPosition(e, i);\
      var dx = absPos[0]-cPos[0];\
      var dy = absPos[1]-cPos[1];\
    return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], brd$jsx_nb);};\
    var down$jsx_nb=function(e) {\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      for (el in  brd$jsx_nb.objects) {\
        if(JXG.isPoint(( brd$jsx_nb.objects[el]) &&  brd$jsx_nb.objects[el].hasPoint(coords.scrCoords[1], coords.scrCoords[2]))) {\
          canCreate = false;\
          break;}\
      }\
      if (canCreate) {\
        if(re$jsx_nb==0){p$jsx_nb[re$jsx_nb] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
          point_tmp$jsx_nb= brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black',visible:true});\
          seg_tmp$jsx_nb=brd$jsx_nb.create('segment',[p$jsx_nb[0],point_tmp$jsx_nb]);\
        }\
        if(re$jsx_nb>0){p$jsx_nb[re$jsx_nb] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
          brd$jsx_nb.create('segment',[p$jsx_nb[re$jsx_nb-1],p$jsx_nb[re$jsx_nb]]);\
          brd$jsx_nb.removeObject(segg_tmp$jsx_nb);\
          segg_tmp$jsx_nb=brd$jsx_nb.create('segment',[p$jsx_nb[re$jsx_nb],point_tmp$jsx_nb]);\
        }\
      }\
      re$jsx_nb=re$jsx_nb+1;\
    }\
    var move$jsx_nb= function(e) {\
      var i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
      coords = getMouseCoords$jsx_nb(e, i);\
      if(re$jsx_nb>0){point_tmp$jsx_nb.moveTo(coords.usrCoords.slice(1));}\
    }\
    brd$jsx_nb.on('down',down$jsx_nb);\
    brd$jsx_nb.on('move',move$jsx_nb);\
    JXG.addEvent(jsxbox$jsx_nb,'mouseleave',function(e) {\
      brd$jsx_nb.removeObject(seg_tmp$jsx_nb);\
      brd$jsx_nb.removeObject(segg_tmp$jsx_nb);\
      brd$jsx_nb.create('segment',[p$jsx_nb[re$jsx_nb-1],p$jsx_nb[0]]);\
      brd$jsx_nb.off('down',down$jsx_nb);\
      brd$jsx_nb.off('move',move$jsx_nb);\
      point_tmp$jsx_nb.setAttribute({visible:false});\
      }\
    ,this);\
  function efface$jsx_nb() {\
    brd$jsx_nb.clearTraces();\
    brd$jsx_nb = init_jsx_brd$jsx_nb();\
    re$jsx_nb=0;\
    brd$jsx_nb.on('down',down$jsx_nb);\
    brd$jsx_nb.on('move',move$jsx_nb);\
  }
!endif

!! Broken Line
!if $input_type = brokenline
  !set script$jsx_nb=$(script$jsx_nb)\
    var re$jsx_nb=0;\
    var jsxbox$jsx_nb = document.getElementById('jsxbox$jsx_nb');\
    var point_tmp$jsx_nb;\
    var seg_tmp$jsx_nb;\
    var segg_tmp$jsx_nb;\
    var getMouseCoords$jsx_nb = function(e, i) {\
      var cPos =  brd$jsx_nb.getCoordsTopLeftCorner(e, i);\
      var absPos = JXG.getPosition(e, i);\
      var dx = absPos[0]-cPos[0];\
      var dy = absPos[1]-cPos[1];\
    return new JXG.Coords(JXG.COORDS_BY_SCREEN, [dx, dy], brd$jsx_nb);};\
    var down$jsx_nb=function(e) {\
      var canCreate = true, i, coords, el;\
      if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
        coords = getMouseCoords$jsx_nb(e, i);\
        for (el in  brd$jsx_nb.objects) {\
        if(JXG.isPoint(( brd$jsx_nb.objects[el]) &&  brd$jsx_nb.objects[el].hasPoint(coords.scrCoords[1], coords.scrCoords[2]))) {\
          canCreate = false;\
          break;}\
        }\
        if (canCreate) {\
          if(re$jsx_nb==0){p$jsx_nb[re$jsx_nb] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
            point_tmp$jsx_nb= brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black',visible:true});\
            seg_tmp$jsx_nb=brd$jsx_nb.create('segment',[p$jsx_nb[0],point_tmp$jsx_nb]);\
          }\
          if(re$jsx_nb>0){if(re$jsx_nb==1){brd$jsx_nb.removeObject(seg_tmp$jsx_nb);}\
            p$jsx_nb[re$jsx_nb] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',name:'',fixed:false,strokeColor:'black'});\
            brd$jsx_nb.create('segment',[p$jsx_nb[re$jsx_nb-1],p$jsx_nb[re$jsx_nb]]);\
            brd$jsx_nb.removeObject(segg_tmp$jsx_nb);\
            segg_tmp$jsx_nb=brd$jsx_nb.create('segment',[p$jsx_nb[re$jsx_nb],point_tmp$jsx_nb]);\
          }\
        }\
        re$jsx_nb=re$jsx_nb+1;\
      }\
      var move$jsx_nb= function(e) {\
        var i, coords, el;\
        if (e[JXG.touchProperty]) {/* index of the finger that is used to extract the coordinates*/i = 0;}\
        coords = getMouseCoords$jsx_nb(e, i);\
        if(re$jsx_nb>0){point_tmp$jsx_nb.moveTo(coords.usrCoords.slice(1));}\
      }\
      brd$jsx_nb.on('down',down$jsx_nb);\
      brd$jsx_nb.on('move',move$jsx_nb);\
      JXG.addEvent(jsxbox$jsx_nb,'mouseleave',function(e) {\
        brd$jsx_nb.removeObject(segg_tmp$jsx_nb);\
        brd$jsx_nb.off('down',down$jsx_nb);\
        brd$jsx_nb.off('move',move$jsx_nb);\
        point_tmp$jsx_nb.setAttribute({visible:false});\
        }\
      ,this);\
    function efface$jsx_nb() {\
      brd$jsx_nb.clearTraces();\
      brd$jsx_nb = init_jsx_brd$jsx_nb();\
      re$jsx_nb=0;\
      brd$jsx_nb.on('down',down$jsx_nb);\
      brd$jsx_nb.on('move',move$jsx_nb);\
    }
!endif

!if $input_type = curve
  !set script$jsx_nb=$(script$jsx_nb)\
    var pp=[];\
    var re$jsx_nb=0;\
    var ree=0;\
    var rrr$jsx_nb=0;\
    var aa$jsx_nb='';\
    var tt=0;\
    var jj$jsx_nb=0;\
    JXG.addEvent(document.getElementById('jsxbox$jsx_nb'),'click', function (e) {\
    var coords = new JXG.Coords(JXG.COORDS_BY_SCREEN, brd$jsx_nb.getMousePosition(e), brd$jsx_nb);\
    p$jsx_nb[re$jsx_nb+tt] = brd$jsx_nb.create('point', coords.usrCoords.slice(1),{face:'+', size:'8',fixed:true,strokeColor:'black', name:''});\
    c = [Math.round(p$jsx_nb[re$jsx_nb+tt].X()),Math.round(p$jsx_nb[re$jsx_nb+tt].Y())];\
    aa$jsx_nb=aa$jsx_nb+c+',';\
    re$jsx_nb=re$jsx_nb+1;\
    JXG.addEvent(document.getElementById('jsxbox$jsx_nb'),'mousemove', function (z) {\
      var coor = new JXG.Coords(JXG.COORDS_BY_SCREEN, brd$jsx_nb.getMousePosition(z), brd$jsx_nb);\
        pp[rrr$jsx_nb+jj$jsx_nb] = brd$jsx_nb.create('point', coor.usrCoords.slice(1),{face:'+',size:'1',Color:'blue',name:''});\
        d = [Math.round(pp[rrr$jsx_nb+jj$jsx_nb].X()),Math.round(pp[rrr$jsx_nb+jj$jsx_nb].Y())];\
        aa$jsx_nb=aa$jsx_nb+d+',';\
        /*brd$jsx_nb.create('segment',[p$jsx_nb[0],pp[0]],{Color:'red'});*/\
        if(rrr$jsx_nb>0){brd$jsx_nb.create('segment',[pp[rrr$jsx_nb-1+jj$jsx_nb],pp[rrr$jsx_nb+jj$jsx_nb]],{Color:'yellow'});}\
        rrr$jsx_nb=rrr$jsx_nb+1;\
        if(rrr$jsx_nb>$wims_bound || jj$jsx_nb+rrr$jsx_nb>$wims_bound){JXG.removeAllEvents (document.getElementById ('jsxbox$jsx_nb'), 'mousemove', this);\
        alert('$name_alert');\
        efface$jsx_nb();}\
    },this);\
    if(re$jsx_nb%2==0){JXG.removeAllEvents (document.getElementById ('jsxbox$jsx_nb'), 'mousemove', this);\
      aa$jsx_nb=aa$jsx_nb.substr(0,aa$jsx_nb.length-1);\
      aa$jsx_nb=aa$jsx_nb+';';\
      tt=tt+re$jsx_nb;\
      jj$jsx_nb=jj$jsx_nb+rrr$jsx_nb;\
      /*alert('re$jsx_nb='+re$jsx_nb+'tt='+tt);\
      alert(aa$jsx_nb);*/\
      re$jsx_nb=0;\
      rrr$jsx_nb=0;}\
    }, this);\
    function efface$jsx_nb() {\
      brd$jsx_nb.removeObject(p$jsx_nb);\
      brd$jsx_nb.removeObject(pp);\
      JXG.removeAllEvents (document.getElementById ('jsxbox$jsx_nb'), 'mousemove', this);\
      aa$jsx_nb='';\
      re$jsx_nb=0;\
      rrr$jsx_nb=0;\
      jj$jsx_nb=0;\
    }
!endif

!readproc slib/geo2D/jsxgraph jsxbox$jsx_nb,$jsx_xsize x $jsx_ysize,$(script$jsx_nb)

$slib_out
<script>
/*<![CDATA[*/
!if $input_type iswordof points bound
  var capture$jsx_nb = function(){\
    p$jsx_nb.forEach(function(element,index,arr){jsxbox_free$jsx_nb.push([Math.round(arr[index].X()),Math.round(arr[index].Y())]);});\
    document.getElementById('$jsx_reply').value='free='+jsxbox_free$jsx_nb +'';}
!endif
!if $input_type iswordof line sline segment vector rectangle
  var capture$jsx_nb = function(){\
    p$jsx_nb.forEach(function(element,index,arr){jsxbox_free$jsx_nb.push([Math.round(arr[index].X()),Math.round(arr[index].Y())]);});\
    document.getElementById('$jsx_reply').value='free='+jsxbox_free$jsx_nb +'';}
!endif
!if $input_type iswordof circle
  var capture$jsx_nb = function(){\
    p$jsx_nb.forEach(function(element,index,arr){jsxbox_free$jsx_nb.push([Math.round(arr[index].X()),Math.round(arr[index].Y())]);});\
    document.getElementById('$jsx_reply').value='free=' + [Math.round(p$jsx_nb[0].X()),Math.round(p$jsx_nb[0].Y()),Math.round(p$jsx_nb[0].Dist(p$jsx_nb[1]))] +'';}
!endif
!if $input_type iswordof polygon brokenline
  var capture$jsx_nb = function(){\
    p$jsx_nb.forEach(function(element,index,arr){jsxbox_free$jsx_nb.push([Math.round(arr[index].X())+","+Math.round(arr[index].Y())+";"]);});\
    jsss$jsx_nb=jsxbox_free$jsx_nb.join("");\
    document.getElementById('$jsx_reply').value='free=' + jsss$jsx_nb +'';}
!endif
!if $input_type iswordof curve
  var capture$jsx_nb = function(){document.getElementById('$jsx_reply').value='free=' + aa$jsx_nb;}
!endif
/*]]>*/
</script>