Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 package com.generalrobotix.ui.view.vsensor;
00012
00013
00014 import java.awt.GraphicsConfiguration;
00015
00016
00017 import javax.media.j3d.*;
00018
00025 @SuppressWarnings("serial")
00026 public final class OffScreenCanvas3D extends Canvas3DI
00027 {
00036 public OffScreenCanvas3D(
00037 GraphicsConfiguration graphicsConfiguration,
00038 Raster raster,
00039 int width,
00040 int height,
00041 int rasterType)
00042 {
00043 super(graphicsConfiguration, true, raster, width, height, rasterType);
00044
00045
00046 if (rasterType_ == Raster.RASTER_COLOR
00047 || rasterType_ == Raster.RASTER_COLOR_DEPTH){
00048 setOffScreenBuffer(raster_.getImage());
00049 } else {
00050 setOffScreenBuffer(new ImageComponent2D(ImageComponent.FORMAT_RGB,
00051 width, height));
00052 }
00053
00054 Screen3D s3d = getScreen3D();
00055 s3d.setSize(width, height);
00056 s3d.setPhysicalScreenWidth(width);
00057 s3d.setPhysicalScreenHeight(height);
00058 }
00059
00060 public void renderOnce(){
00061 super.renderOnce();
00062 renderOffScreenBuffer();
00063 waitForOffScreenRendering();
00064 }
00065 }