MCPcopy Create free account
hub / github.com/PDAL/PDAL / newTriangle

Method newTriangle

io/ObjReader.cpp:103–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void ObjReader::newTriangle(PointViewPtr view, TRI tri)
104{
105 // checks if a point exists yet, if not, adds it to the point table via addPoint()
106 auto insertPoint = [view, this](VTN vertex)
107 {
108 PointId id;
109 auto it = m_points.find(vertex);
110 if (it == m_points.end())
111 {
112 id = addPoint(view, vertex);
113 m_points.insert({vertex, id});
114 }
115 else
116 id = it->second;
117 return id;
118 };
119 PointId p1 = insertPoint(tri[0]);
120 PointId p2 = insertPoint(tri[1]);
121 PointId p3 = insertPoint(tri[2]);
122 m_mesh->add(p1, p2, p3);
123}
124
125// adds a point to the point table
126PointId ObjReader::addPoint(PointViewPtr view, VTN vertex)

Callers

nothing calls this directly

Calls 5

addPointFunction · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected