package j3deditor.bin.hierarchy;


import javax.media.j3d.Geometry;
import javax.media.j3d.GeometryArray;


/**
 * Manages Java 3D <code>javax.media.j3d.Geometry</code>
 * object.
 * 
 * @author Risto Seene
 * 
 * @see javax.media.j3d.Geometry
 */
public class J3DeGeometry{

	/** geometry */
	private Geometry geometry;


	/**
	 * Creates an instance of <code>J3DeGeometry</code>
	 * with the specified <code>Geometry</code> object.
	 * 
	 * @param geometry
	 * 	<code>Geometry</code> object this
	 *        <code>J3DeGeometry</code> manages
	 */
	public J3DeGeometry(Geometry geometry){
		this.geometry = geometry;	
	}


	/**
	 * Sets all necessary capability flags.
	 * 
	 * @param geom
	 * 	<code>Geometry</code> which flags will be set
	 */
	public static void setCapabilities(Geometry geom){
		if(geom instanceof GeometryArray){
			J3DeGeometryArray.setCapabilities((GeometryArray)geom);
		}
	}
	
	/**
	 * Returns the <code>Geometry</code>.
	 * 
	 * @return the <code>Geometry</code>
	 */
	public Geometry getGeometry(){
		return this.geometry;
	}

}
