当前位置: 首页>>代码示例>>Java>>正文


Java Shape.setWireframeDisplayed方法代码示例

本文整理汇总了Java中org.jzy3d.plot3d.primitives.Shape.setWireframeDisplayed方法的典型用法代码示例。如果您正苦于以下问题:Java Shape.setWireframeDisplayed方法的具体用法?Java Shape.setWireframeDisplayed怎么用?Java Shape.setWireframeDisplayed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jzy3d.plot3d.primitives.Shape的用法示例。


在下文中一共展示了Shape.setWireframeDisplayed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateSurface

import org.jzy3d.plot3d.primitives.Shape; //导入方法依赖的package包/类
/**
 * Generates a {@code Shape} to represent the data using the specified {@code interpolationLevel} and {@code colormap}.
 * 
 * @param interpolationLevel an integer specifying the interpolation level to use.
 * @param colorMap an {@code IColorMap} to configure the surface.
 * @param colorMapRange a {@code Range} to create the surface color mapper.
 * @param scale a {@code DoubleFunction<Double>} to scale the data.
 * @return a new {@code Shape} with the surface for this data.
 */
public Shape generateSurface(int interpolationLevel, IColorMap colorMap, 
	Range colorMapRange, DoubleFunction<Double> scale
) {
	final List<Coord3d> coords = dataToCoord3d(
		scale(
			scale,
			interpolate(data, interpolationLevel)
		)
	);
	
	final Shape surface = Builder.buildDelaunay(coords);
	surface.setColorMapper(new ColorMapper(colorMap, colorMapRange));
	surface.setFaceDisplayed(true);
	surface.setWireframeDisplayed(false);
	return surface;
}
 
开发者ID:sing-group,项目名称:la-images,代码行数:26,代码来源:ElementDataSurfaceAdapter.java

示例2: getDelaunayChart

import org.jzy3d.plot3d.primitives.Shape; //导入方法依赖的package包/类
/**
 * @param coordinates
 * @return
 */
public Chart getDelaunayChart(List<Coord3d> coordinates) {

	// Create the object to represent the function over the given range.
	Shape surface = Builder.buildDelaunay(coordinates);

	surface.setColorMapper(new ColorMapper(new ColorMapRainbow(),
			surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1,
					0.75f)));
	surface.setFaceDisplayed(true);
	surface.setWireframeDisplayed(true);
	AWTColorbarLegend legend = new AWTColorbarLegend(surface, new AxeBoxLayout());
	surface.setLegend(legend);

	// Create a chart
	Chart chart = new Chart(this.factory, Quality.Nicest, "awt", Settings.getInstance()
			.getGLCapabilities());
	chart.setAxeDisplayed(true);
	chart.getScene().getGraph().add(surface);

	return chart;
}
 
开发者ID:gsi-upm,项目名称:BARMAS,代码行数:26,代码来源:Plotter.java

示例3: createShape

import org.jzy3d.plot3d.primitives.Shape; //导入方法依赖的package包/类
private Shape createShape()
{
    List<Polygon> polygons = new ArrayList<Polygon>();
    for (int sx = 0; sx < stepsX; sx++)
    {
        for (int sy = 0; sy < stepsY; sy++)
        {
            polygons.add(createPolygon(sx, sy));
        }
    }
    final Shape shp = new Shape(polygons);

    ColorMapper colorMapper = new ColorMapper()
    {
        @Override
        public org.jzy3d.colors.Color getColor(Coord3d c)
        {
            float rgb[] = cubeCoordinatesToRgbColorComponents.apply(new float[] { c.x, c.y, c.z });
            return new org.jzy3d.colors.Color(rgb[0], rgb[1], rgb[2]);
        }
    };
    shp.setColorMapper(colorMapper);
    shp.setFaceDisplayed(true);
    shp.setWireframeDisplayed(true);
    shp.setWireframeColor(org.jzy3d.colors.Color.GRAY);
    return shp;
}
 
开发者ID:igd-iva,项目名称:colormap-explorer,代码行数:28,代码来源:ColormapShape.java

示例4: getChartFromSRTMData

import org.jzy3d.plot3d.primitives.Shape; //导入方法依赖的package包/类
private AWTChart getChartFromSRTMData(final JavaFXChartFactory factory, final String toolkit, final SRTMData srtmData) {
    // -------------------------------
    // Define a function to plot
    final Mapper mapper = new Mapper() {
        @Override
        public double f(double x, double y) {
            final float height = Math.max(0f, srtmData.getValues()[(int) x][(int) y]);
            return height;
        }
    };

    // we don't want to plot the full set, only 1/10 of it
    final int dataCount = srtmData.getKey().getValue().getDataCount();
    final int steps = dataCount / 10;
    
    // Define range and precision for the function to plot
    final Range lonrange = new Range(0f, 1f*(dataCount-1));
    final Range latrange = new Range(1f*(dataCount-1), 0f);
    final OrthonormalGrid grid = new OrthonormalGrid(lonrange, steps, latrange, steps);

    // Create the object to represent the function over the given range.
    final Shape surface = Builder.buildOrthonormal(grid, mapper);
    surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
    surface.setFaceDisplayed(true);
    surface.setWireframeDisplayed(false);

    // -------------------------------
    // Create a chart
    Quality quality = Quality.Nicest;
    quality.setSmoothPolygon(true);
    //quality.setAnimated(true);
    
    // let factory bind mouse and keyboard controllers to JavaFX node
    final AWTChart chart = (AWTChart) factory.newChart(quality, toolkit);
    chart.getScene().getGraph().add(surface);
    
    // and now for some beautifying
    final String name = srtmData.getKey().getKey();
    final String lat = name.substring(0, 3);
    final String lon = name.substring(3, 7);
    chart.getAxeLayout().setXAxeLabel( lat );
    chart.getAxeLayout().setYAxeLabel( lon );
    chart.getAxeLayout().setZAxeLabel( "m" );
    
    chart.setViewMode(ViewPositionMode.FREE);
    chart.setViewPoint(new Coord3d(0.05f, 1.1f, 4000f));
    return chart;
}
 
开发者ID:ThomasDaheim,项目名称:GPXEditor,代码行数:49,代码来源:SRTMDataViewer.java

示例5: createChart

import org.jzy3d.plot3d.primitives.Shape; //导入方法依赖的package包/类
private void createChart() {
		if (chartCreated.compareAndSet(false, true)) {
			System.out.println("Creating chart!");
			Runnable worker = new Runnable() {

				@Override
				public void run() {
					ProgressHandle ph = ProgressHandleFactory.createHandle("Opening Jzy3D View!");
					ph.start();
					ph.switchToIndeterminate();
					try {
						AWTChartComponentFactory accf = new AWTChartComponentFactory();
						final Chart chart = accf.newChart(Quality.Advanced, Toolkit.newt.name());
						chart.getView().setMaximized(true);
						canvas = (CanvasNewtAwt) chart.getCanvas();
						final CameraThreadController ctc = new CameraThreadController(chart);
						//signature change in latest upstream jogl causes java.lang.NoSuchMethodError: com.jogamp.newt.event.MouseEvent.getClickCount()I
//						NewtCameraMouseController camMouse = new NewtCameraMouseController(chart);
						WorkaroundNewtCameraMouseController camMouse = new WorkaroundNewtCameraMouseController(chart);
						// Create a surface drawing that function
						// Define a function to plot
						Mapper mapper = new Mapper() {
							public double f(double x, double y) {
								return 10 * Math.sin(x / 10) * Math.cos(y / 20) * x;
							}
						};
						// Define range and precision for the function to plot
						Range range = new Range(-150, 150);
						int steps = 50;
						Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
						surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
						surface.setFaceDisplayed(true);
						surface.setWireframeDisplayed(false);
						surface.setWireframeColor(Color.BLACK);
						chart.getScene().getGraph().add(surface, true);
						SwingUtilities.invokeLater(new Runnable() {

							@Override
							public void run() {
								setChart(chart);
								canvas.setMinimumSize(getMinimumSize());
								canvas.setMaximumSize(getMaximumSize());
								canvas.setPreferredSize(getPreferredSize());
								add(canvas, BorderLayout.CENTER);
								setCameraThreadController(ctc);
								if (toggleAnimation.isSelected()) {
									ctc.start();
								}
								//need to update complete component tree
								invalidate();
								getTopLevelAncestor().invalidate();
								getTopLevelAncestor().revalidate();
							}
						});
					} finally {
						ph.finish();
					}
				}

			};
			Task t = RequestProcessor.getDefault().post(worker);
			t.addTaskListener(new TaskListener() {

				@Override
				public void taskFinished(Task task) {
					if (task.isFinished()) {
						requestAttention(true);
					}
				}
			});
		} else {
			System.out.println("Chart already created!");
		}
	}
 
开发者ID:nilshoffmann,项目名称:netbeans-jogl2,代码行数:75,代码来源:Jzy3DDemoTopComponent.java


注:本文中的org.jzy3d.plot3d.primitives.Shape.setWireframeDisplayed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。