MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / Execute

Method Execute

src/Tools.cc:365–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363
364
365void StepAsyncReadWorker::Execute() {
366
367 MutexLocker _locker(stepOperation_mutex);
368
369 void* data = request.data;
370 this->_retValue = 0;
371
372 occHandle(Message_ProgressIndicator) progress = new MyProgressIndicator(this);
373
374 progress->SetScale(1, 100, 1);
375 progress->Show();
376
377 try {
378
379 STEPControl_Reader aReader;
380
381
382 Interface_Static::SetCVal("xstep.cascade.unit", "mm");
383 Interface_Static::SetIVal("read.step.nonmanifold", 1);
384 Interface_Static::SetIVal("read.step.product.mode", 1);
385
386 progress->NewScope(5, "reading");
387
388 if (aReader.ReadFile(_filename.c_str()) != IFSelect_RetDone) {
389
390 std::stringstream str;
391 str << " (1) cannot read STEP file " << _filename << std::ends;
392 this->SetErrorMessage(str.str().c_str());
393
394 // Local<Value> argv[] = { Local<Value>(String::New()) };
395 // Local<Value> res = callback->Call(global, 1, argv);
396 // NanReturnUndefined();
397 progress->EndScope();
398 progress->SetValue(105.0);
399 progress->Show();
400 this->_retValue = 1;
401 return;
402
403 }
404 progress->EndScope();
405 progress->Show();
406
407
408 progress->NewScope(95, "transfert");
409 progress->Show();
410 aReader.WS()->MapReader()->SetProgress(progress);
411
412
413 // Root transfers
414 int nbr = aReader.NbRootsForTransfer();
415
416 Standard_Boolean failsonly = Standard_False;
417 aReader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity);
418
419 progress->SetRange(0, nbr);
420 int mod = nbr / 10 + 1;
421 for (int n = 1; n <= nbr; n++) {
422

Callers

nothing calls this directly

Calls 2

ShowMethod · 0.80
ShapeMethod · 0.80

Tested by

no test coverage detected