| 29 | |
| 30 | template <class SHAPE> |
| 31 | inline v8::Local<v8::Array> extract_shapes_as_javascript_array(SHAPE* pThis,TopAbs_ShapeEnum type) { |
| 32 | |
| 33 | TopTools_IndexedMapOfShape anIndices; |
| 34 | TopExp::MapShapes(pThis->shape(), type, anIndices); |
| 35 | |
| 36 | int nb =anIndices.Extent(); |
| 37 | v8::Local<v8::Array> arr = Nan::New<v8::Array>(nb); |
| 38 | for (int i=0; i<nb; i++) { |
| 39 | v8::Local<v8::Object> obj= buildWrapper(anIndices(i+1)); // 1 based !!! |
| 40 | Nan::Set(arr,i,obj); |
| 41 | } |
| 42 | return arr; |
| 43 | } |
| 44 | |
| 45 | |
| 46 |
no test coverage detected