File: VRwaveReader.java

package info (click to toggle)
vrwave 0.9-4
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 5,032 kB
  • ctags: 7,153
  • sloc: java: 15,050; ansic: 8,219; sh: 458; makefile: 181
file content (58 lines) | stat: -rw-r--r-- 1,186 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * VRwaveReader.java
 * read streamed input data
 *
 * created: mpichler, 19970814
 *
 * changed: mpichler, 19970822
 *
 * $Id: VRwaveReader.java,v 1.2 1997/09/19 14:48:21 mpichler Exp $
 */


import iicm.vrml.vrwave.*;

import java.io.InputStream;

import vrml.external.Browser;  // Java-EAI


class VRwaveReader implements Runnable
{
  Scene scene_;
  InputStream in_;  // PipedInputStream
  String baseurl_;
  boolean acceptdata_;


  VRwaveReader (Scene scene, InputStream in, String baseurl)
  {
    scene_ = scene;
    in_ = in;
    baseurl_ = baseurl;
    acceptdata_ = true;  // will start to read data when running
  }


  public void run ()
  {
    try
    { scene_.readScene (in_, baseurl_, null);
    }
    catch (Throwable t)
    { System.err.println ("Error during reading of VRML data: " + t);
    }
    acceptdata_ = false;  // will read no more data from pipe

    try
    { in_.close ();
    }
    catch (Throwable t)
    { System.err.println ("Error: could not close input side of pipe" + t);
    }

    // now that we have read the scene, we can activate the EAI connection
    Browser.startVRwave (scene_);  // register for EAI connection
  }

} // VRwaveReader