MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / create_vector_from_array

Function create_vector_from_array

src/examples/triangulated_faceset.cpp:41–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40template <typename T>
41std::vector< std::vector<T> > create_vector_from_array(const T* arr, unsigned size) {
42 std::vector< std::vector<T> > result;
43 result.reserve(size);
44
45 for (unsigned i = 0; i < size; ) {
46 std::vector<T> ts; ts.reserve(3);
47 for (unsigned j = 0; j < 3; ++i, ++j) {
48 ts.push_back(arr[i]);
49 }
50 result.push_back(ts);
51 }
52
53 return result;
54}
55
56int main(int argc, char** argv) {
57 IfcHierarchyHelper<IfcSchema> file;

Callers 1

mainFunction · 0.85

Calls 2

reserveMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected