home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / graphics / avs / 1045 < prev    next >
Encoding:
Text File  |  1992-12-30  |  5.0 KB  |  126 lines

  1. Newsgroups: comp.graphics.avs
  2. Path: sparky!uunet!cs.utexas.edu!lgc.com!lgc.com!srinivas
  3. From: srinivas@lgc.com (Manapragada Srinivas)
  4. Subject: Geometry Viewer misses inputs?
  5. Message-ID: <1992Dec31.012514.7123@lgc.com>
  6. Sender: usenet@lgc.com
  7. Nntp-Posting-Host: squirt.lgc.com
  8. Organization: Landmark Graphics LGC
  9. Date: Thu, 31 Dec 1992 01:25:14 GMT
  10. Lines: 114
  11.  
  12. Hi,
  13.  
  14.     We are having a problem with the geometry viewer, it seems to be
  15. missing certain inputs. I will explain the problem with the help of the
  16. network below -
  17.  
  18.  
  19.                                              +-----+
  20.                                              |     |
  21.             +--------------------+-+   |
  22.             |         CM1          |   |
  23.             | UI Module (Coroutine)|   |
  24.             +------------------+---+   |
  25.                        |    integer
  26.                        |     (ack)
  27.                             string     |
  28.                       (file name)  |
  29.                        |       |
  30.             +------------------+---+   |
  31.             |         SM1          |   |
  32.             | Data Reader Module   |   |
  33.             |    (Subroutine)      |   |
  34.             +------------------+-+-+   |
  35.                        | |     |
  36.                        | +-----+
  37.                              field
  38.                        |
  39.             +------------------+---+
  40.             |         SM2          |
  41.             | Data Mapper Module   |
  42.             |    (Subroutine)      |
  43.             +------------------+---+
  44.                        |
  45.                         Geometry
  46.                        |
  47.             +------------------+---+
  48.             |          G1          |
  49.             |   Geoemtry Viewer    |
  50.             +----------------------+
  51.  
  52.  
  53.     CM1 (UI Module) implements a motif user interface, among various
  54. ui components, there is a file selection dialog box, wherein a user can
  55. select one or more files. If more than one file is selected, the module
  56. will output the name of the first one and queue up the rest for subsequent
  57. outputs. The file names in the queue are sent one by one to SM1 (Data Reader
  58. Module), the module downstream. A name from the queue is output if and only
  59. if an acknowledgement is received from SM1, which simply is an integer input
  60. port in CM1. Finally when the queue is drained, CM1 will call
  61. AVSmark_output_unchanged on its string output port, to prevent uncontrolled
  62. loops.
  63.  
  64.     SM1 implements the file IO, it accepts a name from CM1 and reads
  65. the file, creates an AVS field, and sets the first label to the filename.
  66. After it is done it outputs the field to SM2 (Data Mapper Subroutine) and an
  67. integer to CM1. The integer serves as an acknowledgement to CM1, which then
  68. outputs another filename.
  69.  
  70.     SM2 implements a mapper which creates a geometry from the field.
  71. The first label is extracted from the field and is used for the naming the
  72. geometry. Hence each geometry object is named after the file from which the
  73. data was read in. This geometry is output to G1 (Geometry Viewer).
  74.  
  75.     The above explains in a nutshell what we are doing. Now the problem
  76. is that when a user selects multiple file names, for eg. A, B and C, only
  77. the geometry corresponding to C shows up in G1. When looking at the printf's
  78. to trace the flow of the data, we see that SM1 has successfully read all
  79. the files, and SM2 has successfully generated the corresponding geometries.
  80. So there is no loss of data among CM1, SM1 and SM2. However G1 is missing
  81. the geometries corresponding to A and B. Isn't the flow executive supposed
  82. to handle this?
  83.  
  84.     Now I know that in the interface between a coroutine module running
  85. asynchronously and a subroutine module, data loss is possible. We took
  86. elaborate measures to counter this by passing all the critical data through
  87. FIFO buffers and having an acknowledgement mechanism to time the outputs
  88. properly. This solution has worked very well for us.
  89.  
  90.     However I did not expect data loss between a subroutine module and
  91. the geometry viewer (which is a builtin module). Is it possible that the
  92. geometry viewer also runs asynchronously like a coroutine module? If so the
  93. upstream information currently put out is inadequate. For instance in the
  94. problem above upstream information about objects being added should be
  95. sent out, so that the upstream module can know when it is safe to output yet
  96. another geometry.
  97.  
  98.     Ofcourse the proper and elegant solution would be to use queues on
  99. the geometry viewers input ports, as FIFO buffers, so that no data is lost.
  100.  
  101.     Now I will describe the current work-around we are using. In SM2
  102. we call GEOMinit_edit_list only once and reuse the edit list for subsequent
  103. invocations. This seems to solve the problem and all the geometries appear
  104. without being lost. The code fragment looks like this,
  105.  
  106.         if( !*geom ) // Dangerous! remove this later
  107.                 *geom = GEOMinit_edit_list( *geom );
  108.  
  109.         GEOMedit_geometry( *geom, name, obj );
  110.         GEOMdestroy_obj( obj );
  111.     
  112. however I am afraid this might be a very bad thing to do :^) What are the
  113. possible repurcussions of reusing the edit list, without initializing it?
  114. I guess the list will keep growing endlessly. Also deletions would become
  115. a headache.
  116.  
  117.     I hope I am missing something very obvious, if so please point it out.
  118. In either case any help, suggestions and or workarounds would be greatly
  119. appreciated.
  120.  
  121. Thanks,
  122. Srinivas
  123. Landmark Graphics Corp.                    (713) 560-1073
  124. -- 
  125. Yonder, beyond the event horizon!
  126.