6 import java.io.BufferedReader;
7 import java.io.PrintWriter;
8 import java.io.IOException;
15 this(vec3fs.length, vec3fs);
19 for (
int i = 0; i < size; i += 3)
20 __vect.addElement(
new ConstSFVec3f(vec3fs[i], vec3fs[i+1], vec3fs[i+2]));
24 for (
int i = 0; i < vec3fs.length; i++)
25 __vect.addElement(
new ConstSFVec3f(vec3fs[i][0], vec3fs[i][1], vec3fs[i][2]));
28 public void getValue(
float[] vec3fs) {
30 int size = __vect.size();
31 for (
int i = 0; i < size; i++) {
33 vec3fs[3*i+0] = sfVec3f.x;
34 vec3fs[3*i+1] = sfVec3f.y;
35 vec3fs[3*i+2] = sfVec3f.z;
39 public void getValue(
float[][] vec3fs) {
41 int size = __vect.size();
42 for (
int i = 0; i < size; i++)
43 ((
ConstSFVec3f) __vect.elementAt(i)).getValue(vec3fs[i]);
46 public void get1Value(
int index,
float[] vec3fs) {
48 ((
ConstSFVec3f) __vect.elementAt(index)).getValue(vec3fs);
51 public void get1Value(
int index,
SFVec3f sfVec3f) {
53 sfVec3f.setValue((
ConstSFVec3f) __vect.elementAt(index));
56 public String toString() {
58 StringBuffer sb =
new StringBuffer(
"[");
59 int size = __vect.size();
60 for (
int i = 0; i < size; i++) {
61 if (i > 0) sb.append(
", ");
62 sb.append(__vect.elementAt(i));
64 return sb.append(
"]").toString();
67 public void __fromPerl(BufferedReader in)
throws IOException {
69 String lenline = in.readLine();
72 int len = Integer.parseInt(lenline);
73 for (
int i = 0; i < len; i++) {
76 __vect.addElement(sf);
80 public void __toPerl(PrintWriter out)
throws IOException {
81 StringBuffer sb =
new StringBuffer(
"");
82 int size = __vect.size();
84 for (
int i = 0; i < size; i++) {
86 if (i != (size-1)) out.print (
", ");