Basic HTML version of Foils prepared Sept 23 97

Foil 21 Filter Example (x = x + c)

From Tutorial on Scivis Java Visualization System Rome Lab CIV Review, NAVO Miss. Tutorial -- Sept 24-25 97. by Byeongseob Ki, Scott KLasky


1 package sv.filters;
2 import java.util.*; import java.awt.*; import sv.kernel.*;
3 public class CAddXFilter extends Filter {
4 public CAddXFilter()// output data set's dimension is 1 and 1 arg needs
5 super(Filter.ONED, 1); label = "Enter the constant c: ";
6 }
7 public Object performFilter() {
8 TimeData1D onetimedata;
9 DataSet1D dataSet = (DataSet1D)sources.firstElement();
10 Vector timeDataVec = new Vector();
11 float[] xarr, yarr;
12 int points;
13 float c = args[0];
14 for (int i=0; i &#060 dataSet.getnoOfTime(); i++) {
15 onetimedata = dataSet.getTimeData(i);
16 points = onetimedata.getnoOfPoints();
17 xarr = onetimedata.getxArr();
18 yarr = onetimedata.getyArr();
19 for (int j=0; j &#060 points; j++)
20 xarr[j] =xarr[j] + c;
21 onetimedata = new TimeData1D(dataSet.getTimeArr[i], points, xarr, yarr);
22 timeDataVec.addElement(onetimedata);
23 }
24 return new DataSet1D("x=x+c : " + dataSet.getTitle(), timeDataVec);
25 }
26 }

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Sep 23 1997