/** * Constructs a view of points (x1,x2) with multiple plot segments. * The lengths of the specified arrays x1 and x2 must be equal. * @param x1 array of arrays of x1 coordinates. * @param x2 array of arrays of x2 coordinates. */ public PointsView(float[][] x1, float[][] x2) { set(x1,x2); }
private void updatePolesView() { int np = _poles.size(); float[] xp = new float[np]; float[] yp = new float[np]; for (int ip=0; ip<np; ++ip) { Cdouble p = _poles.get(ip); xp[ip] = (float)p.r; yp[ip] = (float)p.i; } if (_polesView==null) { _polesView = _plotPanel.addPoints(xp,yp); _polesView.setMarkStyle(PointsView.Mark.CROSS); _polesView.setLineStyle(PointsView.Line.NONE); } else { _polesView.set(xp,yp); } }
private void updateZerosView() { int nz = _zeros.size(); float[] xz = new float[nz]; float[] yz = new float[nz]; for (int iz=0; iz<nz; ++iz) { Cdouble z = _zeros.get(iz); xz[iz] = (float)z.r; yz[iz] = (float)z.i; } if (_zerosView==null) { _zerosView = _plotPanel.addPoints(xz,yz); _zerosView.setMarkStyle(PointsView.Mark.HOLLOW_CIRCLE); _zerosView.setLineStyle(PointsView.Line.NONE); } else { _zerosView.set(xz,yz); } }
/** * Constructs a view of points (x1,x2) for a sampled function x2(x1). * @param s1 the sampling of x1 coordinates. * @param x2 array of x2 coordinates. */ public PointsView(Sampling s1, float[] x2) { set(s1,x2); }
/** * Constructs a view of points (x1,x2,x3) with a single plot segment. * The lengths of the specified arrays x1 and x2 must be equal. * If x3 is not null, its length must equal that of x1 and x2. * @param x1 array of x1 coordinates. * @param x2 array of x2 coordinates. * @param x3 array of x3 coordinates; null, if none. */ public PointsView(float[] x1, float[] x2, float[] x3) { set(x1,x2,x3); }
/** * Sets array of arrays of (x1,x2) coordinates for multiple plot segments. * The lengths of the specified arrays x1 and x2 must be equal. * @param x1 array of arrays of x1 coordinates. * @param x2 array of arrays of x2 coordinates. */ public void set(float[][] x1, float[][] x2) { set(x1,x2,null); }
/** * Constructs a view of points (x1,x2) with a single plot segment. * The lengths of the specified arrays x1 and x2 must be equal. * @param x1 array of x1 coordinates. * @param x2 array of x2 coordinates. */ public PointsView(float[] x1, float[] x2) { set(x1,x2); }
/** * Constructs a view of points (x1,x2,x3) with multiple plot segments. * The lengths of the specified arrays x1 and x2 must be equal. * If x3 is not null, its length must equal that of x1 and x2. * @param x1 array of arrays of x1 coordinates. * @param x2 array of arrays of x2 coordinates. * @param x3 array of arrays of x3 coordinates. */ public PointsView(float[][] x1, float[][] x2, float[][] x3) { set(x1,x2,x3); }
/** * Sets arrays of (x1,x2) coordinates for a single plot segment. * The lengths of the specified arrays x1 and x2 must be equal. * @param x1 array of x1 coordinates. * @param x2 array of x2 coordinates. */ public void set(float[] x1, float[] x2) { set(x1,x2,null); }
/** * Constructs a view of points (x1,x2) with specified x2 coordinates. * The corresponding coordinates x1 are assumed to be 0, 1, 2, .... * @param x2 array of x2 coordinates. */ public PointsView(float[] x2) { float[] x1 = rampfloat(0.0f,1.0f,x2.length); set(x1,x2); }
/** * Sets (x1,x2) coordinates for a sampled function x2(x1). * @param s1 the sampling of x1 coordinates. * @param x2 array of x2 coordinates. */ public void set(Sampling s1, float[] x2) { Check.argument(s1.getCount()==x2.length,"s1 count equals x2 length"); int n1 = x2.length; float[] x1 = new float[n1]; for (int i1=0; i1<n1; ++i1) x1[i1] = (float)s1.getValue(i1); set(x1,x2); }
/** * Sets sample indices for all slices. * @param k1 sample index for 1st dimension. * @param k2 sample index for 2nd dimension. * @param k3 sample index for 3rd dimension. */ public void setSlices(int k1, int k2, int k3) { if (_k1!=k1) { _k1 = k1; if (_transpose23) { _p23.set(_s3,_s2,slice23()); } else { _p23.set(_s2,_s3,slice23()); } _l12.set(lines12a(),lines12b()); _l13.set(lines13a(),lines13b()); } if (_k2!=k2) { _k2 = k2; _p13.set(_s1,_s3,slice13()); _l12.set(lines12a(),lines12b()); _l23.set(lines23a(),lines23b()); } if (_k3!=k3) { _k3 = k3; _p12.set(_s1,_s2,slice12()); _l13.set(lines13a(),lines13b()); _l23.set(lines23a(),lines23b()); } }
private void updateViews() { Real1 h = computeImpulseResponse(); Real1[] ap = computeAmplitudeAndPhaseResponses(); Real1 a = ap[0]; Real1 p = ap[1]; if (_hView==null) { _hView = _plotPanelH.addSequence(h.getSampling(),h.getValues()); _aView = _plotPanelAP.addPoints(0,0,a.getSampling(),a.getValues()); _pView = _plotPanelAP.addPoints(1,0,p.getSampling(),p.getValues()); } else { _hView.set(h.getSampling(),h.getValues()); _aView.set(a.getSampling(),a.getValues()); _pView.set(p.getSampling(),p.getValues()); } }