| 141 | } |
| 142 | |
| 143 | void IfcViewerWidget::loadFile(const std::string& filePath) |
| 144 | { |
| 145 | std::vector<osg::ref_ptr<osg::MatrixTransform>> matrixTransforms; |
| 146 | |
| 147 | if(!m_parser.Parse(filePath, matrixTransforms)) { |
| 148 | MessageLogger::log("Failed to prepare IFC geometry"); |
| 149 | return; |
| 150 | } |
| 151 | |
| 152 | MessageLogger::log("\nIFC geometry prepared"); |
| 153 | |
| 154 | for (auto matrixTransform : matrixTransforms) { |
| 155 | root->addChild(matrixTransform); |
| 156 | } |
| 157 | |
| 158 | // set initial camera position |
| 159 | orientScene(root); |
| 160 | |
| 161 | // request redraw |
| 162 | update(); |
| 163 | } |
| 164 | |
| 165 | void IfcViewerWidget::orientScene(osg::ref_ptr<osg::Group> rootGroup) |
| 166 | { |