MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / setGeometry

Method setGeometry

src/fields2cover/types/MultiLineString.cpp:103–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void MultiLineString::setGeometry(size_t i, const LineString& line) {
104 auto n = this->size();
105 if (i < n) {
106 MultiLineString lines;
107 for (size_t j = 0; j < n; ++j) {
108 lines.addGeometry((i == j) ? line : this->getGeometry(j));
109 }
110 *this = lines;
111 return;
112 } else if (i != n) {
113 for (size_t j = n; j < i; ++j) {
114 this->addGeometry(LineString());
115 }
116 }
117 this->addGeometry(line);
118}
119
120void MultiLineString::addGeometry(const LineString& line) {
121 this->data_->addGeometry(line.get());

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.95
addGeometryMethod · 0.95
getGeometryMethod · 0.95
LineStringClass · 0.85

Tested by

no test coverage detected