| 181 | } |
| 182 | |
| 183 | void Process1(vtkMultiProcessController* contr, void* arg) |
| 184 | { |
| 185 | GenericCommunicatorArgs_tmp* args = reinterpret_cast<GenericCommunicatorArgs_tmp*>(arg); |
| 186 | |
| 187 | vtkCommunicator* comm = contr->GetCommunicator(); |
| 188 | |
| 189 | int i; |
| 190 | |
| 191 | // Test sending all supported types of arrays |
| 192 | int datai[scMsgLength]; |
| 193 | for (i = 0; i < scMsgLength; i++) |
| 194 | { |
| 195 | datai[i] = i; |
| 196 | } |
| 197 | vtkIntArray* ia = vtkIntArray::New(); |
| 198 | ia->SetArray(datai, 10, 1); |
| 199 | if (!comm->Send(ia, 1, 11)) |
| 200 | { |
| 201 | std::cerr << "Client error: Error sending data." << std::endl; |
| 202 | *(args->retVal) = 0; |
| 203 | } |
| 204 | ia->Delete(); |
| 205 | |
| 206 | unsigned long dataul[scMsgLength]; |
| 207 | for (i = 0; i < scMsgLength; i++) |
| 208 | { |
| 209 | dataul[i] = static_cast<unsigned long>(i); |
| 210 | } |
| 211 | vtkUnsignedLongArray* ula = vtkUnsignedLongArray::New(); |
| 212 | ula->SetArray(dataul, 10, 1); |
| 213 | if (!comm->Send(ula, 1, 22)) |
| 214 | { |
| 215 | std::cerr << "Client error: Error sending data." << std::endl; |
| 216 | *(args->retVal) = 0; |
| 217 | } |
| 218 | ula->Delete(); |
| 219 | |
| 220 | char datac[scMsgLength]; |
| 221 | for (i = 0; i < scMsgLength; i++) |
| 222 | { |
| 223 | datac[i] = static_cast<char>(i); |
| 224 | } |
| 225 | vtkCharArray* ca = vtkCharArray::New(); |
| 226 | ca->SetArray(datac, 10, 1); |
| 227 | if (!comm->Send(ca, 1, 33)) |
| 228 | { |
| 229 | std::cerr << "Client error: Error sending data." << std::endl; |
| 230 | *(args->retVal) = 0; |
| 231 | } |
| 232 | ca->Delete(); |
| 233 | |
| 234 | unsigned char datauc[scMsgLength]; |
| 235 | for (i = 0; i < scMsgLength; i++) |
| 236 | { |
| 237 | datauc[i] = static_cast<unsigned char>(i); |
| 238 | } |
| 239 | vtkUnsignedCharArray* uca = vtkUnsignedCharArray::New(); |
| 240 | uca->SetArray(datauc, 10, 1); |
nothing calls this directly
no test coverage detected