MCPcopy Create free account
hub / github.com/Kitware/VTK / AppendAlgorithmParameters

Method AppendAlgorithmParameters

Filters/Statistics/vtkStatisticsAlgorithm.cxx:169–217  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

167
168//------------------------------------------------------------------------------
169void vtkStatisticsAlgorithm::AppendAlgorithmParameters(std::string& algorithmParameters) const
170{
171 if (this->AssessNames && this->AssessNames->GetNumberOfValues() > 0)
172 {
173 if (!algorithmParameters.empty() && algorithmParameters.back() != '(')
174 {
175 algorithmParameters += ",";
176 }
177 algorithmParameters += "assess_names=(";
178 vtkIdType nv = this->AssessNames->GetNumberOfValues() - 1;
179 for (vtkIdType ii = 0; ii <= nv; ++ii)
180 {
181 auto strname = this->AssessNames->GetValue(ii);
182 if (strname.find('"') == std::string::npos)
183 {
184 algorithmParameters += "\"" + strname + (ii < nv ? "\"," : "\"");
185 }
186 else if (strname.find('\'') == std::string::npos)
187 {
188 algorithmParameters += "'" + strname + (ii < nv ? "'," : "'");
189 }
190 else
191 {
192 vtkErrorMacro(
193 "Cannot serialize assess names (" << strname << ") with both kinds of quotes.");
194 continue;
195 }
196 }
197 algorithmParameters += ")";
198 }
199 // Only specify non-default values for GhostsToSkip, SkipInvalidValues:
200 if (this->GhostsToSkip != 0xff)
201 {
202 if (!algorithmParameters.empty() && algorithmParameters.back() != '(')
203 {
204 algorithmParameters += ",";
205 }
206 algorithmParameters += "ghosts_to_skip=" + vtk::to_string(static_cast<int>(this->GhostsToSkip));
207 }
208 if (!this->SkipInvalidValues)
209 {
210 if (!algorithmParameters.empty() && algorithmParameters.back() != '(')
211 {
212 algorithmParameters += ",";
213 }
214 algorithmParameters +=
215 "skip_invalid_values=" + vtk::to_string(static_cast<int>(this->SkipInvalidValues));
216 }
217}
218
219//------------------------------------------------------------------------------
220std::size_t vtkStatisticsAlgorithm::ConsumeNextAlgorithmParameter(

Callers 1

Calls 6

backMethod · 0.80
to_stringFunction · 0.50
GetNumberOfValuesMethod · 0.45
emptyMethod · 0.45
GetValueMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected