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

Function MET_InitWriteField

Utilities/MetaIO/vtkmetaio/metaUtils.h:378–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376
377template <class T>
378bool
379MET_InitWriteField(MET_FieldRecordType * _mf, const char * _name, MET_ValueEnumType _type, size_t _length, T * _v)
380{
381 strncpy(_mf->name, _name, 254);
382 _mf->name[254] = '\0';
383 _mf->type = _type;
384 _mf->defined = true;
385 _mf->length = static_cast<int>(_length);
386 _mf->dependsOn = -1;
387 _mf->required = false;
388 _mf->terminateRead = false;
389 if (_type == MET_FLOAT_MATRIX)
390 {
391 size_t i;
392 for (i = 0; i < MET_MAX_NUMBER_OF_FIELD_VALUES && i < _length * _length; i++)
393 {
394 _mf->value[i] = (double)(_v[i]);
395 }
396 }
397 else if (_type != MET_STRING)
398 {
399 size_t i;
400 for (i = 0; i < MET_MAX_NUMBER_OF_FIELD_VALUES && i < _length; i++)
401 {
402 _mf->value[i] = (double)(_v[i]);
403 }
404 }
405 else
406 {
407 strncpy((char *)(_mf->value), (const char *)_v, (sizeof(_mf->value) - 1));
408 ((char *)(_mf->value))[(sizeof(_mf->value) - 1)] = '\0';
409 }
410 return true;
411}
412
413METAIO_EXPORT
414bool

Callers 15

M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_WriteMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
AddUserFieldFunction · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70
M_SetupWriteFieldsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected