NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
hello all, Can someone tell me why this Linear3Dset is not a volume?!?!?!? Cheers, Tiago
import java.io.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; import visad.*; import visad.java3d.*; import visad.util.*; public class tester { private DisplayImpl display; public tester() { try { display = new DisplayImplJ3D("display"); ScalarMap latMap = new ScalarMap(RealType.Latitude, Display.XAxis); ScalarMap lonMap = new ScalarMap(RealType.Longitude, Display.YAxis); ScalarMap hgtMap = new ScalarMap(RealType.Radius, Display.ZAxis); display.addMap(latMap); display.addMap(lonMap); display.addMap(hgtMap); latMap.setRange(-90.0, 90.0); lonMap.setRange(-180.0, 180.0); hgtMap.setRange(0.0f, 100.0f); RealTupleType fieldtuple = new RealTupleType(RealType.Latitude, RealType.Longitude, RealType.Radius); Linear3DSet layerLines = new Linear3DSet(fieldtuple, 0.0f, 50.0f, 30, 20.0f, 60.0f, 30, 50.0f, 90.0f, 30); DataReference coast_linesref = new DataReferenceImpl("layerLines"); coast_linesref.setData(layerLines); display.addReference(coast_linesref); JFrame frame = new JFrame("Tester"); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(display.getComponent(), BorderLayout.CENTER); frame.setSize(800, 600); frame.setVisible(true); GraphicsModeControl dispGMC = display.getGraphicsModeControl(); dispGMC.setScaleEnable(true); } catch (Exception ne) { ne.printStackTrace(); System.exit(1); } } public static void main(String[] args) { tester satDisplay = new tester(); } }
visad
archives: