MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / readFile

Function readFile

src/Mod/JtReader/App/JtReader.cpp:584–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void readFile(const char* FileName, int iLods)
585{
586 iLod = iLods;
587
588 testLicence();
589
590 JtkCADImporter* importer = NULL;
591 importer = JtkEntityFactory::createCADImporter();
592 if (importer) {
593 importer->ref();
594 importer->setShapeLoadOption(JtkCADImporter::JtkALL_LODS);
595 importer->setBrepLoadOption(JtkCADImporter::JtkTESS_AND_BREP);
596 JtkHierarchy* root = NULL;
597
598 root = importer->import(FileName);
599
600 if (root) {
601 root->ref();
602 JtkTraverser* trav = JtkEntityFactory::createTraverser();
603 trav->setupPreActionCallback(myPreactionCB_CollectFacets);
604 if (trav) {
605 trav->ref();
606 trav->traverseGraph(root);
607 trav->unref();
608 trav = NULL;
609 }
610 else {
611 throw "Unable to create JtkTraverser.\n";
612 }
613
614 root->unref();
615 root = NULL;
616 }
617 else {
618 throw "Unable in find root node. Check file...\n";
619 }
620
621 importer->unref();
622 importer = NULL;
623 }
624 else {
625 throw "Unable to create JtkCADImporter. Check license...\n";
626 }
627}
628
629
630const SimpleMeshFacet* iterStart(void)

Callers 2

setNavigationModeFileMethod · 0.50
getMaterialFromPathMethod · 0.50

Calls 4

testLicenceFunction · 0.85
traverseGraphMethod · 0.80
refMethod · 0.45
unrefMethod · 0.45

Tested by

no test coverage detected