~holger-seelig/cobweb.js/1.4

« back to all changes in this revision

Viewing changes to cobweb.js/cobweb/Components/Rendering/IndexedLineSet.js

  • Committer: Holger Seelig
  • Date: 2016-04-23 04:10:18 UTC
  • Revision ID: holger.seelig@yahoo.de-20160423041018-p2co33alldequj0a
Added PolylineEmitter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
 
178
178
                        return polylines;
179
179
                },
 
180
                getPolylines: function (polylines)
 
181
                {
 
182
                        // Polyline map
 
183
 
 
184
                        polylines .length = 0;
 
185
                
 
186
                        if (! this .coordNode || this .coordNode .isEmpty ())
 
187
                                return polylines;
 
188
                
 
189
                        var
 
190
                                polylineIndices = this .getPolylineIndices (),
 
191
                                coordIndex      = this .coordIndex_. getValue ();
 
192
 
 
193
                        for (var p = 0; p < polylineIndices .length; ++ p)
 
194
                        {
 
195
                                var polyline = polylineIndices [p];
 
196
 
 
197
                                // Create two vertices for each line.
 
198
                
 
199
                                for (var line = 0, endL = polyline .length - 1; line < endL; ++ line)
 
200
                                {
 
201
                                        for (var index = line, endI = line + 2; index < endI; ++ index)
 
202
                                        {
 
203
                                                polylines .push (this .coordNode .get1Point (coordIndex [polyline [index]] .getValue ()));
 
204
                                        }
 
205
                                }
 
206
                        }
 
207
                
 
208
                        return polylines;
 
209
                },
180
210
                build: function ()
181
211
                {
182
212
                        if (! this .coordNode || this .coordNode .isEmpty ())