MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / SurfacePlot

Class SurfacePlot

src/org/opensourcephysics/display2d/SurfacePlot.java:34–1533  ·  view source on GitHub ↗

SurfacePlot draws a 3D surface of a scalar field. Surfaceplot uses code from the Surface Plotter package by Yanto Suryono. @author Wolfgang Christian and Yanto Suryono @version 1.0

Source from the content-addressed store, hash-verified

32 * @version 1.0
33 */
34public class SurfacePlot implements Plot2D, False3D {
35 protected boolean visible = true;
36 protected DecimalFormat labelFormat = org.opensourcephysics.numerics.Util.newDecimalFormat("0.00"); //$NON-NLS-1$
37 private static final int TOP = 0;
38 private static final int CENTER = 1;
39 // // for splitting polygons
40 // private static final int UPPER = 1;
41 // private static final int COINCIDE = 0;
42 // private static final int LOWER = -1;
43
44 /** Field INIT_CALC_DIV */
45 public static final int INIT_CALC_DIV = 33;
46
47 /** Field INIT_DISP_DIV */
48 public static final int INIT_DISP_DIV = INIT_CALC_DIV;
49 protected GridData griddata;
50 private int calc_divisions = INIT_CALC_DIV; // number of divisions to calculate
51 private int disp_divisions = INIT_DISP_DIV; // number of divisions to calculate
52 private int plot_mode = ColorMapper.SPECTRUM;
53 private boolean isBoxed, isMesh, isScaleBox, isDisplayXY, isDisplayZ, isDisplayGrids;
54 private double zmin = -2, zmax = 2;
55 private boolean autoscaleZ = true;
56 private boolean symmetricZ = false;
57 private double color_factor;
58 private Point projection;
59 private SurfaceVertex cop; // center of projection
60 private SurfaceVertex[] vertexArray; // vertices array
61 private final SurfaceVertex values1[] = new SurfaceVertex[4];
62 //private final SurfaceVertex values2[] = new SurfaceVertex[4];
63 private Color line_color = Color.black;
64 private int factor_x, factor_y; // conversion factors
65 private int t_x, t_y, t_z; // determines ticks density
66 //private boolean mouseDown = false;
67 private int click_x, click_y; // previous mouse cursor position
68 private boolean invalidProjection = true;
69 private int iwidth = 0, iheight = 0; // the width and height of the last drawing operation
70 private double xmin, xmax, ymin, ymax;
71 private int ampIndex = 0; // amplitude index
72 // the following are needed by the SurfaceVertex
73 SurfacePlotProjector projector; // the projector
74 double zminV, zmaxV, zfactorV;
75 int master_project_indexV = 0; // over 4 billion times to reset
76 private JFrame legendFrame;
77 String xLabel = "x", yLabel = "y", zLabel = "z"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
78 ZExpansion zMap;
79
80 /**
81 * SurfacePlot constructor.
82 */
83 public SurfacePlot() {
84 this(null);
85 }
86
87 /**
88 * SurfacePlot constructor.
89 * @param _griddata
90 */
91 public SurfacePlot(GridData _griddata) {

Callers

nothing calls this directly

Calls 1

newDecimalFormatMethod · 0.80

Tested by

no test coverage detected