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

Function emit_line_component

src/serializers/TtlWktSerializer.cpp:90–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 }
89
90 void emit_line_component(
91 std::ostream& os,
92 const std::vector<double>& vertices,
93 const std::vector<int>& component,
94 bool force_2d = false,
95 const char* const wkt_geometry_type=LINESTRING)
96 {
97 os << wkt_geometry_type << " ";
98 if (!force_2d) {
99 os << "Z";
100 }
101 os << "(";
102 if (wkt_geometry_type == POLYGON) {
103 os << "(";
104 }
105 for (size_t i = 0; i < component.size() + (wkt_geometry_type == POLYGON ? 1 : 0); ++i) {
106 if (i != 0) {
107 os << ", ";
108 }
109 for (size_t l = 0; l < (force_2d ? 2 : 3); ++l) {
110 os << vertices[component[i % component.size()] * 3 + l];
111 if (l != (force_2d ? 1 : 2)) {
112 os << " ";
113 }
114 }
115 }
116 os << ")";
117 if (wkt_geometry_type == POLYGON) {
118 os << ")";
119 }
120 }
121
122 void emit_line_strings(
123 std::ostream& os,

Callers 1

emit_line_stringsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected