initial camera-orientation; multiple materials in a single element; default material used from IfcGeom; improved triangle node data generation for OSG

This commit is contained in:
dushyant basson
2023-09-14 12:36:45 +05:30
committed by Thomas Krijnen
parent e4ce53d548
commit 832618b84a
4 changed files with 167 additions and 150 deletions
+8 -17
View File
@@ -10,17 +10,6 @@
#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
{
@@ -34,12 +23,14 @@ public:
);
private:
std::vector<Triangle> createTriangles(
const std::vector<int>& elemFaces,
const std::vector<double>& elemVertices,
const std::vector<double>& elemNormals
);
osg::Vec4 getDefaultOsgDiffuseColor();
void buildTriangleNodes(
const std::vector<int>& fVertIds,
const std::vector<double>& elemVertices,
const std::vector<double>& elemNormals,
size_t index,
osg::ref_ptr<osg::Vec3Array> osgVertices,
osg::ref_ptr<osg::Vec3Array> osgNormals);
osg::ref_ptr<osg::Material> getOsgMaterial(const IfcGeom::Material& material);
};