Pose.java
Go to the documentation of this file.
00001 /*
00002  * Created on Oct 19, 2009
00003  *
00004  * TODO To change the template for this generated file go to
00005  * Window - Preferences - Java - Code Style - Code Templates
00006  */
00007 package edu.tum.cs.ias.knowrob.vis.items.transform;
00008 
00009 import edu.tum.cs.ias.knowrob.vis.Canvas;
00010 
00011 public class Pose implements Cloneable, DrawingTransformation {
00012         public float x, y, z, xRot, yRot, zRot, scale;
00013         
00014         public Pose(float x, float y, float z, float xRot, float yRot, float zRot, float scale) {
00015                 this.x = x;
00016                 this.y = y;
00017                 this.z = z;
00018                 this.xRot = xRot;
00019                 this.yRot = yRot;
00020                 this.zRot = zRot;
00021                 this.scale = scale;
00022         }
00023 
00024         public void applyTransformation(Canvas c) {
00025                 c.translate(x, y, z);
00026                 c.scale(scale);
00027                 if(xRot != 0) c.rotateX(xRot);
00028                 if(yRot != 0) c.rotateY(yRot); 
00029                 if(zRot != 0) c.rotateZ(zRot);
00030         }
00031         
00032         public boolean equals(Pose o) {
00033                 return x==o.x && y==o.y && z==o.z && xRot==o.xRot && yRot==o.yRot && zRot==o.zRot && scale==o.scale;
00034         }
00035         
00036         @Override
00037         public Pose clone() {
00038                 return new Pose(x,y,z,xRot,yRot,zRot,scale);
00039         }
00040 }


mod_vis
Author(s): Moritz Tenorth, Jakob Engel
autogenerated on Mon Oct 6 2014 01:30:00