| 300 | } |
| 301 | |
| 302 | void |
| 303 | MetaMesh::M_SetupWriteFields() |
| 304 | { |
| 305 | MetaObject::M_SetupWriteFields(); |
| 306 | |
| 307 | MET_FieldRecordType * mF; |
| 308 | |
| 309 | char s[255]; |
| 310 | mF = new MET_FieldRecordType; |
| 311 | MET_TypeToString(m_PointType, s); |
| 312 | MET_InitWriteField(mF, "PointType", MET_STRING, strlen(s), s); |
| 313 | m_Fields.push_back(mF); |
| 314 | |
| 315 | // Find the pointDataType |
| 316 | if (!m_PointData.empty()) |
| 317 | { |
| 318 | m_PointDataType = (*m_PointData.begin())->GetMetaType(); |
| 319 | } |
| 320 | |
| 321 | char s1[255]; |
| 322 | mF = new MET_FieldRecordType; |
| 323 | MET_TypeToString(m_PointDataType, s1); |
| 324 | MET_InitWriteField(mF, "PointDataType", MET_STRING, strlen(s1), s1); |
| 325 | m_Fields.push_back(mF); |
| 326 | |
| 327 | char s2[255]; |
| 328 | mF = new MET_FieldRecordType; |
| 329 | MET_TypeToString(m_CellDataType, s2); |
| 330 | MET_InitWriteField(mF, "CellDataType", MET_STRING, strlen(s2), s2); |
| 331 | m_Fields.push_back(mF); |
| 332 | |
| 333 | unsigned int numberOfCellTypes = 0; |
| 334 | for (auto & i : m_CellListArray) |
| 335 | { |
| 336 | if (!i->empty()) |
| 337 | { |
| 338 | numberOfCellTypes++; |
| 339 | } |
| 340 | } |
| 341 | if (numberOfCellTypes) |
| 342 | { |
| 343 | mF = new MET_FieldRecordType; |
| 344 | MET_InitWriteField(mF, "NCellTypes", MET_INT, numberOfCellTypes); |
| 345 | m_Fields.push_back(mF); |
| 346 | } |
| 347 | |
| 348 | if (strlen(m_PointDim) > 0) |
| 349 | { |
| 350 | mF = new MET_FieldRecordType; |
| 351 | MET_InitWriteField(mF, "PointDim", MET_STRING, strlen(m_PointDim), m_PointDim); |
| 352 | m_Fields.push_back(mF); |
| 353 | } |
| 354 | |
| 355 | m_NPoints = static_cast<int>(m_PointList.size()); |
| 356 | mF = new MET_FieldRecordType; |
| 357 | MET_InitWriteField(mF, "NPoints", MET_INT, m_NPoints); |
| 358 | m_Fields.push_back(mF); |
| 359 |
nothing calls this directly
no test coverage detected