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

Method M_SetupWriteFields

Utilities/MetaIO/vtkmetaio/metaMesh.cxx:302–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void
303MetaMesh::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

Callers

nothing calls this directly

Calls 6

MET_TypeToStringFunction · 0.85
MET_InitWriteFieldFunction · 0.70
push_backMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected