OffScreenCanvas3D.java
Go to the documentation of this file.
00001 // -*- indent-tabs-mode: nil; tab-width: 4; -*-
00002 /*
00003  * Copyright (c) 2008, AIST, the University of Tokyo and General Robotix Inc.
00004  * All rights reserved. This program is made available under the terms of the
00005  * Eclipse Public License v1.0 which accompanies this distribution, and is
00006  * available at http://www.eclipse.org/legal/epl-v10.html
00007  * Contributors:
00008  * General Robotix Inc.
00009  * National Institute of Advanced Industrial Science and Technology (AIST) 
00010  */
00011 package com.generalrobotix.ui.view.vsensor;
00012 
00013 // Java2 SDK
00014 import java.awt.GraphicsConfiguration;
00015 
00016 // Java3D
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                 //System.out.println("OffScreenCanvas3D::OffScreenCanvas3D()");
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 }


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:18