/[gzz]/gzz/gzz/view/PlainVanishing.java
ViewVC logotype

Diff of /gzz/gzz/view/PlainVanishing.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by benja, Sat Nov 23 13:44:20 2002 UTC revision 1.5 by tjl, Thu Feb 6 11:53:14 2003 UTC
# Line 49  public static final String rcsid = "$Id$ Line 49  public static final String rcsid = "$Id$
49    
50      // XXX Assume single-threaded      // XXX Assume single-threaded
51    
     //public float[] shrink = new float[] {0.9f, 0.9f, 0.9f, 0.9f};  
52      public float[] shrink = new float[] {0.8f, 0.8f, 0.8f, 0.8f};      public float[] shrink = new float[] {0.8f, 0.8f, 0.8f, 0.8f};
53    
54      public float initmul = 1.3f; // 3f;      public float initmul = 1.3f; // 3f;
# Line 57  public static final String rcsid = "$Id$ Line 56  public static final String rcsid = "$Id$
56      public float xgapmult = 1.3f;      public float xgapmult = 1.3f;
57      public float ygapmult = 1.5f;      public float ygapmult = 1.5f;
58    
59        public BFRaster raster = new BFRaster();
60    
61      VanishingClient client;      VanishingClient client;
62    
     public BFRaster raster = new BFRaster();  
63    
64      int ndims;      int ndims;
65    
66      public void render(VanishingClient client, ViewContext context,      public void render(VanishingClient client, ViewContext context,
67                         int px, int py) {                         float px, float py) {
68          Cell center = context.getAccursed();          Cell center = context.getAccursed();
69          Dim[] dims = context.getDims();          Dim[] dims = context.getDims();
70    
# Line 93  public static final String rcsid = "$Id$ Line 92  public static final String rcsid = "$Id$
92       * The recursive passthrough is the most convenient for vanishing-type       * The recursive passthrough is the most convenient for vanishing-type
93       * views.       * views.
94       */       */
95      protected void paint(int index, int x, int y, int d, int rdepth,      protected void paint(int index, float x, float y, float d, float rdepth,
96                          float fract, float xalign, float yalign,                          float fract, float xalign, float yalign,
97                          int pdx, int pdy, float rot) {                          float pdx, float pdy, float rot) {
98          if(raster.cells[index] == null) return;          if(raster.cells[index] == null) return;
99          if(!raster.used[index]) return;          if(!raster.used[index]) return;
100          if(rdepth >= raster.depth) return;          if(rdepth >= raster.depth) return;
# Line 106  public static final String rcsid = "$Id$ Line 105  public static final String rcsid = "$Id$
105                  dim);                  dim);
106    
107          // connection length taken into account          // connection length taken into account
108          int w = (int)(dim.width*xgapmult) / 2;          float w = (dim.width*xgapmult) / 2;
109          int h = (int)(dim.height*ygapmult) / 2;          float h = (dim.height*ygapmult) / 2;
110    
111          double c = Math.cos(rot);          float c = (float)Math.cos(rot);
112          double s = Math.sin(rot);          float s = (float)Math.sin(rot);
113    
114          x += c * (-xalign) * w + s * (-yalign) * h;          x += c * (-xalign) * w + s * (-yalign) * h;
115          y += c * (-yalign) * h - s * (-xalign) * w;          y += c * (-yalign) * h - s * (-xalign) * w;
# Line 130  public static final String rcsid = "$Id$ Line 129  public static final String rcsid = "$Id$
129          }          }
130          if(ndims > 1) {          if(ndims > 1) {
131              paint(raster.ptrs[index]+2, x, y + h,              paint(raster.ptrs[index]+2, x, y + h,
132                          (int)(d + 50 + d * 0.05), rdepth, fract * shrink[1],                          (d + 50 + d * 0.05f), rdepth, fract * shrink[1],
133                      0, -1.0f, 0, 1, 0);                      0, -1.0f, 0, 1, 0);
134              paint(raster.ptrs[index]+3, x, y - h,              paint(raster.ptrs[index]+3, x, y - h,
135                      (int)(d + 50 + d * 0.05), rdepth, fract * shrink[1],                      (d + 50 + d * 0.05f), rdepth, fract * shrink[1],
136                      0, 1.0f, 0, -1, 0);                      0, 1.0f, 0, -1, 0);
137          }          }
138          if(ndims > 2) {          if(ndims > 2) {
139              paint(raster.ptrs[index]+4, x + w, y + h,              paint(raster.ptrs[index]+4, x + w, y + h,
140                      (int)(d + 60 + d * 0.1), rdepth, fract * shrink[1],                      (d + 60 + d * 0.1f), rdepth, fract * shrink[1],
141                      -1.0f, -1.0f, 0, 0, 0);                      -1.0f, -1.0f, 0, 0, 0);
142              paint(raster.ptrs[index]+5, x - w, y - h,              paint(raster.ptrs[index]+5, x - w, y - h,
143                      (int)(d + 60 + d * 0.1), rdepth, fract * shrink[1],                      (d + 60 + d * 0.1f), rdepth, fract * shrink[1],
144                      1.0f, 1.0f, 0, 0, 0);                      1.0f, 1.0f, 0, 0, 0);
145          }          }
146    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26