FreeWRL/FreeX3D
3.0.0
Main Page
Related Pages
Data Structures
Files
File List
EventOutMFFloat.java
1
// read in a multi float value from the FreeWRL browser.
2
3
package
vrml.external.field;
4
import
vrml.external.Browser
;
5
import
vrml.external.field.FieldTypes
;
6
import
java.util.*;
7
8
public
class
EventOutMFFloat
extends
EventOutMField
{
9
public
EventOutMFFloat
() { EventType = FieldTypes.MFFLOAT; }
10
11
public
float
[] getValue() {
12
float
[] rval;
13
int
lines;
14
int
rows;
15
int
count1;
16
int
count2;
17
StringTokenizer tokens;
18
String rep;
19
20
if
(RLreturn == null) {
21
rep = Browser.SendEventOut (nodeptr, offset, datasize, datatype,
command
);
22
}
else
{
23
rep = RLreturn;
24
}
25
// get the number of lines of code to come back.
26
27
rows = 1;
28
29
tokens =
new
StringTokenizer (rep);
30
31
//System.out.println ("DEBUG: EventOutMFFloat getValue - rep = " + rep);
32
lines = Integer.valueOf(tokens.nextToken()).intValue();
33
//System.out.println ("DEBUG: read in as a token " + lines);
34
35
rval =
new
float
[lines];
36
37
// now, read in the lines.
38
for
(count1=0; count1<lines; count1++) {
39
rval[count1] = Float.valueOf(tokens.nextToken()).floatValue();
40
}
41
42
// for the getSize call
43
sizeof
= lines;
44
45
return
rval;
46
}
47
48
49
public
float
get1Value(
int
index) {
50
float
all[] = getValue();
51
52
return
all[index];
53
}
54
}
command
Definition:
common.c:686
vrml.external.field.FieldTypes
Definition:
FieldTypes.java:5
vrml.external.field.EventOutMFFloat
Definition:
EventOutMFFloat.java:8
vrml.external.field.EventOutMField
Definition:
EventOutMField.java:7
vrml.external.Browser
Definition:
Browser.java:27
src
java
vrml
external
field
EventOutMFFloat.java
Generated on Thu Dec 14 2017 12:14:40 for FreeWRL/FreeX3D by
1.8.6