17 package com.generalrobotix.ui.view.graph;
20 import java.util.StringTokenizer;
21 import java.text.DecimalFormat;
22 import javax.vecmath.*;
31 df_ =
new DecimalFormat(
"0.####");
37 df_ =
new DecimalFormat(
"0.####");
43 df_ =
new DecimalFormat(
"0.####");
49 df_ =
new DecimalFormat(
"0.####");
55 df_ =
new DecimalFormat(
"0.####");
61 df_ =
new DecimalFormat(
"0.####");
67 df_ =
new DecimalFormat(
"0.####");
73 df_ =
new DecimalFormat(
"0.####");
84 for (
int i = 0;
i < 4;
i ++) {
87 }
else if (value[
i].isInfinite()) {
93 value[0].doubleValue(),
94 value[1].doubleValue(),
95 value[2].doubleValue(),
96 value[3].doubleValue()
99 Quat4d quat =
new Quat4d();
107 for (
int i = 0;
i < 4;
i ++) {
108 if (Double.isNaN(value[
i])) {
110 }
else if (Double.isInfinite(value[i])) {
117 Quat4d quat =
new Quat4d();
125 for (
int i = 0;
i < 4;
i ++) {
126 if (Double.isNaN(value[
i])) {
128 }
else if (Double.isInfinite(value[i])) {
139 Quat4d quat =
new Quat4d();
150 if (isNaN_) {
return ""; }
152 StringBuffer strBuf =
new StringBuffer();
154 strBuf.append(df_.format(value_.x));
156 strBuf.append(df_.format(value_.y));
158 strBuf.append(df_.format(value_.z));
160 strBuf.append(df_.format(value_.angle));
162 return strBuf.toString();
166 if (str.equals(
"")) {
171 StringTokenizer token =
new StringTokenizer(str);
173 Double[] doubleArray =
new Double[4];
177 for (
int i = 0;
i < 4;
i ++) {
178 if (token.hasMoreTokens()) {
179 String
value = token.nextToken();
180 if (value.equals(
"NaN")) {
182 doubleArray[
i] =
new Double(Double.NaN);
185 doubleArray[
i] =
new Double(value);
186 }
catch (NumberFormatException ex) {
190 if (doubleArray[
i].
isNaN()) {
192 }
else if (doubleArray[
i].isInfinite()) {
201 if (token.hasMoreTokens()) {
206 doubleArray[0].doubleValue(),
207 doubleArray[1].doubleValue(),
208 doubleArray[2].doubleValue(),
209 doubleArray[3].doubleValue()
212 Quat4d quat =
new Quat4d();
216 return (Object)value_;
220 Quat4d quat =
new Quat4d();
225 public void setValue(
double x,
double y,
double z,
double angle) {
226 value_.set(x, y, z, angle);
227 Quat4d quat =
new Quat4d();
237 return (Object)value_;
SEAxisAngle(DecimalFormat df)
SEAxisAngle(String value)
#define null
our own NULL pointer
SEAxisAngle(float[] value)
void setValue(Quat4d value)
void setValue(String str)
SEAxisAngle(double x, double y, double z, double angle)
SEAxisAngle(AxisAngle4d value)
void setValue(double x, double y, double z, double angle)
void setValue(Object value)
void setValue(float value[])
void setValue(Double value[])
Object fromString(String str)
SEAxisAngle(double[] value)
SEAxisAngle(Quat4d value)
SEAxisAngle(Double[] value)
void setValue(double value[])