6 import java.io.BufferedReader;
7 import java.io.PrintWriter;
8 import java.io.IOException;
15 this(rotations.length, rotations);
18 public MFRotation(
int size,
float[] rotations) {
19 for (
int i = 0; i < size; i += 4)
20 __vect.addElement(
new ConstSFRotation(rotations[i], rotations[i+1], rotations[i+2], rotations[i+3]));
24 for (
int i = 0; i < rotations.length; i++)
25 __vect.addElement(
new ConstSFRotation(rotations[i][0], rotations[i][1], rotations[i][2], rotations[i][3]));
28 public void getValue(
float[] rotations) {
30 int size = __vect.size();
31 for (
int i = 0; i < size; i++) {
33 rotations[4*i+0] = sfRotation.axisX;
34 rotations[4*i+1] = sfRotation.axisY;
35 rotations[4*i+2] = sfRotation.axisZ;
36 rotations[4*i+3] = sfRotation.angle;
40 public void getValue(
float[][] rotations) {
42 int size = __vect.size();
43 for (
int i = 0; i < size; i++)
47 public void get1Value(
int index,
float[] rotations) {
52 public void get1Value(
int index,
SFRotation sfRotation) {
57 public void setValue(
float[] rotations) {
58 setValue(rotations.length, rotations);
61 public void setValue(
int size,
float[] rotations) {
63 for (
int i = 0; i < size; i += 4)
64 __vect.addElement(
new ConstSFRotation(rotations[i], rotations[i+1], rotations[i+2], rotations[i+3]));
68 public void set1Value(
int index,
float axisX,
float axisY,
float axisZ,
float angle) {
72 public void set1Value(
int index,
SFRotation sfRotation) {
73 sfRotation.__updateRead();
74 __set1Value(index,
new ConstSFRotation(sfRotation.axisX, sfRotation.axisY, sfRotation.axisZ, sfRotation.angle));
78 __set1Value(index, sfRotation);
81 public void addValue(
float axisX,
float axisY,
float axisZ,
float angle) {
86 sfRotation.__updateRead();
87 __addValue(
new ConstSFRotation(sfRotation.axisX, sfRotation.axisY, sfRotation.axisZ, sfRotation.angle));
91 __addValue(sfRotation);
94 public void insertValue(
int index,
float axisX,
float axisY,
float axisZ,
float angle) {
98 public void insertValue(
int index,
SFRotation sfRotation) {
99 sfRotation.__updateRead();
100 __insertValue(index,
new ConstSFRotation(sfRotation.axisX, sfRotation.axisY, sfRotation.axisZ, sfRotation.angle));
104 __insertValue(index, sfRotation);
107 public String toString() {
109 StringBuffer sb =
new StringBuffer(
"[");
110 int size = __vect.size();
111 for (
int i = 0; i < size; i++) {
112 if (i > 0) sb.append(
", ");
113 sb.append(__vect.elementAt(i));
115 return sb.append(
"]").toString();
118 public void __fromPerl(BufferedReader in)
throws IOException {
120 String lenline = in.readLine();
123 int len = Integer.parseInt(lenline);
124 for (
int i = 0; i < len; i++) {
127 __vect.addElement(sf);
131 public void __toPerl(PrintWriter out)
throws IOException {
132 StringBuffer sb =
new StringBuffer(
"");
133 int size = __vect.size();
135 for (
int i = 0; i < size; i++) {
137 if (i != (size-1)) out.print (
", ");