@@ -134,6 +134,16 @@ impl Drop for Window {
134
134
135
135
impl Window {
136
136
/// Creates new Window object
137
+ ///
138
+ /// # Parameters
139
+ ///
140
+ /// - `width` is width of the window
141
+ /// - `height` is the height of window
142
+ /// - `title` is the string displayed on window title bar
143
+ ///
144
+ /// # Return Values
145
+ ///
146
+ /// Window Object
137
147
#[ allow( unused_mut) ]
138
148
pub fn new ( width : i32 , height : i32 , title : String ) -> Window {
139
149
unsafe {
@@ -153,6 +163,11 @@ impl Window {
153
163
}
154
164
155
165
/// Set window starting position on the screen
166
+ ///
167
+ /// # Parameters
168
+ ///
169
+ /// - `x` is the horiontal coordinate where window is to be placed
170
+ /// - `y` is the vertical coordinate where window is to be placed
156
171
pub fn set_position ( & self , x : u32 , y : u32 ) {
157
172
unsafe {
158
173
let err_val = af_set_position ( self . handle as WndHandle , x as c_uint , y as c_uint ) ;
@@ -161,6 +176,10 @@ impl Window {
161
176
}
162
177
163
178
/// Set window title
179
+ ///
180
+ /// # Parameters
181
+ ///
182
+ /// - `title` is the string to be displayed on window title bar
164
183
pub fn set_title ( & self , title : String ) {
165
184
unsafe {
166
185
let cstr_ret = CString :: new ( title. as_bytes ( ) ) ;
@@ -220,7 +239,12 @@ impl Window {
220
239
}
221
240
}
222
241
223
- /// Used to setup display layout in multiview mode
242
+ /// Setup display layout in multiview mode
243
+ ///
244
+ /// # Parameters
245
+ ///
246
+ /// - `rows` is the number of rows into which whole window is split into in multiple view mode
247
+ /// - `cols` is the number of cols into which whole window is split into in multiple view mode
224
248
pub fn grid ( & self , rows : i32 , cols : i32 ) {
225
249
unsafe {
226
250
let err_val = af_grid ( self . handle as WndHandle , rows as c_int , cols as c_int ) ;
@@ -239,8 +263,14 @@ impl Window {
239
263
}
240
264
}
241
265
242
- /// Used in multiview mode to set the current sub-region to which the subsequence draw call
243
- /// renders to
266
+ /// Set the current sub-region to render
267
+ ///
268
+ /// This function is only to be used into multiview mode
269
+ ///
270
+ /// # Parameters
271
+ ///
272
+ /// - `r` is the target row id
273
+ /// - `c` is the target row id
244
274
pub fn set_view ( & mut self , r : i32 , c : i32 ) {
245
275
self . row = r;
246
276
self . col = c;
@@ -351,6 +381,12 @@ impl Window {
351
381
}
352
382
353
383
/// Render given Array as an image
384
+ ///
385
+ /// # Parameters
386
+ ///
387
+ /// - `input` image
388
+ /// - `title` parameter has effect only in multiview mode, where this string
389
+ /// is displayed as the respective cell/view title.
354
390
pub fn draw_image ( & self , input : & Array , title : Option < String > ) {
355
391
let tstr = match title {
356
392
Some ( s) => s,
@@ -365,6 +401,13 @@ impl Window {
365
401
}
366
402
367
403
/// Render given two Array's `x` and `y` as a 2d line plot
404
+ ///
405
+ /// # Parameters
406
+ ///
407
+ /// - `x` is the x coordinates of the plot
408
+ /// - `y` is the y coordinates of the plot
409
+ /// - `title` parameter has effect only in multiview mode, where this string
410
+ /// is displayed as the respective cell/view title.
368
411
pub fn draw_plot2 ( & self , x : & Array , y : & Array , title : Option < String > ) {
369
412
let tstr = match title {
370
413
Some ( s) => s,
@@ -380,6 +423,14 @@ impl Window {
380
423
}
381
424
382
425
/// Render given Array's `x`, `y` and `z` as a 3d line plot
426
+ ///
427
+ /// # Parameters
428
+ ///
429
+ /// - `x` is the x coordinates of the plot
430
+ /// - `y` is the y coordinates of the plot
431
+ /// - `z` is the z coordinates of the plot
432
+ /// - `title` parameter has effect only in multiview mode, where this string
433
+ /// is displayed as the respective cell/view title.
383
434
pub fn draw_plot3 ( & self , x : & Array , y : & Array , z : & Array , title : Option < String > ) {
384
435
let tstr = match title {
385
436
Some ( s) => s,
@@ -395,6 +446,12 @@ impl Window {
395
446
}
396
447
397
448
/// Render give Arrays of points as a 3d line plot
449
+ ///
450
+ /// # Parameters
451
+ ///
452
+ /// - `points` is an Array containing list of points of plot
453
+ /// - `title` parameter has effect only in multiview mode, where this string
454
+ /// is displayed as the respective cell/view title.
398
455
pub fn draw_plot ( & self , points : & Array , title : Option < String > ) {
399
456
let tstr = match title {
400
457
Some ( s) => s,
@@ -409,6 +466,14 @@ impl Window {
409
466
}
410
467
411
468
/// Render given Array as a histogram
469
+ ///
470
+ /// # Parameters
471
+ ///
472
+ /// - `hst` is an Array containing histogram data
473
+ /// - `minval` is the minimum bin value of histogram
474
+ /// - `maxval` is the maximum bin value of histogram
475
+ /// - `title` parameter has effect only in multiview mode, where this string
476
+ /// is displayed as the respective cell/view title.
412
477
pub fn draw_hist ( & self , hst : & Array , minval : f64 , maxval : f64 , title : Option < String > ) {
413
478
let tstr = match title {
414
479
Some ( s) => s,
@@ -424,6 +489,14 @@ impl Window {
424
489
}
425
490
426
491
/// Render give Arrays as 3d surface
492
+ ///
493
+ /// # Parameters
494
+ ///
495
+ /// - `x` is the x coordinates of the surface plot
496
+ /// - `y` is the y coordinates of the surface plot
497
+ /// - `z` is the z coordinates of the surface plot
498
+ /// - `title` parameter has effect only in multiview mode, where this string
499
+ /// is displayed as the respective cell/view title.
427
500
pub fn draw_surface ( & self , xvals : & Array , yvals : & Array , zvals : & Array , title : Option < String > ) {
428
501
let tstr = match title {
429
502
Some ( s) => s,
@@ -441,6 +514,14 @@ impl Window {
441
514
}
442
515
443
516
/// Render given Arrays as 2d scatter plot
517
+ ///
518
+ /// # Parameters
519
+ ///
520
+ /// - `xvals` is the x coordinates of the scatter plot
521
+ /// - `yvals` is the y coordinates of the scatter plot
522
+ /// - `marker` is of enum type [MarkerType](./enum.MarkerType.html)
523
+ /// - `title` parameter has effect only in multiview mode, where this string
524
+ /// is displayed as the respective cell/view title.
444
525
pub fn draw_scatter2 ( & self , xvals : & Array , yvals : & Array ,
445
526
marker : MarkerType , title : Option < String > ) {
446
527
let tstr = match title {
@@ -457,6 +538,15 @@ impl Window {
457
538
}
458
539
459
540
/// Render given Arrays as 3d scatter plot
541
+ ///
542
+ /// # Parameters
543
+ ///
544
+ /// - `xvals` is the x coordinates of the scatter plot
545
+ /// - `yvals` is the y coordinates of the scatter plot
546
+ /// - `zvals` is the z coordinates of the scatter plot
547
+ /// - `marker` is of enum type [MarkerType](./enum.MarkerType.html)
548
+ /// - `title` parameter has effect only in multiview mode, where this string
549
+ /// is displayed as the respective cell/view title.
460
550
pub fn draw_scatter3 ( & self , xvals : & Array , yvals : & Array , zvals : & Array ,
461
551
marker : MarkerType , title : Option < String > ) {
462
552
let tstr = match title {
@@ -473,6 +563,13 @@ impl Window {
473
563
}
474
564
475
565
/// Render give Array as 3d scatter plot
566
+ ///
567
+ /// # Parameters
568
+ ///
569
+ /// - `points` is an Array containing list of points of plot
570
+ /// - `marker` is of enum type [MarkerType](./enum.MarkerType.html)
571
+ /// - `title` parameter has effect only in multiview mode, where this string
572
+ /// is displayed as the respective cell/view title.
476
573
pub fn draw_scatter ( & self , vals : & Array , marker : MarkerType , title : Option < String > ) {
477
574
let tstr = match title {
478
575
Some ( s) => s,
@@ -487,6 +584,15 @@ impl Window {
487
584
}
488
585
489
586
/// Render given Arrays as 2d vector field
587
+ ///
588
+ /// # Parameters
589
+ ///
590
+ /// - `xpnts` is an Array containing list of x coordinates
591
+ /// - `xdirs` is an Array containing direction component of x coord
592
+ /// - `ypnts` is an Array containing list of y coordinates
593
+ /// - `ydirs` is an Array containing direction component of y coord
594
+ /// - `title` parameter has effect only in multiview mode, where this string
595
+ /// is displayed as the respective cell/view title.
490
596
pub fn draw_vector_field2 ( & self , xpnts : & Array , ypnts : & Array ,
491
597
xdirs : & Array , ydirs : & Array , title : Option < String > ) {
492
598
let tstr = match title {
@@ -504,6 +610,17 @@ impl Window {
504
610
}
505
611
506
612
/// Render given Arrays as 3d vector field
613
+ ///
614
+ /// # Parameters
615
+ ///
616
+ /// - `xpnts` is an Array containing list of x coordinates
617
+ /// - `xdirs` is an Array containing direction component of x coord
618
+ /// - `ypnts` is an Array containing list of y coordinates
619
+ /// - `ydirs` is an Array containing direction component of y coord
620
+ /// - `zpnts` is an Array containing list of z coordinates
621
+ /// - `zdirs` is an Array containing direction component of z coord
622
+ /// - `title` parameter has effect only in multiview mode, where this string
623
+ /// is displayed as the respective cell/view title.
507
624
pub fn draw_vector_field3 ( & self , xpnts : & Array , ypnts : & Array , zpnts : & Array ,
508
625
xdirs : & Array , ydirs : & Array , zdirs : & Array ,
509
626
title : Option < String > ) {
@@ -523,6 +640,14 @@ impl Window {
523
640
}
524
641
525
642
/// Render given Array as vector field
643
+ ///
644
+ /// # Parameters
645
+ ///
646
+ /// - `points` is an Array containing list of coordinates of vector field
647
+ /// - `directions` is an Array containing directions at the coordinates specified in `points`
648
+ /// Array.
649
+ /// - `title` parameter has effect only in multiview mode, where this string
650
+ /// is displayed as the respective cell/view title.
526
651
pub fn draw_vector_field ( & self , points : & Array , directions : & Array , title : Option < String > ) {
527
652
let tstr = match title {
528
653
Some ( s) => s,
0 commit comments