MCPcopy Create free account
hub / github.com/Kitware/ParaView / IsArrayAcceptable

Method IsArrayAcceptable

Remoting/ServerManager/vtkSMInputArrayDomain.cxx:199–240  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

197
198//----------------------------------------------------------------------------
199int vtkSMInputArrayDomain::IsArrayAcceptable(vtkPVArrayInformation* arrayInfo)
200{
201 if (arrayInfo == nullptr)
202 {
203 return -1;
204 }
205
206 int numberOfComponents = arrayInfo->GetNumberOfComponents();
207
208 // Empty AcceptableNumbersOfComponents means any number of components
209 // are acceptable
210 if (this->AcceptableNumbersOfComponents.empty())
211 {
212 return numberOfComponents;
213 }
214
215 bool acceptableConversion = false;
216 for (unsigned int i = 0; i < this->AcceptableNumbersOfComponents.size(); i++)
217 {
218 // 0 means all are ok
219 if (this->AcceptableNumbersOfComponents[i] == 0)
220 {
221 return numberOfComponents;
222 }
223
224 // Standard use, where the AcceptableNumbersOfComponents is the
225 // number of components of the array
226 else if (this->AcceptableNumbersOfComponents[i] == numberOfComponents)
227 {
228 return numberOfComponents;
229 }
230
231 // Conversion use, only if activated, and only if AcceptableNumbersOfComponents is 1
232 // Also we keep trying to check if there are other better AcceptableNumbersOfComponents
233 else if (this->GetAutoConvertProperties() && this->AcceptableNumbersOfComponents[i] == 1 &&
234 numberOfComponents > 1)
235 {
236 acceptableConversion = true;
237 }
238 }
239 return acceptableConversion ? 1 : -1;
240}
241
242//----------------------------------------------------------------------------
243bool vtkSMInputArrayDomain::IsAttributeTypeAcceptable(int attributeType)

Callers 2

HasAcceptableArrayMethod · 0.95
BuildArrayListMethod · 0.80

Calls 4

GetNumberOfComponentsMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected