/[gzz]/gzz/gzz/modules/pp/PPView2.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp/PPView2.java

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

revision 1.2 by tjl, Sat Nov 2 20:32:48 2002 UTC revision 1.3 by tjl, Sun Nov 3 12:03:07 2002 UTC
# Line 10  import java.awt.Dimension; Line 10  import java.awt.Dimension;
10    
11  public class PPView2 implements View {  public class PPView2 implements View {
12    
13        /** The current zoom.
14         * Pixels for 1 paper coordinate unit.
15         */
16        public float zoom = 1;
17    
18        /** The scale of the background.
19         * bgscale in paper coordinates = 1 in background coords.
20         */
21        public float bgscale = 200;
22    
23      Space space;      Space space;
24      PPDims d;      PPDims d;
25    
26      CoordinatePlaneView coordinatePlaneView;      CoordinatePlaneView coordinatePlaneView;
27    
28        /** A single PP plane, with given view context.
29         * This class takes care of drawing the stencil,
30         * the background and the vobs inside the plane.
31         */
32      class SinglePlane {      class SinglePlane {
33          ViewContext context;          ViewContext context;
34          void render(final VobScene vs, final int frameCS, final int c2fCS) {          void render(final VobScene vs, final int frameCS, final int c2fCS) {
# Line 27  public class PPView2 implements View { Line 41  public class PPView2 implements View {
41              final BgVob bg = BgVob.create(plane);              final BgVob bg = BgVob.create(plane);
42    
43              final IrregularFrame f = IrregularFrame.create(-100,-100,1600,1600,              final IrregularFrame f = IrregularFrame.create(-100,-100,1600,1600,
44                                          50.3f, 1000f);                                          50.3f, 500f);
45    
46              final int frameUnit = vs.unitSqCS(frameCS, "USQ");              final int frameUnit = vs.unitSqCS(frameCS, "USQ");
47    
# Line 41  public class PPView2 implements View { Line 55  public class PPView2 implements View {
55              float[] sqs = new float[2];              float[] sqs = new float[2];
56              glc.getSqSize(frameCS, sqs);              glc.getSqSize(frameCS, sqs);
57    
58              final int c2fUnit = vs.scaleCS(c2fCS, "SCA", 1.0f/sqs[0], 1.0f/sqs[1]);  
59                final int c2fUnit = vs.scaleCS(c2fCS, "SCA",
60                            bgscale/sqs[0], bgscale/sqs[1]);
61    
62              Stencil.drawStenciled(vs,              Stencil.drawStenciled(vs,
63                          new Putter(f.getContent()),                          new Putter(f.getContent()),
# Line 72  public class PPView2 implements View { Line 88  public class PPView2 implements View {
88          pl.context = vc;          pl.context = vc;
89    
90          int frameCS = vs.orthoBoxCS(0, "frame", 0, 100, 100, 1, 1, 400, 400);          int frameCS = vs.orthoBoxCS(0, "frame", 0, 100, 100, 1, 1, 400, 400);
91          int c2fCS = 0;  
92            int c2fCS = vs.orthoCS(0, "C2F", 0, 0, 0, 10, 10);
93            setZoomPan(vs);
94          pl.render(vs, frameCS, c2fCS);          pl.render(vs, frameCS, c2fCS);
95    
96      }      }
97    
98        /** Cause the changes to the zooming and panning variables
99         * to be shown in the given vobscene.
100         * This changes the parameters of the coordinate systems created by render().
101         */
102        public void setZoomPan(VobScene vs) {
103            int cs = vs.matcher.getCS("C2F");
104            vs.coords.setOrthoParams(cs, 0, 0, 0, zoom, zoom);
105        }
106  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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