mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 03:33:48 +00:00
IFC file successfully parsed and loaded in Qt OpenGL widget
This commit is contained in:
committed by
Thomas Krijnen
parent
c8c08439b2
commit
7b92b5c7e2
@@ -4,14 +4,43 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../ifcgeom_schema_agnostic/IfcGeomIterator.h"
|
||||
#include "osg/Material"
|
||||
#include "osg/ref_ptr"
|
||||
#include "osg/Geometry"
|
||||
|
||||
struct VertexWithNormal {
|
||||
osg::Vec3 vertex;
|
||||
osg::Vec3 normal;
|
||||
};
|
||||
|
||||
struct Triangle {
|
||||
VertexWithNormal vn1;
|
||||
VertexWithNormal vn2;
|
||||
VertexWithNormal vn3;
|
||||
};
|
||||
|
||||
class ParseIfcFile : public QObject
|
||||
{
|
||||
|
||||
public:
|
||||
ParseIfcFile();
|
||||
~ParseIfcFile();
|
||||
|
||||
void Parse(const std::string& filePath);
|
||||
bool Parse(
|
||||
const std::string& filePath,
|
||||
std::vector<osg::ref_ptr<osg::Geometry>>& geometries
|
||||
);
|
||||
|
||||
private:
|
||||
std::vector<Triangle> createTriangles(
|
||||
const std::vector<int>& elemFaces,
|
||||
const std::vector<double>& elemVertices,
|
||||
const std::vector<double>& elemNormals
|
||||
);
|
||||
osg::Vec4 getDefaultOsgDiffuseColor();
|
||||
osg::ref_ptr<osg::Material> getOsgMaterial(const IfcGeom::Material& material);
|
||||
};
|
||||
|
||||
#endif // PARSEIFCFILE_H
|
||||
|
||||
Reference in New Issue
Block a user